diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..0a69dbeed --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +tools/managed-stack/tlsfuzzer-conversation.sh text eol=lf diff --git a/.github/workflows/conformance.yml b/.github/workflows/conformance.yml index 25829748a..c4874e245 100644 --- a/.github/workflows/conformance.yml +++ b/.github/workflows/conformance.yml @@ -6,6 +6,7 @@ name: conformance # h2spec nightly + workflow_dispatch: h2spec against a prior-knowledge h2c reverse listener # autobahn nightly + workflow_dispatch: Autobahn|Testsuite client cases through a reverse listener # real-peer nightly + workflow_dispatch: the reverse listener in front of an external reference peer container +# bogo nightly + workflow_dispatch: BoringSSL runner against the TLS 1.3 server shim # # The three heavy jobs follow the gateway-conformance precedent: they report from the first run on, but they only # fail the workflow once the repository variable CONFORMANCE_ENFORCE is 'true'. Until then the report (and the @@ -304,3 +305,277 @@ jobs: path: | artifacts/real-peer/*.log if-no-files-found: ignore + + tlsfuzzer: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: Publish the TLS probe + run: dotnet publish tools/managed-stack/TlsProbe/TlsProbe.csproj -c Release -o artifacts/tls-probe --nologo + - name: TLS 1.3 conversation script + id: suite + run: | + set +e + mkdir -p artifacts/tlsfuzzer + docker rm -f twp-tls-probe >/dev/null 2>&1 || true + docker run -d --name twp-tls-probe -v "$PWD/artifacts/tls-probe:/app" -w /app mcr.microsoft.com/dotnet/runtime:10.0 \ + dotnet TlsProbe.dll 127.0.0.1 18443 + docker run --rm --network container:twp-tls-probe -v "$PWD/tools/managed-stack/tlsfuzzer-conversation.sh:/run.sh:ro" \ + python:3.12 bash /run.sh > artifacts/tlsfuzzer/conversation.log 2>&1 + docker logs twp-tls-probe > artifacts/tlsfuzzer/probe.log 2>&1 || true + docker rm -f twp-tls-probe >/dev/null 2>&1 || true + if grep -q "Alert(fatal, unexpected_message)" artifacts/tlsfuzzer/conversation.log \ + && grep -q "FAIL: 3" artifacts/tlsfuzzer/conversation.log \ + && grep -q "first=160300" artifacts/tlsfuzzer/probe.log; then + echo "known: sanity ClientHello uses record version 0x0300 and the probe sends alert 10." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + echo "::warning::tlsfuzzer conversation result did not match the recorded failure." + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + - name: Upload the tlsfuzzer log + if: always() + uses: actions/upload-artifact@v7 + with: + name: tlsfuzzer-conversation + path: artifacts/tlsfuzzer + if-no-files-found: ignore + + tls-anvil: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: Publish the TLS probe + run: dotnet publish tools/managed-stack/TlsProbe/TlsProbe.csproj -c Release -o artifacts/tls-probe --nologo + - name: Feature scan + run: | + set +e + mkdir -p artifacts/tls-anvil + docker rm -f twp-tls-anvil-probe >/dev/null 2>&1 || true + docker run -d --name twp-tls-anvil-probe -v "$PWD/artifacts/tls-probe:/app" -w /app mcr.microsoft.com/dotnet/runtime:10.0 \ + dotnet TlsProbe.dll 127.0.0.1 18443 + docker run --rm --network container:twp-tls-anvil-probe ghcr.io/tls-attacker/tlsanvil:latest \ + -disableTcpDump -strength 1 -parallelHandshakes 1 -parallelTests 1 -connectionTimeout 3000 \ + -identifier managed-probe \ + -testPackage de.rub.nds.tlstest.suite.tests.both.tls13.statemachine \ + server -connect 127.0.0.1:18443 > artifacts/tls-anvil/scan.log 2>&1 + docker logs twp-tls-anvil-probe > artifacts/tls-anvil/probe.log 2>&1 || true + docker rm -f twp-tls-anvil-probe >/dev/null 2>&1 || true + if grep -q "Supported Protocol Versions: TLS13" artifacts/tls-anvil/scan.log \ + && grep -q "TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256" artifacts/tls-anvil/scan.log \ + && grep -q "ECDH_X25519" artifacts/tls-anvil/scan.log \ + && grep -q "SECP256R1" artifacts/tls-anvil/scan.log \ + && grep -q "SECP384R1" artifacts/tls-anvil/scan.log \ + && grep -q "sendEmptyRecordFinished" artifacts/tls-anvil/scan.log \ + && grep -q "0 test runs FULLY_FAILED" artifacts/tls-anvil/scan.log \ + && grep -q "1 test runs STRICTLY_SUCCEEDED" artifacts/tls-anvil/scan.log; then + echo "known: feature scan matches. sendEmptyRecordFinished is scored succeeded. The tool still does not parse a fatal alert, and the probe sends alert 10." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + echo "::warning::TLS-Anvil feature scan did not match the recorded result." + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + - name: Upload the TLS-Anvil log + if: always() + uses: actions/upload-artifact@v7 + with: + name: tls-anvil-scan + path: artifacts/tls-anvil + if-no-files-found: ignore + + h3spec: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: Publish the HTTP/3 probe + run: dotnet publish tools/managed-stack/H3Probe/H3Probe.csproj -c Release -o artifacts/h3-probe --nologo + - name: h3spec against the probe + run: | + mkdir -p artifacts/h3spec + if ! curl -fsSL -o artifacts/h3spec/h3spec https://github.com/kazu-yamamoto/h3spec/releases/download/v0.1.15/h3spec-linux-x86_64; then + echo "::notice::h3spec binary could not be downloaded." + exit 0 + fi + echo "c3c5f497153f4ba81f82023791ba7f9a4bc46d4141211e614196f141c5996830 artifacts/h3spec/h3spec" | sha256sum -c + chmod +x artifacts/h3spec/h3spec + docker rm -f twp-h3-probe >/dev/null 2>&1 || true + docker run -d --name twp-h3-probe -v "$PWD/artifacts/h3-probe:/app" -w /app mcr.microsoft.com/dotnet/runtime:10.0 \ + dotnet H3Probe.dll 127.0.0.1 18443 + ready=0 + for _ in 1 2 3 4 5 6 7 8 9 10; do + if docker logs twp-h3-probe 2>&1 | grep -q "port=18443"; then + ready=1 + break + fi + sleep 1 + done + if [ "$ready" != 1 ]; then + echo "::warning::The HTTP/3 probe did not listen." + docker logs twp-h3-probe > artifacts/h3spec/probe.log 2>&1 || true + docker rm -f twp-h3-probe >/dev/null 2>&1 || true + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + fi + set +e + docker run --rm --network container:twp-h3-probe -v "$PWD/artifacts/h3spec/h3spec:/h3spec:ro" debian:bookworm \ + /h3spec -n 127.0.0.1 18443 > artifacts/h3spec/h3spec.log 2>&1 + set -e + docker logs twp-h3-probe > artifacts/h3spec/probe.log 2>&1 || true + docker rm -f twp-h3-probe >/dev/null 2>&1 || true + if grep -F "86 examples, 77 failures, 5 pending" artifacts/h3spec/h3spec.log \ + && grep -F "large offset is received [Transport 4.1] [v]" artifacts/h3spec/h3spec.log \ + && grep -F "stream ID exceeds the limit [Transport 4.6] [v]" artifacts/h3spec/h3spec.log \ + && grep -F "initial_source_connection_id is missing [Transport 7.3] [v]" artifacts/h3spec/h3spec.log \ + && grep -F "original_destination_connection_id is received [Transport 18.2] [v]" artifacts/h3spec/h3spec.log; then + echo "known: h3spec 0.1.15 reports 86 examples, 77 failures, and 5 pending. Four transport checks passed." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + echo "::warning::h3spec result did not match the recorded run." + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + - name: Upload the h3spec log + if: always() + uses: actions/upload-artifact@v7 + with: + name: h3spec + path: artifacts/h3spec + if-no-files-found: ignore + + quic-interop: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: Handshake case with the quic-go client + run: | + mkdir -p artifacts/quic-interop-run artifacts/quic-www + dotnet publish tools/managed-stack/QuicInterop/QuicInterop.csproj -c Release -o artifacts/quic-interop --nologo + dotnet artifacts/quic-interop/QuicInterop.dll self-test > artifacts/quic-interop-run/self-test.log 2>&1 || true + python3 -c "open('artifacts/quic-www/a.bin','wb').write(bytes(range(1,65))); open('artifacts/quic-www/b.bin','wb').write(bytes([7])*1000)" + docker rm -f twp-quic-interop >/dev/null 2>&1 || true + docker run -d --name twp-quic-interop \ + -v "$PWD/artifacts/quic-interop:/app" -v "$PWD/artifacts/quic-www:/www:ro" -w /app \ + mcr.microsoft.com/dotnet/runtime:10.0 \ + dotnet QuicInterop.dll 127.0.0.1 18443 /www + ready=0 + for _ in 1 2 3 4 5 6 7 8 9 10; do + if docker logs twp-quic-interop 2>&1 | grep -q "port=18443"; then + ready=1 + break + fi + sleep 1 + done + if [ "$ready" != 1 ]; then + echo "::warning::The QUIC interop server did not listen." + docker logs twp-quic-interop > artifacts/quic-interop-run/server.log 2>&1 || true + docker rm -f twp-quic-interop >/dev/null 2>&1 || true + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + fi + set +e + docker run --rm --network container:twp-quic-interop -e TESTCASE=handshake --entrypoint /bin/sh \ + martenseemann/quic-go-interop@sha256:ae4b763aa4f6684d661248e475027d55b7bd72b33320aeaaccbc3a9c9fef8472 \ + -c "mkdir -p /logs /downloads && ./client https://127.0.0.1:18443/a.bin https://127.0.0.1:18443/b.bin; echo CLIENT_EXIT:\$?; wc -c /downloads/a.bin /downloads/b.bin" \ + > artifacts/quic-interop-run/client.log 2>&1 + set -e + docker logs twp-quic-interop > artifacts/quic-interop-run/server.log 2>&1 || true + docker rm -f twp-quic-interop >/dev/null 2>&1 || true + if grep -F "quic-interop self-test ok" artifacts/quic-interop-run/self-test.log \ + && grep -F "CLIENT_EXIT:0" artifacts/quic-interop-run/client.log \ + && grep -F "64 /downloads/a.bin" artifacts/quic-interop-run/client.log \ + && grep -F "1000 /downloads/b.bin" artifacts/quic-interop-run/client.log \ + && grep -F "served a.bin" artifacts/quic-interop-run/server.log \ + && grep -F "served b.bin" artifacts/quic-interop-run/server.log; then + echo "known: quic-go handshake downloaded a 64-byte file and a 1000-byte file. The rest of the interop matrix is not this job." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + echo "::warning::QUIC interop handshake result did not match the recorded run." + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + - name: Upload the QUIC interop log + if: always() + uses: actions/upload-artifact@v7 + with: + name: quic-interop + path: artifacts/quic-interop-run + if-no-files-found: ignore + + bogo: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: TLS 1.3 server slice + run: | + set +e + mkdir -p artifacts/bogo-run + dotnet publish tools/managed-stack/BogoShim/BogoShim.csproj -c Release -r linux-x64 --self-contained true -o artifacts/bogo-shim --nologo + artifacts/bogo-shim/BogoShim self-test > artifacts/bogo-run/self-test.log 2>&1 + rm -rf artifacts/boringssl + git clone --filter=blob:none --sparse --depth 1 https://github.com/google/boringssl.git artifacts/boringssl + if [ -d artifacts/boringssl/.git ]; then + git -C artifacts/boringssl sparse-checkout set --no-cone /go.mod /go.sum /ssl/test/runner /util/testresult + git -C artifacts/boringssl fetch --depth 1 origin a003590712db258f80de823b660ee788589c98cf + git -C artifacts/boringssl checkout --detach FETCH_HEAD + docker run --rm -v "$PWD:/work" -w /work/artifacts/boringssl/ssl/test/runner -e GOTOOLCHAIN=auto \ + golang:1.25@sha256:699337d620559a59b4a2bb298ad59611e535d2ee755a34cf2d2a98f37578dc80 \ + go test -c -o /work/artifacts/bogo-run/bogo + docker run --rm -v "$PWD:/work" -w /work \ + golang:1.25@sha256:699337d620559a59b4a2bb298ad59611e535d2ee755a34cf2d2a98f37578dc80 \ + /work/artifacts/bogo-run/bogo -shim-path /work/artifacts/bogo-shim/BogoShim -num-workers 4 -pipe -json-output /work/artifacts/bogo-run/bogo.json \ + > artifacts/bogo-run/runner.log 2>&1 + else + echo "::notice::BoringSSL could not be fetched." + fi + if grep -q "bogo-shim self-test ok" artifacts/bogo-run/self-test.log \ + && python3 -c 'import json,sys; c=json.load(open("artifacts/bogo-run/bogo.json"))["num_failures_by_type"]; sys.exit(0 if c.get("PASS")==49 and c.get("FAIL")==248 and c.get("SKIP")==7821 else 1)'; then + echo "known: BoringSSL a003590712db, TLS 1.3 server slice, 49 passed, 248 failed, 7821 unimplemented." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + echo "::warning::BoGo result did not match the recorded run." + if [ "$ENFORCE" = "true" ]; then + exit 1 + fi + exit 0 + - name: Upload the BoGo result + if: always() + uses: actions/upload-artifact@v7 + with: + name: bogo + path: artifacts/bogo-run + if-no-files-found: ignore diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 4fa1ceeeb..18123a63a 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -360,6 +360,10 @@ jobs: $projects = @( 'tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj', 'tests/Titanium.Xds.Tests/Titanium.Xds.Tests.csproj', + 'tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj', + 'tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj', + 'tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj', + 'tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj', 'tests/Titanium.Web.Proxy.Configuration.Tests/Titanium.Web.Proxy.Configuration.Tests.csproj', 'tests/Titanium.Manager.Tests/Titanium.Manager.Tests.csproj', 'tests/Titanium.Web.Proxy.Scripting.Tests/Titanium.Web.Proxy.Scripting.Tests.csproj', @@ -429,6 +433,15 @@ jobs: dotnet test tests/Titanium.Xds.Tests/Titanium.Xds.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --blame-hang --blame-hang-timeout 2m --collect:"Code Coverage" --results-directory coverage/xds if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --blame-hang --blame-hang-timeout 2m --collect:"Code Coverage" --results-directory coverage/tls --filter "TestCategory!=Slow&TestCategory!=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --blame-hang --blame-hang-timeout 2m --collect:"Code Coverage" --results-directory coverage/quic --filter "TestCategory!=Slow&TestCategory!=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --blame-hang --blame-hang-timeout 2m --collect:"Code Coverage" --results-directory coverage/compat + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --blame-hang --blame-hang-timeout 2m --collect:"Code Coverage" --results-directory coverage/nethttp + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $unitJobs = @( @{ Project = 'tests/Titanium.Web.Proxy.Configuration.Tests/Titanium.Web.Proxy.Configuration.Tests.csproj'; Results = 'coverage/configuration' }, @{ Project = 'tests/Titanium.Manager.Tests/Titanium.Manager.Tests.csproj'; Results = 'coverage/manager' }, @@ -1020,6 +1033,16 @@ jobs: **/playwright-report/** if-no-files-found: ignore + # Managed TLS and QUIC suites, the OpenSSL oracle, and the advisory benchmark-regression job. + # The workflow is reusable (managed-stack.yml); this job is the dotnetcore.yml context for it. + managed-stack: + name: managed-stack + needs: changes + if: needs.changes.outputs.code == 'true' + uses: ./.github/workflows/managed-stack.yml + permissions: + contents: read + # One context for branch protection. Docs-only pull requests skip the code jobs; # a code change requires each of them to succeed. lint-workflows: @@ -1044,7 +1067,7 @@ jobs: merge-gate: name: merge-gate if: always() - needs: [changes, lint-workflows, sonar-build, lint-build, unit, heavy-suites, regression, integration, coverage, redis-fleet, ui-portable, cli-e2e] + needs: [changes, lint-workflows, sonar-build, lint-build, unit, heavy-suites, regression, integration, coverage, redis-fleet, ui-portable, cli-e2e, managed-stack] runs-on: ubuntu-latest permissions: contents: read @@ -1067,24 +1090,25 @@ jobs: REDIS: ${{ needs.redis-fleet.result }} UI: ${{ needs.ui-portable.result }} CLI: ${{ needs.cli-e2e.result }} + MANAGED: ${{ needs.managed-stack.result }} shell: bash run: | set -euo pipefail - echo "changes=$CHANGES lint-workflows=$LINT sonar-build=$SONAR_BUILD lint-build=$LINT_BUILD unit=$UNIT heavy-suites=$HEAVY regression=$REGRESSION integration=$INTEGRATION coverage=$COVERAGE redis-fleet=$REDIS ui-portable=$UI cli-e2e=$CLI code=$CODE infra=$INFRA skipped_by_evidence=$SKIPPED_BY_EVIDENCE" + echo "changes=$CHANGES lint-workflows=$LINT sonar-build=$SONAR_BUILD lint-build=$LINT_BUILD unit=$UNIT heavy-suites=$HEAVY regression=$REGRESSION integration=$INTEGRATION coverage=$COVERAGE redis-fleet=$REDIS ui-portable=$UI cli-e2e=$CLI managed-stack=$MANAGED code=$CODE infra=$INFRA skipped_by_evidence=$SKIPPED_BY_EVIDENCE" if [[ "$SKIPPED_BY_EVIDENCE" == "true" ]]; then echo "merge-gate passed (skipped by tree evidence)" exit 0 fi - for result in "$CHANGES" "$LINT" "$SONAR_BUILD" "$LINT_BUILD" "$UNIT" "$HEAVY" "$REGRESSION" "$INTEGRATION" "$COVERAGE" "$REDIS" "$UI" "$CLI"; do + for result in "$CHANGES" "$LINT" "$SONAR_BUILD" "$LINT_BUILD" "$UNIT" "$HEAVY" "$REGRESSION" "$INTEGRATION" "$COVERAGE" "$REDIS" "$UI" "$CLI" "$MANAGED"; do if [[ "$result" == "failure" || "$result" == "cancelled" ]]; then echo "::error::a required job finished as $result" exit 1 fi done if [[ "$CODE" == "true" ]]; then - for result in "$LINT" "$SONAR_BUILD" "$LINT_BUILD" "$UNIT" "$HEAVY" "$REGRESSION" "$INTEGRATION" "$COVERAGE" "$REDIS" "$UI" "$CLI"; do + for result in "$LINT" "$SONAR_BUILD" "$LINT_BUILD" "$UNIT" "$HEAVY" "$REGRESSION" "$INTEGRATION" "$COVERAGE" "$REDIS" "$UI" "$CLI" "$MANAGED"; do if [[ "$result" != "success" ]]; then - echo "::error::a code change needs success from lint-workflows, sonar-build, lint-build, unit, heavy-suites, regression, integration, coverage, redis-fleet, ui-portable, and cli-e2e (got $result)" + echo "::error::a code change needs success from lint-workflows, sonar-build, lint-build, unit, heavy-suites, regression, integration, coverage, redis-fleet, ui-portable, cli-e2e, and managed-stack (got $result)" exit 1 fi done diff --git a/.github/workflows/fuzz-nightly.yml b/.github/workflows/fuzz-nightly.yml index 75df652a9..461ccacb1 100644 --- a/.github/workflows/fuzz-nightly.yml +++ b/.github/workflows/fuzz-nightly.yml @@ -21,3 +21,37 @@ jobs: - name: Crash-only parser mutations run: | dotnet test tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj -c Release --filter "TestCategory=Fuzz-Nightly|FullyQualifiedName~ParserCorpusRunnerTests" --nologo + + tls-corpus: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: TLS handshake corpus + run: dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj -c Release --filter "FullyQualifiedName~CorpusRunnerTests" --nologo + + # The 10,000-handshake OpenSSL sample stays out of this workflow until the runner + # has OpenSSL 3.5. Without that oracle the test is inconclusive, and one local + # 10,000-handshake run already took 1 hour 44 minutes. + + quic-corpus: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: QUIC packet and frame corpus + run: dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj -c Release --filter "FullyQualifiedName~QuicFuzzTests" --nologo diff --git a/.github/workflows/handler-platform-http3.yml b/.github/workflows/handler-platform-http3.yml new file mode 100644 index 000000000..0ffc59b89 --- /dev/null +++ b/.github/workflows/handler-platform-http3.yml @@ -0,0 +1,65 @@ +name: handler-platform-http3 + +# HTTP/3 from TitaniumHttpHandler against Kestrel and the proxy listener. +# QuicListener opens a wildcard UDP socket, so these tests stay off the Windows unit job. + +on: + workflow_dispatch: + pull_request: + branches: + - develop + - beta + - stable + paths: + - src/Titanium.Net.Http/** + - src/Titanium.Quic/** + - src/Titanium.Http3/** + - src/Titanium.Tls/** + - src/Titanium.Web.Proxy/** + - tests/Titanium.Net.Http.Tests/** + - tests/Titanium.Web.Proxy.IntegrationTests/** + - .github/workflows/handler-platform-http3.yml + - .github/actions/ensure-msquic/** + +permissions: + contents: read + +concurrency: + group: handler-platform-http3-${{ github.ref }} + cancel-in-progress: true + +jobs: + platform-http3: + runs-on: ${{ matrix.os }} + timeout-minutes: 40 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + env: + TITANIUM_QUIC_PLATFORM_LISTENER: "1" + TITANIUM_SKIP_ROOT_STORE_UI: "1" + TITANIUM_NO_ELEVATE: "1" + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: | + 10.0.x + + - name: Ensure MsQuic + uses: ./.github/actions/ensure-msquic + + - name: Kestrel HTTP/3 GET and POST + run: > + dotnet test tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj + --configuration Release --nologo + --filter FullyQualifiedName~PlatformQuicServer + + - name: Proxy listener HTTP/3 GET and POST + run: > + dotnet test tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj + --configuration Release --nologo + --filter FullyQualifiedName~HandlerHttp3ProxyTests diff --git a/.github/workflows/managed-package-feed.yml b/.github/workflows/managed-package-feed.yml new file mode 100644 index 000000000..e2306695e --- /dev/null +++ b/.github/workflows/managed-package-feed.yml @@ -0,0 +1,48 @@ +name: managed-package-feed + +# Packs the managed libraries and builds the three samples from that local feed. +# The packages are not published. + +on: + pull_request: + branches: + - develop + - beta + - stable + paths: + - src/Titanium.Managed.Common.props + - src/Titanium.Tls/** + - src/Titanium.Quic/** + - src/Titanium.Quic.UdpOffload/** + - src/Titanium.Http3/** + - src/Titanium.Net.Http/** + - src/Titanium.Net.Compatibility/** + - samples/HttpClientManagedStack/** + - samples/TlsStreamEcho/** + - samples/QuicEcho/** + - tools/managed-stack/pack-and-build-samples.ps1 + - .github/workflows/managed-package-feed.yml + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: managed-package-feed-${{ github.ref }} + cancel-in-progress: true + +jobs: + local-feed: + runs-on: ubuntu-latest + timeout-minutes: 25 + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + + - name: Pack and build the samples from the local feed + shell: pwsh + run: ./tools/managed-stack/pack-and-build-samples.ps1 diff --git a/.github/workflows/managed-stack-proxy.yml b/.github/workflows/managed-stack-proxy.yml new file mode 100644 index 000000000..0e555db64 --- /dev/null +++ b/.github/workflows/managed-stack-proxy.yml @@ -0,0 +1,71 @@ +name: managed-stack-proxy + +# Soft gate. TWP_MANAGED_TLS=1 turns both managed stacks on for the existing proxy suites. +# A failure here is a triage item (managed bug, parity gap, or a test that assumes the platform stack). +# The job stays green until that triage is the required gate. + +on: + pull_request: + branches: + - develop + - beta + - stable + paths: + - 'src/Titanium.Web.Proxy/**' + - 'src/Titanium.Tls/**' + - 'src/Titanium.Quic/**' + - 'src/Titanium.Net.Compatibility/**' + - 'tests/Titanium.Web.Proxy.UnitTests/**' + - 'tests/Titanium.Web.Proxy.IntegrationTests/**' + - '.github/workflows/managed-stack-proxy.yml' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: managed-stack-proxy-${{ github.ref }} + cancel-in-progress: true + +jobs: + proxy-suites: + runs-on: ubuntu-latest + timeout-minutes: 45 + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: | + 10.0.x + + - name: Unit tests with the managed stack + id: unit + continue-on-error: true + env: + TWP_MANAGED_TLS: "1" + run: | + dotnet test tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj --configuration Release --nologo \ + --filter "TestCategory!=Slow&TestCategory!=Fuzz-Nightly" + + - name: Integration tests with the managed stack + id: integration + continue-on-error: true + env: + TWP_MANAGED_TLS: "1" + run: | + dotnet test tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj --configuration Release --nologo \ + --filter "TestCategory!=Slow" + + - name: Record the soft result + if: always() + run: | + { + echo "### Managed stack proxy suites" + echo + echo "Unit: ${{ steps.unit.outcome }}" + echo "Integration: ${{ steps.integration.outcome }}" + echo + echo "TWP_MANAGED_TLS=1. This job does not fail the pull request." + } >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/managed-stack.yml b/.github/workflows/managed-stack.yml new file mode 100644 index 000000000..250d63deb --- /dev/null +++ b/.github/workflows/managed-stack.yml @@ -0,0 +1,229 @@ +# Managed TLS and QUIC suites, plus an advisory benchmark-regression check. +# +# Reusable: dotnetcore.yml calls it on a code change and merge-gate requires the result. The suites run +# against the managed stacks themselves (Titanium.Tls and Titanium.Quic), not the proxy on top of them; +# managed-stack-proxy.yml keeps its own soft proxy-level gate. +# +# The oracle step installs a real OpenSSL 3.5+ and exports TITANIUM_OPENSSL. TITANIUM_REQUIRE_ORACLE=1 +# then makes a missing oracle a failure instead of an Inconclusive test, so the differential tests +# against a real TLS peer can never be skipped silently. +# +# The perf job is advisory and never fails the pull request. It runs the TestCategory=Perf guards and a +# quick BenchmarkDotNet pass, then compares the fresh medians with the committed baselines under +# src/Titanium.Tls/design/perf-baselines and src/Titanium.Quic/design/perf-baselines. A benchmark more +# than 10% slower than its baseline is a warning, because the runner is not the machine the baseline +# was recorded on. +name: managed-stack + +on: + workflow_call: + inputs: + advisory_perf: + description: 'Run the advisory benchmark-regression job (warn above a 10% slower median).' + type: boolean + required: false + default: true + linux_runner: + description: 'Linux runner label. Pinned to the current image so the cells do not move under us.' + type: string + required: false + default: 'ubuntu-26.04' + workflow_dispatch: + inputs: + advisory_perf: + description: 'Run the advisory benchmark-regression job (warn above a 10% slower median).' + type: boolean + required: false + default: true + linux_runner: + description: 'Linux runner label. Pinned to the current image so the cells do not move under us.' + type: string + required: false + default: 'ubuntu-26.04' + +permissions: + contents: read + +jobs: + suites: + name: suites (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 45 + permissions: + contents: read + strategy: + fail-fast: false + matrix: + # Built from the input so the label lives in one place. The same idiom rps-suite.yml uses; + # an expression keeps actionlint from pinning a label it does not know yet. + os: ${{ fromJSON(format('["windows-latest","{0}","macos-15"]', inputs.linux_runner)) }} + env: + TITANIUM_REQUIRE_ORACLE: '1' + TITANIUM_ALLOW_WILDCARD_BIND_TESTS: 1 + TITANIUM_SKIP_ROOT_STORE_UI: 1 + TITANIUM_NO_ELEVATE: 1 + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: | + 10.0.x + cache: true + cache-dependency-path: '**/*.csproj' + + - name: Install the OpenSSL oracle + shell: pwsh + run: pwsh -NoProfile -File tools/tls/install-oracle.ps1 -MinimumVersion 3.5 + + - name: Restore and build the suites + shell: pwsh + run: | + $projects = @( + 'tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj', + 'tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj' + ) + foreach ($proj in $projects) { + dotnet restore $proj --warnaserror -p:NuGetAudit=true -p:NuGetAuditLevel=high + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet build $proj --configuration Release --no-restore --warnaserror + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + } + + - name: Managed TLS suite + shell: pwsh + run: | + dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj --configuration Release --no-build --no-restore ` + --settings tests/test.runsettings ` + --filter "TestCategory!=Slow&TestCategory!=Perf" ` + --logger "trx;LogFileName=managed-tls.trx" ` + --results-directory "artifacts/managed-tls-${{ matrix.os }}" --nologo + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + - name: Managed QUIC suite + shell: pwsh + run: | + dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj --configuration Release --no-build --no-restore ` + --settings tests/test.runsettings ` + --filter "TestCategory!=Slow&TestCategory!=Perf" ` + --logger "trx;LogFileName=managed-quic.trx" ` + --results-directory "artifacts/managed-quic-${{ matrix.os }}" --nologo + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + - name: Upload suite results + if: failure() + uses: actions/upload-artifact@v7 + with: + name: managed-stack-suites-${{ matrix.os }} + path: | + artifacts/managed-tls-${{ matrix.os }}/** + artifacts/managed-quic-${{ matrix.os }}/** + **/TestResults/** + if-no-files-found: ignore + retention-days: 7 + + perf: + name: perf (advisory) + if: inputs.advisory_perf + # Advisory: a warning or a broken benchmark run must never fail the reusable workflow's result. + continue-on-error: true + runs-on: ${{ inputs.linux_runner }} + timeout-minutes: 45 + permissions: + contents: read + steps: + - uses: actions/checkout@v7 + + - name: Setup .NET + uses: actions/setup-dotnet@v6 + with: + dotnet-version: | + 10.0.x + cache: true + cache-dependency-path: '**/*.csproj' + + # The guards and the benchmark cells compare the managed stack with SslStream on this machine. + # The platform QUIC arm stays off (TITANIUM_QUIC_PLATFORM_LISTENER is unset), so the QUIC cells + # report the managed stack only, exactly as the committed Windows and macOS baselines do. + - name: Perf guards (TestCategory=Perf) + shell: pwsh + run: | + dotnet build tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj --configuration Release --warnaserror + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet build tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj --configuration Release --warnaserror + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj --configuration Release --no-build --nologo --filter "TestCategory=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj --configuration Release --no-build --nologo --filter "TestCategory=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + # Quick cells only: handshake and small exchange. The bulk cells move 256 MiB per iteration and + # are the noisiest rows on a shared runner, so they stay out of the tripwire. + - name: Quick TLS benchmarks + continue-on-error: true + shell: pwsh + run: | + dotnet run --project benchmarks/Titanium.Managed.Benchmarks/Titanium.Managed.Benchmarks.csproj ` + --configuration Release -- ` + --filter "*HandshakeBenchmarks*" "*SmallExchangeBenchmarks*" ` + --artifacts artifacts/perf-tls --join + if ($LASTEXITCODE -ne 0) { "benchmark run exited $LASTEXITCODE; the comparison will report what it has" | Write-Warning } + + - name: Quick QUIC benchmarks + continue-on-error: true + shell: pwsh + run: | + dotnet run --project benchmarks/Titanium.Managed.Benchmarks/Titanium.Managed.Benchmarks.csproj ` + --configuration Release -- ` + --filter "*QuicHandshakeBenchmarks*" "*QuicSmallFlowBenchmarks*" ` + --artifacts artifacts/perf-quic --join + if ($LASTEXITCODE -ne 0) { "benchmark run exited $LASTEXITCODE; the comparison will report what it has" | Write-Warning } + + - name: Compare against the committed baselines + shell: pwsh + run: | + # The committed baselines are keyed by machine. This runner is a fresh Ubuntu image, so use the + # linux rows that exist and fall back to the local-windows rows when a cell has no Linux row. + foreach ($machine in @('linuxmini', 'local-windows')) { + if (Test-Path "src/Titanium.Tls/design/perf-baselines/$machine") { + pwsh -NoProfile -File tools/managed-stack/compare-perf-regression.ps1 ` + -BaselineDir "src/Titanium.Tls/design/perf-baselines/$machine" ` + -FreshDir artifacts/perf-tls -Label "tls/$machine" + } + if (Test-Path "src/Titanium.Quic/design/perf-baselines/$machine") { + pwsh -NoProfile -File tools/managed-stack/compare-perf-regression.ps1 ` + -BaselineDir "src/Titanium.Quic/design/perf-baselines/$machine" ` + -FreshDir artifacts/perf-quic -Label "quic/$machine" + } + } + + - name: Upload the benchmark exports + if: always() + uses: actions/upload-artifact@v7 + with: + name: managed-stack-perf + path: | + artifacts/perf-tls/** + artifacts/perf-quic/** + if-no-files-found: ignore + retention-days: 7 + + # One context for merge-gate. The perf job is advisory, so only the suites decide. + suite-gate: + name: managed-stack-gate + if: always() + needs: [suites] + runs-on: ubuntu-latest + steps: + - name: Require every suite leg + env: + SUITES: ${{ needs.suites.result }} + run: | + set -euo pipefail + echo "suites=$SUITES" + if [[ "$SUITES" != "success" ]]; then + echo "::error::managed-stack needs success from the suites legs (got $SUITES)" + exit 1 + fi + echo "managed-stack-gate passed" diff --git a/.github/workflows/product-smoke.yml b/.github/workflows/product-smoke.yml index 0f8ef79c2..fa8a060b1 100644 --- a/.github/workflows/product-smoke.yml +++ b/.github/workflows/product-smoke.yml @@ -876,3 +876,21 @@ jobs: set -euo pipefail bash tools/packaging/smoke/enforce.sh chart-lifecycle-${{ matrix.chart }} -- \ bash tools/packaging/smoke/kind-chart-lifecycle.sh "${{ matrix.chart }}" + + managed-stack: + name: managed stack (${{ matrix.os }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + continue-on-error: ${{ github.event_name != 'schedule' && inputs.advisory == true }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: CLI with --managed-stack + shell: pwsh + run: ./tools/packaging/smoke/cli-managed-stack.ps1 diff --git a/.github/workflows/rps-ab.yml b/.github/workflows/rps-ab.yml index ccd45ce36..c3fae3096 100644 --- a/.github/workflows/rps-ab.yml +++ b/.github/workflows/rps-ab.yml @@ -11,6 +11,10 @@ # -f baseline_ref=develop -f candidate_ref= \ # -f mode=compare-ceiling -f arm_contains=twp-reverse-http1 -f pairs=5 # +# baseline_probe_args / candidate_probe_args reach one side only, and are appended after probe_args so +# they win. Same-ref A/B of a default-off switch uses them: put the switch on the candidate side and +# leave the baseline side empty (e.g. candidate_probe_args=--managed-stack). +# # Only product code (everything outside tools/RpsLoadProbe) differs between the two sides. # Peers (nginx / HAProxy / Envoy) are not installed here; keep arm_contains on Titanium (twp-) or bare- arms. @@ -63,6 +67,14 @@ on: description: 'Extra probe arguments, space separated; later flags win (e.g. "--response-bytes 65536 --warmup-sec 3 --arm-shard 1/3")' required: false default: '' + baseline_probe_args: + description: 'Extra probe arguments for the BASELINE side only, space separated (applied after probe_args, so they win)' + required: false + default: '' + candidate_probe_args: + description: 'Extra probe arguments for the CANDIDATE side only, space separated (applied after probe_args, so they win)' + required: false + default: '' permissions: contents: read @@ -82,6 +94,8 @@ jobs: AB_COOLDOWN: ${{ inputs.cooldown_sec }} AB_ORDER: ${{ inputs.order }} AB_PROBE_ARGS: ${{ inputs.probe_args }} + AB_BASELINE_PROBE_ARGS: ${{ inputs.baseline_probe_args }} + AB_CANDIDATE_PROBE_ARGS: ${{ inputs.candidate_probe_args }} steps: - uses: actions/checkout@v7 with: @@ -179,6 +193,15 @@ jobs: # shellcheck disable=SC2206 for a in $AB_PROBE_ARGS; do extra+=(--probe-arg "$a"); done fi + if [ -n "${AB_BASELINE_PROBE_ARGS:-}" ]; then + # shellcheck disable=SC2206 + # The `=` form, so a value that starts with `--` (a probe flag) is not read as an option. + for a in $AB_BASELINE_PROBE_ARGS; do extra+=("--baseline-probe-arg=$a"); done + fi + if [ -n "${AB_CANDIDATE_PROBE_ARGS:-}" ]; then + # shellcheck disable=SC2206 + for a in $AB_CANDIDATE_PROBE_ARGS; do extra+=("--candidate-probe-arg=$a"); done + fi python3 tools/RpsLoadProbe/rps-ab-run.py \ --baseline-probe "$RUNNER_TEMP/ab-bin/baseline/run-probe.sh" \ --candidate-probe "$RUNNER_TEMP/ab-bin/candidate/run-probe.sh" \ @@ -196,6 +219,7 @@ jobs: echo "baseline \`$AB_BASELINE_REF\` = \`$AB_BASELINE_SHA\` " echo "candidate \`${AB_CANDIDATE_REF:-$GITHUB_SHA}\` = \`$AB_CANDIDATE_SHA\` " echo "harness (identical on both sides) = \`$GITHUB_SHA\`" + echo "probe args: common=\`${AB_PROBE_ARGS:-}\` baseline-only=\`${AB_BASELINE_PROBE_ARGS:-}\` candidate-only=\`${AB_CANDIDATE_PROBE_ARGS:-}\` " echo } > "$RUNNER_TEMP/ab-out/summary.md" python3 tools/RpsLoadProbe/rps-ab-analyze.py "$RUNNER_TEMP/ab-out" --markdown "$RUNNER_TEMP/ab-out/analysis.md" > /dev/null diff --git a/.github/workflows/soak.yml b/.github/workflows/soak.yml index 4ee906d62..24cdec409 100644 --- a/.github/workflows/soak.yml +++ b/.github/workflows/soak.yml @@ -162,3 +162,20 @@ jobs: name: soak path: artifacts/soak if-no-files-found: ignore + + # Handshake and connection soaks. This job does not set TITANIUM_SOAK_SECONDS, so each + # test keeps its 30 minute default. The unit jobs exclude TestCategory=Slow, so these + # tests run here and not on a pull request. This job does not change the reverse-proxy soak above. + managed-handshake-soak: + if: github.event_name == 'workflow_dispatch' || github.repository == 'justcoding121/titanium-web-proxy' + runs-on: ubuntu-latest + timeout-minutes: 100 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-dotnet@v6 + with: + dotnet-version: 10.0.x + - name: TLS handshakes stay bounded + run: dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj -c Release --filter "FullyQualifiedName~ThirtyMinutesOfHandshakesStayBounded" --nologo + - name: QUIC connections stay bounded + run: dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj -c Release --filter "FullyQualifiedName~ThirtyMinutesOfConnectionsStayBounded" --nologo diff --git a/.github/workflows/windows-full-tests.yml b/.github/workflows/windows-full-tests.yml index 6da6c6b05..fbde9ebde 100644 --- a/.github/workflows/windows-full-tests.yml +++ b/.github/workflows/windows-full-tests.yml @@ -61,6 +61,10 @@ jobs: $projects = @( 'tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj', 'tests/Titanium.Xds.Tests/Titanium.Xds.Tests.csproj', + 'tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj', + 'tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj', + 'tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj', + 'tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj', 'tests/Titanium.Web.Proxy.Configuration.Tests/Titanium.Web.Proxy.Configuration.Tests.csproj', 'tests/Titanium.Manager.Tests/Titanium.Manager.Tests.csproj', 'tests/Titanium.Web.Proxy.Scripting.Tests/Titanium.Web.Proxy.Scripting.Tests.csproj', @@ -117,6 +121,15 @@ jobs: dotnet test tests/Titanium.Xds.Tests/Titanium.Xds.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --nologo if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --nologo --filter "TestCategory!=Slow&TestCategory!=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --nologo --filter "TestCategory!=Slow&TestCategory!=Perf" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --nologo + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + dotnet test tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj --configuration Release --no-build --no-restore --settings $settings --nologo + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $unitJobs = @( @{ Project = 'tests/Titanium.Web.Proxy.Configuration.Tests/Titanium.Web.Proxy.Configuration.Tests.csproj' }, @{ Project = 'tests/Titanium.Manager.Tests/Titanium.Manager.Tests.csproj' }, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 36d2a2f43..dfc05443c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Thanks for contributing to Titanium Web Proxy. | Paths | License | External PRs | |-------|---------|--------------| -| `src/Titanium.Web.Proxy/`, `src/Titanium.Web.Proxy.Abstractions/`, `src/Titanium.Web.Proxy.Configuration/`, `src/Titanium.Web.Proxy.Scripting/`, `src/Titanium.Cli/`, `src/Titanium.Manager/`, `src/Titanium.Gateway/`, related MIT tests, examples, tools, deploy, docs, wiki, `website/` | MIT | Welcome after CLA | +| `src/Titanium.Web.Proxy/`, `src/Titanium.Web.Proxy.Abstractions/`, `src/Titanium.Web.Proxy.Configuration/`, `src/Titanium.Web.Proxy.Scripting/`, `src/Titanium.Cli/`, `src/Titanium.Manager/`, `src/Titanium.Gateway/`, `src/Titanium.Tls/`, `src/Titanium.Quic/`, `src/Titanium.Quic.UdpOffload/`, `src/Titanium.Http3/`, `src/Titanium.Net.Http/`, `src/Titanium.Net.Compatibility/`, related MIT tests, examples, tools, deploy, docs, wiki, `website/` | MIT | Welcome after CLA | | `src/Titanium.Plus/`, `src/Titanium.Inspector/`, `src/Titanium.Xds/`, `src/Titanium.Cli.GeoIp/`, `tests/Titanium.Plus.Tests/`, `tests/Titanium.Inspector.Tests/`, `tests/Titanium.Xds.Tests/`, `tests/Titanium.Cli.GeoIp.Tests/` | PolyForm Noncommercial | Maintainer allowlist only | See [CLA.md](CLA.md) and the [README License](README.md#license) section. diff --git a/README.md b/README.md index ac33bb677..4e957455d 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Requires .NET 10 or later for the library. CLI and Inspector downloads are self- - **Visual MITM traffic debugger** (Titanium Inspector) — Session grid, inspectors, AutoResponder, breakpoints, HAR export. [Download Inspector](https://titaniumproxy.com/download#stable-inspector) · [Inspector](https://titaniumproxy.com/docs/inspector) - **Benchmarked speed at scale** — Practical reverse RPS versus peers on the same harness. [Performance](#performance) · [Site charts](https://titaniumproxy.com/docs/performance) - **Optional control-plane add-ons** (`Titanium.Plus`) — xDS, GeoIP, caching, rate limiting, health probes, dashboard. `titanium update --plus` · [Plus](https://titaniumproxy.com/docs/plus) +- **Managed TLS and QUIC** — Experimental libraries in this tree. The proxy, the CLI, and the charts leave them off. Inspector stays on the platform stack. [Managed TLS and QUIC](https://github.com/justcoding121/titanium-web-proxy/wiki/Managed-TLS-and-QUIC) ## Run the CLI diff --git a/benchmarks/Titanium.Managed.Benchmarks/BenchmarkConfig.cs b/benchmarks/Titanium.Managed.Benchmarks/BenchmarkConfig.cs new file mode 100644 index 000000000..38a1e4811 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/BenchmarkConfig.cs @@ -0,0 +1,26 @@ +using BenchmarkDotNet.Columns; +using BenchmarkDotNet.Configs; +using BenchmarkDotNet.Diagnosers; +using BenchmarkDotNet.Exporters.Json; +using BenchmarkDotNet.Jobs; +using BenchmarkDotNet.Loggers; + +namespace Titanium.Managed.Benchmarks; + +internal sealed class TlsBenchmarkConfig : ManualConfig +{ + public TlsBenchmarkConfig() + { + AddJob(Job.Default + .WithWarmupCount(1) + .WithIterationCount(10) + .WithInvocationCount(1) + .WithUnrollFactor(1) + .WithLaunchCount(1) + .WithId("local")); + AddDiagnoser(MemoryDiagnoser.Default); + AddColumn(StatisticColumn.Median, StatisticColumn.P95); + AddExporter(JsonExporter.Full); + AddLogger(ConsoleLogger.Default); + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/CrossProtocolSanity.cs b/benchmarks/Titanium.Managed.Benchmarks/CrossProtocolSanity.cs new file mode 100644 index 000000000..319a097db --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/CrossProtocolSanity.cs @@ -0,0 +1,295 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using Titanium.Tls; + +namespace Titanium.Managed.Benchmarks; + +/// +/// One-off cross-protocol sanity check, not a parity cell. The platform arm is +/// with on both sides; the managed arm is +/// with on both sides. The official benchmark cells are untouched +/// and stay on for both stacks. Resumed handshakes are skipped. +/// +internal static class CrossProtocolSanity +{ + private const int Iterations = 10; + private const int HandshakesPerIteration = 20; + private const int ExchangesPerIteration = 50; + private const int BulkChunk = 16 * 1024; + private const int ExchangeSmall = 100; + private const int ExchangeLarge = 1024; + + public static void Run() + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + Console.WriteLine($"crossproto machine os={Environment.OSVersion} runtime={Environment.Version} processors={Environment.ProcessorCount}"); + + WriteNegotiated(StackKind.Platform, SslProtocols.Tls12, TransportKind.Loopback, certificate); + WriteNegotiated(StackKind.Managed, SslProtocols.Tls13, TransportKind.Loopback, certificate); + + foreach (StackKind stack in new[] { StackKind.Platform, StackKind.Managed }) + { + SslProtocols protocols = ProtocolsFor(stack); + WriteHandshake(stack, protocols, TransportKind.Loopback, "handshake-loopback", certificate); + WriteHandshake(stack, protocols, TransportKind.Memory, "handshake-memory", certificate); + WriteBulk(stack, protocols, certificate); + WriteExchanges(stack, protocols, certificate); + } + } + + private static SslProtocols ProtocolsFor(StackKind stack) => + stack == StackKind.Platform ? SslProtocols.Tls12 : SslProtocols.Tls13; + + private static void WriteNegotiated(StackKind stack, SslProtocols protocols, TransportKind transport, X509Certificate2 certificate) + { + try + { + using OpenedConnection connection = Open(stack, protocols, transport, certificate); + string protocol = connection.Client.GetType() == typeof(SslStream) + ? ((SslStream)connection.Client).SslProtocol.ToString() + : ((TlsStream)connection.Client).SslProtocol.ToString(); + string cipher = connection.Client.GetType() == typeof(SslStream) + ? ((SslStream)connection.Client).NegotiatedCipherSuite.ToString() + : ((TlsStream)connection.Client).NegotiatedCipherSuite.ToString(); + string serverProtocol = connection.Server.GetType() == typeof(SslStream) + ? ((SslStream)connection.Server).SslProtocol.ToString() + : ((TlsStream)connection.Server).SslProtocol.ToString(); + Console.WriteLine($"crossproto negotiated arm={stack} transport={transport} requested={protocols} client-protocol={protocol} client-cipher={cipher} server-protocol={serverProtocol}"); + } + catch (Exception ex) + { + Console.WriteLine($"crossproto negotiated arm={stack} transport={transport} requested={protocols} error={ex.GetType().Name}: {ex.Message}"); + } + } + + private static void WriteHandshake(StackKind stack, SslProtocols protocols, TransportKind transport, string cell, X509Certificate2 certificate) + { + for (int i = 0; i < HandshakesPerIteration; i++) + { + using OpenedConnection warm = Open(stack, protocols, transport, certificate); + } + + var medians = new double[Iterations]; + for (int iteration = 0; iteration < Iterations; iteration++) + { + var watch = Stopwatch.StartNew(); + for (int i = 0; i < HandshakesPerIteration; i++) + { + using OpenedConnection connection = Open(stack, protocols, transport, certificate); + } + + watch.Stop(); + medians[iteration] = watch.Elapsed.TotalMicroseconds / HandshakesPerIteration; + } + + Console.WriteLine($"crossproto cell={cell} arm={stack} us-per-handshake={Median(medians):F2} iters={Summary(medians)}"); + } + + private static void WriteBulk(StackKind stack, SslProtocols protocols, X509Certificate2 certificate) + { + using OpenedConnection connection = Open(stack, protocols, TransportKind.Loopback, certificate); + var chunk = new byte[BulkChunk]; + var readBuffer = new byte[64 * 1024]; + TlsBenchHarness.Transfer(connection.Client, connection.Server, chunk, readBuffer, TlsBenchHarness.BulkBytes); + + var medians = new double[Iterations]; + for (int iteration = 0; iteration < Iterations; iteration++) + { + var watch = Stopwatch.StartNew(); + TlsBenchHarness.Transfer(connection.Client, connection.Server, chunk, readBuffer, TlsBenchHarness.BulkBytes); + watch.Stop(); + medians[iteration] = watch.Elapsed.TotalMilliseconds; + } + + Console.WriteLine($"crossproto cell=bulk-256MiB-loopback-16KiB arm={stack} ms-per-256MiB={Median(medians):F2} iters={Summary(medians)}"); + } + + private static void WriteExchanges(StackKind stack, SslProtocols protocols, X509Certificate2 certificate) + { + using OpenedConnection connection = Open(stack, protocols, TransportKind.Loopback, certificate); + var buffer = new byte[64 * 1024]; + var echo = new Thread(() => + { + try + { + while (true) + { + int count = connection.Server.Read(buffer, 0, buffer.Length); + if (count == 0) + { + return; + } + + connection.Server.Write(buffer, 0, count); + } + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + }) + { + IsBackground = true, + }; + echo.Start(); + + try + { + MeasureExchange(connection, ExchangeSmall, "exchange-100-loopback"); + MeasureExchange(connection, ExchangeLarge, "exchange-1KiB-loopback"); + } + finally + { + connection.Dispose(); + echo.Join(); + } + + void MeasureExchange(OpenedConnection opened, int size, string cell) + { + var payload = new byte[size]; + for (int i = 0; i < ExchangesPerIteration; i++) + { + opened.Client.Write(payload); + ReadFull(opened.Client, payload); + } + + var medians = new double[Iterations]; + for (int iteration = 0; iteration < Iterations; iteration++) + { + var watch = Stopwatch.StartNew(); + for (int i = 0; i < ExchangesPerIteration; i++) + { + opened.Client.Write(payload); + ReadFull(opened.Client, payload); + } + + watch.Stop(); + medians[iteration] = watch.Elapsed.TotalMicroseconds / ExchangesPerIteration; + } + + Console.WriteLine($"crossproto cell={cell} arm={stack} us-per-exchange={Median(medians):F2} iters={Summary(medians)}"); + } + } + + private static OpenedConnection Open(StackKind stack, SslProtocols protocols, TransportKind transport, X509Certificate2 certificate) + { + TransportPair pair = TransportPair.Create(transport); + Stream? client = null; + Stream? server = null; + Exception? serverError = null; + var serverThread = new Thread(() => + { + try + { + server = AuthenticateServer(stack, pair.Server, certificate, protocols); + } + catch (Exception ex) + { + serverError = ex; + } + }) + { + IsBackground = true, + }; + serverThread.Start(); + try + { + client = AuthenticateClient(stack, pair.Client, protocols); + serverThread.Join(); + } + catch + { + pair.Dispose(); + serverThread.Join(); + throw; + } + + if (serverError is not null || client is null || server is null) + { + pair.Dispose(); + throw serverError ?? new InvalidOperationException("The handshake did not finish."); + } + + return new OpenedConnection(pair, client, server, resumed: false); + } + + private static Stream AuthenticateClient(StackKind stack, Stream inner, SslProtocols protocols) + { + var options = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = protocols, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }; + if (stack == StackKind.Platform) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + ssl.AuthenticateAsClient(options); + return ssl; + } + + var stream = new TlsStream(inner, new TlsStreamOptions()); + stream.AuthenticateAsClient(options); + return stream; + } + + private static Stream AuthenticateServer(StackKind stack, Stream inner, X509Certificate2 certificate, SslProtocols protocols) + { + var options = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = protocols, + }; + if (stack == StackKind.Platform) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + ssl.AuthenticateAsServer(options); + return ssl; + } + + var stream = new TlsStream(inner, new TlsStreamOptions()); + stream.AuthenticateAsServer(options); + return stream; + } + + private static void ReadFull(Stream source, byte[] buffer) + { + int read = 0; + while (read < buffer.Length) + { + int count = source.Read(buffer, read, buffer.Length - read); + if (count == 0) + { + throw new EndOfStreamException("The exchange ended early."); + } + + read += count; + } + } + + private static double Median(double[] values) + { + double[] sorted = (double[])values.Clone(); + Array.Sort(sorted); + int middle = sorted.Length / 2; + return sorted.Length % 2 == 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2; + } + + private static string Summary(double[] values) + { + var text = new System.Text.StringBuilder(); + foreach (double value in values) + { + text.Append(' ').Append(value.ToString("F2")); + } + + return text.ToString().Trim(); + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/HandshakeBenchmarks.cs b/benchmarks/Titanium.Managed.Benchmarks/HandshakeBenchmarks.cs new file mode 100644 index 000000000..e3b837629 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/HandshakeBenchmarks.cs @@ -0,0 +1,218 @@ +using System; +using System.IO; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using BenchmarkDotNet.Attributes; +using Titanium.Tls; + +namespace Titanium.Managed.Benchmarks; + +[Config(typeof(TlsBenchmarkConfig))] +public class HandshakeBenchmarks +{ + private X509Certificate2 _certificate = null!; + + [GlobalSetup] + public void Setup() => _certificate = TlsBenchHarness.CreateEcdsa(); + + [GlobalCleanup] + public void Cleanup() => _certificate.Dispose(); + + [Arguments(StackKind.Platform, TransportKind.Loopback)] + [Arguments(StackKind.Managed, TransportKind.Loopback)] + [Arguments(StackKind.Platform, TransportKind.Memory)] + [Arguments(StackKind.Managed, TransportKind.Memory)] + [Benchmark(OperationsPerInvoke = 20)] + public void FullHandshake(StackKind stack, TransportKind transport) + { + for (int i = 0; i < 20; i++) + { + using OpenedConnection connection = TlsBenchHarness.Open(stack, transport, _certificate, gear: null); + } + } +} + +[Config(typeof(TlsBenchmarkConfig))] +public class ResumedHandshakeBenchmarks +{ + private X509Certificate2 _certificate = null!; + private SessionGear? _gear; + + [Params(StackKind.Platform, StackKind.Managed)] + public StackKind Stack { get; set; } + + [Params(TransportKind.Loopback, TransportKind.Memory)] + public TransportKind Transport { get; set; } + + [GlobalSetup] + public void Setup() + { + _certificate = TlsBenchHarness.CreateEcdsa(); + if (Stack == StackKind.Managed) + { + _gear = new SessionGear(); + } + + using (OpenedConnection primed = TlsBenchHarness.Open(Stack, Transport, _certificate, _gear)) + { + TlsBenchHarness.Exchange(primed.Client, primed.Server, new byte[1]); + } + } + + [GlobalCleanup] + public void Cleanup() + { + _gear?.Dispose(); + _certificate.Dispose(); + } + + [Benchmark(OperationsPerInvoke = 20)] + public void ResumedHandshake() + { + for (int i = 0; i < 20; i++) + { + using OpenedConnection connection = TlsBenchHarness.Open(Stack, Transport, _certificate, _gear); + if (Stack == StackKind.Managed && !connection.Resumed) + { + throw new InvalidOperationException("The managed handshake did not resume."); + } + } + } +} + +[Config(typeof(TlsBenchmarkConfig))] +public class BulkBenchmarks +{ + private X509Certificate2 _certificate = null!; + private OpenedConnection _connection = null!; + private byte[] _chunk = null!; + private byte[] _readBuffer = null!; + + [Params(StackKind.Platform, StackKind.Managed)] + public StackKind Stack { get; set; } + + [Params(TransportKind.Loopback, TransportKind.Memory)] + public TransportKind Transport { get; set; } + + [Params(16 * 1024, 64 * 1024)] + public int Chunk { get; set; } + + [GlobalSetup] + public void Setup() + { + _certificate = TlsBenchHarness.CreateEcdsa(); + _connection = TlsBenchHarness.Open(Stack, Transport, _certificate, gear: null); + _chunk = new byte[Chunk]; + _readBuffer = new byte[64 * 1024]; + } + + [GlobalCleanup] + public void Cleanup() + { + _connection.Dispose(); + _certificate.Dispose(); + } + + [Benchmark] + public void Bulk256MiB() => TlsBenchHarness.Transfer(_connection.Client, _connection.Server, _chunk, _readBuffer, TlsBenchHarness.BulkBytes); +} + +[Config(typeof(TlsBenchmarkConfig))] +public class SmallExchangeBenchmarks +{ + private X509Certificate2 _certificate = null!; + private OpenedConnection _connection = null!; + private byte[] _small100 = null!; + private byte[] _small1024 = null!; + private Thread? _echo; + + [Params(StackKind.Platform, StackKind.Managed)] + public StackKind Stack { get; set; } + + [Params(TransportKind.Loopback, TransportKind.Memory)] + public TransportKind Transport { get; set; } + + [GlobalSetup] + public void Setup() + { + _certificate = TlsBenchHarness.CreateEcdsa(); + _connection = TlsBenchHarness.Open(Stack, Transport, _certificate, gear: null); + _small100 = new byte[100]; + _small1024 = new byte[1024]; + _echo = new Thread(Echo) + { + IsBackground = true, + }; + _echo.Start(); + } + + [GlobalCleanup] + public void Cleanup() + { + _connection.Dispose(); + _echo?.Join(); + _certificate.Dispose(); + } + + [Benchmark(OperationsPerInvoke = 50)] + public void Small100() + { + for (int i = 0; i < 50; i++) + { + _connection.Client.Write(_small100); + ReadFull(_connection.Client, _small100); + } + } + + [Benchmark(OperationsPerInvoke = 50)] + public void Small1024() + { + for (int i = 0; i < 50; i++) + { + _connection.Client.Write(_small1024); + ReadFull(_connection.Client, _small1024); + } + } + + private void Echo() + { + var buffer = new byte[64 * 1024]; + try + { + while (true) + { + int count = _connection.Server.Read(buffer, 0, buffer.Length); + if (count == 0) + { + return; + } + + _connection.Server.Write(buffer, 0, count); + } + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + catch (TimeoutException) + { + } + } + + private static void ReadFull(Stream source, byte[] buffer) + { + int read = 0; + while (read < buffer.Length) + { + int count = source.Read(buffer, read, buffer.Length - read); + if (count == 0) + { + throw new EndOfStreamException("The exchange ended early."); + } + + read += count; + } + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/ProbeCommand.cs b/benchmarks/Titanium.Managed.Benchmarks/ProbeCommand.cs new file mode 100644 index 000000000..d4a09f924 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/ProbeCommand.cs @@ -0,0 +1,554 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Security.Cryptography; +using System.IO; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Tls; + +namespace Titanium.Managed.Benchmarks; + +internal static class ProbeCommand +{ + public static void Run(string[] args) + { + string kind = args.Length > 0 ? args[0] : "all"; + if (kind is "ladder") + { + PrintLadder(); + return; + } + + if (kind is "quic") + { + PrintQuic(); + return; + } + + if (kind is "quic-loop") + { + StackKind stack = args.Length > 1 && string.Equals(args[1], "platform", StringComparison.OrdinalIgnoreCase) ? StackKind.Platform : StackKind.Managed; + bool bulk = args.Length > 2 && string.Equals(args[2], "bulk", StringComparison.OrdinalIgnoreCase); + int seconds = args.Length > 3 && int.TryParse(args[3], out int parsedSeconds) ? parsedSeconds : 10; + int warmup = args.Length > 4 && int.TryParse(args[4], out int parsedWarmup) ? parsedWarmup : 200; + int maxOperations = args.Length > 5 && int.TryParse(args[5], out int parsedMax) ? parsedMax : int.MaxValue; + PrintQuicLoop(stack, bulk, seconds, warmup, maxOperations); + return; + } + + if (kind is "bulk") + { + StackKind stack = args.Length > 1 && string.Equals(args[1], "platform", StringComparison.OrdinalIgnoreCase) ? StackKind.Platform : StackKind.Managed; + TransportKind transport = args.Length > 2 && string.Equals(args[2], "memory", StringComparison.OrdinalIgnoreCase) ? TransportKind.Memory : TransportKind.Loopback; + int chunk = args.Length > 3 && int.TryParse(args[3], out int parsedChunk) ? parsedChunk : 64 * 1024; + int iterations = args.Length > 4 && int.TryParse(args[4], out int parsedIterations) ? parsedIterations : 4; + PrintBulk(stack, transport, chunk, iterations); + return; + } + + if (kind is "handshake-cold") + { + StackKind stack = args.Length > 1 && string.Equals(args[1], "platform", StringComparison.OrdinalIgnoreCase) ? StackKind.Platform : StackKind.Managed; + TransportKind transport = args.Length > 2 && string.Equals(args[2], "loopback", StringComparison.OrdinalIgnoreCase) ? TransportKind.Loopback : TransportKind.Memory; + int blocks = args.Length > 3 && int.TryParse(args[3], out int parsedBlocks) ? parsedBlocks : 12; + PrintHandshakeCold(stack, transport, blocks); + return; + } + + if (kind is "handshake-loop") + { + StackKind stack = args.Length > 1 && string.Equals(args[1], "platform", StringComparison.OrdinalIgnoreCase) ? StackKind.Platform : StackKind.Managed; + TransportKind transport = args.Length > 2 && string.Equals(args[2], "loopback", StringComparison.OrdinalIgnoreCase) ? TransportKind.Loopback : TransportKind.Memory; + int seconds = args.Length > 3 && int.TryParse(args[3], out int parsedSeconds) ? parsedSeconds : 10; + PrintHandshakeLoop(stack, transport, seconds); + return; + } + + if (kind is "machine" or "all") + { + PrintMachine(); + } + + if (kind is "alloc" or "all") + { + PrintAllocations(); + } + + if (kind is "rsa" or "all") + { + PrintRsa(); + } + + if (kind is "resume" or "all") + { + PrintResume(); + } + + if (kind is "idle" or "all") + { + int count = args.Length > 1 && int.TryParse(args[1], out int parsed) ? parsed : 50_000; + PrintIdle(count); + } + + if (kind is "storm" or "all") + { + int count = args.Length > 1 && int.TryParse(args[1], out int parsed) ? parsed : 10_000; + PrintStorm(count); + } + } + + private static void PrintQuicLoop(StackKind stack, bool bulk, int seconds, int warmup, int maxOperations) + { + Titanium.Quic.QuicPathCounters.Enabled = true; + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + using var stop = new CancellationTokenSource(); + QuicBenchHarness.Opened opened = QuicBenchHarness.Open(stack, certificate).GetAwaiter().GetResult(); + Task? echo = bulk ? null : QuicBenchHarness.Echo(opened, stop.Token); + byte[] payload = new byte[QuicBenchHarness.SmallBytes]; + byte[] chunk = new byte[QuicBenchHarness.ChunkBytes]; + // BenchmarkDotNet runs 50 exchanges inside one async method, so continuations stay on pool threads. One blocking wait per exchange would add a main-thread wake that the cell does not have. + int perCall = bulk ? 1 : 50; + async Task SmallBatch() + { + for (int i = 0; i < perCall; i++) + { + await QuicBenchHarness.Exchange(opened, payload).ConfigureAwait(false); + } + } + + void One() + { + if (bulk) + { + QuicBenchHarness.Transfer(opened, chunk, QuicBenchHarness.RepeatedBulkBytes).GetAwaiter().GetResult(); + } + else + { + SmallBatch().GetAwaiter().GetResult(); + } + } + + for (int i = 0; i < warmup; i += perCall) + { + One(); + } + + long allocatedBefore = GC.GetAllocatedBytesForCurrentThread(); + long totalBefore = GC.GetTotalAllocatedBytes(); + int gcBefore = GC.CollectionCount(0); + Titanium.Quic.QuicPathCounters.Snapshot countersBefore = Titanium.Quic.QuicPathCounters.Read(); + long poolItemsBefore = ThreadPool.CompletedWorkItemCount; + var watch = Stopwatch.StartNew(); + int count = 0; + var blocks = new System.Text.StringBuilder(); + double blockStart = 0; + while (watch.Elapsed.TotalSeconds < seconds && count < maxOperations) + { + One(); + count += perCall; + if (count % 200 == 0 && count <= 4000) + { + double now = watch.Elapsed.TotalMicroseconds; + blocks.Append($" {(now - blockStart) / 200:F0}"); + blockStart = now; + } + } + + watch.Stop(); + Titanium.Quic.QuicPathCounters.Snapshot counters = Titanium.Quic.QuicPathCounters.Read().Since(countersBefore); + long poolItems = ThreadPool.CompletedWorkItemCount - poolItemsBefore; + Console.WriteLine($"quic-loop blocks-of-200-us:{blocks}"); + if (stack == StackKind.Managed) + { + // Per operation: a 64 KiB transfer on the bulk cell, one 100-byte exchange on the small cell. + double perOp = count; + long listenerWakes = Math.Max(1, counters.ListenerWakes); + long clientWakes = Math.Max(1, counters.ClientWakes); + Console.WriteLine( + $"quic-loop counters per-op: listener-datagrams={counters.ListenerDatagrams / perOp:F1} listener-wakes={counters.ListenerWakes / perOp:F1} listener-datagrams-per-wake={(double)counters.ListenerDatagrams / listenerWakes:F2} " + + $"client-datagrams={counters.ClientDatagrams / perOp:F1} client-wakes={counters.ClientWakes / perOp:F1} client-datagrams-per-wake={(double)counters.ClientDatagrams / clientWakes:F2} " + + $"ack-only-sent={counters.AckOnlyDatagrams / perOp:F1} reader-notifies={counters.ReaderNotifies / perOp:F1} reader-wakeups={counters.ReaderResumes / perOp:F1} " + + $"send-syscalls={counters.SendCalls / perOp:F1} sent-datagrams={counters.SentDatagrams / perOp:F1} threadpool-items={poolItems / perOp:F1}"); + } + else + { + Console.WriteLine($"quic-loop counters per-op: threadpool-items={poolItems / (double)count:F1}"); + } + + Console.WriteLine($"quic-loop stack={stack} cell={(bulk ? "bulk-64KiB" : "small-100")} count={count} us-per-op={watch.Elapsed.TotalMicroseconds / count:F1} caller-thread-bytes-per-op={(GC.GetAllocatedBytesForCurrentThread() - allocatedBefore) / count} all-thread-bytes-per-op={(GC.GetTotalAllocatedBytes() - totalBefore) / count} gen0-collections={GC.CollectionCount(0) - gcBefore}"); + stop.Cancel(); + opened.DisposeAsync().AsTask().GetAwaiter().GetResult(); + echo?.GetAwaiter().GetResult(); + } + + private static void PrintBulk(StackKind stack, TransportKind transport, int chunk, int iterations) + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + using OpenedConnection connection = TlsBenchHarness.Open(stack, transport, certificate, gear: null); + var chunkBuffer = new byte[chunk]; + var readBuffer = new byte[64 * 1024]; + var line = new System.Text.StringBuilder(); + for (int i = 0; i < iterations; i++) + { + var watch = Stopwatch.StartNew(); + TlsBenchHarness.Transfer(connection.Client, connection.Server, chunkBuffer, readBuffer, TlsBenchHarness.BulkBytes); + watch.Stop(); + line.Append($" {watch.Elapsed.TotalMilliseconds:F0}"); + } + + Console.WriteLine($"bulk stack={stack} transport={transport} chunk={chunk} ms-per-256MiB:{line}"); + } + + private static void PrintHandshakeCold(StackKind stack, TransportKind transport, int blocks) + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + var line = new System.Text.StringBuilder(); + for (int block = 0; block < blocks; block++) + { + var watch = Stopwatch.StartNew(); + for (int i = 0; i < 20; i++) + { + using OpenedConnection connection = TlsBenchHarness.Open(stack, transport, certificate, gear: null); + } + + watch.Stop(); + line.Append($" {watch.Elapsed.TotalMicroseconds / 20:F0}"); + } + + Console.WriteLine($"handshake-cold stack={stack} transport={transport} us-per-handshake-by-block-of-20:{line}"); + } + + private static void PrintHandshakeLoop(StackKind stack, TransportKind transport, int seconds) + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + for (int i = 0; i < 200; i++) + { + using OpenedConnection warm = TlsBenchHarness.Open(stack, transport, certificate, gear: null); + } + + long allocatedBefore = GC.GetAllocatedBytesForCurrentThread(); + var watch = Stopwatch.StartNew(); + int count = 0; + while (watch.Elapsed.TotalSeconds < seconds) + { + using OpenedConnection connection = TlsBenchHarness.Open(stack, transport, certificate, gear: null); + count++; + } + + watch.Stop(); + Console.WriteLine($"handshake-loop stack={stack} transport={transport} count={count} us-per-handshake={watch.Elapsed.TotalMicroseconds / count:F1} client-thread-bytes-per-handshake={(GC.GetAllocatedBytesForCurrentThread() - allocatedBefore) / count}"); + } + + private static void PrintLadder() + { + Span scalar = stackalloc byte[32]; + Span point = stackalloc byte[32]; + Span output = stackalloc byte[32]; + RandomNumberGenerator.Fill(scalar); + point[0] = 9; + X25519.ScalarMult(scalar, point, output); + var warmup = Stopwatch.StartNew(); + while (warmup.ElapsedMilliseconds < 1500) + { + X25519.ScalarMult(scalar, point, output); + } + + var watch = Stopwatch.StartNew(); + const int count = 2000; + for (int i = 0; i < count; i++) + { + X25519.ScalarMult(scalar, point, output); + } + + watch.Stop(); + Console.WriteLine($"ladder calls={count} us-per-call={watch.Elapsed.TotalMicroseconds / count:F0} first={output[0]}"); + } + + private static void PrintQuic() + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + var watch = Stopwatch.StartNew(); + QuicBenchHarness.Handshake(StackKind.Managed, certificate).GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"managed handshake ms={watch.Elapsed.TotalMilliseconds:F1}"); + watch.Restart(); + using var stop = new CancellationTokenSource(); + QuicBenchHarness.Opened opened = QuicBenchHarness.Open(StackKind.Managed, certificate).GetAwaiter().GetResult(); + Task echo = QuicBenchHarness.Echo(opened, stop.Token); + byte[] payload = new byte[QuicBenchHarness.SmallBytes]; + for (int i = 0; i < 50; i++) + { + QuicBenchHarness.Exchange(opened, payload).GetAwaiter().GetResult(); + } + + stop.Cancel(); + opened.DisposeAsync().AsTask().GetAwaiter().GetResult(); + echo.GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"managed small-50 ms={watch.Elapsed.TotalMilliseconds:F1}"); + watch.Restart(); + QuicBenchHarness.Opened bulk = QuicBenchHarness.Open(StackKind.Managed, certificate).GetAwaiter().GetResult(); + QuicBenchHarness.Transfer(bulk, new byte[QuicBenchHarness.ChunkBytes], QuicBenchHarness.BulkBytes).GetAwaiter().GetResult(); + bulk.DisposeAsync().AsTask().GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"managed bulk-1MiB ms={watch.Elapsed.TotalMilliseconds:F1}"); + if (!QuicBenchHarness.PlatformListenerAllowed) + { + return; + } + + watch.Restart(); + QuicBenchHarness.Handshake(StackKind.Platform, certificate).GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"platform handshake ms={watch.Elapsed.TotalMilliseconds:F1}"); + watch.Restart(); + using var platformStop = new CancellationTokenSource(); + QuicBenchHarness.Opened platform = QuicBenchHarness.Open(StackKind.Platform, certificate).GetAwaiter().GetResult(); + Task platformEcho = QuicBenchHarness.Echo(platform, platformStop.Token); + for (int i = 0; i < 50; i++) + { + QuicBenchHarness.Exchange(platform, payload).GetAwaiter().GetResult(); + } + + platformStop.Cancel(); + platform.DisposeAsync().AsTask().GetAwaiter().GetResult(); + platformEcho.GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"platform small-50 ms={watch.Elapsed.TotalMilliseconds:F1}"); + watch.Restart(); + QuicBenchHarness.Opened platformBulk = QuicBenchHarness.Open(StackKind.Platform, certificate).GetAwaiter().GetResult(); + QuicBenchHarness.Transfer(platformBulk, new byte[QuicBenchHarness.ChunkBytes], QuicBenchHarness.BulkBytes).GetAwaiter().GetResult(); + platformBulk.DisposeAsync().AsTask().GetAwaiter().GetResult(); + watch.Stop(); + Console.WriteLine($"platform bulk-1MiB ms={watch.Elapsed.TotalMilliseconds:F1}"); + } + + private static void PrintMachine() + { + Console.WriteLine($"machine os={Environment.OSVersion} processors={Environment.ProcessorCount} sdk-runtime={Environment.Version} 64bit={Environment.Is64BitProcess}"); + Console.WriteLine($"power={ReadPowerPlan()}"); + } + + private static void PrintAllocations() + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + var payload = new byte[16 * 1024]; + foreach (TransportKind transport in new[] { TransportKind.Memory, TransportKind.Loopback }) + { + foreach (StackKind stack in new[] { StackKind.Platform, StackKind.Managed }) + { + PrintOneAllocation(certificate, payload, transport, stack); + } + } + } + + private static void PrintOneAllocation(X509Certificate2 certificate, byte[] payload, TransportKind transport, StackKind stack) + { + using OpenedConnection connection = TlsBenchHarness.Open(stack, transport, certificate, gear: null); + var echo = new Thread(() => + { + var buffer = new byte[16 * 1024]; + try + { + while (true) + { + int count = connection.Server.Read(buffer, 0, buffer.Length); + if (count == 0) + { + return; + } + + connection.Server.Write(buffer, 0, count); + } + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + catch (TimeoutException) + { + } + }) + { + IsBackground = true, + }; + echo.Start(); + connection.Client.Write(payload); + ReadFull(connection.Client, payload); + long beforeWrite = GC.GetAllocatedBytesForCurrentThread(); + connection.Client.Write(payload); + long writeBytes = GC.GetAllocatedBytesForCurrentThread() - beforeWrite; + long beforeRead = GC.GetAllocatedBytesForCurrentThread(); + ReadFull(connection.Client, payload); + long readBytes = GC.GetAllocatedBytesForCurrentThread() - beforeRead; + Console.WriteLine($"alloc transport={transport} stack={stack} write={writeBytes} read={readBytes}"); + connection.Dispose(); + echo.Join(); + } + + private static void PrintRsa() + { + using X509Certificate2 certificate = TlsBenchHarness.CreateRsa(); + try + { + using OpenedConnection connection = TlsBenchHarness.Open(StackKind.Managed, TransportKind.Memory, certificate, gear: null); + Console.WriteLine("rsa managed-to-managed=completed"); + } + catch (Exception ex) + { + Console.WriteLine($"rsa managed-to-managed=failed {ex.GetType().Name}: {ex.Message}"); + } + + long platform = TimeOne(StackKind.Platform, certificate); + Console.WriteLine($"rsa platform-full-handshake-us={platform}"); + } + + private static void PrintResume() + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + using var gear = new SessionGear(); + using (OpenedConnection primed = TlsBenchHarness.Open(StackKind.Managed, TransportKind.Memory, certificate, gear)) + { + TlsBenchHarness.Exchange(primed.Client, primed.Server, new byte[1]); + } + + using OpenedConnection resumed = TlsBenchHarness.Open(StackKind.Managed, TransportKind.Memory, certificate, gear); + Console.WriteLine($"resume managed={resumed.Resumed}"); + } + + private static void PrintIdle(int count) + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + foreach (StackKind stack in new[] { StackKind.Platform, StackKind.Managed }) + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + long memoryBefore = GC.GetTotalMemory(forceFullCollection: true); + long workingBefore = Process.GetCurrentProcess().WorkingSet64; + var held = new List(count); + try + { + for (int i = 0; i < count; i++) + { + held.Add(TlsBenchHarness.Open(stack, TransportKind.Memory, certificate, gear: null)); + } + + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + long memoryAfter = GC.GetTotalMemory(forceFullCollection: true); + long workingAfter = Process.GetCurrentProcess().WorkingSet64; + Console.WriteLine($"idle stack={stack} count={count} gc-bytes-per-connection={(memoryAfter - memoryBefore) / count} working-set-delta={workingAfter - workingBefore}"); + } + finally + { + foreach (OpenedConnection connection in held) + { + connection.Dispose(); + } + } + } + } + + private static void PrintStorm(int count) + { + using X509Certificate2 certificate = TlsBenchHarness.CreateEcdsa(); + foreach (StackKind stack in new[] { StackKind.Platform, StackKind.Managed }) + { + using OpenedConnection quiet = TlsBenchHarness.Open(stack, TransportKind.Memory, certificate, gear: null); + var payload = new byte[100]; + var latencies = new long[32]; + Exception? stormError = null; + int started = 0; + var gate = new ManualResetEventSlim(false); + var threads = new Thread[count]; + for (int i = 0; i < count; i++) + { + threads[i] = new Thread(() => + { + gate.Wait(); + try + { + using OpenedConnection connection = TlsBenchHarness.Open(stack, TransportKind.Memory, certificate, gear: null); + Interlocked.Increment(ref started); + } + catch (Exception ex) + { + stormError ??= ex; + } + }); + threads[i].IsBackground = true; + threads[i].Start(); + } + + gate.Set(); + var watch = Stopwatch.StartNew(); + for (int i = 0; i < latencies.Length; i++) + { + long start = watch.ElapsedTicks; + TlsBenchHarness.Exchange(quiet.Client, quiet.Server, payload); + latencies[i] = watch.ElapsedTicks - start; + } + + foreach (Thread thread in threads) + { + thread.Join(); + } + + Array.Sort(latencies); + long p99 = latencies[(int)(latencies.Length * 0.99)]; + double us = p99 * 1_000_000.0 / Stopwatch.Frequency; + Console.WriteLine($"storm stack={stack} requested={count} completed={Volatile.Read(ref started)} quiet-p99-us={us:F0} error={(stormError is null ? "none" : stormError.GetType().Name)}"); + } + } + + private static void ReadFull(Stream source, byte[] buffer) + { + int read = 0; + while (read < buffer.Length) + { + int count = source.Read(buffer, read, buffer.Length - read); + if (count == 0) + { + throw new EndOfStreamException("The exchange ended early."); + } + + read += count; + } + } + + private static long TimeOne(StackKind stack, X509Certificate2 certificate) + { + var watch = Stopwatch.StartNew(); + using OpenedConnection connection = TlsBenchHarness.Open(stack, TransportKind.Memory, certificate, gear: null); + return (long)(watch.Elapsed.TotalMicroseconds); + } + + private static string ReadPowerPlan() + { + try + { + using var process = new Process(); + process.StartInfo = new ProcessStartInfo + { + FileName = "powercfg", + Arguments = "/getactivescheme", + RedirectStandardOutput = true, + UseShellExecute = false, + }; + process.Start(); + string text = process.StandardOutput.ReadToEnd().Trim(); + process.WaitForExit(); + return text.Length == 0 ? "unknown" : text; + } + catch (Exception ex) + { + return ex.GetType().Name; + } + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/Program.cs b/benchmarks/Titanium.Managed.Benchmarks/Program.cs new file mode 100644 index 000000000..26ca04400 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/Program.cs @@ -0,0 +1,32 @@ +using System; +using BenchmarkDotNet.Running; + +namespace Titanium.Managed.Benchmarks; + +public static class Program +{ + public static void Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine("Pass BenchmarkDotNet arguments, or 'probe' with alloc, rsa, idle, storm, machine, or quic."); + return; + } + + if (string.Equals(args[0], "probe", StringComparison.Ordinal)) + { + var rest = new string[args.Length - 1]; + Array.Copy(args, 1, rest, 0, rest.Length); + if (rest.Length > 0 && string.Equals(rest[0], "crossproto", StringComparison.Ordinal)) + { + CrossProtocolSanity.Run(); + return; + } + + ProbeCommand.Run(rest); + return; + } + + BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args); + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/QuicBenchHarness.cs b/benchmarks/Titanium.Managed.Benchmarks/QuicBenchHarness.cs new file mode 100644 index 000000000..ed8e40607 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/QuicBenchHarness.cs @@ -0,0 +1,306 @@ +#pragma warning disable CA1416 // The platform stack is an optional peer, started only when the listener flag is set. +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Quic; + +namespace Titanium.Managed.Benchmarks; + +internal static class QuicBenchHarness +{ + internal const int SmallBytes = 100; + + internal const int BulkBytes = 1024 * 1024; + + // The managed stream window is 1 MiB and is not raised. One jitting call, one warmup, and ten iterations of this size stay inside it. + internal const int RepeatedBulkBytes = 64 * 1024; + + internal const int ChunkBytes = 8 * 1024; + + private static readonly SslApplicationProtocol Protocol = new("test"); + + internal static bool PlatformListenerAllowed => + string.Equals(Environment.GetEnvironmentVariable("TITANIUM_QUIC_PLATFORM_LISTENER"), "1", StringComparison.Ordinal); + + internal static IEnumerable Stacks() + { + yield return StackKind.Managed; + if (PlatformListenerAllowed) + { + yield return StackKind.Platform; + } + } + + internal static Task Handshake(StackKind stack, X509Certificate2 certificate) + { + return stack == StackKind.Platform ? ConnectPlatform(certificate) : ConnectManaged(certificate); + } + + private static async Task ConnectManaged(X509Certificate2 certificate) + { + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = ServerOptions(certificate), + }), + }).ConfigureAwait(false); + RequireEphemeral(listener.LocalEndPoint.Port); + Task accepted = listener.AcceptConnectionAsync().AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = ClientOptions(), + }).ConfigureAwait(false); + await using ManagedQuicConnection server = await accepted.ConfigureAwait(false); + } + + private static async Task ConnectPlatform(X509Certificate2 certificate) + { + if (!PlatformListenerAllowed) + { + throw new InvalidOperationException("Set TITANIUM_QUIC_PLATFORM_LISTENER=1 to start the platform QUIC listener."); + } + + if (!QuicListener.IsSupported) + { + throw new InvalidOperationException("The platform QUIC listener is not supported on this machine."); + } + + await using QuicListener listener = await QuicListener.ListenAsync(new QuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ApplicationProtocols = new List { Protocol }, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new QuicServerConnectionOptions + { + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + IdleTimeout = TimeSpan.FromMinutes(1), + MaxInboundBidirectionalStreams = 4, + ServerAuthenticationOptions = ServerOptions(certificate), + }), + }).ConfigureAwait(false); + RequireEphemeral(listener.LocalEndPoint.Port); + Task accepted = listener.AcceptConnectionAsync().AsTask(); + await using QuicConnection client = await QuicConnection.ConnectAsync(new QuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + IdleTimeout = TimeSpan.FromMinutes(1), + ClientAuthenticationOptions = ClientOptions(), + }).ConfigureAwait(false); + await using QuicConnection server = await accepted.ConfigureAwait(false); + } + + internal static async Task Exchange(Opened opened, byte[] payload) + { + await opened.Outbound.WriteAsync(payload).ConfigureAwait(false); + await ReadExactly(opened.Outbound, payload.Length).ConfigureAwait(false); + } + + internal static async Task Transfer(Opened opened, byte[] chunk, int total) + { + Task read = ReadExactly(opened.Inbound, total); + long written = 0; + while (written < total) + { + int length = (int)Math.Min(chunk.Length, total - written); + await opened.Outbound.WriteAsync(chunk.AsMemory(0, length)).ConfigureAwait(false); + written += length; + } + + await read.ConfigureAwait(false); + } + + internal static Task Echo(Opened opened, CancellationToken cancellationToken) + { + return Task.Run(async () => + { + var buffer = new byte[64 * 1024]; + try + { + while (!cancellationToken.IsCancellationRequested) + { + int count = await opened.Inbound.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + if (count == 0) + { + return; + } + + await opened.Inbound.WriteAsync(buffer.AsMemory(0, count), cancellationToken).ConfigureAwait(false); + } + } + catch (Exception exception) when (exception is OperationCanceledException or IOException or QuicException or ObjectDisposedException) + { + } + }, cancellationToken); + } + + internal static Task Open(StackKind stack, X509Certificate2 certificate) + { + return stack == StackKind.Platform ? OpenPlatform(certificate) : OpenManaged(certificate); + } + + private static async Task OpenManaged(X509Certificate2 certificate) + { + ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = ServerOptions(certificate), + }), + }).ConfigureAwait(false); + try + { + RequireEphemeral(listener.LocalEndPoint.Port); + Task accepted = listener.AcceptConnectionAsync().AsTask(); + ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = ClientOptions(), + }).ConfigureAwait(false); + ManagedQuicConnection server = await accepted.ConfigureAwait(false); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional).ConfigureAwait(false); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync().ConfigureAwait(false); + return new Opened(outbound, inbound, async () => + { + await client.DisposeAsync().ConfigureAwait(false); + await server.DisposeAsync().ConfigureAwait(false); + await listener.DisposeAsync().ConfigureAwait(false); + }); + } + catch + { + await listener.DisposeAsync().ConfigureAwait(false); + throw; + } + } + + private static async Task OpenPlatform(X509Certificate2 certificate) + { + if (!PlatformListenerAllowed) + { + throw new InvalidOperationException("Set TITANIUM_QUIC_PLATFORM_LISTENER=1 to start the platform QUIC listener."); + } + + if (!QuicListener.IsSupported) + { + throw new InvalidOperationException("The platform QUIC listener is not supported on this machine."); + } + + var listener = await QuicListener.ListenAsync(new QuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ApplicationProtocols = new List { Protocol }, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new QuicServerConnectionOptions + { + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + IdleTimeout = TimeSpan.FromMinutes(1), + MaxInboundBidirectionalStreams = 4, + ServerAuthenticationOptions = ServerOptions(certificate), + }), + }).ConfigureAwait(false); + try + { + RequireEphemeral(listener.LocalEndPoint.Port); + Task accepted = listener.AcceptConnectionAsync().AsTask(); + QuicConnection client = await QuicConnection.ConnectAsync(new QuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + IdleTimeout = TimeSpan.FromMinutes(1), + ClientAuthenticationOptions = ClientOptions(), + }).ConfigureAwait(false); + QuicConnection server = await accepted.ConfigureAwait(false); + using var openBudget = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + Task inboundTask = server.AcceptInboundStreamAsync(openBudget.Token).AsTask(); + QuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, openBudget.Token).ConfigureAwait(false); + await outbound.WriteAsync(new byte[] { 1 }, openBudget.Token).ConfigureAwait(false); + QuicStream inbound = await inboundTask.ConfigureAwait(false); + await ReadExactly(inbound, 1).ConfigureAwait(false); + return new Opened(outbound, inbound, async () => + { + await client.DisposeAsync().ConfigureAwait(false); + await server.DisposeAsync().ConfigureAwait(false); + await listener.DisposeAsync().ConfigureAwait(false); + }); + } + catch + { + await listener.DisposeAsync().ConfigureAwait(false); + throw; + } + } + + private static SslServerAuthenticationOptions ServerOptions(X509Certificate2 certificate) + { + return new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { Protocol }, + }; + } + + private static SslClientAuthenticationOptions ClientOptions() + { + return new SslClientAuthenticationOptions + { + TargetHost = "localhost", + ApplicationProtocols = new List { Protocol }, + RemoteCertificateValidationCallback = (_, _, _, _) => true, + }; + } + + private static async Task ReadExactly(Stream stream, int total) + { + var buffer = new byte[64 * 1024]; + int read = 0; + while (read < total) + { + int count = await stream.ReadAsync(buffer.AsMemory(0, Math.Min(buffer.Length, total - read))).ConfigureAwait(false); + if (count == 0) + { + throw new EndOfStreamException("The transfer ended early."); + } + + read += count; + } + } + + private static void RequireEphemeral(int port) + { + if (port is 0 or 8000 or 8866 or 9080 or 9464) + { + throw new InvalidOperationException("The benchmark refused port " + port + "."); + } + } + + internal sealed class Opened : IAsyncDisposable + { + private readonly Func _close; + + internal Opened(Stream outbound, Stream inbound, Func close) + { + Outbound = outbound; + Inbound = inbound; + _close = close; + } + + internal Stream Outbound { get; } + + internal Stream Inbound { get; } + + public async ValueTask DisposeAsync() => await _close().ConfigureAwait(false); + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/QuicBenchmarks.cs b/benchmarks/Titanium.Managed.Benchmarks/QuicBenchmarks.cs new file mode 100644 index 000000000..976d81570 --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/QuicBenchmarks.cs @@ -0,0 +1,118 @@ +using System.Collections.Generic; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using BenchmarkDotNet.Attributes; + +namespace Titanium.Managed.Benchmarks; + +[Config(typeof(TlsBenchmarkConfig))] +public class QuicHandshakeBenchmarks +{ + private X509Certificate2 _certificate = null!; + + public static IEnumerable Stacks() => QuicBenchHarness.Stacks(); + + [ParamsSource(nameof(Stacks))] + public StackKind Stack { get; set; } + + [GlobalSetup] + public void Setup() => _certificate = TlsBenchHarness.CreateEcdsa(); + + [GlobalCleanup] + public void Cleanup() => _certificate.Dispose(); + + [Benchmark(OperationsPerInvoke = 5)] + public async Task Handshake() + { + for (int i = 0; i < 5; i++) + { + await QuicBenchHarness.Handshake(Stack, _certificate).ConfigureAwait(false); + } + } +} + +[Config(typeof(TlsBenchmarkConfig))] +public class QuicSmallFlowBenchmarks +{ + private X509Certificate2 _certificate = null!; + + private QuicBenchHarness.Opened _opened = null!; + + private byte[] _payload = null!; + + private CancellationTokenSource _stop = null!; + + private Task? _echo; + + public static IEnumerable Stacks() => QuicBenchHarness.Stacks(); + + [ParamsSource(nameof(Stacks))] + public StackKind Stack { get; set; } + + [GlobalSetup] + public async Task Setup() + { + _certificate = TlsBenchHarness.CreateEcdsa(); + _payload = new byte[QuicBenchHarness.SmallBytes]; + _opened = await QuicBenchHarness.Open(Stack, _certificate).ConfigureAwait(false); + _stop = new CancellationTokenSource(); + _echo = QuicBenchHarness.Echo(_opened, _stop.Token); + } + + [GlobalCleanup] + public async Task Cleanup() + { + _stop.Cancel(); + await _opened.DisposeAsync().ConfigureAwait(false); + if (_echo is not null) + { + await _echo.ConfigureAwait(false); + } + + _stop.Dispose(); + _certificate.Dispose(); + } + + [Benchmark(OperationsPerInvoke = 50)] + public async Task Small100() + { + for (int i = 0; i < 50; i++) + { + await QuicBenchHarness.Exchange(_opened, _payload).ConfigureAwait(false); + } + } +} + +[Config(typeof(TlsBenchmarkConfig))] +public class QuicBulkBenchmarks +{ + private X509Certificate2 _certificate = null!; + + private QuicBenchHarness.Opened _opened = null!; + + private byte[] _chunk = null!; + + public static IEnumerable Stacks() => QuicBenchHarness.Stacks(); + + [ParamsSource(nameof(Stacks))] + public StackKind Stack { get; set; } + + [GlobalSetup] + public async Task Setup() + { + _certificate = TlsBenchHarness.CreateEcdsa(); + _chunk = new byte[QuicBenchHarness.ChunkBytes]; + _opened = await QuicBenchHarness.Open(Stack, _certificate).ConfigureAwait(false); + } + + [GlobalCleanup] + public async Task Cleanup() + { + await _opened.DisposeAsync().ConfigureAwait(false); + _certificate.Dispose(); + } + + [Benchmark] + public Task Bulk64KiB() => QuicBenchHarness.Transfer(_opened, _chunk, QuicBenchHarness.RepeatedBulkBytes); +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/StrongNameKey.snk b/benchmarks/Titanium.Managed.Benchmarks/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/benchmarks/Titanium.Managed.Benchmarks/StrongNameKey.snk differ diff --git a/benchmarks/Titanium.Managed.Benchmarks/Titanium.Managed.Benchmarks.csproj b/benchmarks/Titanium.Managed.Benchmarks/Titanium.Managed.Benchmarks.csproj new file mode 100644 index 000000000..fa2efa35f --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/Titanium.Managed.Benchmarks.csproj @@ -0,0 +1,20 @@ + + + Exe + net10.0 + enable + disable + false + true + StrongNameKey.snk + Titanium.Managed.Benchmarks + + + + + + + + + + diff --git a/benchmarks/Titanium.Managed.Benchmarks/TlsBenchHarness.cs b/benchmarks/Titanium.Managed.Benchmarks/TlsBenchHarness.cs new file mode 100644 index 000000000..81c834adf --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/TlsBenchHarness.cs @@ -0,0 +1,307 @@ +using System; +using System.IO; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using Titanium.Tls; + +namespace Titanium.Managed.Benchmarks; + +public enum StackKind +{ + Platform, + Managed, +} + +internal static class TlsBenchHarness +{ + public const int BulkBytes = 256 * 1024 * 1024; + + public static X509Certificate2 CreateEcdsa() => CreateCertificate(rsa: false); + + public static X509Certificate2 CreateRsa() => CreateCertificate(rsa: true); + + public static OpenedConnection Open(StackKind stack, TransportKind transport, X509Certificate2 certificate, SessionGear? gear) + { + TransportPair pair = TransportPair.Create(transport); + try + { + return Authenticate(stack, pair, certificate, gear); + } + catch + { + pair.Dispose(); + throw; + } + } + + public static void Transfer(Stream source, Stream destination, byte[] chunk, byte[] readBuffer, long total) + { + Exception? readerError = null; + var reader = new Thread(() => + { + try + { + ReadExactly(destination, readBuffer, total); + } + catch (Exception ex) + { + readerError = ex; + } + }); + reader.IsBackground = true; + reader.Start(); + try + { + WriteRepeated(source, chunk, total); + } + finally + { + reader.Join(); + } + + if (readerError is not null) + { + throw readerError; + } + } + + public static void Exchange(Stream client, Stream server, byte[] payload) + { + var echo = new byte[payload.Length]; + Exception? serverError = null; + var thread = new Thread(() => + { + try + { + ReadFull(server, echo); + server.Write(echo); + } + catch (Exception ex) + { + serverError = ex; + } + }); + thread.IsBackground = true; + thread.Start(); + try + { + client.Write(payload); + ReadFull(client, payload); + } + finally + { + thread.Join(); + } + + if (serverError is not null) + { + throw serverError; + } + } + + private static OpenedConnection Authenticate(StackKind stack, TransportPair pair, X509Certificate2 certificate, SessionGear? gear) + { + Stream? client = null; + Stream? server = null; + Exception? serverError = null; + var serverThread = new Thread(() => + { + try + { + server = AuthenticateServer(stack, pair.Server, certificate, gear); + } + catch (Exception ex) + { + serverError = ex; + } + }); + serverThread.IsBackground = true; + serverThread.Start(); + try + { + client = AuthenticateClient(stack, pair.Client, gear); + serverThread.Join(); + } + catch + { + pair.Dispose(); + serverThread.Join(); + throw; + } + + if (serverError is not null || client is null || server is null) + { + pair.Dispose(); + throw serverError ?? new InvalidOperationException("The handshake did not finish."); + } + + bool resumed = server is TlsStream tls && tls.AcceptedResumption; + return new OpenedConnection(pair, client, server, resumed); + } + + private static Stream AuthenticateClient(StackKind stack, Stream inner, SessionGear? gear) + { + var options = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }; + if (stack == StackKind.Platform) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + ssl.AuthenticateAsClient(options); + return ssl; + } + + var stream = new TlsStream(inner, new TlsStreamOptions { SessionCache = gear?.Cache }); + stream.AuthenticateAsClient(options); + return stream; + } + + private static Stream AuthenticateServer(StackKind stack, Stream inner, X509Certificate2 certificate, SessionGear? gear) + { + var options = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }; + if (stack == StackKind.Platform) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + ssl.AuthenticateAsServer(options); + return ssl; + } + + var stream = new TlsStream(inner, new TlsStreamOptions { Tickets = gear?.Tickets }); + stream.AuthenticateAsServer(options); + return stream; + } + + private static void WriteRepeated(Stream destination, byte[] buffer, long total) + { + long written = 0; + while (written < total) + { + int length = (int)Math.Min(buffer.Length, total - written); + destination.Write(buffer, 0, length); + written += length; + } + } + + private static void ReadExactly(Stream source, byte[] buffer, long total) + { + long read = 0; + while (read < total) + { + int length = (int)Math.Min(buffer.Length, total - read); + int count = source.Read(buffer, 0, length); + if (count == 0) + { + throw new EndOfStreamException("The transfer ended early."); + } + + read += count; + } + } + + private static void ReadFull(Stream source, byte[] buffer) + { + int read = 0; + while (read < buffer.Length) + { + int count = source.Read(buffer, read, buffer.Length - read); + if (count == 0) + { + throw new EndOfStreamException("The exchange ended early."); + } + + read += count; + } + } + + private static X509Certificate2 CreateCertificate(bool rsa) + { + using AsymmetricAlgorithm key = rsa ? RSA.Create(2048) : ECDsa.Create(ECCurve.NamedCurves.nistP256)!; + CertificateRequest request = key switch + { + ECDsa ecdsa => new CertificateRequest("CN=localhost", ecdsa, HashAlgorithmName.SHA256), + RSA algorithm => new CertificateRequest("CN=localhost", algorithm, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1), + _ => throw new InvalidOperationException("The certificate key is missing."), + }; + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(2)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } +} + +internal sealed class SessionGear : IDisposable +{ + public SessionGear() + { + Tickets = new MemoryTicketProtector(); + Cache = new MemoryTlsSessionCache(); + } + + public MemoryTicketProtector Tickets { get; } + + public MemoryTlsSessionCache Cache { get; } + + public void Dispose() => Tickets.Dispose(); +} + +internal sealed class OpenedConnection : IDisposable +{ + private readonly TransportPair _pair; + private int _disposed; + + public OpenedConnection(TransportPair pair, Stream client, Stream server, bool resumed) + { + _pair = pair; + Client = client; + Server = server; + Resumed = resumed; + } + + public Stream Client { get; } + + public Stream Server { get; } + + public bool Resumed { get; } + + public void Dispose() + { + if (Interlocked.Exchange(ref _disposed, 1) != 0) + { + return; + } + + _pair.Unblock(); + try + { + Client.Dispose(); + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + + try + { + Server.Dispose(); + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + + _pair.Dispose(); + } +} diff --git a/benchmarks/Titanium.Managed.Benchmarks/TransportPairs.cs b/benchmarks/Titanium.Managed.Benchmarks/TransportPairs.cs new file mode 100644 index 000000000..25082804f --- /dev/null +++ b/benchmarks/Titanium.Managed.Benchmarks/TransportPairs.cs @@ -0,0 +1,251 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading; + +namespace Titanium.Managed.Benchmarks; + +public enum TransportKind +{ + Loopback, + Memory, +} + +internal sealed class TransportPair : IDisposable +{ + private readonly IDisposable _owner; + private int _disposed; + + private TransportPair(Stream client, Stream server, IDisposable owner) + { + Client = client; + Server = server; + _owner = owner; + } + + public Stream Client { get; } + + public Stream Server { get; } + + public static TransportPair Create(TransportKind kind) + { + return kind == TransportKind.Memory ? CreateMemory() : CreateLoopback(); + } + + public void Unblock() => _owner.Dispose(); + + public void Dispose() + { + if (Interlocked.Exchange(ref _disposed, 1) != 0) + { + return; + } + + Unblock(); + try + { + Client.Dispose(); + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + + try + { + Server.Dispose(); + } + catch (IOException) + { + } + catch (ObjectDisposedException) + { + } + } + + private static TransportPair CreateMemory() + { + var clientToServer = new BlockingPipe(); + var serverToClient = new BlockingPipe(); + var owner = new CompositeDisposable(clientToServer, serverToClient); + return new TransportPair(new PipeStream(serverToClient, clientToServer), new PipeStream(clientToServer, serverToClient), owner); + } + + private static TransportPair CreateLoopback() + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + var client = new TcpClient { NoDelay = true }; + Exception? connectError = null; + var connect = new Thread(() => + { + try + { + client.Connect(IPAddress.Loopback, port); + } + catch (Exception ex) + { + connectError = ex; + } + }); + connect.IsBackground = true; + connect.Start(); + TcpClient server = listener.AcceptTcpClient(); + connect.Join(); + if (connectError is not null) + { + server.Dispose(); + client.Dispose(); + throw connectError; + } + + server.NoDelay = true; + var owner = new CompositeDisposable(client, server); + return new TransportPair(client.GetStream(), server.GetStream(), owner); + } +} + +internal sealed class BlockingPipe : IDisposable +{ + private readonly byte[] _buffer = new byte[32 * 1024]; + private readonly object _gate = new(); + private int _head; + private int _count; + private bool _closed; + + public int Read(Span destination) + { + lock (_gate) + { + while (_count == 0 && !_closed) + { + if (!Monitor.Wait(_gate, 30_000)) + { + throw new TimeoutException("The in-memory transport stalled."); + } + } + + int length = Math.Min(destination.Length, _count); + int first = Math.Min(length, _buffer.Length - _head); + _buffer.AsSpan(_head, first).CopyTo(destination); + if (first < length) + { + _buffer.AsSpan(0, length - first).CopyTo(destination[first..]); + } + + _head = (_head + length) % _buffer.Length; + _count -= length; + Monitor.PulseAll(_gate); + return length; + } + } + + public void Write(ReadOnlySpan source) + { + int offset = 0; + while (offset < source.Length) + { + lock (_gate) + { + while (_count == _buffer.Length && !_closed) + { + if (!Monitor.Wait(_gate, 30_000)) + { + throw new TimeoutException("The in-memory transport stalled."); + } + } + + if (_closed) + { + throw new IOException("The in-memory transport is closed."); + } + + int length = Math.Min(source.Length - offset, _buffer.Length - _count); + int tail = (_head + _count) % _buffer.Length; + int first = Math.Min(length, _buffer.Length - tail); + source.Slice(offset, first).CopyTo(_buffer.AsSpan(tail, first)); + if (first < length) + { + source.Slice(offset + first, length - first).CopyTo(_buffer.AsSpan(0, length - first)); + } + + _count += length; + offset += length; + Monitor.PulseAll(_gate); + } + } + } + + public void Dispose() + { + lock (_gate) + { + _closed = true; + Monitor.PulseAll(_gate); + } + } +} + +internal sealed class PipeStream : Stream +{ + private readonly BlockingPipe _read; + private readonly BlockingPipe _write; + + public PipeStream(BlockingPipe read, BlockingPipe write) + { + _read = read; + _write = write; + } + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => true; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) => _read.Read(buffer.AsSpan(offset, count)); + + public override int Read(Span buffer) => _read.Read(buffer); + + public override void Write(byte[] buffer, int offset, int count) => _write.Write(buffer.AsSpan(offset, count)); + + public override void Write(ReadOnlySpan buffer) => _write.Write(buffer); + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); +} + +internal sealed class CompositeDisposable : IDisposable +{ + private readonly IDisposable _first; + private readonly IDisposable _second; + + public CompositeDisposable(IDisposable first, IDisposable second) + { + _first = first; + _second = second; + } + + public void Dispose() + { + _first.Dispose(); + _second.Dispose(); + } +} diff --git a/deploy/helm/titanium-gateway/README.md b/deploy/helm/titanium-gateway/README.md new file mode 100644 index 000000000..7e14561f3 --- /dev/null +++ b/deploy/helm/titanium-gateway/README.md @@ -0,0 +1,3 @@ +# titanium-gateway + +The data plane leaves `dataPlane.managedStack.enabled` false. The managed TLS and QUIC stacks are not a FIPS-validated module, so the chart keeps the platform stack. Set the value to true only when that trade-off is acceptable. diff --git a/deploy/helm/titanium-gateway/ci/rendered-default.yaml b/deploy/helm/titanium-gateway/ci/rendered-default.yaml index 6c4dd789f..d95f2d52f 100644 --- a/deploy/helm/titanium-gateway/ci/rendered-default.yaml +++ b/deploy/helm/titanium-gateway/ci/rendered-default.yaml @@ -115,7 +115,7 @@ metadata: helm.sh/resource-policy: keep data: twp.yaml: | - {"schemaVersion":"7.1","listeners":[],"routes":[{"id":"titanium-gateway-no-match","clusterId":"titanium-gateway-none","match":{"path":"/","pathKind":"prefix","pathCaseSensitive":true},"order":1,"directResponse":{"status":404},"grpcWeb":false}],"clusters":[],"policies":[],"server":{"admin":{"enabled":true,"host":"0.0.0.0","port":9901,"authTokenEnv":"TITANIUM_ADMIN_TOKEN","readiness":{"requireHealthyClusters":false},"preStopDelaySeconds":5}}} + {"schemaVersion":"7.1","listeners":[],"routes":[{"id":"titanium-gateway-no-match","clusterId":"titanium-gateway-none","match":{"path":"/","pathKind":"prefix","pathCaseSensitive":true},"order":1,"directResponse":{"status":404},"grpcWeb":false}],"clusters":[],"policies":[],"server":{"managedStack":false,"admin":{"enabled":true,"host":"0.0.0.0","port":9901,"authTokenEnv":"TITANIUM_ADMIN_TOKEN","readiness":{"requireHealthyClusters":false},"preStopDelaySeconds":5}}} --- # Source: titanium-gateway/templates/rbac.yaml apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/helm/titanium-gateway/templates/bootstrap.yaml b/deploy/helm/titanium-gateway/templates/bootstrap.yaml index e107e0f47..9afec51ef 100644 --- a/deploy/helm/titanium-gateway/templates/bootstrap.yaml +++ b/deploy/helm/titanium-gateway/templates/bootstrap.yaml @@ -20,6 +20,9 @@ metadata: data: twp.yaml: | {{- $body := .Values.dataPlane.bootstrapConfig }} + {{- if .Values.dataPlane.managedStack.enabled }} + {{- $body = replace "\"managedStack\":false" "\"managedStack\":true" $body }} + {{- end }} {{- $live := lookup "v1" "ConfigMap" .Release.Namespace $data }} {{- if and $live $live.data (hasKey $live.data "twp.yaml") }} {{- $body = index $live.data "twp.yaml" }} diff --git a/deploy/helm/titanium-gateway/values.schema.json b/deploy/helm/titanium-gateway/values.schema.json index 967683990..426c1901b 100644 --- a/deploy/helm/titanium-gateway/values.schema.json +++ b/deploy/helm/titanium-gateway/values.schema.json @@ -6,6 +6,19 @@ "gatewayClass": { "type": "object", "additionalProperties": true }, "ingressClass": { "type": "object", "additionalProperties": true }, "controller": { "type": "object", "additionalProperties": true }, + "dataPlane": { + "type": "object", + "additionalProperties": true, + "properties": { + "managedStack": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { "type": "boolean" } + } + } + } + }, "imagePullSecrets": { "type": "array" } } } diff --git a/deploy/helm/titanium-gateway/values.yaml b/deploy/helm/titanium-gateway/values.yaml index b4e7c849d..cfac8cfa9 100644 --- a/deploy/helm/titanium-gateway/values.yaml +++ b/deploy/helm/titanium-gateway/values.yaml @@ -147,7 +147,11 @@ dataPlane: # The config the pods start with, before the controller has published anything: no listeners, a 404 for everything, admin only. The # controller replaces it. Keep it equal to what the controller renders for an empty cluster (a test checks this). - bootstrapConfig: '{"schemaVersion":"7.1","listeners":[],"routes":[{"id":"titanium-gateway-no-match","clusterId":"titanium-gateway-none","match":{"path":"/","pathKind":"prefix","pathCaseSensitive":true},"order":1,"directResponse":{"status":404},"grpcWeb":false}],"clusters":[],"policies":[],"server":{"admin":{"enabled":true,"host":"0.0.0.0","port":9901,"authTokenEnv":"TITANIUM_ADMIN_TOKEN","readiness":{"requireHealthyClusters":false},"preStopDelaySeconds":5}}}' + # The managed TLS and QUIC stacks stay off. They are not a FIPS-validated module. + managedStack: + enabled: false + + bootstrapConfig: '{"schemaVersion":"7.1","listeners":[],"routes":[{"id":"titanium-gateway-no-match","clusterId":"titanium-gateway-none","match":{"path":"/","pathKind":"prefix","pathCaseSensitive":true},"order":1,"directResponse":{"status":404},"grpcWeb":false}],"clusters":[],"policies":[],"server":{"managedStack":false,"admin":{"enabled":true,"host":"0.0.0.0","port":9901,"authTokenEnv":"TITANIUM_ADMIN_TOKEN","readiness":{"requireHealthyClusters":false},"preStopDelaySeconds":5}}}' podAnnotations: {} podLabels: {} diff --git a/deploy/helm/titanium-manager/values.yaml b/deploy/helm/titanium-manager/values.yaml index 2806489b2..09462dc0a 100644 --- a/deploy/helm/titanium-manager/values.yaml +++ b/deploy/helm/titanium-manager/values.yaml @@ -1,4 +1,5 @@ # Default values for Titanium Manager. +# This chart does not run the data plane. The managed TLS and QUIC stacks stay off on the proxy and gateway charts. # Single-instance only: keep replicaCount at 1 and use one PVC for the SQLite database. replicaCount: 1 diff --git a/deploy/helm/titanium/README.md b/deploy/helm/titanium/README.md new file mode 100644 index 000000000..dab002916 --- /dev/null +++ b/deploy/helm/titanium/README.md @@ -0,0 +1,3 @@ +# titanium + +The proxy chart leaves `managedStack.enabled` false. The managed TLS and QUIC stacks are not a FIPS-validated module, so the chart keeps the platform stack. Set the value to true only when that trade-off is acceptable. The value is written to `server.managedStack`. diff --git a/deploy/helm/titanium/ci/rendered-default.yaml b/deploy/helm/titanium/ci/rendered-default.yaml index bc1399814..871d10596 100644 --- a/deploy/helm/titanium/ci/rendered-default.yaml +++ b/deploy/helm/titanium/ci/rendered-default.yaml @@ -74,6 +74,7 @@ data: preStopDelaySeconds: 5 readiness: requireHealthyClusters: false + managedStack: false --- # Source: titanium/templates/service.yaml apiVersion: v1 diff --git a/deploy/helm/titanium/ci/rendered-full.yaml b/deploy/helm/titanium/ci/rendered-full.yaml index 686697f15..91a37df46 100644 --- a/deploy/helm/titanium/ci/rendered-full.yaml +++ b/deploy/helm/titanium/ci/rendered-full.yaml @@ -138,6 +138,7 @@ data: preStopDelaySeconds: 10 readiness: requireHealthyClusters: true + managedStack: false --- # Source: titanium/templates/service.yaml apiVersion: v1 @@ -209,7 +210,7 @@ spec: template: metadata: annotations: - checksum/config: d0262af266cfb1b8f48db3e1dc81fe938dccf3b7ecc54b43a93b5a675b66de3e + checksum/config: 489d0106cf5860921f8860752375ff25af56a30159224197ff5d5a90718fb101 labels: helm.sh/chart: titanium-1.0.10 app.kubernetes.io/name: titanium diff --git a/deploy/helm/titanium/templates/_helpers.tpl b/deploy/helm/titanium/templates/_helpers.tpl index 260a8c654..1a6bf422f 100644 --- a/deploy/helm/titanium/templates/_helpers.tpl +++ b/deploy/helm/titanium/templates/_helpers.tpl @@ -66,6 +66,7 @@ reference, and the pre-stop delay always agree with the Deployment. {{- $server := default (dict) (get $cfg "server") -}} {{- $admin := dict "enabled" true "host" "0.0.0.0" "port" (int .Values.admin.port) "authTokenEnv" "TITANIUM_ADMIN_TOKEN" "preStopDelaySeconds" (int .Values.admin.preStopDelaySeconds) "readiness" (dict "requireHealthyClusters" (.Values.admin.requireHealthyClusters | default false)) -}} {{- $_ := set $server "admin" $admin -}} +{{- $_ := set $server "managedStack" (.Values.managedStack.enabled | default false) -}} {{- $_ := set $cfg "server" $server -}} {{- if .Values.plus.enabled -}} {{- $_ := required "plus.controlPlane.sharedSecret.existingSecret is required when plus.enabled is true" .Values.plus.controlPlane.sharedSecret.existingSecret -}} diff --git a/deploy/helm/titanium/values.schema.json b/deploy/helm/titanium/values.schema.json index 4b1561b46..3906e6f5a 100644 --- a/deploy/helm/titanium/values.schema.json +++ b/deploy/helm/titanium/values.schema.json @@ -16,6 +16,13 @@ }, "imagePullSecrets": { "type": "array" }, "serviceAccount": { "type": "object", "additionalProperties": true }, - "terminationGracePeriodSeconds": { "type": "integer", "minimum": 0 } + "terminationGracePeriodSeconds": { "type": "integer", "minimum": 0 }, + "managedStack": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { "type": "boolean" } + } + } } } diff --git a/deploy/helm/titanium/values.yaml b/deploy/helm/titanium/values.yaml index 65f8ce90d..b8e082bf0 100644 --- a/deploy/helm/titanium/values.yaml +++ b/deploy/helm/titanium/values.yaml @@ -40,6 +40,11 @@ strategy: # The Titanium config document (twp.yaml). The chart owns `server.admin` and overwrites whatever is set there: # use the `admin` values below instead. Everything else is passed through unchanged. +# The managed TLS and QUIC stacks stay off. They are not a FIPS-validated module, and the platform +# stack remains the default. `managedStack.enabled` is written to `server.managedStack`. +managedStack: + enabled: false + config: schemaVersion: "7.1" listeners: diff --git a/samples/HttpClientManagedStack/HttpClientManagedStack.csproj b/samples/HttpClientManagedStack/HttpClientManagedStack.csproj new file mode 100644 index 000000000..4152ff853 --- /dev/null +++ b/samples/HttpClientManagedStack/HttpClientManagedStack.csproj @@ -0,0 +1,17 @@ + + + Exe + net10.0 + enable + disable + true + false + 0.1.0-preview.1 + + + + + + + + diff --git a/samples/HttpClientManagedStack/Program.cs b/samples/HttpClientManagedStack/Program.cs new file mode 100644 index 000000000..72bac8b84 --- /dev/null +++ b/samples/HttpClientManagedStack/Program.cs @@ -0,0 +1,53 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using Titanium.Net.Http; + +namespace HttpClientManagedStack; + +/// Sends one HTTPS request on HTTP/1.1, HTTP/2, and HTTP/3 through . +public static class Program +{ + /// Calls the URL from the first argument on each version. + /// The HTTPS URL. + /// Zero when the HTTP/1.1 call succeeds. + public static async Task Main(string[] args) + { + if (args.Length != 1 || !Uri.TryCreate(args[0], UriKind.Absolute, out Uri? address) || address.Scheme != Uri.UriSchemeHttps) + { + Console.WriteLine("Usage: HttpClientManagedStack "); + return 1; + } + + using TitaniumHttpHandler handler = new(); + using HttpClient client = new(handler, disposeHandler: false) + { + Timeout = TimeSpan.FromSeconds(20), + }; + bool http11 = await CallAsync(client, address, new Version(1, 1), HttpVersionPolicy.RequestVersionExact).ConfigureAwait(false); + await CallAsync(client, address, new Version(2, 0), HttpVersionPolicy.RequestVersionExact).ConfigureAwait(false); + await CallAsync(client, address, new Version(3, 0), HttpVersionPolicy.RequestVersionExact).ConfigureAwait(false); + return http11 ? 0 : 1; + } + + private static async Task CallAsync(HttpClient client, Uri address, Version version, HttpVersionPolicy policy) + { + try + { + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = version, + VersionPolicy = policy, + }; + using HttpResponseMessage response = await client.SendAsync(request).ConfigureAwait(false); + string body = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + Console.WriteLine(version.ToString() + " " + ((int)response.StatusCode).ToString() + " " + body.Length.ToString() + " bytes"); + return response.IsSuccessStatusCode; + } + catch (Exception ex) + { + Console.WriteLine(version.ToString() + " failed: " + ex.Message); + return false; + } + } +} diff --git a/samples/QuicEcho/Program.cs b/samples/QuicEcho/Program.cs new file mode 100644 index 000000000..b9ab54d4d --- /dev/null +++ b/samples/QuicEcho/Program.cs @@ -0,0 +1,98 @@ +#pragma warning disable CA1416 // QuicStreamType is the BCL name. This sample does not start the platform QUIC stack. +using System; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Titanium.Quic; + +namespace QuicEcho; + +/// Echoes two bytes on one loopback managed QUIC stream. +public static class Program +{ + /// Returns zero when the client reads the same two bytes it wrote. + /// Zero on a matching echo. + public static async Task Main() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + }, + }), + }).ConfigureAwait(false); + Task accepted = listener.AcceptConnectionAsync().AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + AllowManagedStackUnderFips = true, + ClientAuthenticationOptions = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }, + }).ConfigureAwait(false); + await using ManagedQuicConnection server = await accepted.ConfigureAwait(false); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional).ConfigureAwait(false); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync().ConfigureAwait(false); + byte[] payload = [0x6F, 0x6B]; + await outbound.WriteAsync(payload).ConfigureAwait(false); + var echoed = new byte[2]; + int read = 0; + while (read < echoed.Length) + { + int count = await inbound.ReadAsync(echoed.AsMemory(read)).ConfigureAwait(false); + if (count == 0) + { + return 1; + } + + read += count; + } + + await inbound.WriteAsync(echoed).ConfigureAwait(false); + var roundTrip = new byte[2]; + read = 0; + while (read < roundTrip.Length) + { + int count = await outbound.ReadAsync(roundTrip.AsMemory(read)).ConfigureAwait(false); + if (count == 0) + { + return 1; + } + + read += count; + } + + bool match = roundTrip[0] == payload[0] && roundTrip[1] == payload[1]; + Console.WriteLine(match ? "ok" : "mismatch"); + await client.CloseAsync(0).ConfigureAwait(false); + await server.CloseAsync(0).ConfigureAwait(false); + return match ? 0 : 1; + } + + private static X509Certificate2 Certificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), null, flags); + } +} diff --git a/samples/QuicEcho/QuicEcho.csproj b/samples/QuicEcho/QuicEcho.csproj new file mode 100644 index 000000000..5f1a679db --- /dev/null +++ b/samples/QuicEcho/QuicEcho.csproj @@ -0,0 +1,17 @@ + + + Exe + net10.0 + enable + disable + true + false + 0.1.0-preview.1 + + + + + + + + diff --git a/samples/TlsStreamEcho/Program.cs b/samples/TlsStreamEcho/Program.cs new file mode 100644 index 000000000..bf3977abd --- /dev/null +++ b/samples/TlsStreamEcho/Program.cs @@ -0,0 +1,91 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Titanium.Tls; + +namespace TlsStreamEcho; + +/// Echoes two bytes between a loopback client and server. +public static class Program +{ + /// Returns zero when the client reads the same two bytes it wrote. + /// Zero on a matching echo. + public static async Task Main() + { + using X509Certificate2 certificate = Certificate(); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + Task accepted = listener.AcceptTcpClientAsync(); + using var clientTcp = new TcpClient(); + await clientTcp.ConnectAsync((IPEndPoint)listener.LocalEndpoint!).ConfigureAwait(false); + using TcpClient serverTcp = await accepted.ConfigureAwait(false); + await using var server = new TlsStream(serverTcp.GetStream(), Options()); + await using var client = new TlsStream(clientTcp.GetStream(), Options()); + Task serverAuth = server.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + }); + Task clientAuth = client.AuthenticateAsClientAsync(new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }); + await Task.WhenAll(serverAuth, clientAuth).ConfigureAwait(false); + byte[] payload = [0x6F, 0x6B]; + await client.WriteAsync(payload).ConfigureAwait(false); + var echoed = new byte[2]; + int read = 0; + while (read < echoed.Length) + { + int count = await server.ReadAsync(echoed.AsMemory(read)).ConfigureAwait(false); + if (count == 0) + { + return 1; + } + + read += count; + } + + await server.WriteAsync(echoed).ConfigureAwait(false); + var roundTrip = new byte[2]; + read = 0; + while (read < roundTrip.Length) + { + int count = await client.ReadAsync(roundTrip.AsMemory(read)).ConfigureAwait(false); + if (count == 0) + { + return 1; + } + + read += count; + } + + listener.Stop(); + bool match = roundTrip[0] == payload[0] && roundTrip[1] == payload[1]; + Console.WriteLine(match ? "ok" : "mismatch"); + return match ? 0 : 1; + } + + private static TlsStreamOptions Options() => new() { AllowManagedStackUnderFips = true }; + + private static X509Certificate2 Certificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), null, flags); + } +} diff --git a/samples/TlsStreamEcho/TlsStreamEcho.csproj b/samples/TlsStreamEcho/TlsStreamEcho.csproj new file mode 100644 index 000000000..8e0b70491 --- /dev/null +++ b/samples/TlsStreamEcho/TlsStreamEcho.csproj @@ -0,0 +1,17 @@ + + + Exe + net10.0 + enable + disable + true + false + 0.1.0-preview.1 + + + + + + + + diff --git a/src/Titanium.Cli/Config/RunCommand.cs b/src/Titanium.Cli/Config/RunCommand.cs index 150ff72e8..f92c8cb83 100644 --- a/src/Titanium.Cli/Config/RunCommand.cs +++ b/src/Titanium.Cli/Config/RunCommand.cs @@ -63,6 +63,7 @@ public static async Task ExecuteAsync(string[] args) var serviceMode = ParseServiceMode(args); var watch = ParseWatch(args); var zoneOverride = ParseZone(args); + var managedStackOverride = ParseManagedStack(args); var serviceName = ParseServiceName(args) ?? Service.ServiceDefaults.DefaultServiceName; if (serviceMode && OperatingSystem.IsWindows()) @@ -71,7 +72,7 @@ public static async Task ExecuteAsync(string[] args) .ConfigureAwait(false); } - return await ExecuteCoreAsync(configPath, verbose, serviceMode, CancellationToken.None, watch, zoneOverride) + return await ExecuteCoreAsync(configPath, verbose, serviceMode, CancellationToken.None, watch, zoneOverride, managedStackOverride) .ConfigureAwait(false); } @@ -82,7 +83,8 @@ internal static async Task ExecuteCoreAsync( // NOSONAR S3776 -- CLI run li bool serviceMode, CancellationToken stoppingToken, bool watch = false, - string? zoneOverride = null) + string? zoneOverride = null, + bool? managedStackOverride = null) { // Hashed before the load: if the file is replaced in between (a ConfigMap swap while the pod starts), the run // loads the newer content but reports the older hash, and the check after the watcher starts reloads it. @@ -151,6 +153,7 @@ internal static async Task ExecuteCoreAsync( // NOSONAR S3776 -- CLI run li proxy.CertificateManager.ApplyFastColdStartLeafSettings(); ZstdCodecRegistration.RegisterIfConfigured(loaded.Config.Server?.ResponseCompression); ServerConfigApplier.Apply(proxy, loaded.Config.Server); + ApplyManagedStackOverride(proxy, managedStackOverride); using var geoIpHost = new GeoIpResolverHost(); var plusEnabled = loaded.Config.Plus?.Enabled == true; if (!string.IsNullOrWhiteSpace(loaded.Config.Server?.GeoIpDatabasePath) && !plusEnabled) @@ -355,7 +358,8 @@ await ReloadConfigAsync( setPlugins: next => pluginHost = next, scriptPipeline: scriptPipeline, stoppingToken: ct, - runningListeners: runningListeners).ConfigureAwait(false); + runningListeners: runningListeners, + managedStackOverride: managedStackOverride).ConfigureAwait(false); configHash = AdminHost.ComputeConfigHash(configPath); AsyncConsole.WriteLine("Config reloaded."); await AsyncConsole.FlushAsync().ConfigureAwait(false); @@ -740,7 +744,8 @@ internal static async Task ReloadConfigAsync( // NOSONAR S107 -- Reload keeps es CliConfigEditor? configEditor = null, SemaphoreSlim? configEditGate = null, Dictionary? runningListeners = null, - CancellationToken stoppingToken = default) + CancellationToken stoppingToken = default, + bool? managedStackOverride = null) { if (configEditGate is not null) { @@ -783,6 +788,7 @@ internal static async Task ReloadConfigAsync( // NOSONAR S107 -- Reload keeps es ZstdCodecRegistration.RegisterIfConfigured(loaded.Config.Server?.ResponseCompression); ServerConfigApplier.Apply(proxy, loaded.Config.Server); + ApplyManagedStackOverride(proxy, managedStackOverride); if (loaded.Config.Plus?.Enabled == true) { geoIpHost?.Apply(loaded.Config.Server?.GeoIpDatabasePath, startup: false, warn: AsyncConsole.WriteError); @@ -1125,6 +1131,13 @@ titanium run -c [-v|--verbose] [--service] [--name ] [--w --service Run as an OS service worker (used by `titanium service install`). --name Windows SCM service name when --service is set (default: titanium). --watch Debounced reload when the config file changes (off by default). + --managed-stack [true|false] + Use Titanium's TLS and QUIC stacks. Also reads TITANIUM_MANAGED_STACK + (1, true, 0, or false). The flag wins, then the variable, then the config file. + Fingerprint shaping and terminating QUIC from raw datagrams need these stacks. + The platform APIs do not expose the ClientHello layout or those datagrams. + While FIPS mode is on, startup refuses the stacks unless + TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1. They are not a FIPS-validated module. Starts the proxy and blocks until Ctrl+C, SIGTERM, or the service manager stops it. With server.admin enabled, /readyz answers 503 as soon as a stop is requested, then the @@ -2403,4 +2416,87 @@ private static void WriteConfigWarnings(LoadedConfig loaded) return null; } + + internal static bool? ParseManagedStack(string[] args) + { + bool? value = null; + for (var i = 0; i < args.Length; i++) + { + if (args[i].Equals("--managed-stack", StringComparison.OrdinalIgnoreCase)) + { + if (i + 1 < args.Length && TryParseManagedStackValue(args[i + 1], out var next)) + { + value = next; + i++; + } + else + { + value = true; + } + + continue; + } + + if (args[i].StartsWith("--managed-stack=", StringComparison.OrdinalIgnoreCase)) + { + var text = args[i]["--managed-stack=".Length..]; + if (!TryParseManagedStackValue(text, out var parsed)) + { + throw new ArgumentException("--managed-stack expects true, false, 1, or 0."); + } + + value = parsed; + } + } + + return value; + } + + internal static bool? ResolveManagedStack(bool? cliOverride) + { + if (cliOverride is bool fromCli) + { + return fromCli; + } + + var env = Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK"); + if (string.IsNullOrWhiteSpace(env)) + { + return null; + } + + if (!TryParseManagedStackValue(env.Trim(), out var fromEnv)) + { + throw new ArgumentException("TITANIUM_MANAGED_STACK expects true, false, 1, or 0."); + } + + return fromEnv; + } + + internal static void ApplyManagedStackOverride(ProxyServer proxy, bool? cliOverride) + { + if (ResolveManagedStack(cliOverride) is bool enabled) + { + proxy.UseManagedTlsStack = enabled; + proxy.UseManagedQuicStack = enabled; + } + } + + private static bool TryParseManagedStackValue(string text, out bool value) + { + if (text.Equals("1", StringComparison.OrdinalIgnoreCase) || text.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + value = true; + return true; + } + + if (text.Equals("0", StringComparison.OrdinalIgnoreCase) || text.Equals("false", StringComparison.OrdinalIgnoreCase)) + { + value = false; + return true; + } + + value = false; + return false; + } } diff --git a/src/Titanium.Cli/Config/ServerConfigApplier.cs b/src/Titanium.Cli/Config/ServerConfigApplier.cs index f6f13bc0d..104ecf05f 100644 --- a/src/Titanium.Cli/Config/ServerConfigApplier.cs +++ b/src/Titanium.Cli/Config/ServerConfigApplier.cs @@ -144,6 +144,8 @@ private static void ApplyDecryptExclusions(ProxyServer proxy, ServerConfig serve private static void ApplyProtocolFlags(ProxyServer proxy, ServerConfig server) { ApplyBool(server.EnableHttp2, v => proxy.EnableHttp2 = v); + ApplyManagedStack(proxy, server); + ApplyManagedStackFipsOverride(proxy, server); if (server.EnableHttp3 is bool http3) { @@ -195,6 +197,25 @@ private static void ApplyProtocolFlags(ProxyServer proxy, ServerConfig server) } } + private static void ApplyManagedStack(ProxyServer proxy, ServerConfig server) + { + if (server.ManagedStack is null && server.ManagedTls is null && server.ManagedQuic is null) + { + return; + } + + proxy.UseManagedTlsStack = server.ManagedTls ?? server.ManagedStack ?? false; + proxy.UseManagedQuicStack = server.ManagedQuic ?? server.ManagedStack ?? false; + } + + private static void ApplyManagedStackFipsOverride(ProxyServer proxy, ServerConfig server) + { + if (server.ManagedStackFipsOverride is bool allow) + { + proxy.AllowManagedStackUnderFips = allow; + } + } + private static void ApplyBool(bool? value, Action apply) { if (value is bool b) diff --git a/src/Titanium.Cli/Program.cs b/src/Titanium.Cli/Program.cs index d06ec64c2..b33ed3f1e 100644 --- a/src/Titanium.Cli/Program.cs +++ b/src/Titanium.Cli/Program.cs @@ -75,7 +75,7 @@ private static int PrintHelp() Titanium Web Proxy CLI Usage: - titanium run -c [-v|--verbose] [--service] [--watch] + titanium run -c [-v|--verbose] [--service] [--watch] [--managed-stack [true|false]] titanium reload -c titanium restart -c (Linux hot restart) titanium test -c diff --git a/src/Titanium.Gateway/Translation/GatewayTranslator.cs b/src/Titanium.Gateway/Translation/GatewayTranslator.cs index 242626260..d68ae1fd8 100644 --- a/src/Titanium.Gateway/Translation/GatewayTranslator.cs +++ b/src/Titanium.Gateway/Translation/GatewayTranslator.cs @@ -212,6 +212,8 @@ private TwpConfig BuildConfig(List drafts, ClusterRegistry clusters, PreStopDelaySeconds = 5, Readiness = new AdminReadinessConfig { RequireHealthyClusters = false }, }, + // Explicit false matches the chart bootstrap. Null would be omitted from JSON and the two would drift. + ManagedStack = false, ForwardedHeaders = _options.TrustedProxies is { Count: > 0 } proxies ? new ForwardedHeadersConfig { TrustedProxies = proxies } : null, diff --git a/src/Titanium.Http3/AssemblyInfo.cs b/src/Titanium.Http3/AssemblyInfo.cs new file mode 100644 index 000000000..42a3b87af --- /dev/null +++ b/src/Titanium.Http3/AssemblyInfo.cs @@ -0,0 +1,44 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Titanium.Web.Proxy, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("Titanium.Web.Proxy.UnitTests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("Titanium.Web.Proxy.IntegrationTests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("Titanium.Net.Http, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("Titanium.Net.Http.Tests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("Titanium.Inspector.Tests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] +[assembly: InternalsVisibleTo("RpsLoadProbe, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] diff --git a/src/Titanium.Http3/BannedSymbols.txt b/src/Titanium.Http3/BannedSymbols.txt new file mode 100644 index 000000000..24d8a23f4 --- /dev/null +++ b/src/Titanium.Http3/BannedSymbols.txt @@ -0,0 +1,9 @@ +T:System.Runtime.InteropServices.DllImportAttribute;P/Invoke is not allowed in the HTTP/3 codec. +T:System.Runtime.InteropServices.LibraryImportAttribute;P/Invoke is not allowed in the HTTP/3 codec. +M:System.Threading.Tasks.Task.Run(System.Action);Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken);Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task});Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken);Protocol work stays on the caller. Do not hop threads. +T:System.IO.Pipelines.Pipe;The codec uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeReader;The codec uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeWriter;The codec uses the caller-driven stream model, not a pipe. diff --git a/src/Titanium.Web.Proxy/Masque/CapsuleCodec.cs b/src/Titanium.Http3/CapsuleReader.cs similarity index 78% rename from src/Titanium.Web.Proxy/Masque/CapsuleCodec.cs rename to src/Titanium.Http3/CapsuleReader.cs index 4f92af7b4..cc4c900fc 100644 --- a/src/Titanium.Web.Proxy/Masque/CapsuleCodec.cs +++ b/src/Titanium.Http3/CapsuleReader.cs @@ -1,15 +1,18 @@ using System; using System.Buffers.Binary; -namespace Titanium.Web.Proxy.Masque; +namespace Titanium.Http3; /// -/// RFC 9297 capsule parser. A declared length never allocates: oversize capsules are discarded -/// as the bytes arrive. One instance is reused for the life of a tunnel. +/// RFC 9297 capsule parser. A declared length never allocates: oversize capsules are discarded +/// as the bytes arrive. One instance is reused for the life of a tunnel. /// -internal sealed class CapsuleReader +public sealed class CapsuleReader { + /// Largest capsule body this reader accepts by default. public const int DefaultMaxCapsuleBytes = 2048; + + /// Largest datagram payload this reader delivers by default. public const int DefaultMaxDatagramBytes = 1500; private readonly byte[] value; @@ -24,6 +27,9 @@ internal sealed class CapsuleReader private int valueNeed; private Phase phase = Phase.Type; + /// Creates a reader with the given capsule and datagram limits. + /// Largest capsule body to keep. Larger bodies are discarded. + /// Largest datagram payload to deliver. public CapsuleReader(int maxCapsuleBytes = DefaultMaxCapsuleBytes, int maxDatagramBytes = DefaultMaxDatagramBytes) { if (maxCapsuleBytes <= 0 || maxDatagramBytes <= 0) @@ -36,16 +42,17 @@ public CapsuleReader(int maxCapsuleBytes = DefaultMaxCapsuleBytes, int maxDatagr value = new byte[maxCapsuleBytes]; } + /// How many capsules this reader has discarded. public int Dropped { get; private set; } /// - /// Bridge mode. Invoked for capsule types other than DATAGRAM (0). The memory is valid only - /// for the duration of the call. MASQUE leaves this unset and keeps context-0 datagram delivery. - /// The WebTransport bridges do not parse capsules at all: they copy DATA bytes, so unknown - /// capsule types pass through without this hook. + /// Invoked for capsule types other than DATAGRAM (0). The memory is valid only for the duration of the call. /// public Action>? OnUnknownCapsule { get; set; } + /// Parses the next bytes and delivers each complete context-0 datagram. + /// The next chunk of capsule bytes. + /// Called with each datagram payload. The span is valid only for the call. public void Feed(ReadOnlySpan data, DatagramHandler onDatagram) { var index = 0; @@ -71,6 +78,60 @@ public void Feed(ReadOnlySpan data, DatagramHandler onDatagram) } } + /// Writes a context-0 DATAGRAM capsule. + /// The buffer that receives the capsule. + /// The datagram payload. + /// The number of bytes written, or -1 when the buffer is too small. + public static int WriteDatagram(Span destination, ReadOnlySpan payload) + { + var length = 1 + payload.Length; + var needed = VarintSize(0) + VarintSize(length) + length; + if (destination.Length < needed) + { + return -1; + } + + var written = WriteVarint(destination, 0); + written += WriteVarint(destination[written..], length); + destination[written++] = 0; + payload.CopyTo(destination[written..]); + return written + payload.Length; + } + + /// Writes a QUIC variable-length integer. + /// The buffer that receives the integer. + /// The integer to write. + /// The number of bytes written, or -1 when the buffer is too small. + public static int WriteVarint(Span destination, long value) + { + var size = VarintSize(value); + if (destination.Length < size) + { + return -1; + } + + switch (size) + { + case 1: + destination[0] = (byte)value; + break; + case 2: + BinaryPrimitives.WriteUInt16BigEndian(destination, (ushort)value); + destination[0] |= 0x40; + break; + case 4: + BinaryPrimitives.WriteUInt32BigEndian(destination, (uint)value); + destination[0] |= 0x80; + break; + default: + BinaryPrimitives.WriteUInt64BigEndian(destination, (ulong)value); + destination[0] |= 0xC0; + break; + } + + return size; + } + private void Skip(ReadOnlySpan data, ref int index) { var take = (int)Math.Min(skipRemaining, data.Length - index); @@ -134,22 +195,6 @@ private void CopyValue(ReadOnlySpan data, ref int index, DatagramHandler o } } - public static int WriteDatagram(Span destination, ReadOnlySpan payload) - { - var length = 1 + payload.Length; - var needed = VarintSize(0) + VarintSize(length) + length; - if (destination.Length < needed) - { - return -1; - } - - var written = WriteVarint(destination, 0); - written += WriteVarint(destination[written..], length); - destination[written++] = 0; - payload.CopyTo(destination[written..]); - return written + payload.Length; - } - private bool FillVarint(ReadOnlySpan data, ref int index) { if (varintFilled == 0) @@ -262,36 +307,6 @@ private static int VarintSize(long value) return 8; } - public static int WriteVarint(Span destination, long value) - { - var size = VarintSize(value); - if (destination.Length < size) - { - return -1; - } - - switch (size) - { - case 1: - destination[0] = (byte)value; - break; - case 2: - BinaryPrimitives.WriteUInt16BigEndian(destination, (ushort)value); - destination[0] |= 0x40; - break; - case 4: - BinaryPrimitives.WriteUInt32BigEndian(destination, (uint)value); - destination[0] |= 0x80; - break; - default: - BinaryPrimitives.WriteUInt64BigEndian(destination, (ulong)value); - destination[0] |= 0xC0; - break; - } - - return size; - } - private enum Phase { Type = 0, @@ -301,4 +316,6 @@ private enum Phase } } -internal delegate void DatagramHandler(ReadOnlySpan payload); +/// Receives one datagram payload. The span is valid only for the call. +/// The datagram payload. +public delegate void DatagramHandler(ReadOnlySpan payload); diff --git a/src/Titanium.Http3/Http3ErrorCode.cs b/src/Titanium.Http3/Http3ErrorCode.cs new file mode 100644 index 000000000..95734b9c6 --- /dev/null +++ b/src/Titanium.Http3/Http3ErrorCode.cs @@ -0,0 +1,65 @@ +namespace Titanium.Http3; + +/// HTTP/3 application error codes (RFC 9114 §8.1). +public enum Http3ErrorCode : long +{ + /// No error. The connection or stream is closing without a more specific cause. + NoError = 0x100, + + /// The peer violated the protocol and no more specific code applies. + GeneralProtocolError = 0x101, + + /// An internal error occurred in the HTTP stack. + InternalError = 0x102, + + /// The peer created a stream that this endpoint will not accept. + StreamCreationError = 0x103, + + /// A stream required by the connection was closed or reset. + ClosedCriticalStream = 0x104, + + /// A frame arrived in a state or on a stream where it is not allowed. + FrameUnexpected = 0x105, + + /// A frame failed its layout or size requirements. + FrameError = 0x106, + + /// The peer is behaving in a way that may create excessive load. + ExcessiveLoad = 0x107, + + /// A stream ID or push ID was used incorrectly. + IdError = 0x108, + + /// The SETTINGS payload was invalid. + SettingsError = 0x109, + + /// The control stream did not start with SETTINGS. + MissingSettings = 0x10A, + + /// The server rejected a request without application processing. + RequestRejected = 0x10B, + + /// The request or its response was cancelled. + RequestCancelled = 0x10C, + + /// The stream ended before a complete request. + RequestIncomplete = 0x10D, + + /// The message was well formed and is not supported. + MessageError = 0x10E, + + /// The TCP connection from a CONNECT request was reset or closed abnormally. + ConnectError = 0x10F, + + /// The operation cannot be served over HTTP/3. The peer should retry over HTTP/1.1. + VersionFallback = 0x110, + + /// QPACK decompression failed. + QpackDecompressionFailed = 0x200, + + /// The QPACK encoder stream failed. + QpackEncoderStreamError = 0x201, + + /// The QPACK decoder stream failed. + QpackDecoderStreamError = 0x202, +} diff --git a/src/Titanium.Web.Proxy/Http3/Http3Exceptions.cs b/src/Titanium.Http3/Http3Exceptions.cs similarity index 96% rename from src/Titanium.Web.Proxy/Http3/Http3Exceptions.cs rename to src/Titanium.Http3/Http3Exceptions.cs index 2551d415f..6792e9341 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3Exceptions.cs +++ b/src/Titanium.Http3/Http3Exceptions.cs @@ -1,6 +1,6 @@ using System; -namespace Titanium.Web.Proxy.Http3; +namespace Titanium.Http3; /// /// Exception carrying an HTTP/3 error code, used to abort a stream or connection. diff --git a/src/Titanium.Http3/Http3FrameCodec.cs b/src/Titanium.Http3/Http3FrameCodec.cs new file mode 100644 index 000000000..9a459721e --- /dev/null +++ b/src/Titanium.Http3/Http3FrameCodec.cs @@ -0,0 +1,68 @@ +using System; + +namespace Titanium.Http3; + +/// HTTP/3 frame layout (RFC 9114 §7.1): type, length, then payload. This type does not write to a stream. +public static class Http3FrameCodec +{ + /// Default per-frame payload cap when a caller passes no positive limit. + public const long DefaultMaxPayloadBytes = 4 * 1024 * 1024; + + /// First rent size for a payload larger than this. The buffer grows as bytes arrive. + public const int ProgressiveRentChunkBytes = 256 * 1024; + + /// Slice size for a DATA payload that is streamed instead of rented whole. + public const int RelayUnitBytes = 16 * 1024; + + /// + /// Payload byte cap for one frame. HEADERS use . + /// Other frames use . + /// + /// The HTTP/3 frame type. + /// Cap for a HEADERS payload. + /// Cap for every other payload. + /// The cap that applies to this frame. + public static long PayloadLimitForFrameType(ulong frameType, long fieldSectionLimit, long dataFrameLimit) => + frameType == Http3FrameType.Headers ? fieldSectionLimit : dataFrameLimit; + + /// + /// True when a DATA payload should be copied in slices instead of rented as one buffer. + /// + /// The HTTP/3 frame type. + /// The declared payload length. + /// The whole-frame cap. Zero uses . + /// When true, the payload is kept whole. + /// Whether the payload should be streamed in slices. + public static bool StreamsPastFrameCap(ulong frameType, long length, long frameCap, bool captureWholeFrame) + => !captureWholeFrame + && frameType == Http3FrameType.Data + && length > (frameCap > 0 ? frameCap : DefaultMaxPayloadBytes); + + /// Writes the frame type and payload length. + /// The buffer that receives the header. It must hold both variable-length integers. + /// The HTTP/3 frame type. + /// The payload length. + /// The number of bytes written. + public static int WriteHeader(Span destination, ulong frameType, ulong payloadLength) + { + var typeLen = Http3VarInt.Write(destination, frameType); + var lengthLen = Http3VarInt.Write(destination[typeLen..], payloadLength); + return typeLen + lengthLen; + } + + /// Writes one complete frame. + /// The buffer that receives the frame. It must hold the header and the payload. + /// The HTTP/3 frame type. + /// The payload bytes. + /// The number of bytes written. + public static int Write(Span destination, ulong frameType, ReadOnlySpan payload) + { + var headerLen = WriteHeader(destination, frameType, (ulong)payload.Length); + if (!payload.IsEmpty) + { + payload.CopyTo(destination[headerLen..]); + } + + return headerLen + payload.Length; + } +} diff --git a/src/Titanium.Http3/Http3FrameType.cs b/src/Titanium.Http3/Http3FrameType.cs new file mode 100644 index 000000000..79350a191 --- /dev/null +++ b/src/Titanium.Http3/Http3FrameType.cs @@ -0,0 +1,42 @@ +namespace Titanium.Http3; + +/// HTTP/3 frame type values (RFC 9114 §7.2). +public static class Http3FrameType +{ + /// DATA frame. Carries the request or response payload. + public const ulong Data = 0x0; + + /// HEADERS frame. Carries a QPACK field section. + public const ulong Headers = 0x1; + + /// CANCEL_PUSH frame. Cancels a server push before its stream arrives. + public const ulong CancelPush = 0x3; + + /// SETTINGS frame. Carries connection parameters. + public const ulong Settings = 0x4; + + /// PUSH_PROMISE frame. Carries a promised request header section. + public const ulong PushPromise = 0x5; + + /// GOAWAY frame. Starts a graceful shutdown. + public const ulong GoAway = 0x7; + + /// MAX_PUSH_ID frame. Limits how many pushes the server may start. + public const ulong MaxPushId = 0xD; +} + +/// HTTP/3 unidirectional stream type codes (RFC 9114 §6.2). +public static class Http3StreamType +{ + /// Control stream. + public const ulong Control = 0x0; + + /// Push stream. + public const ulong Push = 0x1; + + /// QPACK encoder stream. + public const ulong QpackEncoder = 0x2; + + /// QPACK decoder stream. + public const ulong QpackDecoder = 0x3; +} diff --git a/src/Titanium.Web.Proxy/Http3/Http3Settings.cs b/src/Titanium.Http3/Http3Settings.cs similarity index 52% rename from src/Titanium.Web.Proxy/Http3/Http3Settings.cs rename to src/Titanium.Http3/Http3Settings.cs index b296b10da..2233cf0ed 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3Settings.cs +++ b/src/Titanium.Http3/Http3Settings.cs @@ -1,131 +1,146 @@ using System; using System.Collections.Generic; -namespace Titanium.Web.Proxy.Http3; +namespace Titanium.Http3; /// -/// HTTP/3 SETTINGS parameter identifiers (RFC 9114 §7.2.4 + §7.2.4.1, plus QPACK extension RFC 9204). +/// HTTP/3 SETTINGS parameter identifiers (RFC 9114 §7.2.4 and the QPACK settings in RFC 9204). /// -internal static class Http3SettingsId +public static class Http3SettingsId { - /// Deprecated in HTTP/3 (was SETTINGS_HEADER_TABLE_SIZE in HTTP/2). MUST be 0 if present. + /// Deprecated in HTTP/3 (was SETTINGS_HEADER_TABLE_SIZE in HTTP/2). Must be 0 if present. public const ulong HeaderTableSize = 0x1; - /// Deprecated in HTTP/3 (was SETTINGS_ENABLE_PUSH in HTTP/2). MUST NOT be present. + /// Deprecated in HTTP/3 (was SETTINGS_ENABLE_PUSH in HTTP/2). Must not be present. public const ulong EnablePush = 0x2; - /// Deprecated in HTTP/3. MUST NOT be present. + /// Deprecated in HTTP/3. Must not be present. public const ulong MaxConcurrentStreams = 0x3; - /// Deprecated in HTTP/3. MUST NOT be present. + /// Deprecated in HTTP/3. Must not be present. public const ulong InitialWindowSize = 0x4; - /// Deprecated in HTTP/3. MUST NOT be present. + /// Deprecated in HTTP/3. Must not be present. public const ulong MaxFrameSize = 0x5; - /// - /// SETTINGS_MAX_FIELD_SECTION_SIZE: advisory limit on the maximum size of an uncompressed field section. - /// Mirrors HTTP/2 SETTINGS_MAX_HEADER_LIST_SIZE. - /// + /// SETTINGS_MAX_FIELD_SECTION_SIZE. Advisory limit on an uncompressed field section. public const ulong MaxFieldSectionSize = 0x6; - /// QPACK: maximum number of entries in the dynamic table. Default 0 (no dynamic table). - public const ulong QpackMaxTableCapacity = 0x1; // reuses 0x1 in QPACK namespace (draft-ietf-quic-qpack) + /// QPACK maximum dynamic-table capacity. Default 0 means no dynamic table. + public const ulong QpackMaxTableCapacity = 0x1; - /// QPACK: maximum number of blocked streams. Default 0. + /// QPACK maximum number of blocked streams. Default 0. public const ulong QpackBlockedStreams = 0x7; - /// RFC 9220 / RFC 8441: SETTINGS_ENABLE_CONNECT_PROTOCOL. + /// SETTINGS_ENABLE_CONNECT_PROTOCOL. public const ulong EnableConnectProtocol = 0x8; } -/// -/// A parsed SETTINGS frame body — a list of (id, value) pairs. -/// -internal sealed class Http3Settings +/// A parsed SETTINGS frame body: a list of identifier and value pairs. +public sealed class Http3Settings { - private readonly List<(ulong Id, ulong Value)> _parameters = new(); + private readonly List<(ulong Id, ulong Value)> parameters = new(); - /// - /// The raw (id, value) pairs as parsed from the wire. Unknown IDs must be ignored (RFC 9114 §7.2.4). - /// - public IReadOnlyList<(ulong Id, ulong Value)> Parameters => _parameters; + /// The raw pairs from the wire. Unknown identifiers are kept and ignored by the known-field setters. + public IReadOnlyList<(ulong Id, ulong Value)> Parameters => parameters; /// SETTINGS_MAX_FIELD_SECTION_SIZE (0x6). 0 means no limit was sent. public ulong MaxFieldSectionSize { get; private set; } - /// SETTINGS_QPACK_MAX_TABLE_CAPACITY (0x1). 0 means no dynamic table (default). + /// SETTINGS_QPACK_MAX_TABLE_CAPACITY (0x1). 0 means no dynamic table. public uint QpackMaxTableCapacity { get; private set; } - /// SETTINGS_QPACK_BLOCKED_STREAMS (0x7). 0 means no blocked streams (default). + /// SETTINGS_QPACK_BLOCKED_STREAMS (0x7). 0 means no blocked streams. public uint QpackBlockedStreams { get; private set; } /// SETTINGS_ENABLE_CONNECT_PROTOCOL (0x8). False when absent or zero. public bool EnableConnectProtocol { get; private set; } + /// Records one settings pair and updates the known field when the identifier matches. + /// The settings identifier. + /// The settings value. public void Add(ulong id, ulong value) { - _parameters.Add((id, value)); + parameters.Add((id, value)); if (id == Http3SettingsId.MaxFieldSectionSize) + { MaxFieldSectionSize = value; + } else if (id == Http3SettingsId.QpackMaxTableCapacity) + { QpackMaxTableCapacity = (uint)Math.Min(value, uint.MaxValue); + } else if (id == Http3SettingsId.QpackBlockedStreams) + { QpackBlockedStreams = (uint)Math.Min(value, uint.MaxValue); + } else if (id == Http3SettingsId.EnableConnectProtocol) + { EnableConnectProtocol = value == 1; + } } - /// Adds SETTINGS_QPACK_MAX_TABLE_CAPACITY to this settings object. + /// Adds SETTINGS_QPACK_MAX_TABLE_CAPACITY. + /// The dynamic-table capacity. public void SetQpackMaxTableCapacity(uint capacity) => Add(Http3SettingsId.QpackMaxTableCapacity, capacity); - /// Adds SETTINGS_QPACK_BLOCKED_STREAMS to this settings object. + /// Adds SETTINGS_QPACK_BLOCKED_STREAMS. + /// The blocked-stream limit. public void SetQpackBlockedStreams(uint count) => Add(Http3SettingsId.QpackBlockedStreams, count); - /// - /// Adds SETTINGS_MAX_FIELD_SECTION_SIZE. Advertise the same value the connection - /// enforces as the compressed HEADERS / trailers payload cap. - /// + /// Adds SETTINGS_MAX_FIELD_SECTION_SIZE. + /// The field-section limit. public void SetMaxFieldSectionSize(ulong size) => Add(Http3SettingsId.MaxFieldSectionSize, size); - /// Adds SETTINGS_ENABLE_CONNECT_PROTOCOL (0x08) when enabled. + /// Adds SETTINGS_ENABLE_CONNECT_PROTOCOL when is true. + /// Whether the CONNECT protocol is enabled. public void SetEnableConnectProtocol(bool enabled) { if (enabled) + { Add(Http3SettingsId.EnableConnectProtocol, 1); + } } - /// - /// Parses a SETTINGS frame payload. - /// + /// Parses a SETTINGS frame payload. A truncated pair stops the parse and is ignored. + /// The frame payload. + /// The parsed settings. public static Http3Settings Parse(ReadOnlySpan payload) { var settings = new Http3Settings(); var remaining = payload; while (!remaining.IsEmpty) { - if (!Http3VarInt.TryRead(remaining, out var id, out var idLen)) break; + if (!Http3VarInt.TryRead(remaining, out var id, out var idLen)) + { + break; + } + remaining = remaining[idLen..]; - if (!Http3VarInt.TryRead(remaining, out var value, out var valueLen)) break; + if (!Http3VarInt.TryRead(remaining, out var value, out var valueLen)) + { + break; + } + remaining = remaining[valueLen..]; settings.Add(id, value); } + return settings; } - /// - /// Serializes this settings object into a SETTINGS frame payload byte array. - /// + /// Serializes this object into a SETTINGS frame payload. + /// The payload bytes. public byte[] Serialize() { - // Each pair: up to 8 bytes for id + 8 bytes for value. - var buf = new byte[_parameters.Count * 16]; + var buf = new byte[parameters.Count * 16]; var offset = 0; - foreach (var (id, value) in _parameters) + foreach (var (id, value) in parameters) { offset += Http3VarInt.Write(buf.AsSpan(offset), id); offset += Http3VarInt.Write(buf.AsSpan(offset), value); } + return buf[..offset]; } } diff --git a/src/Titanium.Web.Proxy/Http3/Http3VarInt.cs b/src/Titanium.Http3/Http3VarInt.cs similarity index 94% rename from src/Titanium.Web.Proxy/Http3/Http3VarInt.cs rename to src/Titanium.Http3/Http3VarInt.cs index fabf6255c..fb72db1f2 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3VarInt.cs +++ b/src/Titanium.Http3/Http3VarInt.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Titanium.Web.Proxy.Http3; +namespace Titanium.Http3; /// /// QUIC / HTTP/3 variable-length integer encoder/decoder (RFC 9000 §16). @@ -14,12 +14,19 @@ namespace Titanium.Web.Proxy.Http3; /// 10 = 4 bytes (30-bit value), 11 = 8 bytes (62-bit value). /// /// -internal static class Http3VarInt +public static class Http3VarInt { - public const ulong Max1ByteValue = (1UL << 6) - 1; // 63 - public const ulong Max2ByteValue = (1UL << 14) - 1; // 16,383 - public const ulong Max4ByteValue = (1UL << 30) - 1; // 1,073,741,823 - public const ulong Max8ByteValue = (1UL << 62) - 1; // 4,611,686,018,427,387,903 + /// Largest value that fits in one byte. + public const ulong Max1ByteValue = (1UL << 6) - 1; + + /// Largest value that fits in two bytes. + public const ulong Max2ByteValue = (1UL << 14) - 1; + + /// Largest value that fits in four bytes. + public const ulong Max4ByteValue = (1UL << 30) - 1; + + /// Largest value that fits in eight bytes. + public const ulong Max8ByteValue = (1UL << 62) - 1; /// /// Returns the number of bytes required to encode . diff --git a/src/Titanium.Http3/HuffmanDecoder.cs b/src/Titanium.Http3/HuffmanDecoder.cs new file mode 100644 index 000000000..fc68f8770 --- /dev/null +++ b/src/Titanium.Http3/HuffmanDecoder.cs @@ -0,0 +1,194 @@ +/* + * Copyright 2014 Twitter, Inc + * This file is a derivative work modified by Ringo Leese + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.IO; + +namespace Titanium.Http3; + +/// HPACK and QPACK Huffman decoder (RFC 7541 Appendix B). +public sealed class HuffmanDecoder +{ + /// + /// Huffman Decoder + /// + public static readonly HuffmanDecoder Instance = new(); + + private readonly Node root; + + /// + /// Creates a new Huffman decoder with the specified Huffman coding. + /// + private HuffmanDecoder() + { + // the Huffman codes indexed by symbol + var codes = HuffmanTable.Codes; + + // the length of each Huffman code + var lengths = HuffmanTable.Lengths; + if (codes.Length != 257 || codes.Length != lengths.Length) + throw new ArgumentException("invalid Huffman coding"); + + root = BuildTree(codes, lengths); + } + + /// + /// Decompresses the given Huffman coded string literal. + /// + /// the string literal to be decoded + /// the output stream for the compressed data + /// + /// throws IOException if an I/O error occurs. In particular, an IOException may + /// be thrown if the output stream has been closed. + /// + public ReadOnlyMemory Decode(byte[] buf) + { + var resultBuf = new byte[buf.Length * 2]; + var resultSize = 0; + var node = root; + var current = 0; + var bits = 0; + for (var i = 0; i < buf.Length; i++) + { + int b = buf[i]; + current = (current << 8) | b; + bits += 8; + DecodeCompleteBytes(current, ref bits, ref node, resultBuf, ref resultSize); + } + + DecodeTrailingBits(current, ref bits, ref node, resultBuf, ref resultSize); + + var mask = (1 << bits) - 1; + if ((current & mask) != mask) throw new IOException("Invalid Padding"); + + return resultBuf.AsMemory(0, resultSize); + } + + private void DecodeCompleteBytes(int current, ref int bits, ref Node node, byte[] result, + ref int resultSize) + { + while (bits >= 8) + { + var c = (current >> (bits - 8)) & 0xFF; + node = GetChild(node, c); + bits -= node.Bits; + if (!node.IsTerminal) continue; + + if (node.Symbol == HuffmanTable.Eos) throw new IOException("EOS Decoded"); + + result[resultSize++] = (byte)node.Symbol; + node = root; + } + } + + private void DecodeTrailingBits(int current, ref int bits, ref Node node, byte[] result, + ref int resultSize) + { + while (bits > 0) + { + var c = (current << (8 - bits)) & 0xFF; + node = GetChild(node, c); + if (node.IsTerminal && node.Bits <= bits) + { + bits -= node.Bits; + result[resultSize++] = (byte)node.Symbol; + node = root; + } + else + { + break; + } + } + } + + private static Node GetChild(Node node, int index) + { + var children = node.Children ?? + throw new IOException("Invalid Huffman code: terminal node has trailing bits."); + return children[index] ?? throw new IOException("Invalid Huffman code."); + } + + private static Node BuildTree(int[] codes, byte[] lengths) + { + var root = new Node(); + for (var i = 0; i < codes.Length; i++) Insert(root, i, codes[i], lengths[i]); + + return root; + } + + private static void Insert(Node root, int symbol, int code, byte length) + { + // traverse tree using the most significant bytes of code + var current = root; + while (length > 8) + { + if (current.IsTerminal) throw new InvalidDataException("invalid Huffman code: prefix not unique"); + + length -= 8; + var i = (code >> length) & 0xFF; + var children = current.Children ?? + throw new InvalidDataException("invalid Huffman code: terminal node has trailing bits"); + children[i] ??= new Node(); + + current = children[i]!; + } + + var terminal = new Node(symbol, length); + var shift = 8 - length; + var start = (code << shift) & 0xFF; + var end = 1 << shift; + var currentChildren = current.Children ?? + throw new InvalidDataException("invalid Huffman code: prefix not unique"); + for (var i = start; i < start + end; i++) currentChildren[i] = terminal; + } + + private sealed class Node + { + /// + /// Initializes a new instance of the class. + /// + public Node() + { + Symbol = 0; + Bits = 8; + Children = new Node?[256]; + } + + /// + /// Initializes a new instance of the class. + /// + /// the symbol the node represents + /// the number of bits matched by this node + public Node(int symbol, int bits) + { + Symbol = symbol; + Bits = bits; + Children = null; + } + + // terminal nodes have a symbol + public int Symbol { get; } + + // number of bits matched by the node + public int Bits { get; } + + // internal nodes have children + public Node?[]? Children { get; } + + public bool IsTerminal => Children == null; + } +} \ No newline at end of file diff --git a/src/Titanium.Http3/HuffmanEncoder.cs b/src/Titanium.Http3/HuffmanEncoder.cs new file mode 100644 index 000000000..2a99bc877 --- /dev/null +++ b/src/Titanium.Http3/HuffmanEncoder.cs @@ -0,0 +1,100 @@ +/* + * Copyright 2014 Twitter, Inc + * This file is a derivative work modified by Ringo Leese + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.IO; + +namespace Titanium.Http3; + +/// HPACK and QPACK Huffman encoder (RFC 7541 Appendix B). +public sealed class HuffmanEncoder +{ + /// + /// Huffman Encoder + /// + public static readonly HuffmanEncoder Instance = new(); + + private HuffmanEncoder() + { + } + + /// + /// the Huffman codes indexed by symbol + /// + private readonly int[] codes = HuffmanTable.Codes; + + /// + /// the length of each Huffman code + /// + private readonly byte[] lengths = HuffmanTable.Lengths; + + /// + /// Compresses the input string literal using the Huffman coding. + /// + /// the output stream for the compressed data + /// the string literal to be Huffman encoded + /// + /// if an I/O error occurs. In particular, an IOException may be thrown if the + /// output stream has been closed. + /// + public void Encode(BinaryWriter output, ReadOnlySpan data) + { + ArgumentNullException.ThrowIfNull(output); + + if (data.Length == 0) return; + + var current = 0L; + var n = 0; + + for (var i = 0; i < data.Length; i++) + { + var b = data[i] & 0xFF; + var code = (uint)codes[b]; + int nbits = lengths[b]; + + current <<= nbits; + current |= code; + n += nbits; + + while (n >= 8) + { + n -= 8; + output.Write((byte)(current >> n)); + } + } + + if (n > 0) + { + current <<= 8 - n; + current |= (uint)(0xFF >> n); // this should be EOS symbol + output.Write((byte)current); + } + } + + /// + /// Returns the number of bytes required to Huffman encode the input string literal. + /// + /// the number of bytes required to Huffman encode data + /// the string literal to be Huffman encoded + public int GetEncodedLength(ReadOnlySpan data) + { + var len = 0L; + foreach (var b in data) len += lengths[b]; + + return (int)((len + 7) >> 3); + } +} \ No newline at end of file diff --git a/src/Titanium.Http3/HuffmanTable.cs b/src/Titanium.Http3/HuffmanTable.cs new file mode 100644 index 000000000..3946950e9 --- /dev/null +++ b/src/Titanium.Http3/HuffmanTable.cs @@ -0,0 +1,308 @@ +/* + * Copyright 2014 Twitter, Inc + * This file is a derivative work modified by Ringo Leese + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +namespace Titanium.Http3; + +/// HPACK and QPACK Huffman code table (RFC 7541 Appendix B). +internal static class HuffmanTable +{ + internal const int Eos = 256; + + // Appendix B: Huffman Codes + // http://tools.ietf.org/html/rfc7541#appendix-B + internal static readonly int[] Codes = + { + 0x1ff8, + 0x7fffd8, + 0xfffffe2, + 0xfffffe3, + 0xfffffe4, + 0xfffffe5, + 0xfffffe6, + 0xfffffe7, + 0xfffffe8, + 0xffffea, + 0x3ffffffc, + 0xfffffe9, + 0xfffffea, + 0x3ffffffd, + 0xfffffeb, + 0xfffffec, + 0xfffffed, + 0xfffffee, + 0xfffffef, + 0xffffff0, + 0xffffff1, + 0xffffff2, + 0x3ffffffe, + 0xffffff3, + 0xffffff4, + 0xffffff5, + 0xffffff6, + 0xffffff7, + 0xffffff8, + 0xffffff9, + 0xffffffa, + 0xffffffb, + 0x14, + 0x3f8, + 0x3f9, + 0xffa, + 0x1ff9, + 0x15, + 0xf8, + 0x7fa, + 0x3fa, + 0x3fb, + 0xf9, + 0x7fb, + 0xfa, + 0x16, + 0x17, + 0x18, + 0x0, + 0x1, + 0x2, + 0x19, + 0x1a, + 0x1b, + 0x1c, + 0x1d, + 0x1e, + 0x1f, + 0x5c, + 0xfb, + 0x7ffc, + 0x20, + 0xffb, + 0x3fc, + 0x1ffa, + 0x21, + 0x5d, + 0x5e, + 0x5f, + 0x60, + 0x61, + 0x62, + 0x63, + 0x64, + 0x65, + 0x66, + 0x67, + 0x68, + 0x69, + 0x6a, + 0x6b, + 0x6c, + 0x6d, + 0x6e, + 0x6f, + 0x70, + 0x71, + 0x72, + 0xfc, + 0x73, + 0xfd, + 0x1ffb, + 0x7fff0, + 0x1ffc, + 0x3ffc, + 0x22, + 0x7ffd, + 0x3, + 0x23, + 0x4, + 0x24, + 0x5, + 0x25, + 0x26, + 0x27, + 0x6, + 0x74, + 0x75, + 0x28, + 0x29, + 0x2a, + 0x7, + 0x2b, + 0x76, + 0x2c, + 0x8, + 0x9, + 0x2d, + 0x77, + 0x78, + 0x79, + 0x7a, + 0x7b, + 0x7ffe, + 0x7fc, + 0x3ffd, + 0x1ffd, + 0xffffffc, + 0xfffe6, + 0x3fffd2, + 0xfffe7, + 0xfffe8, + 0x3fffd3, + 0x3fffd4, + 0x3fffd5, + 0x7fffd9, + 0x3fffd6, + 0x7fffda, + 0x7fffdb, + 0x7fffdc, + 0x7fffdd, + 0x7fffde, + 0xffffeb, + 0x7fffdf, + 0xffffec, + 0xffffed, + 0x3fffd7, + 0x7fffe0, + 0xffffee, + 0x7fffe1, + 0x7fffe2, + 0x7fffe3, + 0x7fffe4, + 0x1fffdc, + 0x3fffd8, + 0x7fffe5, + 0x3fffd9, + 0x7fffe6, + 0x7fffe7, + 0xffffef, + 0x3fffda, + 0x1fffdd, + 0xfffe9, + 0x3fffdb, + 0x3fffdc, + 0x7fffe8, + 0x7fffe9, + 0x1fffde, + 0x7fffea, + 0x3fffdd, + 0x3fffde, + 0xfffff0, + 0x1fffdf, + 0x3fffdf, + 0x7fffeb, + 0x7fffec, + 0x1fffe0, + 0x1fffe1, + 0x3fffe0, + 0x1fffe2, + 0x7fffed, + 0x3fffe1, + 0x7fffee, + 0x7fffef, + 0xfffea, + 0x3fffe2, + 0x3fffe3, + 0x3fffe4, + 0x7ffff0, + 0x3fffe5, + 0x3fffe6, + 0x7ffff1, + 0x3ffffe0, + 0x3ffffe1, + 0xfffeb, + 0x7fff1, + 0x3fffe7, + 0x7ffff2, + 0x3fffe8, + 0x1ffffec, + 0x3ffffe2, + 0x3ffffe3, + 0x3ffffe4, + 0x7ffffde, + 0x7ffffdf, + 0x3ffffe5, + 0xfffff1, + 0x1ffffed, + 0x7fff2, + 0x1fffe3, + 0x3ffffe6, + 0x7ffffe0, + 0x7ffffe1, + 0x3ffffe7, + 0x7ffffe2, + 0xfffff2, + 0x1fffe4, + 0x1fffe5, + 0x3ffffe8, + 0x3ffffe9, + 0xffffffd, + 0x7ffffe3, + 0x7ffffe4, + 0x7ffffe5, + 0xfffec, + 0xfffff3, + 0xfffed, + 0x1fffe6, + 0x3fffe9, + 0x1fffe7, + 0x1fffe8, + 0x7ffff3, + 0x3fffea, + 0x3fffeb, + 0x1ffffee, + 0x1ffffef, + 0xfffff4, + 0xfffff5, + 0x3ffffea, + 0x7ffff4, + 0x3ffffeb, + 0x7ffffe6, + 0x3ffffec, + 0x3ffffed, + 0x7ffffe7, + 0x7ffffe8, + 0x7ffffe9, + 0x7ffffea, + 0x7ffffeb, + 0xffffffe, + 0x7ffffec, + 0x7ffffed, + 0x7ffffee, + 0x7ffffef, + 0x7fffff0, + 0x3ffffee, + 0x3fffffff // EOS + }; + + internal static readonly byte[] Lengths = + { + 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, + 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, + 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, + 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, + 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, + 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, + 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, + 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, + 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, + 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, + 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, + 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, + 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, + 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, + 30 // EOS + }; +} diff --git a/src/Titanium.Http3/LICENSE b/src/Titanium.Http3/LICENSE new file mode 100644 index 000000000..786bcaca4 --- /dev/null +++ b/src/Titanium.Http3/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/src/Titanium.Http3/PublicAPI.Shipped.txt b/src/Titanium.Http3/PublicAPI.Shipped.txt new file mode 100644 index 000000000..7dc5c5811 --- /dev/null +++ b/src/Titanium.Http3/PublicAPI.Shipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Titanium.Http3/PublicAPI.Unshipped.txt b/src/Titanium.Http3/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..470398f57 --- /dev/null +++ b/src/Titanium.Http3/PublicAPI.Unshipped.txt @@ -0,0 +1,109 @@ +#nullable enable +Titanium.Http3.Http3VarInt +const Titanium.Http3.Http3VarInt.Max1ByteValue = 63 -> ulong +const Titanium.Http3.Http3VarInt.Max2ByteValue = 16383 -> ulong +const Titanium.Http3.Http3VarInt.Max4ByteValue = 1073741823 -> ulong +const Titanium.Http3.Http3VarInt.Max8ByteValue = 4611686018427387903 -> ulong +static Titanium.Http3.Http3VarInt.GetByteCount(ulong value) -> int +static Titanium.Http3.Http3VarInt.ReadAsync(System.IO.Stream! stream, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +static Titanium.Http3.Http3VarInt.TryRead(System.ReadOnlySpan source, out ulong value, out int bytesConsumed) -> bool +static Titanium.Http3.Http3VarInt.Write(System.Span destination, ulong value) -> int +Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.ClosedCriticalStream = 260 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.ConnectError = 271 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.ExcessiveLoad = 263 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.FrameError = 262 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.FrameUnexpected = 261 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.GeneralProtocolError = 257 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.IdError = 264 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.InternalError = 258 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.MessageError = 270 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.MissingSettings = 266 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.NoError = 256 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.QpackDecoderStreamError = 514 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.QpackDecompressionFailed = 512 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.QpackEncoderStreamError = 513 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.RequestCancelled = 268 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.RequestIncomplete = 269 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.RequestRejected = 267 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.SettingsError = 265 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.StreamCreationError = 259 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3ErrorCode.VersionFallback = 272 -> Titanium.Http3.Http3ErrorCode +Titanium.Http3.Http3FrameType +const Titanium.Http3.Http3FrameType.CancelPush = 3 -> ulong +const Titanium.Http3.Http3FrameType.Data = 0 -> ulong +const Titanium.Http3.Http3FrameType.GoAway = 7 -> ulong +const Titanium.Http3.Http3FrameType.Headers = 1 -> ulong +const Titanium.Http3.Http3FrameType.MaxPushId = 13 -> ulong +const Titanium.Http3.Http3FrameType.PushPromise = 5 -> ulong +const Titanium.Http3.Http3FrameType.Settings = 4 -> ulong +Titanium.Http3.Http3StreamType +const Titanium.Http3.Http3StreamType.Control = 0 -> ulong +const Titanium.Http3.Http3StreamType.Push = 1 -> ulong +const Titanium.Http3.Http3StreamType.QpackDecoder = 3 -> ulong +const Titanium.Http3.Http3StreamType.QpackEncoder = 2 -> ulong +Titanium.Http3.CapsuleReader +Titanium.Http3.CapsuleReader.CapsuleReader(int maxCapsuleBytes = 2048, int maxDatagramBytes = 1500) -> void +const Titanium.Http3.CapsuleReader.DefaultMaxCapsuleBytes = 2048 -> int +const Titanium.Http3.CapsuleReader.DefaultMaxDatagramBytes = 1500 -> int +Titanium.Http3.CapsuleReader.Dropped.get -> int +Titanium.Http3.CapsuleReader.Feed(System.ReadOnlySpan data, Titanium.Http3.DatagramHandler! onDatagram) -> void +Titanium.Http3.CapsuleReader.OnUnknownCapsule.get -> System.Action>? +Titanium.Http3.CapsuleReader.OnUnknownCapsule.set -> void +static Titanium.Http3.CapsuleReader.WriteDatagram(System.Span destination, System.ReadOnlySpan payload) -> int +static Titanium.Http3.CapsuleReader.WriteVarint(System.Span destination, long value) -> int +Titanium.Http3.DatagramHandler +virtual Titanium.Http3.DatagramHandler.Invoke(System.ReadOnlySpan payload) -> void +Titanium.Http3.Http3Settings +Titanium.Http3.Http3Settings.Http3Settings() -> void +Titanium.Http3.Http3Settings.Add(ulong id, ulong value) -> void +Titanium.Http3.Http3Settings.EnableConnectProtocol.get -> bool +Titanium.Http3.Http3Settings.MaxFieldSectionSize.get -> ulong +Titanium.Http3.Http3Settings.Parameters.get -> System.Collections.Generic.IReadOnlyList<(ulong Id, ulong Value)>! +Titanium.Http3.Http3Settings.QpackBlockedStreams.get -> uint +Titanium.Http3.Http3Settings.QpackMaxTableCapacity.get -> uint +static Titanium.Http3.Http3Settings.Parse(System.ReadOnlySpan payload) -> Titanium.Http3.Http3Settings! +Titanium.Http3.Http3Settings.Serialize() -> byte[]! +Titanium.Http3.Http3Settings.SetEnableConnectProtocol(bool enabled) -> void +Titanium.Http3.Http3Settings.SetMaxFieldSectionSize(ulong size) -> void +Titanium.Http3.Http3Settings.SetQpackBlockedStreams(uint count) -> void +Titanium.Http3.Http3Settings.SetQpackMaxTableCapacity(uint capacity) -> void +Titanium.Http3.Http3SettingsId +const Titanium.Http3.Http3SettingsId.EnableConnectProtocol = 8 -> ulong +const Titanium.Http3.Http3SettingsId.EnablePush = 2 -> ulong +const Titanium.Http3.Http3SettingsId.HeaderTableSize = 1 -> ulong +const Titanium.Http3.Http3SettingsId.InitialWindowSize = 4 -> ulong +const Titanium.Http3.Http3SettingsId.MaxConcurrentStreams = 3 -> ulong +const Titanium.Http3.Http3SettingsId.MaxFieldSectionSize = 6 -> ulong +const Titanium.Http3.Http3SettingsId.MaxFrameSize = 5 -> ulong +const Titanium.Http3.Http3SettingsId.QpackBlockedStreams = 7 -> ulong +const Titanium.Http3.Http3SettingsId.QpackMaxTableCapacity = 1 -> ulong +Titanium.Http3.HuffmanDecoder +static readonly Titanium.Http3.HuffmanDecoder.Instance -> Titanium.Http3.HuffmanDecoder! +Titanium.Http3.HuffmanDecoder.Decode(byte[]! buf) -> System.ReadOnlyMemory +Titanium.Http3.HuffmanEncoder +static readonly Titanium.Http3.HuffmanEncoder.Instance -> Titanium.Http3.HuffmanEncoder! +Titanium.Http3.HuffmanEncoder.Encode(System.IO.BinaryWriter! output, System.ReadOnlySpan data) -> void +Titanium.Http3.HuffmanEncoder.GetEncodedLength(System.ReadOnlySpan data) -> int +Titanium.Http3.QpackDynamicTable +Titanium.Http3.QpackDynamicTable.Capacity.get -> uint +Titanium.Http3.QpackDynamicTable.Dispose() -> void +Titanium.Http3.QpackDynamicTable.Insert(string! name, string! value, System.Collections.Concurrent.ConcurrentDictionary? inFlightMinAbsoluteIndex = null) -> ulong +Titanium.Http3.QpackDynamicTable.InsertCount.get -> ulong +Titanium.Http3.QpackDynamicTable.QpackDynamicTable(uint capacity) -> void +Titanium.Http3.QpackDynamicTable.SetCapacity(uint newCapacity) -> void +Titanium.Http3.QpackDynamicTable.Size.get -> int +Titanium.Http3.QpackDynamicTable.TryFind(string! name, string! value, out ulong absoluteIndex, out bool exactMatch) -> bool +Titanium.Http3.QpackDynamicTable.TryGetByAbsoluteIndex(ulong absoluteIndex, out string! name, out string! value) -> bool +Titanium.Http3.QpackStaticTable +static readonly Titanium.Http3.QpackStaticTable.Entries -> (string! Name, string! Value)[]! +static Titanium.Http3.QpackStaticTable.FindExact(string! name, string! value) -> int +static Titanium.Http3.QpackStaticTable.FindName(string! name) -> int +Titanium.Http3.Http3FrameCodec +const Titanium.Http3.Http3FrameCodec.DefaultMaxPayloadBytes = 4194304 -> long +const Titanium.Http3.Http3FrameCodec.ProgressiveRentChunkBytes = 262144 -> int +const Titanium.Http3.Http3FrameCodec.RelayUnitBytes = 16384 -> int +static Titanium.Http3.Http3FrameCodec.PayloadLimitForFrameType(ulong frameType, long fieldSectionLimit, long dataFrameLimit) -> long +static Titanium.Http3.Http3FrameCodec.StreamsPastFrameCap(ulong frameType, long length, long frameCap, bool captureWholeFrame) -> bool +static Titanium.Http3.Http3FrameCodec.Write(System.Span destination, ulong frameType, System.ReadOnlySpan payload) -> int +static Titanium.Http3.Http3FrameCodec.WriteHeader(System.Span destination, ulong frameType, ulong payloadLength) -> int diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackContext.cs b/src/Titanium.Http3/QpackContext.cs similarity index 92% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackContext.cs rename to src/Titanium.Http3/QpackContext.cs index 9a62c98d8..ab8c355a6 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackContext.cs +++ b/src/Titanium.Http3/QpackContext.cs @@ -4,7 +4,7 @@ using System.Threading.Channels; using System.Threading.Tasks; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// Per-connection QPACK state, holding two independent dynamic tables (one inbound, one outbound) @@ -75,6 +75,18 @@ internal sealed class QpackContext : IAsyncDisposable /// internal bool OutboundTableDisabled { get; private set; } + /// SETTINGS_QPACK_BLOCKED_STREAMS from the peer. Zero until a SETTINGS frame arrives. + internal uint BlockedStreamsFromPeer { get; set; } + + /// True after a Set Dynamic Table Capacity instruction has been written. + internal bool OutboundCapacitySent { get; set; } + + /// + /// Header blocks that reference an insert the peer has not acknowledged. + /// Touched only while is held. + /// + internal int ReferencingStreams { get; set; } + // Used by AwaitInsertCountAsync to be notified when the InboundDecoderTable's insert count grows. private readonly SemaphoreSlim _insertNotifier = new(0); diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoder.cs b/src/Titanium.Http3/QpackDecoder.cs similarity index 98% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoder.cs rename to src/Titanium.Http3/QpackDecoder.cs index 6ba6d8400..dcbd5b3a4 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoder.cs +++ b/src/Titanium.Http3/QpackDecoder.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// QPACK decoder (RFC 9204). Supports both static-table-only mode and dynamic-table mode. @@ -64,7 +64,7 @@ internal static class QpackDecoder } /// - /// Async-shaped wrapper over . Decoding never yields (blocked streams + /// Async-shaped wrapper over . Decoding never yields (blocked streams /// are rejected); prefer the synchronous overload on the request hot path. /// public static ValueTask> DecodeAsync( @@ -339,7 +339,7 @@ private static bool TryReadStringLiteral(ReadOnlySpan data, out string res private static string HuffmanDecode(ReadOnlySpan data) { // QPACK uses the same Huffman table as HPACK (RFC 7541 Appendix B, referenced by RFC 9204). - var decoded = Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.Instance.Decode(data.ToArray()); + var decoded = Titanium.Http3.HuffmanDecoder.Instance.Decode(data.ToArray()); return Encoding.Latin1.GetString(decoded.Span); } } diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoderStreamWriter.cs b/src/Titanium.Http3/QpackDecoderStreamWriter.cs similarity index 96% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoderStreamWriter.cs rename to src/Titanium.Http3/QpackDecoderStreamWriter.cs index e0ef98ff4..faa181fb6 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDecoderStreamWriter.cs +++ b/src/Titanium.Http3/QpackDecoderStreamWriter.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// Drains and writes the pending Section Acknowledgment diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDynamicTable.cs b/src/Titanium.Http3/QpackDynamicTable.cs similarity index 86% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackDynamicTable.cs rename to src/Titanium.Http3/QpackDynamicTable.cs index 99aca9ca9..3d2b32576 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackDynamicTable.cs +++ b/src/Titanium.Http3/QpackDynamicTable.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Threading; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// RFC 9204 QPACK dynamic table. @@ -11,7 +11,7 @@ namespace Titanium.Web.Proxy.Http3.Qpack; /// in-flight eviction protection is straightforward. Thread-safe via : /// reads (decode path) are far more common than writes (insert/evict). /// -internal sealed class QpackDynamicTable : IDisposable +public sealed class QpackDynamicTable : IDisposable { // QPACK overhead per entry: 32 bytes (RFC 9204 §3.2.1, same as HPACK §4.1). private const int EntryOverhead = 32; @@ -23,15 +23,17 @@ internal sealed class QpackDynamicTable : IDisposable private ulong _baseAbsoluteIndex; /// Total number of entries ever inserted (never decremented on eviction). - internal ulong InsertCount { get; private set; } + public ulong InsertCount { get; private set; } /// Maximum total byte capacity of the table. - internal uint Capacity { get; private set; } + public uint Capacity { get; private set; } /// Current used bytes (name.Length + value.Length + 32 per entry). - internal int Size { get; private set; } + public int Size { get; private set; } - internal QpackDynamicTable(uint capacity) + /// Creates a table with the given byte capacity. + /// Maximum total byte capacity, including the 32-byte overhead per entry. + public QpackDynamicTable(uint capacity) { Capacity = capacity; } @@ -40,7 +42,7 @@ internal QpackDynamicTable(uint capacity) /// Inserts a new entry into the table, evicting oldest entries to make room (unless protected /// by ). Returns the absolute index of the new entry. /// - internal ulong Insert(string name, string value, // NOSONAR S3776 -- This protocol/state-machine path shares mutable parsing or transport state; splitting it further would create disproportionate regression risk. + public ulong Insert(string name, string value, // NOSONAR S3776 -- This protocol/state-machine path shares mutable parsing or transport state; splitting it further would create disproportionate regression risk. ConcurrentDictionary? inFlightMinAbsoluteIndex = null) { var entrySize = name.Length + value.Length + EntryOverhead; @@ -93,7 +95,7 @@ internal QpackDynamicTable(uint capacity) } /// Looks up an entry by absolute index. Returns false if evicted or out of range. - internal bool TryGetByAbsoluteIndex(ulong absoluteIndex, out string name, out string value) + public bool TryGetByAbsoluteIndex(ulong absoluteIndex, out string name, out string value) { _lock.EnterReadLock(); try @@ -127,7 +129,7 @@ internal bool TryGetByAbsoluteIndex(ulong absoluteIndex, out string name, out st /// ). Returns true when found; sets when /// both name and value match. /// - internal bool TryFind(string name, string value, + public bool TryFind(string name, string value, out ulong absoluteIndex, out bool exactMatch) { _lock.EnterReadLock(); @@ -164,7 +166,7 @@ internal bool TryFind(string name, string value, } /// Sets a new table capacity, evicting oldest entries until the size constraint is met. - internal void SetCapacity(uint newCapacity) + public void SetCapacity(uint newCapacity) { _lock.EnterWriteLock(); try @@ -184,5 +186,6 @@ internal void SetCapacity(uint newCapacity) } } + /// Releases the table lock. public void Dispose() => _lock.Dispose(); } diff --git a/src/Titanium.Http3/QpackEncoder.cs b/src/Titanium.Http3/QpackEncoder.cs new file mode 100644 index 000000000..2911abea3 --- /dev/null +++ b/src/Titanium.Http3/QpackEncoder.cs @@ -0,0 +1,382 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Titanium.Http3; + +/// +/// QPACK encoder (RFC 9204). Supports both static-table-only mode and dynamic-table mode. +/// When is provided and not disabled, the encoder will attempt to +/// reference dynamic-table entries for repeated headers; otherwise all blocks use static-table +/// references or literals. The 2-byte prefix (Required Insert Count + Base) is computed per +/// RFC 9204 §4.5.1 and emitted at the front of every HEADERS block. +/// +internal static class QpackEncoder +{ + [ThreadStatic] + private static MemoryStream? reusableBuffer; + + /// + /// Encodes a list of header fields into a QPACK header block using static-table-only mode. + /// Equivalent to calling + /// with a null context. + /// + public static byte[] Encode(IEnumerable<(string Name, string Value)> headers) => + Encode(headers, context: null); + + /// + /// Encodes a list of header fields into a QPACK header block. + /// When is non-null and the outbound table is not disabled, the + /// encoder will reference dynamic-table entries. The Required Insert Count prefix is encoded per + /// RFC 9204 §4.5.1.1. + /// + public static byte[] Encode(IEnumerable<(string Name, string Value)> headers, QpackContext? context) // NOSONAR S3776 -- This protocol/state-machine path shares mutable parsing or transport state; splitting it further would create disproportionate regression risk. + { + var body = reusableBuffer ??= new MemoryStream(); + body.SetLength(0); + var outboundTable = context != null && !context.OutboundTableDisabled && context.MaxTableCapacityFromPeer > 0 + ? context.OutboundEncoderTable + : null; + + ulong maxRequiredInsertCount = 0; + + foreach (var (name, value) in headers) + EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, value); + + return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); + } + + /// Reuses the thread-local block buffer. The caller fills it and passes it to . + internal static MemoryStream RentBuffer() + { + var body = reusableBuffer ??= new MemoryStream(); + body.SetLength(0); + return body; + } + + /// The outbound dynamic table when the peer advertised a capacity and the table is enabled. + internal static QpackDynamicTable? SelectOutboundTable(QpackContext? context) => + context != null && !context.OutboundTableDisabled && context.MaxTableCapacityFromPeer > 0 + ? context.OutboundEncoderTable + : null; + + /// + /// Incremental QPACK response builder for the H3→H1 one-pass header parse. + /// Thread-local rent (like HeaderBuilder): TLS slot is empty while rented, so awaits + /// on the same thread allocate a fresh builder rather than sharing the active one. + /// + internal sealed class ResponseBlockBuilder : IDisposable + { + [ThreadStatic] + private static ResponseBlockBuilder? cached; + + private readonly MemoryStream body = new(128); + private QpackDynamicTable? outboundTable; + private QpackContext? context; + private ulong maxRequiredInsertCount; + private bool returned; + + private ResponseBlockBuilder() + { + } + + internal static ResponseBlockBuilder Rent(int statusCode, QpackContext? context) + { + var builder = cached; + if (builder != null) + { + cached = null; + builder.Reset(statusCode, context); + return builder; + } + + builder = new ResponseBlockBuilder(); + builder.Reset(statusCode, context); + return builder; + } + + private void Reset(int statusCode, QpackContext? ctx) + { + returned = false; + context = ctx; + outboundTable = ctx != null && !ctx.OutboundTableDisabled && ctx.MaxTableCapacityFromPeer > 0 + ? ctx.OutboundEncoderTable + : null; + maxRequiredInsertCount = 0; + body.SetLength(0); + EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":status", + StatusCodeToString(statusCode)); + } + + internal void AddHeader(string lowerName, string value) => + EncodeOne(body, outboundTable, ref maxRequiredInsertCount, lowerName, value); + + /// Encode a header value from the H1 window without Latin-1 string round-trip. + internal void AddHeader(string lowerName, ReadOnlySpan value) => + EncodeOne(body, outboundTable, ref maxRequiredInsertCount, lowerName, value); + + internal byte[] Finish() + { + ObjectDisposedException.ThrowIf(returned, nameof(ResponseBlockBuilder)); + return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); + } + + public void Dispose() => Return(this); + + internal static void Return(ResponseBlockBuilder builder) + { + if (builder.returned) + return; + builder.returned = true; + builder.outboundTable = null; + builder.context = null; + builder.maxRequiredInsertCount = 0; + builder.body.SetLength(0); + if (cached == null) + cached = builder; + } + } + + internal static ResponseBlockBuilder RentResponseBlockBuilder(int statusCode, QpackContext? context) => + ResponseBlockBuilder.Rent(statusCode, context); + + /// + /// Appends one literal header to an existing static-table QPACK block (append-only MITM patch). + /// Caller must ensure used no dynamic-table inserts (RIC prefix 0x00 0x00). + /// + internal static byte[] AppendLiteralHeader(byte[] block, string lowerName, string value) + { + if (block.Length < 2) + throw new ArgumentException("QPACK block too short.", nameof(block)); + + var body = reusableBuffer ??= new MemoryStream(); + body.SetLength(0); + body.Write(block, 2, block.Length - 2); + + var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); + if (nameOnlyStaticIndex >= 0) + WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); + else + WriteLiteralNewName(body, lowerName, value); + + return FinishBlock(body, 0, null, null); + } + + internal static string StatusCodeToString(int statusCode) => statusCode switch + { + 200 => "200", + 204 => "204", + 301 => "301", + 302 => "302", + 304 => "304", + 400 => "400", + 404 => "404", + 500 => "500", + 502 => "502", + 503 => "503", + _ => statusCode.ToString(System.Globalization.CultureInfo.InvariantCulture) + }; + + internal static void EncodeOne(MemoryStream body, QpackDynamicTable? outboundTable, + ref ulong maxRequiredInsertCount, string lowerName, string value) + { + var exact = QpackStaticTable.FindExact(lowerName, value); + if (exact >= 0) + { + WriteIndexed(body, (ulong)exact); + return; + } + + var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); + + if (outboundTable != null && outboundTable.TryFind(lowerName, value, out ulong dynAbsIdx, out bool dynExact)) + { + if (dynExact) + { + WriteDynamicIndexed(body, dynAbsIdx); + maxRequiredInsertCount = Math.Max(maxRequiredInsertCount, dynAbsIdx + 1); + } + else + { + WriteLiteralWithDynamicNameRef(body, dynAbsIdx, value); + maxRequiredInsertCount = Math.Max(maxRequiredInsertCount, dynAbsIdx + 1); + } + + return; + } + + if (nameOnlyStaticIndex >= 0) + { + WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); + return; + } + + WriteLiteralNewName(body, lowerName, value); + } + + /// + /// Span value path: name-only static / literal encode (skips FindExact string alloc). + /// Fine for reverse tiny-GET where values are almost never static-exact hits. + /// + internal static void EncodeOne(MemoryStream body, QpackDynamicTable? outboundTable, + ref ulong maxRequiredInsertCount, string lowerName, ReadOnlySpan value) + { + _ = outboundTable; + _ = maxRequiredInsertCount; + var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); + if (nameOnlyStaticIndex >= 0) + { + WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); + return; + } + + WriteLiteralNewName(body, lowerName, value); + } + + internal static byte[] FinishBlock(MemoryStream body, ulong maxRequiredInsertCount, + QpackDynamicTable? outboundTable, QpackContext? context) + { + byte ricByte, sByte; + if (maxRequiredInsertCount == 0 || outboundTable == null) + { + ricByte = 0x00; + sByte = 0x00; + } + else + { + // Encode RIC on the wire. Pair with S=1, DeltaBase = RIC−1 so Base = 0. + // WriteDynamicIndexed / WriteLiteralWithDynamicNameRef emit post-base instructions + // whose wire index is the absolute dynamic-table index; with Base=0 those resolve + // as abs = Base + wireIndex = absoluteIndex (RFC 9204 §4.5.3 / §4.5.5). + var encodedRic = EncodeRequiredInsertCount(maxRequiredInsertCount, context!.MaxTableCapacityFromPeer); + ricByte = (byte)(encodedRic & 0xFF); + var deltaBase = maxRequiredInsertCount - 1; + sByte = (byte)(0x80 | (deltaBase & 0x7F)); + } + + var result = new byte[2 + body.Length]; + result[0] = ricByte; + result[1] = sByte; + body.GetBuffer().AsSpan(0, (int)body.Length).CopyTo(result.AsSpan(2)); + return result; + } + + /// + /// Encodes the Required Insert Count per RFC 9204 §4.5.1.1. + /// Encoded = (count % (2 * MaxEntries)) + 1, where MaxEntries = floor(MaxTableCapacity / 32). + /// + /// Set Dynamic Table Capacity instruction, pattern 01. + internal static byte[] SetCapacityInstruction(uint capacity) + { + var body = new MemoryStream(8); + WritePrefixedInt(body, 0x40, 6, capacity); + return body.ToArray(); + } + + /// Insert With Literal Name instruction, pattern 001 and no Huffman coding. + internal static byte[] InsertLiteralInstruction(string name, string value) + { + var body = new MemoryStream(name.Length + value.Length + 8); + body.WriteByte(0x20); + WriteStringLiteral(body, name); + WriteStringLiteral(body, value); + return body.ToArray(); + } + + internal static ulong EncodeRequiredInsertCount(ulong requiredInsertCount, uint maxTableCapacity) + { + var maxEntries = (ulong)(maxTableCapacity / 32); + if (maxEntries == 0) maxEntries = 1; + return (requiredInsertCount % (2 * maxEntries)) + 1; + } + + // Indexed Header Field (static): 1 1 S=1 Index(6) — pattern 0xC0 + private static void WriteIndexed(MemoryStream buf, ulong index) + { + WritePrefixedInt(buf, 0xC0, 6, index); + } + + // Indexed Header Field (dynamic, post-base): 0 0 0 1 Index(4) — pattern 0x10 + private static void WriteDynamicIndexed(MemoryStream buf, ulong absoluteIndex) + { + WritePrefixedInt(buf, 0x10, 4, absoluteIndex); + } + + // Literal Header Field With Name Reference (static): 0 1 N=0 S=1 Index(4) — pattern 0x50 + private static void WriteLiteralWithStaticNameRef(MemoryStream buf, ulong nameIndex, string value) + { + WritePrefixedInt(buf, 0x50, 4, nameIndex); + WriteStringLiteral(buf, value); + } + + private static void WriteLiteralWithStaticNameRef(MemoryStream buf, ulong nameIndex, ReadOnlySpan value) + { + WritePrefixedInt(buf, 0x50, 4, nameIndex); + WriteStringLiteral(buf, value); + } + + // Literal Header Field With Name Reference (dynamic, post-base): 0 0 0 0 N=0 Index(3) — pattern 0x00 + private static void WriteLiteralWithDynamicNameRef(MemoryStream buf, ulong absoluteIndex, string value) + { + WritePrefixedInt(buf, 0x00, 3, absoluteIndex); + WriteStringLiteral(buf, value); + } + + // Literal Field Line With Literal Name (RFC 9204 §4.5.6): + // 0 0 1 N H NameLen(3+) | Name | H ValueLen(7+) | Value + // Name length occupies the 3-bit prefix of the first byte — it is NOT a separate string literal. + private static void WriteLiteralNewName(MemoryStream buf, string name, string value) + { + var nameBytes = Encoding.Latin1.GetBytes(name); + // pattern 0x20 => 001 N=0 H=0, then 3-bit-prefixed name length + WritePrefixedInt(buf, 0x20, 3, (ulong)nameBytes.Length); + buf.Write(nameBytes, 0, nameBytes.Length); + WriteStringLiteral(buf, value); + } + + private static void WriteLiteralNewName(MemoryStream buf, string name, ReadOnlySpan value) + { + var nameBytes = Encoding.Latin1.GetBytes(name); + WritePrefixedInt(buf, 0x20, 3, (ulong)nameBytes.Length); + buf.Write(nameBytes, 0, nameBytes.Length); + WriteStringLiteral(buf, value); + } + + /// Writes an RFC 7541 §5.1 prefixed integer into the stream. + private static void WritePrefixedInt(MemoryStream buf, byte patternByte, int prefixBits, ulong value) + { + var mask = (uint)((1 << prefixBits) - 1); + if (value < mask) + { + buf.WriteByte((byte)(patternByte | (byte)value)); + return; + } + + buf.WriteByte((byte)(patternByte | (byte)mask)); + value -= mask; + while (value >= 0x80) + { + buf.WriteByte((byte)((value & 0x7F) | 0x80)); + value >>= 7; + } + buf.WriteByte((byte)value); + } + + /// + /// Writes an RFC 7541 §5.2 string literal (length-prefixed, no Huffman encoding). + /// We always emit raw bytes (H=0) to keep the implementation simple. + /// + private static void WriteStringLiteral(MemoryStream buf, string s) + { + var bytes = Encoding.Latin1.GetBytes(s); + WritePrefixedInt(buf, 0x00, 7, (ulong)bytes.Length); + buf.Write(bytes, 0, bytes.Length); + } + + private static void WriteStringLiteral(MemoryStream buf, ReadOnlySpan bytes) + { + WritePrefixedInt(buf, 0x00, 7, (ulong)bytes.Length); + buf.Write(bytes); + } +} diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoderStreamReader.cs b/src/Titanium.Http3/QpackEncoderStreamReader.cs similarity index 98% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoderStreamReader.cs rename to src/Titanium.Http3/QpackEncoderStreamReader.cs index d52b939e2..5f69b3b29 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoderStreamReader.cs +++ b/src/Titanium.Http3/QpackEncoderStreamReader.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// Reads RFC 9204 §3.2 QPACK encoder stream instructions from the peer's unidirectional encoder @@ -183,7 +183,7 @@ private static bool TryReadStringLiteral(ReadOnlySpan data, out string res consumed = total; var strData = data.Slice(headerLen, (int)length); result = huffman - ? Encoding.Latin1.GetString(Titanium.Web.Proxy.Http2.Hpack.HuffmanDecoder.Instance.Decode(strData.ToArray()).Span) + ? Encoding.Latin1.GetString(Titanium.Http3.HuffmanDecoder.Instance.Decode(strData.ToArray()).Span) : Encoding.Latin1.GetString(strData); return true; } diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackStaticTable.cs b/src/Titanium.Http3/QpackStaticTable.cs similarity index 97% rename from src/Titanium.Web.Proxy/Http3/Qpack/QpackStaticTable.cs rename to src/Titanium.Http3/QpackStaticTable.cs index eb454b192..d21b021b4 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackStaticTable.cs +++ b/src/Titanium.Http3/QpackStaticTable.cs @@ -1,18 +1,19 @@ using System; using System.Collections.Generic; -namespace Titanium.Web.Proxy.Http3.Qpack; +namespace Titanium.Http3; /// /// QPACK static table (RFC 9204 Appendix A). 99 entries, indexed 0–98. /// -internal static class QpackStaticTable +public static class QpackStaticTable { private const string Method = ":method"; private const string Status = ":status"; private const string CacheControl = "cache-control"; private const string ContentType = "content-type"; + /// The 99 static-table entries, indexed 0 through 98. public static readonly (string Name, string Value)[] Entries = { /* 00 */ (":authority", ""), diff --git a/src/Titanium.Http3/README.md b/src/Titanium.Http3/README.md new file mode 100644 index 000000000..f47cd9e5d --- /dev/null +++ b/src/Titanium.Http3/README.md @@ -0,0 +1,15 @@ +# Titanium.Http3 + +HTTP/3 framing for .NET. This package holds the pieces that do not know about a proxy or a socket: variable-length integers, frame types, stream types, error codes, the frame layout, the capsule reader, SETTINGS, Huffman coding, and the QPACK tables, encoder, and decoder. + +```csharp +Span buffer = stackalloc byte[8]; +int written = Http3VarInt.Write(buffer, 1500); +Http3VarInt.TryRead(buffer[..written], out ulong value, out int consumed); +``` + +## Limits + +The codec does not open a socket and does not perform a handshake. The proxy still reads frames and writes them to a stream, including the platform QUIC finish bit. + +This package is experimental. It is not a FIPS-validated module. diff --git a/src/Titanium.Http3/StrongNameKey.snk b/src/Titanium.Http3/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/src/Titanium.Http3/StrongNameKey.snk differ diff --git a/src/Titanium.Http3/Titanium.Http3.csproj b/src/Titanium.Http3/Titanium.Http3.csproj new file mode 100644 index 000000000..41f060e20 --- /dev/null +++ b/src/Titanium.Http3/Titanium.Http3.csproj @@ -0,0 +1,26 @@ + + + + Titanium.Http3 + HTTP/3 framing for .NET. The codec does not open sockets. + Titanium.Http3 + http3;qpack;managed + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Titanium.Inspector/Localization/strings.ar.json b/src/Titanium.Inspector/Localization/strings.ar.json index e98015033..bf12b18fa 100644 --- a/src/Titanium.Inspector/Localization/strings.ar.json +++ b/src/Titanium.Inspector/Localization/strings.ar.json @@ -367,6 +367,10 @@ "network.newConnections": "تسري التغييرات على الاتصالات الجديدة.", "network.protocols": "البروتوكولات", "network.reuse": "إعادة استخدام اتصالات الخادم", + "network.tlsStack": "مكدس TLS", + "network.stackManaged": "TLS/QUIC المدار بواسطة Titanium (بدء أسرع، غير معتمد وفق FIPS)", + "network.stackPlatform": "TLS/QUIC الخاص بالمنصة (تشفير نظام التشغيل؛ FIPS 140 عندما يعمل النظام في وضع FIPS)", + "network.stackForced": "مكدس المنصة مطلوب: {0}", "network.summaryBoth": "يمكن للمتصفحات استخدام HTTP/2. يمكن للخوادم استخدام HTTP/2 أو HTTP/3.", "network.summaryH1": "ستستخدم المتصفحات والخوادم HTTP/1.1.", "network.summaryH2": "يمكن للمتصفحات والخوادم استخدام HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.cs.json b/src/Titanium.Inspector/Localization/strings.cs.json index b9f75a776..256158f4d 100644 --- a/src/Titanium.Inspector/Localization/strings.cs.json +++ b/src/Titanium.Inspector/Localization/strings.cs.json @@ -367,6 +367,10 @@ "network.newConnections": "Změny platí pro nová spojení.", "network.protocols": "Protokoly", "network.reuse": "Znovu použít spojení se serverem", + "network.tlsStack": "Zásobník TLS", + "network.stackManaged": "Titanium spravované TLS/QUIC (rychlejší start, není ověřeno FIPS)", + "network.stackPlatform": "Platformní TLS/QUIC (šifrování systému; FIPS 140, když systém běží v režimu FIPS)", + "network.stackForced": "Je vyžadován platformní zásobník: {0}", "network.summaryBoth": "Prohlížeče mohou používat HTTP/2. Servery mohou používat HTTP/2 nebo HTTP/3.", "network.summaryH1": "Prohlížeče a servery použijí HTTP/1.1.", "network.summaryH2": "Prohlížeče a servery mohou používat HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.da.json b/src/Titanium.Inspector/Localization/strings.da.json index 43029f48c..67a6f4a9d 100644 --- a/src/Titanium.Inspector/Localization/strings.da.json +++ b/src/Titanium.Inspector/Localization/strings.da.json @@ -367,6 +367,10 @@ "network.newConnections": "Ændringer gælder nye forbindelser.", "network.protocols": "Protokoller", "network.reuse": "Genbrug serverforbindelser", + "network.tlsStack": "TLS-stak", + "network.stackManaged": "Titanium-administreret TLS/QUIC (hurtigere start, ikke FIPS-valideret)", + "network.stackPlatform": "Platform-TLS/QUIC (operativsystemets krypto; FIPS 140 når systemet kører i FIPS-tilstand)", + "network.stackForced": "Platformstakken er påkrævet: {0}", "network.summaryBoth": "Browsere kan bruge HTTP/2. Servere kan bruge HTTP/2 eller HTTP/3.", "network.summaryH1": "Browsere og servere bruger HTTP/1.1.", "network.summaryH2": "Browsere og servere kan bruge HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.de.json b/src/Titanium.Inspector/Localization/strings.de.json index 8b11e0883..1681976e5 100644 --- a/src/Titanium.Inspector/Localization/strings.de.json +++ b/src/Titanium.Inspector/Localization/strings.de.json @@ -367,6 +367,10 @@ "network.newConnections": "Änderungen gelten für neue Verbindungen.", "network.protocols": "Protokolle", "network.reuse": "Serververbindungen wiederverwenden", + "network.tlsStack": "TLS-Stapel", + "network.stackManaged": "Von Titanium verwaltetes TLS/QUIC (schnellerer Start, nicht FIPS-validiert)", + "network.stackPlatform": "Plattform-TLS/QUIC (Betriebssystem-Kryptografie; FIPS 140, wenn das Betriebssystem im FIPS-Modus läuft)", + "network.stackForced": "Der Plattform-Stapel ist erforderlich: {0}", "network.summaryBoth": "Browser können HTTP/2 nutzen. Server können HTTP/2 oder HTTP/3 nutzen.", "network.summaryH1": "Browser und Server nutzen HTTP/1.1.", "network.summaryH2": "Browser und Server können HTTP/2 nutzen.", diff --git a/src/Titanium.Inspector/Localization/strings.el.json b/src/Titanium.Inspector/Localization/strings.el.json index 57210ecee..d67408b2b 100644 --- a/src/Titanium.Inspector/Localization/strings.el.json +++ b/src/Titanium.Inspector/Localization/strings.el.json @@ -367,6 +367,10 @@ "network.newConnections": "Οι αλλαγές ισχύουν για νέες συνδέσεις.", "network.protocols": "Πρωτόκολλα", "network.reuse": "Επαναχρησιμοποίηση συνδέσεων διακομιστή", + "network.tlsStack": "Στοίβα TLS", + "network.stackManaged": "TLS/QUIC που διαχειρίζεται το Titanium (ταχύτερη εκκίνηση, χωρίς επικύρωση FIPS)", + "network.stackPlatform": "TLS/QUIC πλατφόρμας (κρυπτογράφηση λειτουργικού συστήματος· FIPS 140 όταν το σύστημα είναι σε λειτουργία FIPS)", + "network.stackForced": "Απαιτείται η στοίβα της πλατφόρμας: {0}", "network.summaryBoth": "Τα προγράμματα μπορούν να χρησιμοποιούν HTTP/2. Οι διακομιστές μπορούν να χρησιμοποιούν HTTP/2 ή HTTP/3.", "network.summaryH1": "Τα προγράμματα και οι διακομιστές θα χρησιμοποιούν HTTP/1.1.", "network.summaryH2": "Τα προγράμματα και οι διακομιστές μπορούν να χρησιμοποιούν HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.en.json b/src/Titanium.Inspector/Localization/strings.en.json index e8d79c592..15e404a8f 100644 --- a/src/Titanium.Inspector/Localization/strings.en.json +++ b/src/Titanium.Inspector/Localization/strings.en.json @@ -380,6 +380,10 @@ "network.newConnections": "Changes apply to new connections.", "network.protocols": "Protocols", "network.reuse": "Reuse server connections", + "network.tlsStack": "TLS stack", + "network.stackManaged": "Titanium managed TLS/QUIC (faster startup, not FIPS-validated)", + "network.stackPlatform": "Platform TLS/QUIC (OS crypto; FIPS 140 validated when the OS runs in FIPS mode)", + "network.stackForced": "The platform stack is required: {0}", "network.summaryBoth": "Browsers can use HTTP/2. Servers can use HTTP/2 or HTTP/3.", "network.summaryH1": "Browsers and servers will use HTTP/1.1.", "network.summaryH2": "Browsers and servers can use HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.es.json b/src/Titanium.Inspector/Localization/strings.es.json index 0633594ae..42b7847c9 100644 --- a/src/Titanium.Inspector/Localization/strings.es.json +++ b/src/Titanium.Inspector/Localization/strings.es.json @@ -367,6 +367,10 @@ "network.newConnections": "Los cambios se aplican a conexiones nuevas.", "network.protocols": "Protocolos", "network.reuse": "Reutilizar conexiones al servidor", + "network.tlsStack": "Pila TLS", + "network.stackManaged": "TLS/QUIC administrado por Titanium (arranque más rápido, no validado por FIPS)", + "network.stackPlatform": "TLS/QUIC de la plataforma (cifrado del sistema; FIPS 140 cuando el sistema está en modo FIPS)", + "network.stackForced": "Se requiere la pila de la plataforma: {0}", "network.summaryBoth": "Los navegadores pueden usar HTTP/2. Los servidores pueden usar HTTP/2 o HTTP/3.", "network.summaryH1": "Navegadores y servidores usarán HTTP/1.1.", "network.summaryH2": "Navegadores y servidores pueden usar HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.fa.json b/src/Titanium.Inspector/Localization/strings.fa.json index 4324e2ab3..00376c23e 100644 --- a/src/Titanium.Inspector/Localization/strings.fa.json +++ b/src/Titanium.Inspector/Localization/strings.fa.json @@ -367,6 +367,10 @@ "network.newConnections": "تغییرها برای اتصال‌های تازه اعمال می‌شوند.", "network.protocols": "پروتکل‌ها", "network.reuse": "استفاده دوباره از اتصال سرور", + "network.tlsStack": "پشته TLS", + "network.stackManaged": "TLS/QUIC مدیریت‌شده توسط Titanium (راه‌اندازی سریع‌تر، بدون اعتبارسنجی FIPS)", + "network.stackPlatform": "TLS/QUIC سکوی سامانه (رمزنگاری سیستم‌عامل؛ FIPS 140 وقتی سیستم در حالت FIPS است)", + "network.stackForced": "پشته سکو الزامی است: {0}", "network.summaryBoth": "مرورگرها می‌توانند از HTTP/2 استفاده کنند. سرورها می‌توانند از HTTP/2 یا HTTP/3 استفاده کنند.", "network.summaryH1": "مرورگرها و سرورها از HTTP/1.1 استفاده می‌کنند.", "network.summaryH2": "مرورگرها و سرورها می‌توانند از HTTP/2 استفاده کنند.", diff --git a/src/Titanium.Inspector/Localization/strings.fi.json b/src/Titanium.Inspector/Localization/strings.fi.json index dd8cac15a..de9264fa7 100644 --- a/src/Titanium.Inspector/Localization/strings.fi.json +++ b/src/Titanium.Inspector/Localization/strings.fi.json @@ -367,6 +367,10 @@ "network.newConnections": "Muutokset koskevat uusia yhteyksiä.", "network.protocols": "Protokollat", "network.reuse": "Käytä palvelinyhteyksiä uudelleen", + "network.tlsStack": "TLS-pino", + "network.stackManaged": "Titaniumin hallinnoima TLS/QUIC (nopeampi käynnistys, ei FIPS-validoitu)", + "network.stackPlatform": "Alustan TLS/QUIC (käyttöjärjestelmän salaus; FIPS 140, kun käyttöjärjestelmä on FIPS-tilassa)", + "network.stackForced": "Alustan pino on pakollinen: {0}", "network.summaryBoth": "Selaimet voivat käyttää HTTP/2:ta. Palvelimet voivat käyttää HTTP/2:ta tai HTTP/3:a.", "network.summaryH1": "Selaimet ja palvelimet käyttävät HTTP/1.1:tä.", "network.summaryH2": "Selaimet ja palvelimet voivat käyttää HTTP/2:ta.", diff --git a/src/Titanium.Inspector/Localization/strings.fr.json b/src/Titanium.Inspector/Localization/strings.fr.json index ec8f89fce..861b4bdfc 100644 --- a/src/Titanium.Inspector/Localization/strings.fr.json +++ b/src/Titanium.Inspector/Localization/strings.fr.json @@ -367,6 +367,10 @@ "network.newConnections": "Les changements valent pour les nouvelles connexions.", "network.protocols": "Protocoles", "network.reuse": "Réutiliser les connexions serveur", + "network.tlsStack": "Pile TLS", + "network.stackManaged": "TLS/QUIC géré par Titanium (démarrage plus rapide, non validé FIPS)", + "network.stackPlatform": "TLS/QUIC de la plateforme (chiffrement du système ; FIPS 140 lorsque le système est en mode FIPS)", + "network.stackForced": "La pile de la plateforme est obligatoire : {0}", "network.summaryBoth": "Les navigateurs peuvent utiliser HTTP/2. Les serveurs peuvent utiliser HTTP/2 ou HTTP/3.", "network.summaryH1": "Navigateurs et serveurs utiliseront HTTP/1.1.", "network.summaryH2": "Navigateurs et serveurs peuvent utiliser HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.he.json b/src/Titanium.Inspector/Localization/strings.he.json index 1defc2bac..b7d690c90 100644 --- a/src/Titanium.Inspector/Localization/strings.he.json +++ b/src/Titanium.Inspector/Localization/strings.he.json @@ -367,6 +367,10 @@ "network.newConnections": "השינויים חלים על חיבורים חדשים.", "network.protocols": "פרוטוקולים", "network.reuse": "שימוש חוזר בחיבורי שרת", + "network.tlsStack": "מחסנית TLS", + "network.stackManaged": "TLS/QUIC בניהול Titanium (הפעלה מהירה יותר, ללא אימות FIPS)", + "network.stackPlatform": "TLS/QUIC של הפלטפורמה (הצפנת מערכת ההפעלה; FIPS 140 כאשר המערכת במצב FIPS)", + "network.stackForced": "נדרשת מחסנית הפלטפורמה: {0}", "network.summaryBoth": "דפדפנים יכולים להשתמש ב-HTTP/2. שרתים יכולים להשתמש ב-HTTP/2 או HTTP/3.", "network.summaryH1": "דפדפנים ושרתים ישתמשו ב-HTTP/1.1.", "network.summaryH2": "דפדפנים ושרתים יכולים להשתמש ב-HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.hi.json b/src/Titanium.Inspector/Localization/strings.hi.json index d459e32d7..70fb979d4 100644 --- a/src/Titanium.Inspector/Localization/strings.hi.json +++ b/src/Titanium.Inspector/Localization/strings.hi.json @@ -367,6 +367,10 @@ "network.newConnections": "बदलाव नए कनेक्शन पर लागू होते हैं।", "network.protocols": "प्रोटोकॉल", "network.reuse": "सर्वर कनेक्शन फिर से इस्तेमाल करें", + "network.tlsStack": "TLS स्टैक", + "network.stackManaged": "Titanium द्वारा प्रबंधित TLS/QUIC (तेज़ आरंभ, FIPS-सत्यापित नहीं)", + "network.stackPlatform": "प्लेटफ़ॉर्म TLS/QUIC (ऑपरेटिंग सिस्टम का क्रिप्टो; FIPS 140 जब सिस्टम FIPS मोड में हो)", + "network.stackForced": "प्लेटफ़ॉर्म स्टैक आवश्यक है: {0}", "network.summaryBoth": "ब्राउज़र HTTP/2 इस्तेमाल कर सकते हैं। सर्वर HTTP/2 या HTTP/3 इस्तेमाल कर सकते हैं।", "network.summaryH1": "ब्राउज़र और सर्वर HTTP/1.1 इस्तेमाल करेंगे।", "network.summaryH2": "ब्राउज़र और सर्वर HTTP/2 इस्तेमाल कर सकते हैं।", diff --git a/src/Titanium.Inspector/Localization/strings.hu.json b/src/Titanium.Inspector/Localization/strings.hu.json index ea1a1bbfa..2535f7004 100644 --- a/src/Titanium.Inspector/Localization/strings.hu.json +++ b/src/Titanium.Inspector/Localization/strings.hu.json @@ -367,6 +367,10 @@ "network.newConnections": "A változások az új kapcsolatokra vonatkoznak.", "network.protocols": "Protokollok", "network.reuse": "Kiszolgálókapcsolatok újrahasználata", + "network.tlsStack": "TLS-verem", + "network.stackManaged": "A Titanium által kezelt TLS/QUIC (gyorsabb indulás, nem FIPS-ellenőrzött)", + "network.stackPlatform": "Platform TLS/QUIC (az operációs rendszer kriptográfiája; FIPS 140, ha a rendszer FIPS módban fut)", + "network.stackForced": "A platformverem kötelező: {0}", "network.summaryBoth": "A böngészők használhatják a HTTP/2-t. A kiszolgálók használhatják a HTTP/2-t vagy a HTTP/3-at.", "network.summaryH1": "A böngészők és a kiszolgálók HTTP/1.1-et használnak.", "network.summaryH2": "A böngészők és a kiszolgálók használhatják a HTTP/2-t.", diff --git a/src/Titanium.Inspector/Localization/strings.id.json b/src/Titanium.Inspector/Localization/strings.id.json index e0d5651c7..677ca3624 100644 --- a/src/Titanium.Inspector/Localization/strings.id.json +++ b/src/Titanium.Inspector/Localization/strings.id.json @@ -367,6 +367,10 @@ "network.newConnections": "Perubahan berlaku untuk koneksi baru.", "network.protocols": "Protokol", "network.reuse": "Pakai ulang koneksi server", + "network.tlsStack": "Tumpukan TLS", + "network.stackManaged": "TLS/QUIC yang dikelola Titanium (mulai lebih cepat, tidak divalidasi FIPS)", + "network.stackPlatform": "TLS/QUIC platform (kripto sistem operasi; FIPS 140 saat sistem berjalan dalam mode FIPS)", + "network.stackForced": "Tumpukan platform wajib dipakai: {0}", "network.summaryBoth": "Peramban dapat memakai HTTP/2. Server dapat memakai HTTP/2 atau HTTP/3.", "network.summaryH1": "Peramban dan server akan memakai HTTP/1.1.", "network.summaryH2": "Peramban dan server dapat memakai HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.it.json b/src/Titanium.Inspector/Localization/strings.it.json index 9fc44e5ef..ac314301c 100644 --- a/src/Titanium.Inspector/Localization/strings.it.json +++ b/src/Titanium.Inspector/Localization/strings.it.json @@ -367,6 +367,10 @@ "network.newConnections": "Le modifiche valgono per le nuove connessioni.", "network.protocols": "Protocolli", "network.reuse": "Riusa le connessioni al server", + "network.tlsStack": "Stack TLS", + "network.stackManaged": "TLS/QUIC gestito da Titanium (avvio più rapido, non convalidato FIPS)", + "network.stackPlatform": "TLS/QUIC della piattaforma (cifratura del sistema; FIPS 140 quando il sistema è in modalità FIPS)", + "network.stackForced": "Lo stack della piattaforma è obbligatorio: {0}", "network.summaryBoth": "I browser possono usare HTTP/2. I server possono usare HTTP/2 o HTTP/3.", "network.summaryH1": "Browser e server useranno HTTP/1.1.", "network.summaryH2": "Browser e server possono usare HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.ja.json b/src/Titanium.Inspector/Localization/strings.ja.json index 5b1147056..a914d0303 100644 --- a/src/Titanium.Inspector/Localization/strings.ja.json +++ b/src/Titanium.Inspector/Localization/strings.ja.json @@ -367,6 +367,10 @@ "network.newConnections": "変更は新しい接続に適用されます。", "network.protocols": "プロトコル", "network.reuse": "サーバー接続を再利用", + "network.tlsStack": "TLS スタック", + "network.stackManaged": "Titanium が管理する TLS/QUIC(起動が速い、FIPS 検証なし)", + "network.stackPlatform": "プラットフォームの TLS/QUIC(OS の暗号。OS が FIPS モードのとき FIPS 140)", + "network.stackForced": "プラットフォームのスタックが必要です: {0}", "network.summaryBoth": "ブラウザーは HTTP/2 を使えます。サーバーは HTTP/2 または HTTP/3 を使えます。", "network.summaryH1": "ブラウザーとサーバーは HTTP/1.1 を使います。", "network.summaryH2": "ブラウザーとサーバーは HTTP/2 を使えます。", diff --git a/src/Titanium.Inspector/Localization/strings.ko.json b/src/Titanium.Inspector/Localization/strings.ko.json index 0ede6334b..ef7bd410e 100644 --- a/src/Titanium.Inspector/Localization/strings.ko.json +++ b/src/Titanium.Inspector/Localization/strings.ko.json @@ -367,6 +367,10 @@ "network.newConnections": "변경은 새 연결에 적용됩니다.", "network.protocols": "프로토콜", "network.reuse": "서버 연결 재사용", + "network.tlsStack": "TLS 스택", + "network.stackManaged": "Titanium이 관리하는 TLS/QUIC(더 빠른 시작, FIPS 검증 아님)", + "network.stackPlatform": "플랫폼 TLS/QUIC(운영 체제 암호. 운영 체제가 FIPS 모드일 때 FIPS 140)", + "network.stackForced": "플랫폼 스택이 필요합니다: {0}", "network.summaryBoth": "브라우저는 HTTP/2를 사용할 수 있습니다. 서버는 HTTP/2 또는 HTTP/3를 사용할 수 있습니다.", "network.summaryH1": "브라우저와 서버는 HTTP/1.1을 사용합니다.", "network.summaryH2": "브라우저와 서버는 HTTP/2를 사용할 수 있습니다.", diff --git a/src/Titanium.Inspector/Localization/strings.nb.json b/src/Titanium.Inspector/Localization/strings.nb.json index 35991a4bf..be102466f 100644 --- a/src/Titanium.Inspector/Localization/strings.nb.json +++ b/src/Titanium.Inspector/Localization/strings.nb.json @@ -367,6 +367,10 @@ "network.newConnections": "Endringer gjelder nye tilkoblinger.", "network.protocols": "Protokoller", "network.reuse": "Gjenbruk servertilkoblinger", + "network.tlsStack": "TLS-stakk", + "network.stackManaged": "Titanium-styrt TLS/QUIC (raskere oppstart, ikke FIPS-validert)", + "network.stackPlatform": "Plattform-TLS/QUIC (operativsystemets krypto; FIPS 140 når systemet kjører i FIPS-modus)", + "network.stackForced": "Plattformstakken er påkrevd: {0}", "network.summaryBoth": "Nettlesere kan bruke HTTP/2. Servere kan bruke HTTP/2 eller HTTP/3.", "network.summaryH1": "Nettlesere og servere bruker HTTP/1.1.", "network.summaryH2": "Nettlesere og servere kan bruke HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.nl.json b/src/Titanium.Inspector/Localization/strings.nl.json index f790ee030..e921af9a0 100644 --- a/src/Titanium.Inspector/Localization/strings.nl.json +++ b/src/Titanium.Inspector/Localization/strings.nl.json @@ -367,6 +367,10 @@ "network.newConnections": "Wijzigingen gelden voor nieuwe verbindingen.", "network.protocols": "Protocollen", "network.reuse": "Serververbindingen hergebruiken", + "network.tlsStack": "TLS-stack", + "network.stackManaged": "Door Titanium beheerde TLS/QUIC (snellere start, niet FIPS-gevalideerd)", + "network.stackPlatform": "Platform-TLS/QUIC (besturingssysteemcryptografie; FIPS 140 wanneer het systeem in FIPS-modus staat)", + "network.stackForced": "De platformstack is verplicht: {0}", "network.summaryBoth": "Browsers kunnen HTTP/2 gebruiken. Servers kunnen HTTP/2 of HTTP/3 gebruiken.", "network.summaryH1": "Browsers en servers gebruiken HTTP/1.1.", "network.summaryH2": "Browsers en servers kunnen HTTP/2 gebruiken.", diff --git a/src/Titanium.Inspector/Localization/strings.pl.json b/src/Titanium.Inspector/Localization/strings.pl.json index 6ccb8b016..526b2519e 100644 --- a/src/Titanium.Inspector/Localization/strings.pl.json +++ b/src/Titanium.Inspector/Localization/strings.pl.json @@ -367,6 +367,10 @@ "network.newConnections": "Zmiany dotyczą nowych połączeń.", "network.protocols": "Protokoły", "network.reuse": "Używaj ponownie połączeń z serwerem", + "network.tlsStack": "Stos TLS", + "network.stackManaged": "Zarządzane przez Titanium TLS/QUIC (szybszy start, bez walidacji FIPS)", + "network.stackPlatform": "TLS/QUIC platformy (kryptografia systemu; FIPS 140, gdy system działa w trybie FIPS)", + "network.stackForced": "Stos platformy jest wymagany: {0}", "network.summaryBoth": "Przeglądarki mogą używać HTTP/2. Serwery mogą używać HTTP/2 lub HTTP/3.", "network.summaryH1": "Przeglądarki i serwery użyją HTTP/1.1.", "network.summaryH2": "Przeglądarki i serwery mogą używać HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.pt-BR.json b/src/Titanium.Inspector/Localization/strings.pt-BR.json index 61b9eedaf..3aa0fe93d 100644 --- a/src/Titanium.Inspector/Localization/strings.pt-BR.json +++ b/src/Titanium.Inspector/Localization/strings.pt-BR.json @@ -367,6 +367,10 @@ "network.newConnections": "As mudanças valem para conexões novas.", "network.protocols": "Protocolos", "network.reuse": "Reutilizar conexões com o servidor", + "network.tlsStack": "Pilha TLS", + "network.stackManaged": "TLS/QUIC gerenciado pelo Titanium (inicialização mais rápida, sem validação FIPS)", + "network.stackPlatform": "TLS/QUIC da plataforma (criptografia do sistema; FIPS 140 quando o sistema está no modo FIPS)", + "network.stackForced": "A pilha da plataforma é obrigatória: {0}", "network.summaryBoth": "Navegadores podem usar HTTP/2. Servidores podem usar HTTP/2 ou HTTP/3.", "network.summaryH1": "Navegadores e servidores usarão HTTP/1.1.", "network.summaryH2": "Navegadores e servidores podem usar HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.pt-PT.json b/src/Titanium.Inspector/Localization/strings.pt-PT.json index 72792a4b3..fe470e266 100644 --- a/src/Titanium.Inspector/Localization/strings.pt-PT.json +++ b/src/Titanium.Inspector/Localization/strings.pt-PT.json @@ -367,6 +367,10 @@ "network.newConnections": "As alterações aplicam-se a ligações novas.", "network.protocols": "Protocolos", "network.reuse": "Reutilizar ligações ao servidor", + "network.tlsStack": "Pilha TLS", + "network.stackManaged": "TLS/QUIC gerido pelo Titanium (arranque mais rápido, sem validação FIPS)", + "network.stackPlatform": "TLS/QUIC da plataforma (criptografia do sistema; FIPS 140 quando o sistema está no modo FIPS)", + "network.stackForced": "A pilha da plataforma é obrigatória: {0}", "network.summaryBoth": "Os navegadores podem usar HTTP/2. Os servidores podem usar HTTP/2 ou HTTP/3.", "network.summaryH1": "Navegadores e servidores usarão HTTP/1.1.", "network.summaryH2": "Navegadores e servidores podem usar HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.ru.json b/src/Titanium.Inspector/Localization/strings.ru.json index dc418e908..59fd79a5b 100644 --- a/src/Titanium.Inspector/Localization/strings.ru.json +++ b/src/Titanium.Inspector/Localization/strings.ru.json @@ -367,6 +367,10 @@ "network.newConnections": "Изменения действуют для новых соединений.", "network.protocols": "Протоколы", "network.reuse": "Повторно использовать соединения с сервером", + "network.tlsStack": "Стек TLS", + "network.stackManaged": "Управляемые Titanium TLS/QUIC (быстрее запуск, не проверено по FIPS)", + "network.stackPlatform": "Платформенные TLS/QUIC (криптография ОС; FIPS 140, когда ОС в режиме FIPS)", + "network.stackForced": "Требуется платформенный стек: {0}", "network.summaryBoth": "Браузеры могут использовать HTTP/2. Серверы могут использовать HTTP/2 или HTTP/3.", "network.summaryH1": "Браузеры и серверы будут использовать HTTP/1.1.", "network.summaryH2": "Браузеры и серверы могут использовать HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.sv.json b/src/Titanium.Inspector/Localization/strings.sv.json index 4a777e238..7fe300928 100644 --- a/src/Titanium.Inspector/Localization/strings.sv.json +++ b/src/Titanium.Inspector/Localization/strings.sv.json @@ -367,6 +367,10 @@ "network.newConnections": "Ändringar gäller nya anslutningar.", "network.protocols": "Protokoll", "network.reuse": "Återanvänd serveranslutningar", + "network.tlsStack": "TLS-stack", + "network.stackManaged": "Titanium-hanterad TLS/QUIC (snabbare start, inte FIPS-validerad)", + "network.stackPlatform": "Plattforms-TLS/QUIC (operativsystemets krypto; FIPS 140 när systemet körs i FIPS-läge)", + "network.stackForced": "Plattformsstacken krävs: {0}", "network.summaryBoth": "Webbläsare kan använda HTTP/2. Servrar kan använda HTTP/2 eller HTTP/3.", "network.summaryH1": "Webbläsare och servrar använder HTTP/1.1.", "network.summaryH2": "Webbläsare och servrar kan använda HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.th.json b/src/Titanium.Inspector/Localization/strings.th.json index b9b1e7b6b..0a459143d 100644 --- a/src/Titanium.Inspector/Localization/strings.th.json +++ b/src/Titanium.Inspector/Localization/strings.th.json @@ -367,6 +367,10 @@ "network.newConnections": "การเปลี่ยนแปลงมีผลกับการเชื่อมต่อใหม่", "network.protocols": "โพรโทคอล", "network.reuse": "ใช้การเชื่อมต่อเซิร์ฟเวอร์ซ้ำ", + "network.tlsStack": "สแตก TLS", + "network.stackManaged": "TLS/QUIC ที่ Titanium จัดการ (เริ่มเร็วขึ้น ไม่ได้ผ่านการตรวจสอบ FIPS)", + "network.stackPlatform": "TLS/QUIC ของแพลตฟอร์ม (การเข้ารหัสของระบบปฏิบัติการ; FIPS 140 เมื่อระบบอยู่ในโหมด FIPS)", + "network.stackForced": "ต้องใช้สแตกของแพลตฟอร์ม: {0}", "network.summaryBoth": "เบราว์เซอร์สามารถใช้ HTTP/2 เซิร์ฟเวอร์สามารถใช้ HTTP/2 หรือ HTTP/3", "network.summaryH1": "เบราว์เซอร์และเซิร์ฟเวอร์จะใช้ HTTP/1.1", "network.summaryH2": "เบราว์เซอร์และเซิร์ฟเวอร์สามารถใช้ HTTP/2", diff --git a/src/Titanium.Inspector/Localization/strings.tr.json b/src/Titanium.Inspector/Localization/strings.tr.json index 9bc72b70b..fac195b68 100644 --- a/src/Titanium.Inspector/Localization/strings.tr.json +++ b/src/Titanium.Inspector/Localization/strings.tr.json @@ -367,6 +367,10 @@ "network.newConnections": "Değişiklikler yeni bağlantılara uygulanır.", "network.protocols": "Protokoller", "network.reuse": "Sunucu bağlantılarını yeniden kullan", + "network.tlsStack": "TLS yığını", + "network.stackManaged": "Titanium tarafından yönetilen TLS/QUIC (daha hızlı başlatma, FIPS doğrulamalı değil)", + "network.stackPlatform": "Platform TLS/QUIC (işletim sistemi şifrelemesi; işletim sistemi FIPS modundayken FIPS 140)", + "network.stackForced": "Platform yığını zorunludur: {0}", "network.summaryBoth": "Tarayıcılar HTTP/2 kullanabilir. Sunucular HTTP/2 veya HTTP/3 kullanabilir.", "network.summaryH1": "Tarayıcılar ve sunucular HTTP/1.1 kullanır.", "network.summaryH2": "Tarayıcılar ve sunucular HTTP/2 kullanabilir.", diff --git a/src/Titanium.Inspector/Localization/strings.uk.json b/src/Titanium.Inspector/Localization/strings.uk.json index 4fa74519c..e5b20ef38 100644 --- a/src/Titanium.Inspector/Localization/strings.uk.json +++ b/src/Titanium.Inspector/Localization/strings.uk.json @@ -367,6 +367,10 @@ "network.newConnections": "Зміни діють для нових з’єднань.", "network.protocols": "Протоколи", "network.reuse": "Повторно використовувати з’єднання із сервером", + "network.tlsStack": "Стек TLS", + "network.stackManaged": "Керовані Titanium TLS/QUIC (швидший запуск, не перевірено за FIPS)", + "network.stackPlatform": "Платформні TLS/QUIC (криптографія ОС; FIPS 140, коли ОС у режимі FIPS)", + "network.stackForced": "Потрібен платформний стек: {0}", "network.summaryBoth": "Браузери можуть використовувати HTTP/2. Сервери можуть використовувати HTTP/2 або HTTP/3.", "network.summaryH1": "Браузери і сервери використовуватимуть HTTP/1.1.", "network.summaryH2": "Браузери і сервери можуть використовувати HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.vi.json b/src/Titanium.Inspector/Localization/strings.vi.json index 991bf3f20..b31daaa0c 100644 --- a/src/Titanium.Inspector/Localization/strings.vi.json +++ b/src/Titanium.Inspector/Localization/strings.vi.json @@ -367,6 +367,10 @@ "network.newConnections": "Thay đổi áp dụng cho kết nối mới.", "network.protocols": "Giao thức", "network.reuse": "Dùng lại kết nối máy chủ", + "network.tlsStack": "Ngăn xếp TLS", + "network.stackManaged": "TLS/QUIC do Titanium quản lý (khởi động nhanh hơn, chưa được xác thực FIPS)", + "network.stackPlatform": "TLS/QUIC của nền tảng (mật mã hệ điều hành; FIPS 140 khi hệ điều hành ở chế độ FIPS)", + "network.stackForced": "Bắt buộc dùng ngăn xếp của nền tảng: {0}", "network.summaryBoth": "Trình duyệt có thể dùng HTTP/2. Máy chủ có thể dùng HTTP/2 hoặc HTTP/3.", "network.summaryH1": "Trình duyệt và máy chủ sẽ dùng HTTP/1.1.", "network.summaryH2": "Trình duyệt và máy chủ có thể dùng HTTP/2.", diff --git a/src/Titanium.Inspector/Localization/strings.zh-Hans.json b/src/Titanium.Inspector/Localization/strings.zh-Hans.json index d78e201c1..088f92066 100644 --- a/src/Titanium.Inspector/Localization/strings.zh-Hans.json +++ b/src/Titanium.Inspector/Localization/strings.zh-Hans.json @@ -367,6 +367,10 @@ "network.newConnections": "更改适用于新连接。", "network.protocols": "协议", "network.reuse": "复用服务器连接", + "network.tlsStack": "TLS 堆栈", + "network.stackManaged": "由 Titanium 管理的 TLS/QUIC(启动更快,未经 FIPS 验证)", + "network.stackPlatform": "平台 TLS/QUIC(操作系统加密;操作系统处于 FIPS 模式时为 FIPS 140)", + "network.stackForced": "必须使用平台堆栈:{0}", "network.summaryBoth": "浏览器可以使用 HTTP/2。服务器可以使用 HTTP/2 或 HTTP/3。", "network.summaryH1": "浏览器和服务器将使用 HTTP/1.1。", "network.summaryH2": "浏览器和服务器可以使用 HTTP/2。", diff --git a/src/Titanium.Inspector/Localization/strings.zh-Hant.json b/src/Titanium.Inspector/Localization/strings.zh-Hant.json index b2a0cbe2d..e75517c65 100644 --- a/src/Titanium.Inspector/Localization/strings.zh-Hant.json +++ b/src/Titanium.Inspector/Localization/strings.zh-Hant.json @@ -367,6 +367,10 @@ "network.newConnections": "變更套用到新連線。", "network.protocols": "通訊協定", "network.reuse": "重複使用伺服器連線", + "network.tlsStack": "TLS 堆疊", + "network.stackManaged": "由 Titanium 管理的 TLS/QUIC(啟動較快,未經 FIPS 驗證)", + "network.stackPlatform": "平台 TLS/QUIC(作業系統加密;作業系統處於 FIPS 模式時為 FIPS 140)", + "network.stackForced": "必須使用平台堆疊:{0}", "network.summaryBoth": "瀏覽器可以使用 HTTP/2。伺服器可以使用 HTTP/2 或 HTTP/3。", "network.summaryH1": "瀏覽器和伺服器將使用 HTTP/1.1。", "network.summaryH2": "瀏覽器和伺服器可以使用 HTTP/2。", diff --git a/src/Titanium.Inspector/Services/InspectorNetworkSettings.cs b/src/Titanium.Inspector/Services/InspectorNetworkSettings.cs index a12dbacc0..b45f935db 100644 --- a/src/Titanium.Inspector/Services/InspectorNetworkSettings.cs +++ b/src/Titanium.Inspector/Services/InspectorNetworkSettings.cs @@ -23,6 +23,7 @@ public static void ApplyTo(InterceptionService interception, InspectorSettings s interception.UpstreamProxyAddress = FormatUpstreamUri(settings); interception.PreferHttp2 = settings.EnableHttp2; interception.PreferHttp3 = settings.EnableHttp3; + interception.PreferManagedStack = settings.UseManagedStack; interception.OutboundTlsProtocols = MapOutboundTls(settings.OutboundTlsPreset); interception.ReuseServerConnections = settings.ReuseServerConnections; interception.WinAuthHosts = settings.WinAuthHosts; diff --git a/src/Titanium.Inspector/Services/InterceptionService.cs b/src/Titanium.Inspector/Services/InterceptionService.cs index 511a8b69f..b3c77adcd 100644 --- a/src/Titanium.Inspector/Services/InterceptionService.cs +++ b/src/Titanium.Inspector/Services/InterceptionService.cs @@ -12,6 +12,7 @@ using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Models; +using Titanium.Tls; using Titanium.Web.Proxy.Network; namespace Titanium.Inspector.Services; @@ -229,6 +230,15 @@ public bool IsRootCertificateExpiringSoon /// HTTP/3 toward servers for new connections. Applied by . public bool PreferHttp3 { get; set; } = true; + /// Managed TLS and QUIC for the next start. Off unless the setting says otherwise. + public bool PreferManagedStack { get; set; } + + /// FIPS detector. Tests replace it and restore . + internal static Func FipsEnabled { get; set; } = FipsEnvironment.IsEnabled; + + /// Why the platform stack was kept. Null when the managed stack was applied or not requested. + public string? ManagedStackReason { get; private set; } + /// Outbound TLS mask. keeps the engine default. public System.Security.Authentication.SslProtocols OutboundTlsProtocols { get; set; } @@ -372,6 +382,7 @@ public async Task StartAsync(IPAddress address, int port, CancellationToken canc // Explicit trust flags: do not silently install into the user store on start. // Callers must InstallRootCertificate (or set AutoTrustRootOnStart) so UI can report success/failure. _proxy = new ProxyServer(userTrustRootCertificate: false, machineTrustRootCertificate: false); + ApplyManagedStack(); ApplyLoggingOptions(_loggingSettings); _proxy.EnableHttpInterception = true; _proxy.EnableRequestTimingCapture = true; @@ -480,6 +491,45 @@ public void ApplyHttpProtocols() _proxy.SupportedServerSslProtocols = OutboundTlsProtocols; } + /// + /// Apply the managed stacks before . A running proxy is left alone. + /// + public void ApplyManagedStack() + { + ManagedStackReason = null; + if (_proxy is null || _proxy.ProxyRunning) + { + return; + } + + if (string.Equals(Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK"), "0", StringComparison.Ordinal)) + { + ManagedStackReason = "TITANIUM_MANAGED_STACK=0"; + return; + } + + if (FipsEnabled()) + { + ManagedStackReason = "FIPS"; + return; + } + + if (!PreferManagedStack) + { + return; + } + + try + { + _proxy.UseManagedTlsStack = true; + _proxy.UseManagedQuicStack = true; + } + catch (NotSupportedException ex) + { + ManagedStackReason = ex.Message; + } + } + /// Apply or refresh logging from Inspector settings (safe while running). public void ConfigureLogging(InspectorSettings settings) { diff --git a/src/Titanium.Inspector/Services/SettingsService.cs b/src/Titanium.Inspector/Services/SettingsService.cs index 6b9f578e3..34f5b9852 100644 --- a/src/Titanium.Inspector/Services/SettingsService.cs +++ b/src/Titanium.Inspector/Services/SettingsService.cs @@ -216,6 +216,12 @@ public sealed class InspectorSettings /// Offer HTTP/3 from Inspector to servers when this computer supports QUIC. public bool EnableHttp3 { get; set; } = true; + /// + /// Use the managed TLS and QUIC stacks. Off by default, so Inspector stays on the platform stacks. + /// FIPS mode and TITANIUM_MANAGED_STACK=0 force the platform stacks even when this is true. + /// + public bool UseManagedStack { get; set; } + /// Default, Tls12, or Legacy. Outbound to servers only. public string OutboundTlsPreset { get; set; } = InspectorNetworkSettings.TlsDefault; diff --git a/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml b/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml index 012647e7d..4672eae16 100644 --- a/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml +++ b/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml @@ -83,6 +83,13 @@ AutomationProperties.AutomationId="NetworkTlsLegacyWarning" /> + + + + diff --git a/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml.cs b/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml.cs index 215de598e..2ee0c4599 100644 --- a/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml.cs +++ b/src/Titanium.Inspector/Views/NetworkSettingsWindow.axaml.cs @@ -44,6 +44,7 @@ public NetworkSettingsWindow(SettingsService settings, string bindAddress, int b Http3Check.IsChecked = true; SelectTls(InspectorNetworkSettings.TlsDefault); ReuseCheck.IsChecked = true; + LoadStackChoice(managed: false); WinAuthBox.Text = string.Empty; StatusText.Text = string.Empty; UpdateFieldsEnabled(); @@ -101,6 +102,38 @@ private void LoadFromSettings() SelectTls(s.OutboundTlsPreset); ReuseCheck.IsChecked = s.ReuseServerConnections; WinAuthBox.Text = s.WinAuthHosts; + LoadStackChoice(s.UseManagedStack); + } + + private bool StackChoiceForced() => + InterceptionService.FipsEnabled() + || string.Equals(Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK"), "0", StringComparison.Ordinal); + + private void LoadStackChoice(bool managed) + { + bool forced = StackChoiceForced(); + ManagedStackRadio.IsEnabled = !forced; + if (forced || !managed) + { + PlatformStackRadio.IsChecked = true; + } + else + { + ManagedStackRadio.IsChecked = true; + } + + if (!forced) + { + StackForcedText.IsVisible = false; + return; + } + + string reason = InterceptionService.FipsEnabled() ? "FIPS" : "TITANIUM_MANAGED_STACK=0"; + StackForcedText.Text = string.Format( + System.Globalization.CultureInfo.CurrentCulture, + LanguageService.Get("network.stackForced"), + reason); + StackForcedText.IsVisible = true; } private void SelectTls(string? preset) @@ -181,6 +214,7 @@ private void OnSave(object? sender, RoutedEventArgs e) s.EnableHttp3 = Http3Check.IsEnabled && Http3Check.IsChecked == true; s.OutboundTlsPreset = SelectedTlsPreset(); s.ReuseServerConnections = ReuseCheck.IsChecked == true; + s.UseManagedStack = !StackChoiceForced() && ManagedStackRadio.IsChecked == true; s.WinAuthHosts = WinAuthBox.Text?.Replace("\r\n", "\n", StringComparison.Ordinal) ?? string.Empty; _settings.Save(); _saved = true; diff --git a/src/Titanium.Managed.Common.props b/src/Titanium.Managed.Common.props new file mode 100644 index 000000000..ca9175c0e --- /dev/null +++ b/src/Titanium.Managed.Common.props @@ -0,0 +1,37 @@ + + + net10.0 + enable + disable + latest + true + StrongNameKey.snk + true + true + latest-recommended + true + true + false + 0.1.0 + preview.1 + Jehonathan Thomas + MIT + true + README.md + https://github.com/justcoding121/titanium-web-proxy + git + true + true + snupkg + true + icon.png + Experimental preview. This package is not a FIPS-validated module. + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/src/Titanium.Net.Compatibility/AssemblyMarker.cs b/src/Titanium.Net.Compatibility/AssemblyMarker.cs new file mode 100644 index 000000000..18afa10a5 --- /dev/null +++ b/src/Titanium.Net.Compatibility/AssemblyMarker.cs @@ -0,0 +1,7 @@ +namespace Titanium.Net.Compatibility; + +/// Build marker so the test host can load this assembly. +internal static class AssemblyMarker +{ + internal const string Name = "Titanium.Net.Compatibility"; +} diff --git a/src/Titanium.Net.Compatibility/BannedSymbols.txt b/src/Titanium.Net.Compatibility/BannedSymbols.txt new file mode 100644 index 000000000..c231552d7 --- /dev/null +++ b/src/Titanium.Net.Compatibility/BannedSymbols.txt @@ -0,0 +1,19 @@ +T:System.Runtime.InteropServices.DllImportAttribute;P/Invoke is not allowed in the managed TLS stack. +T:System.Runtime.InteropServices.LibraryImportAttribute;P/Invoke is not allowed in the managed TLS stack. +M:System.Threading.Tasks.Task.Run(System.Action);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task});Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Wait;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Int32);Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Threading.CancellationToken);Blocking on a task hides the caller. Await at the I/O boundary. +P:System.Threading.Tasks.Task`1.Result;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Thread.Sleep(System.Int32);Use TimeProvider and timers, not thread sleeps. +M:System.Random.#ctor;Entropy goes through IEntropySource. +M:System.Random.#ctor(System.Int32);Entropy goes through IEntropySource. +T:System.IO.Pipelines.Pipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeReader;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeWriter;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.IDuplexPipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.Threading.Channels.Channel;No producer and consumer hop on the data path. +T:System.Threading.Channels.Channel`2;No producer and consumer hop on the data path. diff --git a/src/Titanium.Net.Compatibility/LICENSE b/src/Titanium.Net.Compatibility/LICENSE new file mode 100644 index 000000000..786bcaca4 --- /dev/null +++ b/src/Titanium.Net.Compatibility/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/src/Titanium.Net.Compatibility/PublicAPI.Shipped.txt b/src/Titanium.Net.Compatibility/PublicAPI.Shipped.txt new file mode 100644 index 000000000..7dc5c5811 --- /dev/null +++ b/src/Titanium.Net.Compatibility/PublicAPI.Shipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Titanium.Net.Compatibility/PublicAPI.Unshipped.txt b/src/Titanium.Net.Compatibility/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..39d4a2613 --- /dev/null +++ b/src/Titanium.Net.Compatibility/PublicAPI.Unshipped.txt @@ -0,0 +1,7 @@ +#nullable enable +Titanium.Net.Compatibility.QuicClientOptionsAdapter +static Titanium.Net.Compatibility.QuicClientOptionsAdapter.ToManaged(System.Net.Quic.QuicClientConnectionOptions! options) -> Titanium.Quic.ManagedQuicClientConnectionOptions! +static Titanium.Net.Compatibility.QuicClientOptionsAdapter.UnsupportedSettings(System.Net.Quic.QuicClientConnectionOptions! options) -> System.Collections.Generic.IReadOnlyList! +Titanium.Net.Compatibility.QuicListenerOptionsAdapter +static Titanium.Net.Compatibility.QuicListenerOptionsAdapter.ToManaged(System.Net.Quic.QuicListenerOptions! options, Titanium.Quic.ManagedQuicConnectionOptionsCallback! connectionOptionsCallback) -> Titanium.Quic.ManagedQuicListenerOptions! +static Titanium.Net.Compatibility.QuicListenerOptionsAdapter.UnsupportedSettings(System.Net.Quic.QuicListenerOptions! options) -> System.Collections.Generic.IReadOnlyList! diff --git a/src/Titanium.Net.Compatibility/QuicClientOptionsAdapter.cs b/src/Titanium.Net.Compatibility/QuicClientOptionsAdapter.cs new file mode 100644 index 000000000..74e0e2684 --- /dev/null +++ b/src/Titanium.Net.Compatibility/QuicClientOptionsAdapter.cs @@ -0,0 +1,105 @@ +#pragma warning disable CA1416 // The platform option type is the translation source. This adapter does not start that stack. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using Titanium.Quic; + +namespace Titanium.Net.Compatibility; + +/// +/// Copies a platform onto . +/// A setting the managed client cannot apply is refused. +/// +public static class QuicClientOptionsAdapter +{ + /// + /// Builds managed client options from . + /// + /// The platform options. + /// Options the managed client can connect with. + /// is null. + /// The remote endpoint is not an IP endpoint, or a setting cannot be applied. + public static ManagedQuicClientConnectionOptions ToManaged(QuicClientConnectionOptions options) + { + ArgumentNullException.ThrowIfNull(options); + IReadOnlyList unsupported = UnsupportedSettings(options); + if (unsupported.Count > 0) + { + throw new ArgumentException( + "The managed client cannot apply these settings yet: " + string.Join(", ", unsupported) + "."); + } + + if (options.RemoteEndPoint is not IPEndPoint remote) + { + throw new ArgumentException("The managed client takes an IP endpoint. Resolve the name first.", nameof(options)); + } + + return new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = remote, + LocalEndPoint = options.LocalEndPoint, + ClientAuthenticationOptions = options.ClientAuthenticationOptions, + HandshakeTimeout = options.HandshakeTimeout, + KeepAliveInterval = options.KeepAliveInterval, + IdleTimeout = options.IdleTimeout, + MaxInboundBidirectionalStreams = options.MaxInboundBidirectionalStreams, + MaxInboundUnidirectionalStreams = options.MaxInboundUnidirectionalStreams, + DefaultStreamErrorCode = options.DefaultStreamErrorCode, + }; + } + + /// + /// Names the settings on that will refuse. + /// A host name in is one of them. + /// + /// The platform options. + /// The setting names, in a stable order. Empty when can copy the options. + /// is null. + public static IReadOnlyList UnsupportedSettings(QuicClientConnectionOptions options) + { + ArgumentNullException.ThrowIfNull(options); + var defaults = new QuicClientConnectionOptions(); + var names = new List(); + if (options.RemoteEndPoint is not null and not IPEndPoint) + { + names.Add(nameof(QuicClientConnectionOptions.RemoteEndPoint)); + } + + AddIfDifferent(names, nameof(QuicClientConnectionOptions.DefaultCloseErrorCode), options.DefaultCloseErrorCode, defaults.DefaultCloseErrorCode); + if (options.StreamCapacityCallback is not null) + { + names.Add(nameof(QuicClientConnectionOptions.StreamCapacityCallback)); + } + + AddWindowIfDifferent(names, options.InitialReceiveWindowSizes, defaults.InitialReceiveWindowSizes); + return names; + } + + private static void AddWindowIfDifferent(List names, QuicReceiveWindowSizes? value, QuicReceiveWindowSizes? baseline) + { + if (value is null && baseline is null) + { + return; + } + + if (value is null || baseline is null + || value.Connection != baseline.Connection + || value.LocallyInitiatedBidirectionalStream != baseline.LocallyInitiatedBidirectionalStream + || value.RemotelyInitiatedBidirectionalStream != baseline.RemotelyInitiatedBidirectionalStream + || value.UnidirectionalStream != baseline.UnidirectionalStream) + { + names.Add(nameof(QuicClientConnectionOptions.InitialReceiveWindowSizes)); + } + } + + private static void AddIfDifferent(List names, string name, T value, T baseline) + where T : IEquatable + { + if (!value.Equals(baseline)) + { + names.Add(name); + } + } +} +#pragma warning restore CA1416 diff --git a/src/Titanium.Net.Compatibility/QuicListenerOptionsAdapter.cs b/src/Titanium.Net.Compatibility/QuicListenerOptionsAdapter.cs new file mode 100644 index 000000000..58620e054 --- /dev/null +++ b/src/Titanium.Net.Compatibility/QuicListenerOptionsAdapter.cs @@ -0,0 +1,70 @@ +#pragma warning disable CA1416 // The platform option type is the translation source. This adapter does not start that stack. +using System; +using System.Collections.Generic; +using System.Net.Quic; +using Titanium.Quic; + +namespace Titanium.Net.Compatibility; + +/// +/// Copies a platform onto . +/// The platform listener does not carry a handshake timeout, so the managed default stays. +/// Application protocols stay on the server authentication options the callback returns. +/// +public static class QuicListenerOptionsAdapter +{ + /// + /// Builds managed listener options from and . + /// + /// The platform options. + /// Selects the certificate and protocols for each connection. + /// Options the managed listener can bind with. + /// or is null. + /// A setting cannot be applied. + public static ManagedQuicListenerOptions ToManaged( + QuicListenerOptions options, + ManagedQuicConnectionOptionsCallback connectionOptionsCallback) + { + ArgumentNullException.ThrowIfNull(options); + ArgumentNullException.ThrowIfNull(connectionOptionsCallback); + IReadOnlyList unsupported = UnsupportedSettings(options); + if (unsupported.Count > 0) + { + throw new ArgumentException( + "The managed listener cannot apply these settings yet: " + string.Join(", ", unsupported) + "."); + } + + return new ManagedQuicListenerOptions + { + ListenEndPoint = options.ListenEndPoint, + ConnectionOptionsCallback = connectionOptionsCallback, + }; + } + + /// + /// Names the settings on that will refuse. + /// is refused because the managed listener + /// reads protocols from the server authentication options. + /// + /// The platform options. + /// The setting names, in a stable order. Empty when can copy the options. + /// is null. + public static IReadOnlyList UnsupportedSettings(QuicListenerOptions options) + { + ArgumentNullException.ThrowIfNull(options); + var defaults = new QuicListenerOptions(); + var names = new List(); + if (options.ApplicationProtocols is { Count: > 0 }) + { + names.Add(nameof(QuicListenerOptions.ApplicationProtocols)); + } + + if (options.ListenBacklog != defaults.ListenBacklog) + { + names.Add(nameof(QuicListenerOptions.ListenBacklog)); + } + + return names; + } +} +#pragma warning restore CA1416 diff --git a/src/Titanium.Net.Compatibility/README.md b/src/Titanium.Net.Compatibility/README.md new file mode 100644 index 000000000..e82bd5f7f --- /dev/null +++ b/src/Titanium.Net.Compatibility/README.md @@ -0,0 +1,16 @@ +# Titanium.Net.Compatibility + +Adapters that copy `QuicClientConnectionOptions` and `QuicListenerOptions` onto the managed QUIC option types. The proxy calls them when `UseManagedQuicStack` is on. The library default is off. + +A setting the managed client cannot apply is listed by `UnsupportedSettings` and is not copied. + +```csharp +ManagedQuicClientConnectionOptions managed = QuicClientOptionsAdapter.ToManaged(platformOptions); +IReadOnlyList refused = QuicClientOptionsAdapter.UnsupportedSettings(platformOptions); +``` + +## Limits + +This package does not open a connection. `Titanium.Net.Http` does not reference it. A host name, a connection close code, a receive window, a stream-capacity callback, and listener application protocols stay refused. + +This package is experimental. It is not a FIPS-validated module. diff --git a/src/Titanium.Net.Compatibility/StrongNameKey.snk b/src/Titanium.Net.Compatibility/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/src/Titanium.Net.Compatibility/StrongNameKey.snk differ diff --git a/src/Titanium.Net.Compatibility/Titanium.Net.Compatibility.csproj b/src/Titanium.Net.Compatibility/Titanium.Net.Compatibility.csproj new file mode 100644 index 000000000..fd4218670 --- /dev/null +++ b/src/Titanium.Net.Compatibility/Titanium.Net.Compatibility.csproj @@ -0,0 +1,31 @@ + + + + Titanium.Net.Compatibility + SslStream-shaped and QUIC-shaped adapters over the managed TLS and QUIC stacks. + Titanium.Net.Compatibility + tls;quic;managed + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + diff --git a/src/Titanium.Net.Compatibility/design/PHASE-3-SPEC.md b/src/Titanium.Net.Compatibility/design/PHASE-3-SPEC.md new file mode 100644 index 000000000..90dc29992 --- /dev/null +++ b/src/Titanium.Net.Compatibility/design/PHASE-3-SPEC.md @@ -0,0 +1,60 @@ +Phase 3 connects the proxy to the managed TLS and QUIC stacks without changing the flag-off path. This spec is the kickoff. It is the task list. The proxy still calls `SslStream` and `System.Net.Quic`. No existing proxy file is edited by the kickoff. + +## Decisions this kickoff locks + +These follow Part B, Part L, and the Phase 3 sequence. They are not new product choices. + +- The first artifact is `TWP-TOUCH-MAP.md` in this folder. Creation sites are classified before any proxy edit. +- A later seam adds new files first. An existing file changes only at a creation site, and only by one flag branch. The flag-off branch keeps the current lines and the raw `SslStream` or `QuicConnection`. +- `UseManagedTlsStack` and `UseManagedQuicStack` default off for the library, the CLI, charts, and Gateway. Inspector defaults on, in its own later commit. This kickoff does not add the flags. +- A managed handshake that fails because the server chose TLS 1.2 falls back to `SslStream` for that connection. The fallback lives in the proxy, not in `TlsEngine`. +- HTTP/3 framing stays in the proxy until the extraction task. `TitaniumHttpHandler` waits until that extraction exists. +- 0-RTT stays out of this kickoff. The QUIC stack does not send or accept early data. +- FIPS stays fail-closed. An override is a later config task, not a silent switch. +- The compatibility project may adapt option types. It must not reference `Titanium.Web.Proxy`. + +## Tasks + +### P3.1 Touch map + +Done with this kickoff. Every proxy file that constructs `SslStream`, `QuicConnection`, or `QuicListener`, or that calls a member those types own, is in the map. Comment-only mentions are listed as no seam. + +Exit: the map exists, and `git diff` of `src/Titanium.Web.Proxy` is empty. + +### P3.1b Option adapters + +`QuicClientOptionsAdapter` and `QuicListenerOptionsAdapter` copy platform option objects onto the managed types. The client adapter copies an IP endpoint, the TLS options, the handshake timeout, the keep-alive interval, the idle timeout, both inbound stream limits, and the stream error used when a stream is released early. The managed client advertises those limits, sends a PING at the keep-alive interval after the handshake, and sends that stream error on an early release. The adapter still refuses a host name, a connection close code, a receive window, and a stream-capacity callback. The listener adapter copies the listen endpoint and refuses application protocols and a backlog other than the platform default. The platform listener has no handshake timeout, so the managed listener keeps its 10 second default. `QuicConnectionFactory` calls the client adapter after it resolves the host. `QuicClientHandler` calls the listener adapter. Application protocols stay on the server authentication options the callback returns. + +Exit: the compatibility tests pass. A proxy-shaped client options object that already has an IP endpoint is accepted. A host name is still refused, and the caller resolves it. + +### P3.2 Flag-off seam at the creation sites + +`ProxyServer.UseManagedTlsStack` and `ProxyServer.UseManagedQuicStack` exist. Both default to false. Reading them after `Start` is allowed. Assigning a different value after `Start` throws. No creation site reads them yet, so a running proxy still constructs `SslStream` and `System.Net.Quic`. + +`TlsStream` calls `LocalCertificateSelectionCallback` when the server requests a client certificate. The certificate it returns replaces `ClientCertificates`. Issuer names from the request use the same string as `X509Certificate2.Issuer`. `TcpConnectionFactory`, `ExplicitClientHandler`, both transparent client handshakes, both TLS-terminate handshakes, the MASQUE handshake, and the WebTransport client handshake read `UseManagedTlsStack`. The WebTransport origin handshake receives that flag from its caller. The mirror dispatcher reads it when a copy opens TLS. `QuicConnectionFactory` reads `UseManagedQuicStack`. When that flag is set, the factory resolves the host and connects a `ManagedQuicConnection`. The existing `QuicConnection.ConnectAsync` call stays on the other branch. The translated options leave the connection close code at the platform default, and the holder sends the HTTP/3 no-error code when it closes. A request stream on that connection still throws, because HTTP/3 framing reads the platform stream. The listener binds a `ManagedQuicListener` when `UseManagedQuicStack` is set and keeps HTTP/3 on the server authentication options. An accepted connection is closed, because the same framing gap applies. The existing `QuicListener.ListenAsync` call stays on the other branch. Each managed TLS branch authenticates a `TlsStream`. The existing `SslStream` lines stay in the other branch. `HttpStream` treats a `TlsStream` as a network stream for the body-write hook. Client-certificate capture reads `RemoteCertificate` from either stream. A terminate half-close calls `ShutdownAsync` on either stream. The other creation sites still construct the platform types. + +Exit: existing proxy tests stay green and unedited. A flag-off run does not construct `TlsStream` or `ManagedQuicConnection`. + +### P3.3 Flags, defaults, and the FIPS guard + +`server.managedStack` sets both proxy flags. `server.managedTls` and `server.managedQuic` override it. Omit all three and the applier leaves the library default, which is off. `titanium run --managed-stack` and `TITANIUM_MANAGED_STACK` override the file. The flag wins over the variable. The proxy and gateway charts write `server.managedStack: false`. Startup refuses the managed stacks while FIPS mode is on unless `server.managedStackFipsOverride` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1` is set. With the override the handshake uses FIPS-approved algorithms and logs that fingerprint fidelity is reduced. `clusters[].httpClient.fingerprint: chrome` is refused unless the managed TLS flag is on. While the managed ClientHello is still the built-in one, the handshake is refused instead of sending that hello. Inspector is still ahead. + +### P3.4 Managed-mode test run + +`TWP_MANAGED_TLS=1` sets both proxy flags when a `ProxyServer` is constructed. Unset, the library default stays off. The soft workflow `managed-stack-proxy.yml` runs the existing unit and integration suites with that variable and does not fail the pull request. Failures are split into a managed bug, a parity gap in `PARITY-DIFFS.md`, or a test assumption. None are skipped silently. + +### P3.5 Extract `Titanium.Http3` + +`Http3VarInt`, the frame types, the stream types, the error codes, the frame byte layout, the capsule reader, the SETTINGS payload, the Huffman coding, the QPACK tables, and the QPACK encoder and decoder now live in `Titanium.Http3`. The proxy keeps the same names. It still reads frames and writes them to a stream, including the platform QUIC finish bit. The proxy behavior is unchanged. + +### P3.6 `TitaniumHttpHandler` + +`Titanium.Net.Http` contains `TitaniumHttpHandler`. HTTP/1.1 and HTTP/2 go through an inner handler whose connect callback owns the managed TLS stream. The handler rewrites `https` to `http` and keeps port 443, and the response points at the caller's request. A caller http URI is sent as cleartext, including when it asks for version 3. A redirect is followed by the handler, including an HTTP/3 response, so an https Location stays on the managed stream. Authorization is dropped when the host changes, including on HTTP/3. The same host keeps it. A 300 or 302 turns POST into GET, including on HTTP/3. An HTTP/3 redirect to an http URL is fetched as HTTP/1.1. A later https hop returns to HTTP/3. Cancelling the request stops an HTTP/3 redirect while the next hop is waiting. A 303 turns POST into GET and leaves HEAD as HEAD, including on HTTP/3. `MaxAutomaticRedirections` stops a longer chain, including an HTTP/3 chain. `AllowAutoRedirect` false returns the redirect response, including an HTTP/3 response. A redirect copies a `Cookie` header only when `UseCookies` is false, including on HTTP/3. It does not copy `Host`, including on HTTP/3, where the next hop's `:authority` is the URI authority. A 307 keeps the method and body, and an HTTP/3 hop sends that body again. A cleartext hop sends it again too. A 301 turns POST into GET, including on HTTP/3. A 308 keeps the method and body, and an HTTP/3 hop sends that body again. Cookies and decompression stay on the inner handler. A cleartext hop from HTTP/3 still decompresses gzip and sends a cookie stored for that http URI. A Set-Cookie on that hop is stored for the next request. A one-mebibyte upload and download round-trip keeps its SHA-256. The sample is `samples/HttpClientManagedStack`. HTTP/3 opens a managed QUIC connection, sends the control streams, and reads one response. The same connection is reused for that authority until 16 request streams, the idle timeout, or the connection lifetime. The next request opens another connection. While that authority is already at `MaxConnectionsPerServer` and every connection is still busy, the request waits. Each finished request returns its in-flight place, so the wait ends when the busy connection is idle. The call returns after the response headers, and the body is read as the caller reads it. Cancelling that read stops it while it is waiting for the next frame. Cancelling an HTTP/1.1 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/1.1 request stops it while the status line is still waiting. An HTTP/1.1 connection is reused until `PooledConnectionLifetime` elapses. The next request opens another connection. While that connection is busy, `MaxConnectionsPerServer` of 1 keeps the next HTTP/1.1 request waiting. An http request is sent to the configured proxy. The request line is the absolute URI. UseProxy false sends an http request to the origin even when a proxy is set. The request line is the origin path. Changing MaxConnectionsPerServer after the first request throws. An https request opens a CONNECT tunnel to that proxy, then the managed TLS handshake. A proxy that refuses the CONNECT tunnel fails the request before the TLS handshake. An exact HTTP/2 request that the server resets does not fall back to HTTP/1.1. A POST that allows a lower version is not retried after that reset. A POST body is sent when ALPN selects HTTP/1.1 and a lower version is allowed. An exact HTTP/2 request is not retried when ALPN selects HTTP/1.1. A request that starts at HTTP/1.1 and allows a higher version is retried, and the next request reuses that connection. Another port is remembered on its own and still tries a higher version. A certificate in SslOptions.ClientCertificates is presented when the server asks for one. LocalCertificateSelectionCallback chooses which certificate is presented. A certificate without a private key is skipped. SslOptions.TargetHost is the name sent on the handshake, including HTTP/3. The connection still goes to the URI host. QuicOptions.LocalEndPoint is the local UDP address of an HTTP/3 connection. When ConnectTimeout is infinite, QuicOptions.HandshakeTimeout stops a silent HTTP/3 handshake. EnabledSslProtocols that omit TLS 1.3 fail the request before it is sent. An empty SslOptions.TargetHost sends the URI host on an HTTP/3 handshake and on an HTTP/1.1 handshake. Assigning null to SslOptions is rejected. AutomaticDecompression gzip decodes an HTTPS HTTP/1.1 response. An HTTP/3 response with Content-Encoding gzip stays compressed. A direct HTTP/3 request leaves CookieContainer unchanged. An HTTPS HTTP/1.1 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off the request, and Set-Cookie stays out of the container. A Cookie header on a direct HTTP/3 request is sent. A direct HTTP/3 request sends Authorization. An HTTPS HTTP/1.1 request sends Authorization. An HTTPS HTTP/1.1 request sends a caller Host. A direct HTTP/3 request uses the URI as :authority and leaves a caller Host off the request. A caller header is sent on HTTP/3. An HTTP/3 request sends every value of a repeated header. An HTTPS HTTP/1.1 request sends every value of a repeated header. Connection, Upgrade, Keep-Alive, Proxy-Connection, and Transfer-Encoding are left off. An HTTPS HTTP/1.1 request sends a caller header. An HTTP/3 POST sends Content-Type with the body. An HTTPS HTTP/1.1 POST sends Content-Type with the body. An empty HTTP/3 POST sends no DATA frame. An HTTP/3 request keeps the query on :path. An HTTPS HTTP/1.1 request keeps the query. A HEADERS frame after the body is applied to the response trailers while that read runs. A DATA frame before those headers fails the request. A truncated HTTP/3 frame fails the request. An unknown HTTP/3 frame before the response headers is skipped. An unknown HTTP/3 frame while the body is read is skipped. An empty DATA frame while the body is read is skipped. An HTTP/3 response with no headers fails the request. An HTTP/3 response Content-Type is available on the response content headers. An HTTP/3 response Content-Length is available on the response content headers. An HTTP/3 response keeps every value of a repeated header. An HTTP/3 404 is returned with its body. An HTTPS HTTP/1.1 404 is returned with its body. A direct HTTP/3 HEAD sends :method HEAD and returns an empty body. An HTTPS HTTP/1.1 HEAD sends the method and returns an empty body. An HTTP/3 204 is returned with an empty body. An HTTPS HTTP/1.1 204 is returned with an empty body. An HTTP/3 request to a host that does not resolve fails before a connection is opened. A completed HTTP/2 400 is retried once over HTTP/1.1 when the request allows a lower version. A completed HTTP/2 421 is retried once over HTTP/1.1 when the request allows a lower version. An exact HTTP/2 request returns a completed 400 and does not open another connection. An HTTP/2 POST returns a completed 400 and does not open another connection. An HTTP/2 HEAD that receives a completed 400 is retried once over HTTP/1.1, and the retry stays HEAD. An HTTP/2 OPTIONS that receives a completed 400 is retried once over HTTP/1.1, and the retry stays OPTIONS. An HTTP/2 TRACE that receives a completed 400 is retried once over HTTP/1.1, and the retry stays TRACE. After an HTTP/2 400 is retried, the next request to that authority uses HTTP/1.1. An exact HTTP/2 request still tries HTTP/2 after that and returns the 400. An HTTP/2 500 is returned and does not open another connection. An HTTP/2 200 returns its DATA frame as the response body. An HTTP/2 response header is available on the response. An HTTP/2 POST body is returned in the response. An HTTP/2 response Content-Type is available on the response content headers. An HTTP/2 response Content-Length is available on the response content headers. An HTTP/2 response keeps every value of a repeated header. An HTTP/2 trailer is available on the response trailing headers. An HTTP/2 302 is followed, and the next hop stays on HTTP/2. An HTTP/2 303 turns POST into GET. An HTTP/2 303 leaves HEAD as HEAD. An HTTP/2 307 keeps POST and sends the body again. An HTTP/2 redirect drops Authorization when the host changes, and the same host keeps it. An HTTP/2 redirect copies a Cookie header only when UseCookies is false. An HTTP/2 redirect leaves a caller Host off, and the next hop's :authority is the URI authority. AllowAutoRedirect false returns an HTTP/2 redirect. MaxAutomaticRedirections stops a longer HTTP/2 chain. An HTTP/2 request keeps the query on :path. An HTTP/2 request sends a caller header. Connection, Upgrade, and Proxy-Connection stay off, and Keep-Alive is sent. An HTTP/2 request joins every value of a repeated header into one comma-separated value. An HTTP/2 POST sends Content-Type with the body. An empty HTTP/2 POST sends an empty DATA frame. An HTTP/2 request leaves Transfer-Encoding off. An HTTP/2 request reuses the connection for the same authority. PooledConnectionLifetime opens another HTTP/2 connection after it expires. A short PooledConnectionIdleTimeout still reuses an HTTP/2 connection. MaxConnectionsPerServer of one carries two in-flight HTTP/2 requests on that connection. AutomaticDecompression gzip returns the decoded HTTP/2 body. A GOAWAY opens another HTTP/2 connection for the next request. An HTTP/2 request presents the client certificate. SslOptions.TargetHost is the server name on an HTTP/2 handshake. An empty SslOptions.TargetHost sends the URI host on an HTTP/2 handshake. A caller Host on a direct HTTP/2 request becomes `:authority` and the host field stays off. The certificate selection callback chooses the HTTP/2 client certificate. An HTTP/2 client certificate without a private key is skipped. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off an HTTP/2 request, and Set-Cookie stays out of the container. Cancelling an HTTP/2 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/2 request stops it while the response headers are still waiting. EnabledSslProtocols that omit TLS 1.3 fail an HTTP/2 request before it is sent. ConnectTimeout stops an HTTP/2 request while the TCP peer stays silent. An exact HTTPS HTTP/2 request with a proxy set fails before a connection is opened. UseProxy false sends that HTTP/2 request to the origin. An HTTP/2 request that allows a lower version still fails before a connection when a proxy is set. An exact HTTPS HTTP/3 request with a proxy set still reaches the origin. An HTTP/1.1 request that allows a higher version still fails before a connection when a proxy is set. A proxy that closes before the CONNECT response fails the request before the TLS handshake. A proxy whose CONNECT response fills the header buffer fails the request before the TLS handshake. Credentials on the proxy are left off the CONNECT request. Credentials on the proxy are left off a cleartext request. The request line stays the absolute URI. BypassProxyOnLocal sends an HTTPS request for a loopback origin to that origin. A bypass list entry that matches the origin sends that HTTPS request to the origin while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. An HTTP/3 connection idle past `PooledConnectionIdleTimeout` is not reused. A connection older than `PooledConnectionLifetime` is not reused even when it has no idle timeout. A GOAWAY on the peer's control stream stops new requests on that connection and closes it once nothing is in flight. A failed HTTP/3 connect, before any request byte, falls back to the adapter when the request allows a lower version. The same fallback runs when an Alt-Svc upgrade fails. After the server selects HTTP/1.1, the next request to that authority reuses that choice. The dynamic table is capped at 4096 bytes. A request inserts a field that is not in the static table when the peer allows a dynamic table and at least one blocked stream. `ConnectTimeout` bounds a silent TCP handshake and a silent HTTP/3 handshake. A one-mebibyte HTTP/3 upload and download keeps its SHA-256. Reading stream data opens the receive window. A peer insert is decoded. When Alt-Svc is enabled, a later request that allows a higher version uses HTTP/3 after `Alt-Svc: h3` from the same origin. The cache holds 256 origins and honors `ma`. `Alt-Svc: clear` drops the cached port. An Alt-Svc host other than the origin is ignored. The handler always uses the managed stack. + +### P3.7 UDP injection + +A managed listener can take one datagram from the caller and hand each reply to a callback. It does not open a socket. When the managed QUIC stack is on, SOCKS5 UDP ASSOCIATE, CONNECT-UDP, and transparent interception feed a QUIC datagram to that listener. The transparent local address is the origin the client addressed. The reply goes back to the caller. Other datagrams stay on the relay. The platform path stays the default. + +## Self-review + +Checked against Part B and Part O. The kickoff does not add a pipe, a channel, a `Task` around crypto, a P/Invoke, or a second ClientHello parser. Listener fallback keeps the proxy's existing ClientHello parse. CUBIC stays off by default. The UDP offload project stays optional and is not wired here. Public QUIC names stay `Managed*`. The flag-off hot path is not wrapped. diff --git a/src/Titanium.Net.Compatibility/design/TWP-TOUCH-MAP.md b/src/Titanium.Net.Compatibility/design/TWP-TOUCH-MAP.md new file mode 100644 index 000000000..cb3d37061 --- /dev/null +++ b/src/Titanium.Net.Compatibility/design/TWP-TOUCH-MAP.md @@ -0,0 +1,59 @@ +This map is the survey for the Phase 3 seam. `ProxyServer.UseManagedTlsStack` and `ProxyServer.UseManagedQuicStack` default to false. `TcpConnectionFactory`, `ExplicitClientHandler`, `TransparentClientHandler`, `TcpTlsTerminateHandler`, `MasqueClientHandler`, and `WebTransportClientHandler` read `UseManagedTlsStack`. `WebTransportOrigin` receives the flag from those callers. `MirrorDispatcher` reads it when a copy opens TLS. `QuicConnectionFactory` and `QuicClientHandler` read `UseManagedQuicStack`. + +A file is a creation site when it constructs `SslStream`, calls `QuicConnection.ConnectAsync`, or calls `QuicListener.ListenAsync`. A use site calls a member those types own on an object it did not construct. A capability site branches on the runtime type. Comment-only mentions are not a seam. + +## Creation sites + +These are the only places a later flag branch belongs. The flag-off arm stays the lines that are there now. + +| File | What it creates | +| --- | --- | +| `Network/TcpConnection/TcpConnectionFactory.cs` | Upstream handshake. When `UseManagedTlsStack` is set, both sites authenticate a `TlsStream`. The other branch still constructs `SslStream`. | +| `Handlers/ExplicitClientHandler.cs` | Client-facing handshake. When `UseManagedTlsStack` is set, the site authenticates a `TlsStream`. The other branch still constructs `SslStream`. | +| `Handlers/TransparentClientHandler.cs` | Client-facing handshake. When `UseManagedTlsStack` is set, both sites authenticate a `TlsStream`, including the per-name certificate callback. The other branch still constructs `SslStream`. | +| `Handlers/TcpTlsTerminateHandler.cs` | Client-facing and upstream handshakes. When `UseManagedTlsStack` is set, both authenticate a `TlsStream`. The other branch still constructs `SslStream`. | +| `Handlers/MasqueClientHandler.cs` | Client-facing handshake. When `UseManagedTlsStack` is set, the site authenticates a `TlsStream`. The other branch still constructs `SslStream`. | +| `Handlers/WebTransportClientHandler.cs` | Client-facing handshake. When `UseManagedTlsStack` is set, the site authenticates a `TlsStream`. The other branch still constructs `SslStream`. | +| `WebTransport/WebTransportOrigin.cs` | Upstream handshake. When the caller passes the managed flag, the site authenticates a `TlsStream`. The default still constructs `SslStream`. | +| `Routing/MirrorDispatcher.cs` | Upstream handshake for a mirror copy. When the flag is set, the site authenticates a `TlsStream`. The other branch still constructs `SslStream`. | +| `Network/Quic/QuicConnectionFactory.cs` | Outbound dial. When `UseManagedQuicStack` is set, the site resolves the host and connects a `ManagedQuicConnection`. The other branch still calls `QuicConnection.ConnectAsync`. A request stream still needs the platform stream. | +| `Handlers/QuicClientHandler.cs` | Inbound listen. When `UseManagedQuicStack` is set, the site binds a `ManagedQuicListener` and carries HTTP/3 on the server authentication options. The other branch still calls `QuicListener.ListenAsync`. An accepted connection is closed until HTTP/3 framing can read a managed stream. | + +## Capability sites + +These branch on the platform type. A managed stream has to opt in without changing the flag-off object. + +| File | Check | +| --- | --- | +| `Network/Streams/HttpStream.cs` | `baseStream is SslStream` sets `IsNetworkStream` and `SupportsBodyWriteHook` (lines 106 and 109). `ITransportCapableStream` already documents that hook. | +| `Handlers/TcpTlsTerminateHandler.cs` | A half-close calls `ShutdownAsync` on an `SslStream` or a `TlsStream`. | +| `Http3/Http3Frame.cs` | `stream is QuicStream` passes `completeWrites: true` (line 436). | +| `Certificates/ClientCertificateHandshake.cs` | `Capture` reads `RemoteCertificate`. The `SslStream` overload forwards to an overload that takes the certificate, which the managed handshake calls. | + +## Use sites + +These already hold a platform object. They should keep taking `Stream` or the existing proxy wrapper. They are not creation sites. + +| File | Members it uses | +| --- | --- | +| `Network/Quic/QuicServerConnection.cs` | `OpenOutboundStreamAsync` on a connection the factory returned. | +| `Http3/Http3Connection.cs` | `OpenOutboundStreamAsync` and `AcceptInboundStreamAsync`. Stores `QuicConnection`. | +| `Http3/Http3OriginClientSession.cs` | Same pair of stream calls. Stores `QuicConnection`. | +| `Http3/Http3RequestStream.cs` | Reads and writes a `QuicStream`, including the write that finishes the stream. | +| `Http3/Http3TunnelStream.cs` | Holds a `QuicStream`. | +| `Http3/Http3RequestBodyForwarder.cs` | Copies bytes onto a `QuicStream`. | +| `Http3/Http3OriginBridge.Quic.cs` | Writes a `QuicStream` and calls `Flush`. | +| `Http3/Http3OriginBridge.Stall.cs` | Reads a `QuicStream`. | +| `Http3/Http3ExtendedConnectTunnel.cs` | Holds a `QuicStream`. | +| `Http3/Http3ConnectUdp.cs` | Reads and writes a `QuicStream`. | +| `Models/TransparentProxyEndPoint.cs` | Stores the `QuicListener` that `QuicClientHandler` created. | +| `Models/TransparentQuicProxyEndPoint.cs` | Same storage, and it checks `QuicListener.IsSupported`. | +| `Network/Quic/IQuicInboundEndPoint.cs` | The listener properties the endpoint implements. | + +## No seam + +`QuicClientConnection` records endpoints and the negotiated protocol. It does not hold a `QuicConnection`. `IQuicConnectionFactory` returns the proxy's `QuicServerConnection` wrapper. `QuicConnectionPool` only mentions `OpenOutboundStreamAsync` in a comment. + +These files mention `SslStream` or `QuicListener` in comments or XML docs and do not construct one: `ProxyServer.cs`, `ProxyServer.ListenerTls.cs`, `Network/TcpConnection/TcpClientConnection.cs`, `Network/UpstreamTlsMaterial.cs`, `Network/Tcp/DecryptFailureLearning.cs`, `Network/Streams/HttpStream.Write.cs`, `Network/Streams/HttpStream.Fill.cs`, `Network/Streams/HttpStream.Body.cs`, `Http3/Http3OriginBridge.Tcp.cs`, `Http3/Http3NativeBootstrap.cs`, `Http2/Http2FrameWriter.cs`, `Handlers/Http2NegotiationHandler.cs`, `Handlers/CertificateHandler.cs`, `Certificates/CertificateManager.cs`, `Logging/ProxyDiagnostics.cs`, `Extensions/SslExtensions.cs`. + +The plan's candidate list also names `RequestHandler` and `Http2ToHttp3BridgeHandler`. Neither constructs `SslStream` or a QUIC connection. diff --git a/src/Titanium.Net.Http/AltSvcCache.cs b/src/Titanium.Net.Http/AltSvcCache.cs new file mode 100644 index 000000000..2ebf27e08 --- /dev/null +++ b/src/Titanium.Net.Http/AltSvcCache.cs @@ -0,0 +1,236 @@ +using System; +using System.Collections.Generic; + +namespace Titanium.Net.Http; + +/// +/// Remembers Alt-Svc: h3 for one origin. +/// The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. An entry ends when its ma elapses. +/// A missing ma lasts 24 hours. ma=0 and clear drop the entry. In one header, clear followed by h3 keeps the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. +/// A different host is ignored. +/// +internal sealed class AltSvcCache +{ + internal const int MaxEntries = 256; + internal const int DefaultMaxAgeSeconds = 86400; + + private readonly Dictionary _entries = new(StringComparer.Ordinal); + + internal bool TryGet(Uri uri, DateTimeOffset now, out int port) + { + port = 0; + string key = Key(uri); + lock (_entries) + { + if (!_entries.TryGetValue(key, out Entry entry)) + { + return false; + } + + if (entry.Expires <= now) + { + _entries.Remove(key); + return false; + } + + port = entry.Port; + return true; + } + } + + internal void Note(Uri uri, string header, DateTimeOffset now) + { + string key = Key(uri); + bool clear = false; + int? port = null; + int maxAge = DefaultMaxAgeSeconds; + ReadOnlySpan rest = header.AsSpan().Trim(); + while (!rest.IsEmpty) + { + int comma = IndexOfComma(rest); + ReadOnlySpan token = (comma >= 0 ? rest[..comma] : rest).Trim(); + rest = comma >= 0 ? rest[(comma + 1)..] : ReadOnlySpan.Empty; + if (token.Equals("clear", StringComparison.OrdinalIgnoreCase)) + { + clear = true; + port = null; + continue; + } + + if (TryH3(token, uri.IdnHost, out int advertised, out int age)) + { + clear = false; + port = advertised; + maxAge = age; + } + } + + lock (_entries) + { + if (port is int chosen && maxAge > 0) + { + if (_entries.Count >= MaxEntries && !_entries.ContainsKey(key)) + { + DropExpired(now); + } + + if (_entries.Count >= MaxEntries && !_entries.ContainsKey(key)) + { + _entries.Clear(); + } + + _entries[key] = new Entry(chosen, now.AddSeconds(maxAge)); + return; + } + + if (clear || maxAge <= 0) + { + _entries.Remove(key); + } + } + } + + private void DropExpired(DateTimeOffset now) + { + List? stale = null; + foreach (KeyValuePair entry in _entries) + { + if (entry.Value.Expires <= now) + { + stale ??= new List(); + stale.Add(entry.Key); + } + } + + if (stale is null) + { + return; + } + + foreach (string key in stale) + { + _entries.Remove(key); + } + } + + private static string Key(Uri uri) + { + int port = uri.IsDefaultPort ? 443 : uri.Port; + return uri.Scheme + "://" + uri.IdnHost + ":" + port.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + private static bool TryH3(ReadOnlySpan token, string originHost, out int port, out int maxAge) + { + port = 0; + maxAge = DefaultMaxAgeSeconds; + int eq = token.IndexOf('='); + if (eq <= 0 || !token[..eq].Trim().Equals("h3", StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + ReadOnlySpan rest = token[(eq + 1)..].Trim(); + if (!TryQuoted(ref rest, out ReadOnlySpan authority) || !TryPort(authority, originHost, out port)) + { + return false; + } + + while (!rest.IsEmpty) + { + rest = rest.TrimStart(); + if (rest.IsEmpty || rest[0] != ';') + { + break; + } + + rest = rest[1..].TrimStart(); + int end = rest.IndexOf(';'); + ReadOnlySpan parameter = (end >= 0 ? rest[..end] : rest).Trim(); + rest = end >= 0 ? rest[end..] : ReadOnlySpan.Empty; + if (parameter.StartsWith("ma=", StringComparison.OrdinalIgnoreCase) + && int.TryParse(parameter[3..], System.Globalization.NumberStyles.None, System.Globalization.CultureInfo.InvariantCulture, out int age)) + { + maxAge = age; + } + } + + return true; + } + + private static bool TryQuoted(ref ReadOnlySpan rest, out ReadOnlySpan value) + { + value = default; + if (rest.IsEmpty || rest[0] != '"') + { + return false; + } + + int close = rest[1..].IndexOf('"'); + if (close < 0) + { + return false; + } + + value = rest[1..(close + 1)]; + rest = rest[(close + 2)..]; + return true; + } + + private static bool TryPort(ReadOnlySpan authority, string originHost, out int port) + { + port = 0; + authority = authority.Trim(); + if (authority.IsEmpty) + { + return false; + } + + if (authority[0] == ':') + { + return int.TryParse(authority[1..], System.Globalization.NumberStyles.None, System.Globalization.CultureInfo.InvariantCulture, out port) + && port is > 0 and <= 65535; + } + + int colon = authority.LastIndexOf(':'); + ReadOnlySpan host = colon >= 0 ? authority[..colon] : authority; + if (host.Length > 0 && host[0] == '[') + { + int end = host.IndexOf(']'); + host = end > 1 ? host[1..end] : host; + } + + if (host.Length > 0 && !host.Equals(originHost, StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + if (colon < 0) + { + port = 443; + return true; + } + + return int.TryParse(authority[(colon + 1)..], System.Globalization.NumberStyles.None, System.Globalization.CultureInfo.InvariantCulture, out port) + && port is > 0 and <= 65535; + } + + private static int IndexOfComma(ReadOnlySpan value) + { + bool quoted = false; + for (int i = 0; i < value.Length; i++) + { + if (value[i] == '"') + { + quoted = !quoted; + } + else if (value[i] == ',' && !quoted) + { + return i; + } + } + + return -1; + } + + private readonly record struct Entry(int Port, DateTimeOffset Expires); +} diff --git a/src/Titanium.Net.Http/AssemblyInfo.cs b/src/Titanium.Net.Http/AssemblyInfo.cs new file mode 100644 index 000000000..c570d052e --- /dev/null +++ b/src/Titanium.Net.Http/AssemblyInfo.cs @@ -0,0 +1,8 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Titanium.Net.Http.Tests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100e7368e0ccc717e" + + "eb4d57d35ad6a8305cbbed14faa222e13869405e92c83856266d400887d857005f1393ffca2b92" + + "de7f3ba0bdad35ec2d6057ee1846091b34be2abc3f97dc7e72c16fd4958c15126b12923df76964" + + "7d84922c3f4f3b80ee0ae8e4cb40bc1973b782afb90bb00519fd16adf960f217e23696e7c31654" + + "01d0acd6")] diff --git a/src/Titanium.Net.Http/BannedSymbols.txt b/src/Titanium.Net.Http/BannedSymbols.txt new file mode 100644 index 000000000..caf5a9e68 --- /dev/null +++ b/src/Titanium.Net.Http/BannedSymbols.txt @@ -0,0 +1,9 @@ +T:System.Runtime.InteropServices.DllImportAttribute;P/Invoke is not allowed in the HTTP client. +T:System.Runtime.InteropServices.LibraryImportAttribute;P/Invoke is not allowed in the HTTP client. +M:System.Threading.Tasks.Task.Run(System.Action);Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken);Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task});Protocol work stays on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken);Protocol work stays on the caller. Do not hop threads. +T:System.IO.Pipelines.Pipe;The client uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeReader;The client uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeWriter;The client uses the caller-driven stream model, not a pipe. diff --git a/src/Titanium.Net.Http/Http3Client.cs b/src/Titanium.Net.Http/Http3Client.cs new file mode 100644 index 000000000..dcab04cc4 --- /dev/null +++ b/src/Titanium.Net.Http/Http3Client.cs @@ -0,0 +1,661 @@ +#pragma warning disable CA1416 // QuicException and QuicStreamType are the BCL names. This client does not start the platform QUIC stack. +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Net.Quic; +using System.Net.Security; +using System.Net.Sockets; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Http3; +using Titanium.Quic; + +namespace Titanium.Net.Http; + +/// HTTP/3 requests on managed QUIC connections kept by . +internal static class Http3Client +{ + internal const uint TableCapacity = 4096; + + private static readonly SslApplicationProtocol H3 = new("h3"); + + internal static Task SendAsync( + TitaniumHttpHandler handler, + HttpRequestMessage request, + int? remotePort, + CancellationToken cancellationToken) + { + Uri uri = request.RequestUri ?? throw new InvalidOperationException("The request URI is required."); + int port = remotePort ?? (uri.IsDefaultPort ? 443 : uri.Port); + return handler.Pool.SendAsync(handler, request, uri, port, cancellationToken); + } + + internal static async Task<(ManagedQuicConnection Connection, ManagedQuicStream Encoder)> ConnectAsync( + TitaniumHttpHandler handler, + Uri uri, + int port, + CancellationToken cancellationToken) + { + ManagedQuicConnection connection; + try + { + connection = await ManagedQuicConnection.ConnectAsync(BuildOptions(handler, uri, port), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + throw; + } + catch (Exception ex) when (ex is QuicException or SocketException or IOException) + { + throw new Http3ConnectException("The HTTP/3 connection failed before the request was sent.", ex); + } + + try + { + ManagedQuicStream encoder = await WritePrefaceAsync(connection, cancellationToken).ConfigureAwait(false); + return (connection, encoder); + } + catch (Exception ex) + { + await connection.DisposeAsync().ConfigureAwait(false); + if (ex is OperationCanceledException) + { + throw; + } + + if (ex is QuicException or SocketException or IOException) + { + throw new Http3ConnectException("The HTTP/3 connection failed before the request was sent.", ex); + } + + throw; + } + } + + internal static async Task ExchangeAsync( + ManagedQuicConnection connection, + HttpRequestMessage request, + Uri uri, + Func release, + QpackContext qpack, + ManagedQuicStream encoder, + CancellationToken cancellationToken) + { + ManagedQuicStream stream = await connection.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancellationToken).ConfigureAwait(false); + await WriteRequestAsync(stream, request, uri, qpack, encoder, cancellationToken).ConfigureAwait(false); + await stream.CompleteWritesAsync(cancellationToken).ConfigureAwait(false); + HttpResponseMessage response = await ReadResponseAsync(stream, release, qpack, cancellationToken).ConfigureAwait(false); + response.RequestMessage = request; + response.Version = HttpVersion.Version30; + return response; + } + + internal static string Authority(Uri uri) + { + string host = uri.IdnHost; + if (IPAddress.TryParse(host, out IPAddress? address) && address.AddressFamily == AddressFamily.InterNetworkV6) + { + host = "[" + host + "]"; + } + + return uri.IsDefaultPort ? host : host + ":" + uri.Port.ToString(CultureInfo.InvariantCulture); + } + + private static ManagedQuicClientConnectionOptions BuildOptions(TitaniumHttpHandler handler, Uri uri, int port) + { + IPEndPoint remote = new(Resolve(uri.IdnHost), port); + ManagedQuicClientConnectionOptions source = handler.QuicOptions ?? new ManagedQuicClientConnectionOptions(); + TimeSpan budget = handler.ConnectTimeout > TimeSpan.Zero && handler.ConnectTimeout != Timeout.InfiniteTimeSpan + ? handler.ConnectTimeout + : source.HandshakeTimeout; + return new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = remote, + LocalEndPoint = source.LocalEndPoint, + HandshakeTimeout = budget <= TimeSpan.Zero ? TimeSpan.FromSeconds(10) : budget, + KeepAliveInterval = source.KeepAliveInterval, + IdleTimeout = source.IdleTimeout, + MaxInboundBidirectionalStreams = source.MaxInboundBidirectionalStreams, + MaxInboundUnidirectionalStreams = source.MaxInboundUnidirectionalStreams, + DefaultStreamErrorCode = source.DefaultStreamErrorCode, + AllowManagedStackUnderFips = handler.AllowManagedStackUnderFips || source.AllowManagedStackUnderFips, + ClientAuthenticationOptions = CopySsl(handler.SslOptions, uri.IdnHost), + }; + } + + private static SslClientAuthenticationOptions CopySsl(SslClientAuthenticationOptions source, string host) + { + string target = string.IsNullOrEmpty(source.TargetHost) ? host : source.TargetHost; + return new SslClientAuthenticationOptions + { + TargetHost = target, + ClientCertificates = source.ClientCertificates, + CertificateRevocationCheckMode = source.CertificateRevocationCheckMode, + CertificateChainPolicy = source.CertificateChainPolicy, + EncryptionPolicy = source.EncryptionPolicy, + EnabledSslProtocols = source.EnabledSslProtocols, + RemoteCertificateValidationCallback = source.RemoteCertificateValidationCallback, + LocalCertificateSelectionCallback = source.LocalCertificateSelectionCallback, + ClientCertificateContext = source.ClientCertificateContext, + CipherSuitesPolicy = source.CipherSuitesPolicy, + ApplicationProtocols = new List { H3 }, + }; + } + + private static IPAddress Resolve(string host) + { + if (IPAddress.TryParse(host, out IPAddress? parsed)) + { + return parsed; + } + + IPAddress[] addresses = Dns.GetHostAddresses(host); + for (int i = 0; i < addresses.Length; i++) + { + if (addresses[i].AddressFamily == AddressFamily.InterNetwork) + { + return addresses[i]; + } + } + + if (addresses.Length == 0) + { + throw new Http3ConnectException("The HTTP/3 host did not resolve.", new SocketException((int)SocketError.HostNotFound)); + } + + return addresses[0]; + } + + private static async Task WritePrefaceAsync(ManagedQuicConnection connection, CancellationToken cancellationToken) + { + await WriteStreamTypeAsync(connection, Http3StreamType.Control, SettingsFrame(), cancellationToken).ConfigureAwait(false); + ManagedQuicStream encoder = await WriteStreamTypeAsync(connection, Http3StreamType.QpackEncoder, ReadOnlyMemory.Empty, cancellationToken).ConfigureAwait(false); + await WriteStreamTypeAsync(connection, Http3StreamType.QpackDecoder, ReadOnlyMemory.Empty, cancellationToken).ConfigureAwait(false); + return encoder; + } + + /// + /// Reads the peer's unidirectional streams. + /// A GOAWAY frame runs and that connection is not used for new requests. + /// Encoder-stream instructions fill the dynamic table, which is capped at . + /// The first insert runs . + /// + internal static async Task WatchPeerStreamsAsync( + ManagedQuicConnection connection, + QpackContext qpack, + Func onGoAway, + Func onInsert, + Func onSettings, + CancellationToken cancellationToken) + { + _ = GuardAsync(WatchInsertsAsync(qpack, onInsert, cancellationToken)); + try + { + for (int attempt = 0; attempt < 4; attempt++) + { + ManagedQuicStream stream = await connection.AcceptInboundUnidirectionalStreamAsync(cancellationToken).ConfigureAwait(false); + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + if (type == Http3StreamType.Control) + { + _ = GuardAsync(ReadControlAsync(stream, qpack, onGoAway, onSettings, cancellationToken)); + } + else if (type == Http3StreamType.QpackEncoder) + { + _ = GuardAsync(QpackEncoderStreamReader.ProcessAsync(stream, qpack, cancellationToken)); + } + } + } + catch (OperationCanceledException) + { + } + catch (QuicException) + { + } + catch (ObjectDisposedException) + { + } + catch (IOException) + { + } + } + + private static async Task WatchInsertsAsync(QpackContext qpack, Func onInsert, CancellationToken cancellationToken) + { + await qpack.AwaitInsertCountAsync(1, cancellationToken).ConfigureAwait(false); + await onInsert().ConfigureAwait(false); + } + + private static async Task ReadControlAsync( + ManagedQuicStream stream, + QpackContext qpack, + Func onGoAway, + Func onSettings, + CancellationToken cancellationToken) + { + while (await ReadFrameAsync(stream, cancellationToken).ConfigureAwait(false) is Frame frame) + { + if (frame.Type == Http3FrameType.Settings) + { + Http3Settings settings = Http3Settings.Parse(frame.Payload); + qpack.MaxTableCapacityFromPeer = settings.QpackMaxTableCapacity; + qpack.BlockedStreamsFromPeer = settings.QpackBlockedStreams; + if (settings.QpackMaxTableCapacity == 0) + { + qpack.DisableOutboundTable(); + } + + await onSettings().ConfigureAwait(false); + continue; + } + + if (frame.Type == Http3FrameType.GoAway) + { + await onGoAway().ConfigureAwait(false); + } + } + } + + private static async Task GuardAsync(Task work) + { + try + { + await work.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + } + catch (QuicException) + { + } + catch (ObjectDisposedException) + { + } + catch (IOException) + { + } + catch (Http3ConnectionException) + { + } + } + + private static ReadOnlyMemory SettingsFrame() + { + Http3Settings settings = new(); + settings.SetQpackMaxTableCapacity(TableCapacity); + byte[] payload = settings.Serialize(); + byte[] frame = new byte[payload.Length + 16]; + int written = Http3FrameCodec.Write(frame, Http3FrameType.Settings, payload); + return frame.AsMemory(0, written); + } + + private static async Task WriteStreamTypeAsync( + ManagedQuicConnection connection, + ulong streamType, + ReadOnlyMemory rest, + CancellationToken cancellationToken) + { + ManagedQuicStream stream = await connection.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancellationToken).ConfigureAwait(false); + byte[] prefix = new byte[8]; + int length = Http3VarInt.Write(prefix, streamType); + await stream.WriteAsync(prefix.AsMemory(0, length), cancellationToken).ConfigureAwait(false); + if (!rest.IsEmpty) + { + await stream.WriteAsync(rest, cancellationToken).ConfigureAwait(false); + } + + return stream; + } + + private static async Task WriteRequestAsync( + ManagedQuicStream stream, + HttpRequestMessage request, + Uri uri, + QpackContext qpack, + ManagedQuicStream encoder, + CancellationToken cancellationToken) + { + var fields = new List<(string Name, string Value)> + { + (":method", request.Method.Method), + (":scheme", uri.Scheme), + (":authority", Authority(uri)), + (":path", uri.PathAndQuery.Length == 0 ? "/" : uri.PathAndQuery), + }; + AddHeaders(fields, request.Headers); + if (request.Content is not null) + { + AddHeaders(fields, request.Content.Headers); + } + + byte[] block = await EncodeRequestAsync(fields, qpack, encoder, cancellationToken).ConfigureAwait(false); + await WriteFrameAsync(stream, Http3FrameType.Headers, block, cancellationToken).ConfigureAwait(false); + if (request.Content is null) + { + return; + } + + using var buffered = new MemoryStream(); + await request.Content.CopyToAsync(buffered, cancellationToken).ConfigureAwait(false); + if (buffered.Length == 0) + { + return; + } + + byte[] chunk = new byte[Http3FrameCodec.RelayUnitBytes]; + int offset = 0; + int remaining = (int)buffered.Length; + while (remaining > 0) + { + int count = Math.Min(chunk.Length, remaining); + buffered.GetBuffer().AsSpan(offset, count).CopyTo(chunk); + await WriteFrameAsync(stream, Http3FrameType.Data, chunk.AsMemory(0, count), cancellationToken).ConfigureAwait(false); + offset += count; + remaining -= count; + } + } + + private static async Task ReadResponseAsync( + ManagedQuicStream stream, + Func release, + QpackContext qpack, + CancellationToken cancellationToken) + { + var response = new HttpResponseMessage(); + while (await ReadFrameAsync(stream, cancellationToken).ConfigureAwait(false) is Frame frame) + { + if (frame.Type == Http3FrameType.Data) + { + throw new HttpRequestException("The HTTP/3 response sent a body before headers."); + } + + if (frame.Type != Http3FrameType.Headers) + { + continue; + } + + List<(string Name, string Value)> fields = QpackDecoder.Decode(frame.Payload, qpack, cancellationToken); + response.Content = new StreamContent(new Http3ResponseBody(stream, response, release, qpack)); + foreach ((string name, string value) in fields) + { + if (string.Equals(name, ":status", StringComparison.Ordinal)) + { + response.StatusCode = (HttpStatusCode)int.Parse(value, CultureInfo.InvariantCulture); + } + } + + AddFields(response.Headers, response.Content.Headers, fields); + return response; + } + + throw new HttpRequestException("The HTTP/3 response had no headers."); + } + + private static void AddFields(HttpHeaders target, HttpHeaders? contentHeaders, List<(string Name, string Value)> fields) + { + foreach ((string name, string value) in fields) + { + if (name.Length == 0 || name[0] == ':') + { + continue; + } + + if (!target.TryAddWithoutValidation(name, value) && contentHeaders is not null) + { + contentHeaders.TryAddWithoutValidation(name, value); + } + } + } + + private static async Task ReadFrameAsync(Stream stream, CancellationToken cancellationToken) + { + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + if (type is null) + { + return null; + } + + ulong? length = await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + if (length is null || length.Value > (ulong)Http3FrameCodec.DefaultMaxPayloadBytes) + { + throw new HttpRequestException("The HTTP/3 frame ended early."); + } + + byte[] payload = new byte[(int)length.Value]; + int read = 0; + while (read < payload.Length) + { + int count = await stream.ReadAsync(payload.AsMemory(read), cancellationToken).ConfigureAwait(false); + if (count == 0) + { + throw new HttpRequestException("The HTTP/3 frame ended early."); + } + + read += count; + } + + return new Frame(type.Value, payload); + } + + private static Task WriteFrameAsync(Stream stream, ulong type, ReadOnlyMemory payload, CancellationToken cancellationToken) + { + byte[] frame = new byte[payload.Length + 16]; + int written = Http3FrameCodec.Write(frame, type, payload.Span); + return stream.WriteAsync(frame.AsMemory(0, written), cancellationToken).AsTask(); + } + + private static async Task EncodeRequestAsync( + List<(string Name, string Value)> fields, + QpackContext qpack, + ManagedQuicStream encoder, + CancellationToken cancellationToken) + { + if (qpack.OutboundTableDisabled || qpack.MaxTableCapacityFromPeer == 0 || qpack.BlockedStreamsFromPeer == 0) + { + return QpackEncoder.Encode(fields); + } + + await qpack.EncoderStreamWriteLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + if (qpack.ReferencingStreams >= qpack.BlockedStreamsFromPeer) + { + return QpackEncoder.Encode(fields); + } + + uint capacity = Math.Min(qpack.MaxTableCapacityFromPeer, qpack.LocalMaxTableCapacity); + if (!qpack.OutboundCapacitySent) + { + qpack.OutboundEncoderTable.SetCapacity(capacity); + await encoder.WriteAsync(QpackEncoder.SetCapacityInstruction(capacity), cancellationToken).ConfigureAwait(false); + qpack.OutboundCapacitySent = true; + } + + foreach ((string name, string value) in fields) + { + if (QpackStaticTable.FindExact(name, value) >= 0) + { + continue; + } + + if (qpack.OutboundEncoderTable.TryFind(name, value, out _, out bool exact) && exact) + { + continue; + } + + if (name.Length + value.Length + 32 > capacity) + { + continue; + } + + await encoder.WriteAsync(QpackEncoder.InsertLiteralInstruction(name, value), cancellationToken).ConfigureAwait(false); + qpack.OutboundEncoderTable.Insert(name, value); + } + + byte[] block = QpackEncoder.Encode(fields, qpack); + if (block.Length > 0 && block[0] != 0) + { + qpack.ReferencingStreams++; + } + + return block; + } + finally + { + qpack.EncoderStreamWriteLock.Release(); + } + } + + private static void AddHeaders(List<(string Name, string Value)> fields, HttpHeaders headers) + { + foreach (KeyValuePair> header in headers) + { + if (IsConnectionHeader(header.Key)) + { + continue; + } + + foreach (string value in header.Value) + { + fields.Add((header.Key.ToLowerInvariant(), value)); + } + } + } + + private static bool IsConnectionHeader(string name) => + name.Equals("Host", StringComparison.OrdinalIgnoreCase) + || name.Equals("Connection", StringComparison.OrdinalIgnoreCase) + || name.Equals("Transfer-Encoding", StringComparison.OrdinalIgnoreCase) + || name.Equals("Upgrade", StringComparison.OrdinalIgnoreCase) + || name.Equals("Keep-Alive", StringComparison.OrdinalIgnoreCase) + || name.Equals("Proxy-Connection", StringComparison.OrdinalIgnoreCase); + + private readonly struct Frame + { + internal Frame(ulong type, byte[] payload) + { + Type = type; + Payload = payload; + } + + internal ulong Type { get; } + + internal byte[] Payload { get; } + } + + private sealed class Http3ResponseBody : Stream + { + private readonly ManagedQuicStream _stream; + private readonly HttpResponseMessage _response; + private readonly Func _release; + private readonly QpackContext _qpack; + private byte[]? _pending; + private int _offset; + private int _finished; + + internal Http3ResponseBody(ManagedQuicStream stream, HttpResponseMessage response, Func release, QpackContext qpack) + { + _stream = stream; + _response = response; + _release = release; + _qpack = qpack; + } + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => false; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) => + ReadAsync(buffer.AsMemory(offset, count), CancellationToken.None).AsTask().GetAwaiter().GetResult(); + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); + + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + + public override async ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + while (true) + { + if (_pending is not null && _offset < _pending.Length) + { + int count = Math.Min(buffer.Length, _pending.Length - _offset); + _pending.AsSpan(_offset, count).CopyTo(buffer.Span); + _offset += count; + return count; + } + + if (_finished != 0) + { + return 0; + } + + Frame? frame = await ReadFrameAsync(_stream, cancellationToken).ConfigureAwait(false); + if (frame is null) + { + await FinishAsync().ConfigureAwait(false); + return 0; + } + + if (frame.Value.Type == Http3FrameType.Headers) + { + AddFields(_response.TrailingHeaders, null, QpackDecoder.Decode(frame.Value.Payload, _qpack, cancellationToken)); + continue; + } + + if (frame.Value.Type == Http3FrameType.Data && frame.Value.Payload.Length > 0) + { + _pending = frame.Value.Payload; + _offset = 0; + } + } + } + + protected override void Dispose(bool disposing) + { + if (disposing) + { + FinishAsync().GetAwaiter().GetResult(); + } + + base.Dispose(disposing); + } + + private Task FinishAsync() + { + if (Interlocked.Exchange(ref _finished, 1) != 0) + { + return Task.CompletedTask; + } + + return _release(); + } + } +} + +/// An HTTP/3 connect failed before a request byte was written. +internal sealed class Http3ConnectException : HttpRequestException +{ + internal Http3ConnectException(string message, Exception innerException) + : base(message, innerException) + { + } +} diff --git a/src/Titanium.Net.Http/Http3Pool.cs b/src/Titanium.Net.Http/Http3Pool.cs new file mode 100644 index 000000000..4b4702b10 --- /dev/null +++ b/src/Titanium.Net.Http/Http3Pool.cs @@ -0,0 +1,464 @@ +#pragma warning disable CA1416 // QuicException is the BCL name. This pool does not start the platform QUIC stack. +using System; +using System.Collections.Generic; +using System.Net.Quic; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Http3; +using Titanium.Quic; + +namespace Titanium.Net.Http; + +/// +/// Keeps one HTTP/3 connection per authority. +/// A connection accepts 16 request streams, which is the stream limit this stack advertises. +/// The next request opens another connection, up to . +/// A GOAWAY on the peer's control stream stops new requests on that connection and closes it once nothing is in flight. +/// The dynamic table is capped at bytes. +/// +internal sealed class Http3Pool : IDisposable +{ + internal const int StreamCap = 16; + + private readonly SemaphoreSlim _gate = new(1, 1); + private readonly Dictionary> _byAuthority = new(StringComparer.Ordinal); + private readonly TaskCompletionSource _goAway = new(TaskCreationOptions.RunContinuationsAsynchronously); + private readonly TaskCompletionSource _insert = new(TaskCreationOptions.RunContinuationsAsynchronously); + private readonly TaskCompletionSource _settings = new(TaskCreationOptions.RunContinuationsAsynchronously); + private bool _disposed; + + /// Completes when a peer GOAWAY has been read. + internal Task GoAwayObserved => _goAway.Task; + + /// Completes when the peer's encoder stream has inserted one dynamic-table entry. + internal Task EncoderInsertObserved => _insert.Task; + + /// Completes when the peer's first SETTINGS frame has been read. + internal Task PeerSettingsObserved => _settings.Task; + + /// The number of connections still held for any authority. + internal int ConnectionCount + { + get + { + _gate.Wait(); + try + { + int count = 0; + foreach (List list in _byAuthority.Values) + { + count += list.Count; + } + + return count; + } + finally + { + _gate.Release(); + } + } + } + + internal async Task SendAsync( + TitaniumHttpHandler handler, + HttpRequestMessage request, + Uri uri, + int port, + CancellationToken cancellationToken) + { + string authority = uri.IdnHost + ":" + port.ToString(System.Globalization.CultureInfo.InvariantCulture); + int retries = 0; + while (true) + { + cancellationToken.ThrowIfCancellationRequested(); + Entry entry = await RentAsync(handler, uri, authority, port, cancellationToken).ConfigureAwait(false); + Flight flight = new(); + try + { + return await Http3Client.ExchangeAsync( + entry.Connection, + request, + uri, + () => ReleaseAsync(entry, flight), + entry.Qpack, + entry.Encoder, + cancellationToken).ConfigureAwait(false); + } + catch (QuicException ex) when (IsStreamLimit(ex) && retries++ < 1) + { + await RetireAsync(entry).ConfigureAwait(false); + await ReleaseAsync(entry, flight).ConfigureAwait(false); + } + catch + { + await RetireAsync(entry).ConfigureAwait(false); + await ReleaseAsync(entry, flight).ConfigureAwait(false); + throw; + } + } + } + + public void Dispose() + { + List entries = new(); + _gate.Wait(); + try + { + _disposed = true; + foreach (List list in _byAuthority.Values) + { + foreach (Entry entry in list) + { + entry.Retired = true; + if (entry.TryMarkDisposed()) + { + entries.Add(entry); + } + } + } + + _byAuthority.Clear(); + } + finally + { + _gate.Release(); + } + + foreach (Entry entry in entries) + { + entry.Connection.DisposeAsync().AsTask().GetAwaiter().GetResult(); + entry.DisposeQpack(); + } + + _gate.Dispose(); + } + + private async Task RentAsync( + TitaniumHttpHandler handler, + Uri uri, + string authority, + int port, + CancellationToken cancellationToken) + { + while (true) + { + await _gate.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + ObjectDisposedException.ThrowIf(_disposed, typeof(TitaniumHttpHandler)); + + DropExpired(handler, authority); + Entry? entry = Find(authority); + if (entry is null) + { + if (!MakeRoom(handler, authority)) + { + // Every connection for this authority is at the stream cap and still busy. + } + else + { + entry = await OpenAsync(handler, uri, authority, port, cancellationToken).ConfigureAwait(false); + } + } + + if (entry is not null) + { + entry.StreamsOpened++; + entry.InFlight++; + entry.LastUsed = DateTimeOffset.UtcNow; + return entry; + } + } + finally + { + _gate.Release(); + } + + await Task.Delay(10, cancellationToken).ConfigureAwait(false); + } + } + + private async Task OpenAsync( + TitaniumHttpHandler handler, + Uri uri, + string authority, + int port, + CancellationToken cancellationToken) + { + (ManagedQuicConnection connection, ManagedQuicStream encoder) = await Http3Client.ConnectAsync(handler, uri, port, cancellationToken).ConfigureAwait(false); + Entry entry = new(connection, encoder, new QpackContext(Http3Client.TableCapacity)); + if (!_byAuthority.TryGetValue(authority, out List? list)) + { + list = new List(); + _byAuthority.Add(authority, list); + } + + list.Add(entry); + _ = Http3Client.WatchPeerStreamsAsync( + connection, + entry.Qpack, + () => NoteGoAwayAsync(entry), + NoteInsertAsync, + NoteSettingsAsync, + entry.Lifetime.Token); + return entry; + } + + private Task NoteInsertAsync() + { + _insert.TrySetResult(); + return Task.CompletedTask; + } + + private Task NoteSettingsAsync() + { + _settings.TrySetResult(); + return Task.CompletedTask; + } + + private async Task NoteGoAwayAsync(Entry entry) + { + bool dispose = false; + await _gate.WaitAsync().ConfigureAwait(false); + try + { + entry.Retired = true; + dispose = entry.InFlight == 0 && entry.TryMarkDisposed(); + if (dispose) + { + Remove(entry); + } + + _goAway.TrySetResult(); + } + finally + { + _gate.Release(); + } + + if (dispose) + { + await entry.Connection.DisposeAsync().ConfigureAwait(false); + entry.DisposeQpack(); + } + } + + private bool MakeRoom(TitaniumHttpHandler handler, string authority) + { + if (!_byAuthority.TryGetValue(authority, out List? list)) + { + return true; + } + + int live = 0; + Entry? victim = null; + foreach (Entry entry in list) + { + if (entry.Retired) + { + continue; + } + + live++; + if (entry.InFlight == 0 && (victim is null || entry.StreamsOpened > victim.StreamsOpened)) + { + victim = entry; + } + } + + int max = handler.MaxConnectionsPerServer < 1 ? 1 : handler.MaxConnectionsPerServer; + if (live < max) + { + return true; + } + + if (victim is null) + { + return false; + } + + victim.Retired = true; + if (victim.TryMarkDisposed()) + { + list.Remove(victim); + victim.Connection.DisposeAsync().AsTask().GetAwaiter().GetResult(); + victim.DisposeQpack(); + } + + return true; + } + + private void DropExpired(TitaniumHttpHandler handler, string authority) + { + if (!_byAuthority.TryGetValue(authority, out List? list)) + { + return; + } + + DateTimeOffset now = DateTimeOffset.UtcNow; + for (int i = list.Count - 1; i >= 0; i--) + { + Entry entry = list[i]; + if (entry.Retired) + { + continue; + } + + bool lifeEnded = Expired(handler.PooledConnectionLifetime, now - entry.Created); + bool idle = entry.InFlight == 0 && Expired(handler.PooledConnectionIdleTimeout, now - entry.LastUsed); + if (!lifeEnded && !idle) + { + continue; + } + + entry.Retired = true; + if (entry.InFlight == 0 && entry.TryMarkDisposed()) + { + list.RemoveAt(i); + entry.Connection.DisposeAsync().AsTask().GetAwaiter().GetResult(); + entry.DisposeQpack(); + } + } + } + + private static bool Expired(TimeSpan limit, TimeSpan age) => + limit > TimeSpan.Zero && limit != Timeout.InfiniteTimeSpan && age >= limit; + + private Entry? Find(string authority) + { + if (!_byAuthority.TryGetValue(authority, out List? list)) + { + return null; + } + + foreach (Entry entry in list) + { + if (!entry.Retired && entry.StreamsOpened < StreamCap && entry.InFlight < StreamCap) + { + return entry; + } + } + + return null; + } + + private async Task RetireAsync(Entry entry) + { + await _gate.WaitAsync().ConfigureAwait(false); + try + { + entry.Retired = true; + } + finally + { + _gate.Release(); + } + } + + private async Task ReleaseAsync(Entry entry, Flight flight) + { + if (!flight.TryClaim()) + { + return; + } + + bool dispose = false; + await _gate.WaitAsync().ConfigureAwait(false); + try + { + entry.InFlight--; + dispose = entry.Retired && entry.InFlight == 0 && entry.TryMarkDisposed(); + if (dispose) + { + Remove(entry); + } + } + finally + { + _gate.Release(); + } + + if (dispose) + { + await entry.Connection.DisposeAsync().ConfigureAwait(false); + entry.DisposeQpack(); + } + } + + private void Remove(Entry entry) + { + foreach (List list in _byAuthority.Values) + { + if (list.Remove(entry)) + { + return; + } + } + } + + private static bool IsStreamLimit(QuicException exception) => + string.Equals(exception.Message, "The peer's stream limit is exhausted.", StringComparison.Ordinal); + + private sealed class Flight + { + private int _released; + + internal bool TryClaim() => Interlocked.Exchange(ref _released, 1) == 0; + } + + private sealed class Entry + { + private int _disposed; + private int _qpackDisposed; + + internal Entry(ManagedQuicConnection connection, ManagedQuicStream encoder, QpackContext qpack) + { + Connection = connection; + Encoder = encoder; + Qpack = qpack; + Created = DateTimeOffset.UtcNow; + LastUsed = Created; + } + + internal ManagedQuicConnection Connection { get; } + + internal ManagedQuicStream Encoder { get; } + + internal QpackContext Qpack { get; } + + internal CancellationTokenSource Lifetime { get; } = new(); + + internal int StreamsOpened { get; set; } + + internal int InFlight { get; set; } + + internal DateTimeOffset Created { get; } + + internal DateTimeOffset LastUsed { get; set; } + + internal bool Retired { get; set; } + + internal bool TryMarkDisposed() + { + if (Interlocked.Exchange(ref _disposed, 1) != 0) + { + return false; + } + + Lifetime.Cancel(); + return true; + } + + internal void DisposeQpack() + { + if (Interlocked.Exchange(ref _qpackDisposed, 1) != 0) + { + return; + } + + Lifetime.Cancel(); + Qpack.DisposeAsync().AsTask().GetAwaiter().GetResult(); + } + } +} diff --git a/src/Titanium.Net.Http/LICENSE b/src/Titanium.Net.Http/LICENSE new file mode 100644 index 000000000..786bcaca4 --- /dev/null +++ b/src/Titanium.Net.Http/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/src/Titanium.Net.Http/PublicAPI.Shipped.txt b/src/Titanium.Net.Http/PublicAPI.Shipped.txt new file mode 100644 index 000000000..7dc5c5811 --- /dev/null +++ b/src/Titanium.Net.Http/PublicAPI.Shipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Titanium.Net.Http/PublicAPI.Unshipped.txt b/src/Titanium.Net.Http/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..876d80c99 --- /dev/null +++ b/src/Titanium.Net.Http/PublicAPI.Unshipped.txt @@ -0,0 +1,35 @@ +#nullable enable +Titanium.Net.Http.TitaniumHttpHandler +Titanium.Net.Http.TitaniumHttpHandler.AllowAutoRedirect.get -> bool +Titanium.Net.Http.TitaniumHttpHandler.AllowAutoRedirect.set -> void +Titanium.Net.Http.TitaniumHttpHandler.AllowManagedStackUnderFips.get -> bool +Titanium.Net.Http.TitaniumHttpHandler.AllowManagedStackUnderFips.set -> void +Titanium.Net.Http.TitaniumHttpHandler.AutomaticDecompression.get -> System.Net.DecompressionMethods +Titanium.Net.Http.TitaniumHttpHandler.AutomaticDecompression.set -> void +Titanium.Net.Http.TitaniumHttpHandler.ConnectTimeout.get -> System.TimeSpan +Titanium.Net.Http.TitaniumHttpHandler.ConnectTimeout.set -> void +Titanium.Net.Http.TitaniumHttpHandler.CookieContainer.get -> System.Net.CookieContainer? +Titanium.Net.Http.TitaniumHttpHandler.CookieContainer.set -> void +Titanium.Net.Http.TitaniumHttpHandler.EnableAltSvc.get -> bool +Titanium.Net.Http.TitaniumHttpHandler.EnableAltSvc.set -> void +Titanium.Net.Http.TitaniumHttpHandler.FingerprintProfile.get -> Titanium.Tls.TlsFingerprintProfile? +Titanium.Net.Http.TitaniumHttpHandler.FingerprintProfile.set -> void +Titanium.Net.Http.TitaniumHttpHandler.MaxAutomaticRedirections.get -> int +Titanium.Net.Http.TitaniumHttpHandler.MaxAutomaticRedirections.set -> void +Titanium.Net.Http.TitaniumHttpHandler.MaxConnectionsPerServer.get -> int +Titanium.Net.Http.TitaniumHttpHandler.MaxConnectionsPerServer.set -> void +Titanium.Net.Http.TitaniumHttpHandler.PooledConnectionIdleTimeout.get -> System.TimeSpan +Titanium.Net.Http.TitaniumHttpHandler.PooledConnectionIdleTimeout.set -> void +Titanium.Net.Http.TitaniumHttpHandler.PooledConnectionLifetime.get -> System.TimeSpan +Titanium.Net.Http.TitaniumHttpHandler.PooledConnectionLifetime.set -> void +Titanium.Net.Http.TitaniumHttpHandler.Proxy.get -> System.Net.IWebProxy? +Titanium.Net.Http.TitaniumHttpHandler.Proxy.set -> void +Titanium.Net.Http.TitaniumHttpHandler.QuicOptions.get -> Titanium.Quic.ManagedQuicClientConnectionOptions? +Titanium.Net.Http.TitaniumHttpHandler.QuicOptions.set -> void +Titanium.Net.Http.TitaniumHttpHandler.SslOptions.get -> System.Net.Security.SslClientAuthenticationOptions! +Titanium.Net.Http.TitaniumHttpHandler.SslOptions.set -> void +Titanium.Net.Http.TitaniumHttpHandler.TitaniumHttpHandler() -> void +Titanium.Net.Http.TitaniumHttpHandler.UseCookies.get -> bool +Titanium.Net.Http.TitaniumHttpHandler.UseCookies.set -> void +Titanium.Net.Http.TitaniumHttpHandler.UseProxy.get -> bool +Titanium.Net.Http.TitaniumHttpHandler.UseProxy.set -> void diff --git a/src/Titanium.Net.Http/README.md b/src/Titanium.Net.Http/README.md new file mode 100644 index 000000000..83176cc89 --- /dev/null +++ b/src/Titanium.Net.Http/README.md @@ -0,0 +1,23 @@ +# Titanium.Net.Http + +An HTTP client handler that always uses the managed TLS stack. + +HTTP/1.1 and HTTP/2 go through an inner handler. Its connect callback opens the TCP socket and authenticates a `TlsStream`. The handler rewrites `https` to `http` and keeps port 443 so the inner handler does not open its own TLS stream. A caller http URI is sent as cleartext, including when it asks for version 3. A redirect is followed here, including an HTTP/3 response, and each hop is rewritten the same way, so an https Location stays on the managed stream. AllowAutoRedirect false returns that response. MaxAutomaticRedirections stops a longer chain, including an HTTP/3 chain. Authorization is dropped when the host changes, including on HTTP/3. The same host keeps it. A 300 or 302 turns POST into GET, including on HTTP/3. An HTTP/3 redirect to an http URL is fetched as HTTP/1.1. A later https hop returns to HTTP/3. Cancelling the request stops an HTTP/3 redirect while the next hop is waiting. A 303 turns POST into GET and leaves HEAD as HEAD, including on HTTP/3. A 307 keeps the method and body, and an HTTP/3 hop sends that body again. A cleartext hop sends it again too. A 301 turns POST into GET, including on HTTP/3. A 308 keeps the method and body, and an HTTP/3 hop sends that body again. A Cookie header is copied onto an HTTP/3 hop only when UseCookies is false. Cookies and decompression stay on the inner handler. A cleartext hop from HTTP/3 still decompresses gzip and sends a cookie stored for that http URI. A Set-Cookie on that hop is stored for the next request. `Host` stays the original host. An HTTP/3 redirect does not send a caller Host, and the next hop's `:authority` is the URI authority. The response's request is the caller's request, with the `https` URI. + +The inner handler sends `:scheme http` on HTTP/2. There is no hook to change that. A `400` or `421` on a GET, HEAD, OPTIONS, or TRACE is retried once over HTTP/1.1 when the request allows a lower version. An exact HTTP/2 request that the server resets does not fall back to HTTP/1.1. A POST that allows a lower version is not retried after that reset. A server that selects HTTP/1.1 during ALPN is retried over HTTP/1.1 before any request bytes, for any method, when a lower version is allowed. A POST body is sent on that retry. An exact HTTP/2 request is not retried when ALPN selects HTTP/1.1. A request that starts at HTTP/1.1 and allows a higher version is retried, and the next request reuses that connection. Another port is remembered on its own and still tries a higher version. A certificate in SslOptions.ClientCertificates is presented when the server asks for one. LocalCertificateSelectionCallback chooses which certificate is presented. A certificate without a private key is skipped. SslOptions.TargetHost is the name sent on the handshake, including HTTP/3. The connection still goes to the URI host. QuicOptions.LocalEndPoint is the local UDP address of an HTTP/3 connection. When ConnectTimeout is infinite, QuicOptions.HandshakeTimeout stops a silent HTTP/3 handshake. EnabledSslProtocols that omit TLS 1.3 fail the request before it is sent. An empty SslOptions.TargetHost sends the URI host on an HTTP/3 handshake and on an HTTP/1.1 handshake. Assigning null to SslOptions is rejected. AutomaticDecompression gzip decodes an HTTPS HTTP/1.1 response. An HTTP/3 response with Content-Encoding gzip stays compressed. A direct HTTP/3 request leaves CookieContainer unchanged. An HTTPS HTTP/1.1 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off the request, and Set-Cookie stays out of the container. A Cookie header on a direct HTTP/3 request is sent. A direct HTTP/3 request sends Authorization. An HTTPS HTTP/1.1 request sends Authorization. An HTTPS HTTP/1.1 request sends a caller Host. A direct HTTP/3 request uses the URI as :authority and leaves a caller Host off the request. A caller header is sent on HTTP/3. An HTTP/3 request sends every value of a repeated header. An HTTPS HTTP/1.1 request sends every value of a repeated header. Connection, Upgrade, Keep-Alive, Proxy-Connection, and Transfer-Encoding are left off. An HTTPS HTTP/1.1 request sends a caller header. An HTTP/3 POST sends Content-Type with the body. An HTTPS HTTP/1.1 POST sends Content-Type with the body. An empty HTTP/3 POST sends no DATA frame. An HTTP/3 request keeps the query on :path. An HTTPS HTTP/1.1 request keeps the query. + +HTTP/3 opens a managed QUIC connection and reuses it for the same authority until 16 request streams, the idle timeout, or the connection lifetime. A further request opens another connection, up to `MaxConnectionsPerServer`. A GOAWAY on the peer's control stream stops new requests on that connection and closes it once nothing is in flight. The dynamic table is capped at 4096 bytes. A request inserts a field that is not in the static table when the peer allows a dynamic table and at least one blocked stream. A peer insert is decoded. The call returns after the response headers, and the body is read as the caller reads it. Cancelling that read stops it while it is waiting for the next frame. Cancelling an HTTP/1.1 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/1.1 request stops it while the status line is still waiting. An HTTP/1.1 connection is reused until `PooledConnectionLifetime` elapses. The next request opens another connection. While that connection is busy, `MaxConnectionsPerServer` of 1 keeps the next HTTP/1.1 request waiting. An http request is sent to the configured proxy. The request line is the absolute URI. UseProxy false sends an http request to the origin even when a proxy is set. The request line is the origin path. Changing MaxConnectionsPerServer after the first request throws. An https request opens a CONNECT tunnel to that proxy, then the managed TLS handshake. A proxy that refuses the CONNECT tunnel fails the request before the TLS handshake. A HEADERS frame after the body is applied to the response trailers while that read runs. A DATA frame before those headers fails the request. A truncated HTTP/3 frame fails the request. An unknown HTTP/3 frame before the response headers is skipped. An unknown HTTP/3 frame while the body is read is skipped. An empty DATA frame while the body is read is skipped. An HTTP/3 response with no headers fails the request. An HTTP/3 response Content-Type is available on the response content headers. An HTTP/3 response Content-Length is available on the response content headers. An HTTP/3 response keeps every value of a repeated header. An HTTP/3 404 is returned with its body. An HTTPS HTTP/1.1 404 is returned with its body. A direct HTTP/3 HEAD sends :method HEAD and returns an empty body. An HTTPS HTTP/1.1 HEAD sends the method and returns an empty body. An HTTP/3 204 is returned with an empty body. An HTTPS HTTP/1.1 204 is returned with an empty body. An HTTP/3 request to a host that does not resolve fails before a connection is opened. A completed HTTP/2 400 is retried once over HTTP/1.1 when the request allows a lower version. A completed HTTP/2 421 is retried once over HTTP/1.1 when the request allows a lower version. An exact HTTP/2 request returns a completed 400 and does not open another connection. An HTTP/2 POST returns a completed 400 and does not open another connection. An HTTP/2 HEAD that receives a completed 400 is retried once over HTTP/1.1, and the retry stays HEAD. An HTTP/2 OPTIONS that receives a completed 400 is retried once over HTTP/1.1, and the retry stays OPTIONS. An HTTP/2 TRACE that receives a completed 400 is retried once over HTTP/1.1, and the retry stays TRACE. After an HTTP/2 400 is retried, the next request to that authority uses HTTP/1.1. An exact HTTP/2 request still tries HTTP/2 after that and returns the 400. An HTTP/2 500 is returned and does not open another connection. An HTTP/2 200 returns its DATA frame as the response body. An HTTP/2 response header is available on the response. An HTTP/2 POST body is returned in the response. An HTTP/2 response Content-Type is available on the response content headers. An HTTP/2 response Content-Length is available on the response content headers. An HTTP/2 response keeps every value of a repeated header. An HTTP/2 trailer is available on the response trailing headers. An HTTP/2 302 is followed, and the next hop stays on HTTP/2. An HTTP/2 303 turns POST into GET. An HTTP/2 303 leaves HEAD as HEAD. An HTTP/2 307 keeps POST and sends the body again. An HTTP/2 redirect drops Authorization when the host changes, and the same host keeps it. An HTTP/2 redirect copies a Cookie header only when UseCookies is false. An HTTP/2 redirect leaves a caller Host off, and the next hop's :authority is the URI authority. AllowAutoRedirect false returns an HTTP/2 redirect. MaxAutomaticRedirections stops a longer HTTP/2 chain. An HTTP/2 request keeps the query on :path. An HTTP/2 request sends a caller header. Connection, Upgrade, and Proxy-Connection stay off, and Keep-Alive is sent. An HTTP/2 request joins every value of a repeated header into one comma-separated value. An HTTP/2 POST sends Content-Type with the body. An empty HTTP/2 POST sends an empty DATA frame. An HTTP/2 request leaves Transfer-Encoding off. An HTTP/2 request reuses the connection for the same authority. PooledConnectionLifetime opens another HTTP/2 connection after it expires. A short PooledConnectionIdleTimeout still reuses an HTTP/2 connection. MaxConnectionsPerServer of one carries two in-flight HTTP/2 requests on that connection. AutomaticDecompression gzip returns the decoded HTTP/2 body. A GOAWAY opens another HTTP/2 connection for the next request. An HTTP/2 request presents the client certificate. SslOptions.TargetHost is the server name on an HTTP/2 handshake. An empty SslOptions.TargetHost sends the URI host on an HTTP/2 handshake. A caller Host on a direct HTTP/2 request becomes `:authority` and the host field stays off. The certificate selection callback chooses the HTTP/2 client certificate. An HTTP/2 client certificate without a private key is skipped. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off an HTTP/2 request, and Set-Cookie stays out of the container. Cancelling an HTTP/2 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/2 request stops it while the response headers are still waiting. EnabledSslProtocols that omit TLS 1.3 fail an HTTP/2 request before it is sent. ConnectTimeout stops an HTTP/2 request while the TCP peer stays silent. An exact HTTPS HTTP/2 request with a proxy set fails before a connection is opened. UseProxy false sends that HTTP/2 request to the origin. An HTTP/2 request that allows a lower version still fails before a connection when a proxy is set. An exact HTTPS HTTP/3 request with a proxy set still reaches the origin. An HTTP/1.1 request that allows a higher version still fails before a connection when a proxy is set. A proxy that closes before the CONNECT response fails the request before the TLS handshake. A proxy whose CONNECT response fills the header buffer fails the request before the TLS handshake. Credentials on the proxy are left off the CONNECT request. Credentials on the proxy are left off a cleartext request. The request line stays the absolute URI. BypassProxyOnLocal sends an HTTPS request for a loopback origin to that origin. A bypass list entry that matches the origin sends that HTTPS request to the origin while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. When `EnableAltSvc` is set, a later request that allows a higher version uses HTTP/3 after `Alt-Svc: h3` from the same origin. If that handshake fails before a request byte, the request continues on the adapter. The cache holds 256 origins. An entry ends when its `ma` elapses. A missing `ma` lasts 24 hours. `ma=0` and `clear` drop the entry. A different host is ignored. + +`samples/HttpClientManagedStack` sends one HTTPS request as HTTP/1.1, one as HTTP/2, and one as HTTP/3: + +``` +dotnet run --project samples/HttpClientManagedStack -- https://example.com/ +``` + +HTTP/1.1 must succeed for a zero exit code. HTTP/3 is still attempted, and the program reports a failure when that server does not accept QUIC. + +## Limits + +The inner handler sends `:scheme http` on HTTP/2. A 400 or 421 on a replay-safe request is retried once over HTTP/1.1 when a lower version is allowed. HTTP/3 has no server push, no 0-RTT, and no extended CONNECT. An HTTP/3 body stays compressed when `AutomaticDecompression` is set. The client Initial offers `TLS_AES_128_GCM_SHA256`. + +The package is experimental. It is not a FIPS-validated module. While FIPS mode is on, `SendAsync` throws unless `AllowManagedStackUnderFips` is set or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. diff --git a/src/Titanium.Net.Http/StrongNameKey.snk b/src/Titanium.Net.Http/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/src/Titanium.Net.Http/StrongNameKey.snk differ diff --git a/src/Titanium.Net.Http/Titanium.Net.Http.csproj b/src/Titanium.Net.Http/Titanium.Net.Http.csproj new file mode 100644 index 000000000..c0f761315 --- /dev/null +++ b/src/Titanium.Net.Http/Titanium.Net.Http.csproj @@ -0,0 +1,31 @@ + + + + Titanium.Net.Http + HTTP client handler that uses the managed TLS stack. + Titanium.Net.Http + http;http3;tls;quic;managed + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Titanium.Net.Http/TitaniumHttpHandler.cs b/src/Titanium.Net.Http/TitaniumHttpHandler.cs new file mode 100644 index 000000000..7102000bb --- /dev/null +++ b/src/Titanium.Net.Http/TitaniumHttpHandler.cs @@ -0,0 +1,1052 @@ +using System; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Http; +using System.Net.Security; +using System.Net.Sockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Http3; +using Titanium.Quic; +using Titanium.Tls; + +namespace Titanium.Net.Http; + +/// +/// HTTP client that always uses the managed TLS stack. +/// HTTP/1.1 and HTTP/2 go through an inner handler whose connect callback owns the . +/// HTTP/3 uses a managed QUIC connection. One connection is reused per authority. +/// Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. +/// +/// +/// The inner handler sees an http URI, so it does not open its own TLS stream. A caller http URI is sent as cleartext, including when it asks for version 3. +/// A redirect is followed here, including an HTTP/3 response. AllowAutoRedirect false returns that response. Each hop is rewritten the same way, so an https Location stays on the managed stream. Authorization is dropped when the host changes, including on HTTP/3. The same host keeps it. A 300 or 302 turns POST into GET, including on HTTP/3. An HTTP/3 redirect to an http URL is fetched as HTTP/1.1. A later https hop returns to HTTP/3. Cancelling the request stops an HTTP/3 redirect while the next hop is waiting. A 303 turns POST into GET and leaves HEAD as HEAD, including on HTTP/3. A 307 keeps the method and body, and an HTTP/3 hop sends that body again. A cleartext hop sends it again too. A 301 turns POST into GET, including on HTTP/3. A 308 keeps the method and body, and an HTTP/3 hop sends that body again. +/// A Cookie header is copied onto an HTTP/3 hop only when UseCookies is false. A Cookie header on a direct HTTP/3 request is sent. A direct HTTP/3 request sends Authorization. An HTTPS HTTP/1.1 request sends Authorization. +/// Cookies and decompression stay on the inner handler. A cleartext hop from HTTP/3 still decompresses gzip and sends a cookie stored for that http URI. A Set-Cookie on that hop is stored for the next request. A direct HTTP/3 request leaves unchanged. An HTTPS HTTP/1.1 request sends a stored cookie, and a Set-Cookie on that response is stored. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. false leaves that stored cookie off the request, and Set-Cookie stays out of the container. +/// Port 443 stays on that URI when the caller used the default HTTPS port. +/// Host stays the caller's host. An HTTPS HTTP/1.1 request sends that host. An HTTP/3 redirect does not send a caller Host, and the next hop's :authority is the URI authority. A direct HTTP/3 request uses the URI as :authority and leaves a caller Host off the request. A caller header is sent on HTTP/3. An HTTP/3 request sends every value of a repeated header. An HTTPS HTTP/1.1 request sends every value of a repeated header. Connection, Upgrade, Keep-Alive, Proxy-Connection, and Transfer-Encoding are left off. An HTTPS HTTP/1.1 request sends a caller header. An HTTP/3 POST sends Content-Type with the body. An HTTPS HTTP/1.1 POST sends Content-Type with the body. An empty HTTP/3 POST sends no DATA frame. An HTTP/3 request keeps the query on :path. An HTTPS HTTP/1.1 request keeps the query. +/// The inner handler sends :scheme http on HTTP/2, and there is no hook to change it. +/// A 400 or 421 on GET, HEAD, OPTIONS, or TRACE is retried once over HTTP/1.1 when the request allows a lower version. +/// An exact HTTP/2 request that the server resets does not fall back to HTTP/1.1. +/// A POST that allows a lower version is not retried after that reset. +/// A server that selects HTTP/1.1 during ALPN is retried over HTTP/1.1 before any request bytes, for any method, when a lower version is allowed. +/// A POST body is sent on that retry. +/// An exact HTTP/2 request is not retried when ALPN selects HTTP/1.1. +/// A request that starts at HTTP/1.1 and allows a higher version is retried, and the next request reuses that connection. +/// Another port is remembered on its own and still tries a higher version. +/// The negotiated protocol is remembered per authority for ten minutes, up to 256 authorities. +/// HTTP/3 sends :scheme https. returns after the response headers. The body is read as the caller reads it. +/// A HEADERS frame after the body is applied to the response trailers while that read runs. A DATA frame before those headers fails the request. A truncated HTTP/3 frame fails the request. An unknown HTTP/3 frame before the response headers is skipped. An unknown HTTP/3 frame while the body is read is skipped. An empty DATA frame while the body is read is skipped. An HTTP/3 response with no headers fails the request. An HTTP/3 response Content-Type is available on the response content headers. An HTTP/3 response Content-Length is available on the response content headers. An HTTP/3 response keeps every value of a repeated header. An HTTP/3 404 is returned with its body. An HTTPS HTTP/1.1 404 is returned with its body. A direct HTTP/3 HEAD sends :method HEAD and returns an empty body. An HTTPS HTTP/1.1 HEAD sends the method and returns an empty body. An HTTP/3 204 is returned with an empty body. An HTTPS HTTP/1.1 204 is returned with an empty body. An HTTP/3 request to a host that does not resolve fails before a connection is opened. A completed HTTP/2 400 is retried once over HTTP/1.1 when the request allows a lower version. A completed HTTP/2 421 is retried once over HTTP/1.1 when the request allows a lower version. An exact HTTP/2 request returns a completed 400 and does not open another connection. An HTTP/2 POST returns a completed 400 and does not open another connection. An HTTP/2 HEAD that receives a completed 400 is retried once over HTTP/1.1, and the retry stays HEAD. An HTTP/2 OPTIONS that receives a completed 400 is retried once over HTTP/1.1, and the retry stays OPTIONS. An HTTP/2 TRACE that receives a completed 400 is retried once over HTTP/1.1, and the retry stays TRACE. After an HTTP/2 400 is retried, the next request to that authority uses HTTP/1.1. An exact HTTP/2 request still tries HTTP/2 after that and returns the 400. An HTTP/2 500 is returned and does not open another connection. An HTTP/2 200 returns its DATA frame as the response body. An HTTP/2 response header is available on the response. An HTTP/2 POST body is returned in the response. An HTTP/2 response Content-Type is available on the response content headers. An HTTP/2 response Content-Length is available on the response content headers. An HTTP/2 response keeps every value of a repeated header. An HTTP/2 trailer is available on the response trailing headers. An HTTP/2 302 is followed, and the next hop stays on HTTP/2. An HTTP/2 303 turns POST into GET. An HTTP/2 303 leaves HEAD as HEAD. An HTTP/2 307 keeps POST and sends the body again. An HTTP/2 redirect drops Authorization when the host changes, and the same host keeps it. An HTTP/2 redirect copies a Cookie header only when UseCookies is false. An HTTP/2 redirect leaves a caller Host off, and the next hop's :authority is the URI authority. AllowAutoRedirect false returns an HTTP/2 redirect. MaxAutomaticRedirections stops a longer HTTP/2 chain. An HTTP/2 request keeps the query on :path. An HTTP/2 request sends a caller header. Connection, Upgrade, and Proxy-Connection stay off, and Keep-Alive is sent. An HTTP/2 request joins every value of a repeated header into one comma-separated value. An HTTP/2 POST sends Content-Type with the body. An empty HTTP/2 POST sends an empty DATA frame. An HTTP/2 request leaves Transfer-Encoding off. An HTTP/2 request reuses the connection for the same authority. PooledConnectionLifetime opens another HTTP/2 connection after it expires. A short PooledConnectionIdleTimeout still reuses an HTTP/2 connection. MaxConnectionsPerServer of one carries two in-flight HTTP/2 requests on that connection. AutomaticDecompression gzip returns the decoded HTTP/2 body. A GOAWAY opens another HTTP/2 connection for the next request. An HTTP/2 request presents the client certificate. SslOptions.TargetHost is the server name on an HTTP/2 handshake. An empty SslOptions.TargetHost sends the URI host on an HTTP/2 handshake. A caller Host on a direct HTTP/2 request becomes :authority and the host field stays off. The certificate selection callback chooses the HTTP/2 client certificate. An HTTP/2 client certificate without a private key is skipped. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off an HTTP/2 request, and Set-Cookie stays out of the container. Cancelling an HTTP/2 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/2 request stops it while the response headers are still waiting. EnabledSslProtocols that omit TLS 1.3 fail an HTTP/2 request before it is sent. ConnectTimeout stops an HTTP/2 request while the TCP peer stays silent. An exact HTTPS HTTP/2 request with a proxy set fails before a connection is opened. UseProxy false sends that HTTP/2 request to the origin. An HTTP/2 request that allows a lower version still fails before a connection when a proxy is set. An exact HTTPS HTTP/3 request with a proxy set still reaches the origin. An HTTP/1.1 request that allows a higher version still fails before a connection when a proxy is set. A proxy that closes before the CONNECT response fails the request before the TLS handshake. A proxy whose CONNECT response fills the header buffer fails the request before the TLS handshake. Credentials on the proxy are left off the CONNECT request. Credentials on the proxy are left off a cleartext request. The request line stays the absolute URI. BypassProxyOnLocal sends an HTTPS request for a loopback origin to that origin. A bypass list entry that matches the origin sends that HTTPS request to the origin while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. +/// Cancelling that read stops it while it is waiting for the next frame. +/// Cancelling an HTTP/1.1 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/2 body read stops it while the rest of the body is still waiting. +/// Cancelling an HTTP/1.1 request stops it while the status line is still waiting. Cancelling an HTTP/2 request stops it while the response headers are still waiting. +/// An HTTP/1.1 connection is reused until elapses. The next request opens another connection. +/// While that connection is busy, of 1 keeps the next HTTP/1.1 request waiting. +/// An http request is sent to the configured proxy. The request line is the absolute URI. +/// false sends an http request to the origin even when a proxy is set. The request line is the origin path. Changing MaxConnectionsPerServer after the first request throws. +/// An https request opens a CONNECT tunnel to that proxy, then the managed TLS handshake. An exact HTTPS HTTP/2 request with a proxy set fails before a connection is opened. false sends that HTTP/2 request to the origin. An HTTP/2 request that allows a lower version still fails before a connection when a proxy is set. An exact HTTPS HTTP/3 request with a proxy set still reaches the origin. An HTTP/1.1 request that allows a higher version still fails before a connection when a proxy is set. +/// A proxy that refuses the CONNECT tunnel fails the request before the TLS handshake. A proxy that closes before the CONNECT response fails the request before the TLS handshake. A proxy whose CONNECT response fills the header buffer fails the request before the TLS handshake. Credentials on the proxy are left off the CONNECT request. Credentials on the proxy are left off a cleartext request. The request line stays the absolute URI. BypassProxyOnLocal sends an HTTPS request for a loopback origin to that origin. A bypass list entry that matches the origin sends that HTTPS request to the origin while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. +/// One connection is reused for an authority until 16 request streams, the idle timeout, or the connection lifetime. +/// A further request opens another connection, up to . +/// A GOAWAY on the peer's control stream stops new requests on that connection and closes it once nothing is in flight. +/// The dynamic table is capped at 4096 bytes. A request inserts a field that is not in the static table when the peer allows a dynamic table and at least one blocked stream. A peer insert is decoded. +/// A failed HTTP/3 connect, before any request byte, falls back to the adapter when the request allows a lower version, and when an Alt-Svc upgrade fails. +/// When is set, a later request that allows a higher version uses HTTP/3 after Alt-Svc: h3 from the same origin. +/// The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. An entry ends when its ma elapses. A missing ma lasts 24 hours. ma=0 and clear drop the entry. In one header, clear followed by h3 keeps the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A different host is ignored. +/// is the name sent on the handshake, including HTTP/3. The connection still goes to the URI host. +/// that omit TLS 1.3 fail the request before it is sent, including an HTTP/2 request. A that is empty sends the URI host on an HTTP/3 handshake, on an HTTP/1.1 handshake, and on an HTTP/2 handshake. Assigning null to is rejected. +/// gzip decodes an HTTPS HTTP/1.1 response. Deflate decodes an HTTPS HTTP/1.1 response. An HTTP/3 response with Content-Encoding: gzip stays compressed. +/// . is the local UDP address of an HTTP/3 connection. +/// When is infinite, stops a silent HTTP/3 handshake. +/// +public sealed class TitaniumHttpHandler : HttpMessageHandler +{ + private const int MaxAuthorities = 256; + private const string FipsRefusal = + "The managed TLS stack is disabled while FIPS mode is on. Set TlsStreamOptions.AllowManagedStackUnderFips or TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1."; + + /// Marks an inner request whose connect callback must authenticate a managed TLS stream. + internal static readonly HttpRequestOptionsKey ManagedTlsOption = new("Titanium.Net.Http.ManagedTls"); + + /// The caller URI a pooled inner request was last prepared for. A mismatch fills the message again. + private static readonly HttpRequestOptionsKey PreparedOriginOption = new("Titanium.Net.Http.PreparedOrigin"); + + private static readonly Uri UnpreparedOrigin = new("http://127.0.0.1/"); + + private readonly SocketsHttpHandler _sockets = new(); + private readonly HttpMessageInvoker _inner; + private readonly Http3Pool _pool = new(); + private readonly ConcurrentDictionary _alpn = new(); + private readonly AltSvcCache _alt = new(); + private SslClientAuthenticationOptions _sslOptions = new(); + private bool _followRedirects = true; + private int _disposeOnce; + + /// Creates a handler. The inner handler's connect callback owns the managed TLS stream. + public TitaniumHttpHandler() + { + // The HTTP/3 codec stays referenced for the client that follows this adapter. + _ = typeof(Http3FrameCodec).Assembly; + _sockets.ConnectCallback = ConnectAsync; + _sockets.AllowAutoRedirect = false; + _inner = new HttpMessageInvoker(_sockets, disposeHandler: false); + } + + /// HTTP/3 connections kept for reuse. Internal so the HTTP/3 client can rent one. + internal Http3Pool Pool => _pool; + + /// Gets or sets the TLS options copied onto each managed handshake. The handler chooses ALPN. A certificate in is presented when the server asks for one. chooses which certificate is presented. A certificate without a private key is skipped. is the name sent on the handshake, including HTTP/3. The connection still goes to the URI host. that omit TLS 1.3 fail the request before it is sent, including an HTTP/2 request. A that is empty sends the URI host on an HTTP/3 handshake, on an HTTP/1.1 handshake, and on an HTTP/2 handshake. Assigning null to is rejected. + public SslClientAuthenticationOptions SslOptions + { + get => _sslOptions; + set => _sslOptions = value ?? throw new ArgumentNullException(nameof(value)); + } + + /// Gets or sets the fingerprint profile passed to . Null uses the built-in hello. A profile replaces the TCP ClientHello, and that hello's JA4 matches the profile for the same server name and ALPN. QUIC keeps the built-in hello. + public TlsFingerprintProfile? FingerprintProfile { get; set; } + + /// Gets or sets the QUIC options used for an HTTP/3 connection. Null uses the defaults. is the local UDP address. When is infinite, stops a silent handshake. + public ManagedQuicClientConnectionOptions? QuicOptions { get; set; } + + /// + /// Gets or sets whether a later request that allows a higher version uses HTTP/3 after Alt-Svc: h3 from the same origin. + /// The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. An entry is dropped when its ma elapses. The next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. In one header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. + /// + public bool EnableAltSvc { get; set; } + + /// + /// Gets or sets whether may run while FIPS mode is on. + /// The environment variable TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1 allows it as well. + /// + public bool AllowManagedStackUnderFips { get; set; } + + /// Gets or sets the proxy forwarded to the inner handler. An exact HTTPS HTTP/3 request still reaches the origin. Credentials on that proxy are left off the CONNECT request and off a cleartext request. sends an HTTPS request for a loopback origin to that origin. A entry that matches the origin does the same while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. + public IWebProxy? Proxy + { + get => _sockets.Proxy; + set => _sockets.Proxy = value; + } + + /// Gets or sets whether the inner handler uses . False sends an exact HTTPS HTTP/2 request to the origin while a proxy is set. + public bool UseProxy + { + get => _sockets.UseProxy; + set => _sockets.UseProxy = value; + } + + /// Gets or sets the cookie container forwarded to the inner handler. A direct HTTP/3 request leaves it unchanged. An HTTPS HTTP/1.1 request sends a stored cookie, and a Set-Cookie on that response is stored. A Set-Cookie path limits where that cookie is sent later. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. false leaves that stored cookie off the request, and Set-Cookie stays out of the container. + public CookieContainer? CookieContainer + { + get => _sockets.CookieContainer; + set => _sockets.CookieContainer = value; + } + + /// Gets or sets whether the inner handler sends cookies. False leaves a stored cookie off an HTTPS HTTP/1.1 request and off an HTTPS HTTP/2 request, and Set-Cookie stays out of the container. + public bool UseCookies + { + get => _sockets.UseCookies; + set => _sockets.UseCookies = value; + } + + /// + /// Gets or sets whether a 3xx response is followed. + /// Each hop is sent through this handler, so an https Location stays on the managed stream. + /// A 302 with no Location is returned, and the origin is contacted once. + /// A relative Location is resolved against the request path. + /// With redirects off, an unseekable HTTPS HTTP/1.1 POST uses chunked transfer encoding and leaves Content-Length off. + /// + public bool AllowAutoRedirect + { + get => _followRedirects; + set => _followRedirects = value; + } + + /// Gets or sets how many redirects this handler follows, including an HTTP/3 chain. + public int MaxAutomaticRedirections + { + get => _sockets.MaxAutomaticRedirections; + set => _sockets.MaxAutomaticRedirections = value; + } + + /// Gets or sets the decompression methods forwarded to the inner handler. Gzip decodes an HTTPS HTTP/1.1 response. Deflate decodes an HTTPS HTTP/1.1 response. An HTTP/3 response stays compressed. + public DecompressionMethods AutomaticDecompression + { + get => _sockets.AutomaticDecompression; + set => _sockets.AutomaticDecompression = value; + } + + /// Gets or sets how long the inner handler keeps a pooled connection. A short lifetime opens another CONNECT tunnel for the next HTTPS request. + public TimeSpan PooledConnectionLifetime + { + get => _sockets.PooledConnectionLifetime; + set => _sockets.PooledConnectionLifetime = value; + } + + /// Gets or sets how long the inner handler keeps an idle pooled connection. A short idle timeout leaves a CONNECT tunnel in place. + public TimeSpan PooledConnectionIdleTimeout + { + get => _sockets.PooledConnectionIdleTimeout; + set => _sockets.PooledConnectionIdleTimeout = value; + } + + /// Gets or sets how many connections the inner handler opens to one server. One connection keeps a second in-flight HTTPS request on the same CONNECT tunnel. A second origin waits while that request is still outstanding. + public int MaxConnectionsPerServer + { + get => _sockets.MaxConnectionsPerServer; + set => _sockets.MaxConnectionsPerServer = value; + } + + /// Gets or sets how long a TCP connect, the managed TLS handshake, and an HTTP/3 handshake may take. A silent TCP peer stops an HTTP/2 request within that budget. The default matches the inner handler. + public TimeSpan ConnectTimeout + { + get => _sockets.ConnectTimeout; + set => _sockets.ConnectTimeout = value; + } + + /// + /// Builds the request the inner handler sends. + /// An https URI becomes http with an explicit port, and the managed-TLS option is set. + /// + /// The caller's request. This method does not modify it. + /// The version the inner handler must use. + /// The version policy the inner handler must use. + /// The request handed to the inner handler. + internal static HttpRequestMessage CreateInnerRequest(HttpRequestMessage request, Version version, HttpVersionPolicy policy) + { + ArgumentNullException.ThrowIfNull(request); + return FillInner(new HttpRequestMessage(), request, version, policy); + } + + private static readonly ConcurrentBag InnerPool = new(); + private static int _innerPoolCount; + + private static HttpRequestMessage RentInner(HttpRequestMessage request, Version version, HttpVersionPolicy policy) + { + if (!IsHttps(request) || !InnerPool.TryTake(out HttpRequestMessage? inner) || inner is null) + { + return CreateInnerRequest(request, version, policy); + } + + Interlocked.Decrement(ref _innerPoolCount); + if (request.Content is null + && request.Headers.NonValidated.Count == 0 + && inner.Content is null + && inner.Headers.NonValidated.Count == 1 + && inner.Method == request.Method + && ReferenceEquals(inner.Version, version) + && inner.VersionPolicy == policy + && inner.Options.TryGetValue(PreparedOriginOption, out Uri? origin) + && origin is not null + && origin.Equals(request.RequestUri)) + { + return inner; + } + + inner.Headers.Clear(); + inner.Content = null; + return FillInner(inner, request, version, policy); + } + + private static void ReleaseInner(HttpRequestMessage inner, bool https) + { + inner.Content = null; + if (!https) + { + inner.Dispose(); + return; + } + + // A headerless HTTPS send leaves only Host. The next matching request reuses that message. + if (inner.Headers.NonValidated.Count != 1) + { + inner.Headers.Clear(); + } + if (Interlocked.Increment(ref _innerPoolCount) > 32) + { + Interlocked.Decrement(ref _innerPoolCount); + inner.Dispose(); + return; + } + + InnerPool.Add(inner); + } + + private static HttpRequestMessage FillInner(HttpRequestMessage inner, HttpRequestMessage request, Version version, HttpVersionPolicy policy) + { + Uri original = request.RequestUri ?? throw new InvalidOperationException("The request URI is required."); + bool rewritten = string.Equals(original.Scheme, Uri.UriSchemeHttps, StringComparison.Ordinal); + HttpRewrite rewrite = default; + Uri uri = original; + if (rewritten) + { + rewrite = CachedHttpUri(original); + uri = rewrite.Uri; + } + + inner.Method = request.Method; + inner.RequestUri = uri; + inner.Version = version; + inner.VersionPolicy = policy; + inner.Content = request.Content; + if (request.Headers.NonValidated.Count > 0) + { + foreach (KeyValuePair> header in request.Headers) + { + inner.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + if (rewritten) + { + string host = string.IsNullOrEmpty(request.Headers.Host) ? rewrite.Host : request.Headers.Host; + if (!string.Equals(inner.Headers.Host, host, StringComparison.Ordinal)) + { + inner.Headers.Host = host; + } + + if (!inner.Options.TryGetValue(ManagedTlsOption, out bool managed) || !managed) + { + inner.Options.Set(ManagedTlsOption, true); + } + + inner.Options.Set( + PreparedOriginOption, + request.Content is null && request.Headers.NonValidated.Count == 0 ? original : UnpreparedOrigin); + } + + return inner; + } + + private readonly struct HttpRewrite + { + internal HttpRewrite(Uri uri, string host) + { + Uri = uri; + Host = host; + } + + internal Uri Uri { get; } + + internal string Host { get; } + } + + private static readonly ConcurrentDictionary HttpUris = new(); + + private static HttpRewrite CachedHttpUri(Uri original) + { + if (HttpUris.TryGetValue(original, out HttpRewrite found)) + { + return found; + } + + UriBuilder builder = new(original) + { + Scheme = Uri.UriSchemeHttp, + Port = original.IsDefaultPort ? 443 : original.Port, + }; + string host = original.IsDefaultPort ? HostForDefaultPort(original) : original.Authority; + var created = new HttpRewrite(builder.Uri, host); + if (HttpUris.Count < 256) + { + HttpUris.TryAdd(original, created); + } + + return created; + } + + /// + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + ArgumentNullException.ThrowIfNull(request); + RequireFips(); + if (_followRedirects && request.Content is not null) + { + return SendAfterBufferAsync(request, cancellationToken); + } + + return SendPrepared(request, cancellationToken); + } + + private async Task SendAfterBufferAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + await request.Content!.LoadIntoBufferAsync(cancellationToken).ConfigureAwait(false); + return await SendPrepared(request, cancellationToken).ConfigureAwait(false); + } + + private Task SendPrepared(HttpRequestMessage request, CancellationToken cancellationToken) + { + // A plain HTTP/1.1 request has no version fallback. Its state machine stays the small send below. + if (!WantsHttp3(request) + && !(EnableAltSvc && IsHttps(request) && request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher)) + { + VersionChoice choice = Choose(request); + if (!choice.UsedH2 && !choice.CanFallBack) + { + return SendPlainAsync(request, choice, cancellationToken); + } + } + + return SendAsyncSlow(request, cancellationToken); + } + + private async Task SendPlainAsync( + HttpRequestMessage request, + VersionChoice choice, + CancellationToken cancellationToken) + { + HttpRequestMessage innerRequest = RentInner(request, choice.Version, choice.Policy); + HttpResponseMessage direct; + try + { + direct = await _inner.SendAsync(innerRequest, cancellationToken).ConfigureAwait(false); + } + finally + { + ReleaseInner(innerRequest, IsHttps(request)); + } + + direct.RequestMessage = request; + if (!_followRedirects || request.RequestUri is null || !IsRedirect(direct.StatusCode)) + { + NoteAltSvc(request, direct); + return direct; + } + + direct = await FollowRedirectsAsync(request, direct, cancellationToken).ConfigureAwait(false); + NoteAltSvc(request, direct); + return direct; + } + + private async Task SendAsyncSlow(HttpRequestMessage request, CancellationToken cancellationToken) + { + HttpResponseMessage response = await SendOnceAsync(request, cancellationToken).ConfigureAwait(false); + response = await FollowRedirectsAsync(request, response, cancellationToken).ConfigureAwait(false); + NoteAltSvc(request, response); + return response; + } + + private async Task SendOnceAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + bool viaAlt = false; + int? altPort = null; + if (!WantsHttp3(request) + && IsHttps(request) + && EnableAltSvc + && request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher + && request.RequestUri is Uri origin + && _alt.TryGet(origin, DateTimeOffset.UtcNow, out int cachedPort)) + { + viaAlt = true; + altPort = cachedPort; + } + + if (WantsHttp3(request) || viaAlt) + { + try + { + return await Http3Client.SendAsync(this, request, altPort, cancellationToken).ConfigureAwait(false); + } + catch (Http3ConnectException) when (viaAlt || request.VersionPolicy == HttpVersionPolicy.RequestVersionOrLower) + { + } + } + + return await SendAdapterAsync(request, cancellationToken).ConfigureAwait(false); + } + + private async Task FollowRedirectsAsync( + HttpRequestMessage original, + HttpResponseMessage response, + CancellationToken cancellationToken) + { + if (!_followRedirects || original.RequestUri is null) + { + return response; + } + + HttpRequestMessage current = original; + HttpRequestMessage? owned = null; + int left = _sockets.MaxAutomaticRedirections; + while (IsRedirect(response.StatusCode)) + { + if (response.Headers.Location is not Uri location) + { + break; + } + + if (left <= 0) + { + response.Dispose(); + if (owned is not null) + { + owned.Content = null; + owned.Dispose(); + } + + throw new HttpRequestException("The redirect limit was reached."); + } + + Uri nextUri = location.IsAbsoluteUri ? location : new Uri(current.RequestUri!, location); + if (nextUri.Fragment.Length > 0) + { + UriBuilder builder = new(nextUri) { Fragment = string.Empty }; + nextUri = builder.Uri; + } + + HttpMethod method = RedirectMethod(current.Method, response.StatusCode); + bool keepBody = current.Content is not null + && method == current.Method + && response.StatusCode is HttpStatusCode.TemporaryRedirect or HttpStatusCode.PermanentRedirect; + Version hopVersion = original.Version; + HttpVersionPolicy hopPolicy = original.VersionPolicy; + if (!string.Equals(nextUri.Scheme, Uri.UriSchemeHttps, StringComparison.Ordinal) && original.Version.Major == 3) + { + hopVersion = HttpVersion.Version11; + hopPolicy = HttpVersionPolicy.RequestVersionExact; + } + + HttpRequestMessage next = new(method, nextUri) + { + Version = hopVersion, + VersionPolicy = hopPolicy, + }; + foreach (KeyValuePair> header in current.Headers) + { + if (header.Key.Equals("Host", StringComparison.OrdinalIgnoreCase) + || (UseCookies && header.Key.Equals("Cookie", StringComparison.OrdinalIgnoreCase))) + { + continue; + } + + if (header.Key.Equals("Authorization", StringComparison.OrdinalIgnoreCase) + && !string.Equals(current.RequestUri?.IdnHost, nextUri.IdnHost, StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + next.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + + if (keepBody) + { + next.Content = current.Content; + } + + NoteAltSvc(original, response); + response.Dispose(); + if (owned is not null) + { + owned.Content = null; + owned.Dispose(); + } + + owned = next; + current = next; + left--; + response = await SendOnceAsync(current, cancellationToken).ConfigureAwait(false); + } + + response.RequestMessage = original; + if (owned is not null) + { + owned.Content = null; + owned.Dispose(); + } + + return response; + } + + private async Task SendAdapterAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + VersionChoice choice = Choose(request); + HttpResponseMessage response; + bool retried = false; + try + { + response = await SendCoreAsync(request, choice.Version, choice.Policy, cancellationToken).ConfigureAwait(false); + } + catch (HttpRequestException ex) when (choice.CanFallBack && IsAlpnDowngrade(ex)) + { + retried = true; + RememberHttp11(request.RequestUri); + response = await SendCoreAsync(request, HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, cancellationToken).ConfigureAwait(false); + } + catch (HttpRequestException ex) when (choice.UsedH2 && choice.CanFallBack && IsReplaySafe(request.Method) && ex.HttpRequestError == HttpRequestError.HttpProtocolError) + { + retried = true; + RememberHttp11(request.RequestUri); + response = await SendCoreAsync(request, HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, cancellationToken).ConfigureAwait(false); + } + + if (!retried && choice.UsedH2 && choice.CanFallBack && IsReplaySafe(request.Method) && IsSchemeRejection(response.StatusCode)) + { + response.Dispose(); + RememberHttp11(request.RequestUri); + response = await SendCoreAsync(request, HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, cancellationToken).ConfigureAwait(false); + } + + return response; + } + + private static bool IsRedirect(HttpStatusCode status) => + status is HttpStatusCode.MultipleChoices + or HttpStatusCode.MovedPermanently + or HttpStatusCode.Found + or HttpStatusCode.SeeOther + or HttpStatusCode.TemporaryRedirect + or HttpStatusCode.PermanentRedirect; + + private static HttpMethod RedirectMethod(HttpMethod method, HttpStatusCode status) + { + if (status == HttpStatusCode.SeeOther) + { + return method == HttpMethod.Head ? HttpMethod.Head : HttpMethod.Get; + } + + if (method == HttpMethod.Post + && status is HttpStatusCode.MultipleChoices or HttpStatusCode.MovedPermanently or HttpStatusCode.Found) + { + return HttpMethod.Get; + } + + return method; + } + + private void NoteAltSvc(HttpRequestMessage request, HttpResponseMessage response) + { + if (!EnableAltSvc || request.RequestUri is null || !response.Headers.TryGetValues("Alt-Svc", out IEnumerable? values)) + { + return; + } + + _alt.Note(request.RequestUri, string.Join(",", values), DateTimeOffset.UtcNow); + } + + /// + protected override void Dispose(bool disposing) + { + if (disposing && Interlocked.Exchange(ref _disposeOnce, 1) == 0) + { + _pool.Dispose(); + _inner.Dispose(); + _sockets.Dispose(); + } + + base.Dispose(disposing); + } + + private async Task SendCoreAsync( + HttpRequestMessage request, + Version version, + HttpVersionPolicy policy, + CancellationToken cancellationToken) + { + HttpRequestMessage innerRequest = CreateInnerRequest(request, version, policy); + try + { + HttpResponseMessage response = await _inner.SendAsync(innerRequest, cancellationToken).ConfigureAwait(false); + response.RequestMessage = request; + return response; + } + finally + { + innerRequest.Content = null; + innerRequest.Dispose(); + } + } + + private VersionChoice Choose(HttpRequestMessage request) + { + if (request.Version.Major == 3 && !IsHttps(request)) + { + return new VersionChoice(HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, false, false); + } + + bool allowHigher = request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher; + bool asksForHttp2 = request.Version.Major >= 2; + if (!asksForHttp2 && !allowHigher) + { + return new VersionChoice(HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, false, false); + } + + bool knownHttp11 = TryKnownHttp11(request.RequestUri); + bool exact = request.VersionPolicy == HttpVersionPolicy.RequestVersionExact; + bool tryHttp2 = true; + if (knownHttp11 && !(exact && asksForHttp2)) + { + tryHttp2 = false; + } + + if (!tryHttp2) + { + return new VersionChoice(HttpVersion.Version11, HttpVersionPolicy.RequestVersionExact, false, false); + } + + bool canFallBack = request.VersionPolicy == HttpVersionPolicy.RequestVersionOrLower + || (allowHigher && request.Version.Major < 2); + return new VersionChoice(HttpVersion.Version20, HttpVersionPolicy.RequestVersionExact, true, canFallBack); + } + + private void RequireFips() + { + if (AllowManagedStackUnderFips || OverrideIsSet() || !FipsEnvironment.IsEnabled()) + { + return; + } + + throw new NotSupportedException(FipsRefusal); + } + + private static bool WantsHttp3(HttpRequestMessage request) => request.Version.Major == 3 && IsHttps(request); + + private static bool IsHttps(HttpRequestMessage request) => + request.RequestUri is Uri uri && string.Equals(uri.Scheme, Uri.UriSchemeHttps, StringComparison.Ordinal); + + private async ValueTask ConnectAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken) + { + CancellationTokenSource? linked = null; + CancellationToken token = cancellationToken; + TimeSpan budget = _sockets.ConnectTimeout; + if (budget > TimeSpan.Zero && budget != Timeout.InfiniteTimeSpan) + { + linked = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + linked.CancelAfter(budget); + token = linked.Token; + } + + try + { + return await OpenAsync(context, token).ConfigureAwait(false); + } + finally + { + linked?.Dispose(); + } + } + + private async ValueTask OpenAsync(SocketsHttpConnectionContext context, CancellationToken cancellationToken) + { + bool useTls = context.InitialRequestMessage.Options.TryGetValue(ManagedTlsOption, out bool managed) && managed; + Socket socket = new(SocketType.Stream, ProtocolType.Tcp); + socket.NoDelay = true; + try + { + await socket.ConnectAsync(context.DnsEndPoint, cancellationToken).ConfigureAwait(false); + } + catch + { + socket.Dispose(); + throw; + } + + NetworkStream network = new(socket, ownsSocket: true); + if (!useTls) + { + return network; + } + + Uri? requestUri = context.InitialRequestMessage.RequestUri; + if (requestUri is not null && IsProxyEndpoint(context.DnsEndPoint, requestUri)) + { + try + { + await OpenProxyTunnelAsync(network, requestUri, cancellationToken).ConfigureAwait(false); + } + catch + { + await network.DisposeAsync().ConfigureAwait(false); + throw; + } + } + + bool requireHttp2 = context.InitialRequestMessage.Version.Major >= 2; + TlsStream tls = new(network, new TlsStreamOptions + { + FingerprintProfile = FingerprintProfile, + AllowManagedStackUnderFips = AllowManagedStackUnderFips, + }); + bool handedOff = false; + try + { + await tls.AuthenticateAsClientAsync(CopySslOptions(context, requireHttp2), cancellationToken).ConfigureAwait(false); + SslApplicationProtocol negotiated = tls.NegotiatedApplicationProtocol; + string key = AuthorityKey(context.InitialRequestMessage.RequestUri); + if (negotiated != SslApplicationProtocol.Http2) + { + Remember(key, SslApplicationProtocol.Http11); + if (requireHttp2) + { + throw new ServerChoseHttp11Exception(); + } + } + else + { + Remember(key, SslApplicationProtocol.Http2); + } + + handedOff = true; + return tls; + } + finally + { + if (!handedOff) + { + await tls.DisposeAsync().ConfigureAwait(false); + } + } + } + + private static bool IsProxyEndpoint(DnsEndPoint endpoint, Uri origin) + { + if (endpoint.Port != origin.Port) + { + return true; + } + + if (string.Equals(endpoint.Host, origin.IdnHost, StringComparison.OrdinalIgnoreCase) + || string.Equals(endpoint.Host, origin.DnsSafeHost, StringComparison.OrdinalIgnoreCase)) + { + return false; + } + + string endpointHost = endpoint.Host.Trim('[', ']'); + return !(IPAddress.TryParse(endpointHost, out IPAddress? endpointAddress) + && IPAddress.TryParse(origin.IdnHost, out IPAddress? originAddress) + && endpointAddress.Equals(originAddress)); + } + + private static string ProxyAuthority(Uri origin) + { + string host = origin.Host; + if (IPAddress.TryParse(host.Trim('[', ']'), out IPAddress? address) + && address.AddressFamily == AddressFamily.InterNetworkV6 + && host[0] != '[') + { + host = "[" + host + "]"; + } + + return host + ":" + origin.Port.ToString(CultureInfo.InvariantCulture); + } + + private static string HostForDefaultPort(Uri origin) + { + string host = origin.IdnHost; + if (host.Contains(':')) + { + return "[" + host + "]"; + } + + return host; + } + + private static async Task OpenProxyTunnelAsync(Stream stream, Uri origin, CancellationToken cancellationToken) + { + string authority = ProxyAuthority(origin); + string connect = "CONNECT " + authority + " HTTP/1.1\r\nHost: " + authority + "\r\n\r\n"; + await stream.WriteAsync(Encoding.ASCII.GetBytes(connect), cancellationToken).ConfigureAwait(false); + string headers = await ReadAsciiHeadersAsync(stream, cancellationToken).ConfigureAwait(false); + if (!IsProxySuccess(headers)) + { + throw new HttpRequestException("The proxy refused the tunnel."); + } + } + + private static async Task ReadAsciiHeadersAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] buffer = new byte[1024]; + int length = 0; + while (length < buffer.Length) + { + int read = await stream.ReadAsync(buffer.AsMemory(length, 1), cancellationToken).ConfigureAwait(false); + if (read == 0) + { + throw new HttpRequestException("The proxy closed the connection."); + } + + length += read; + if (length >= 4 + && buffer[length - 4] == (byte)'\r' + && buffer[length - 3] == (byte)'\n' + && buffer[length - 2] == (byte)'\r' + && buffer[length - 1] == (byte)'\n') + { + return Encoding.ASCII.GetString(buffer, 0, length); + } + } + + throw new HttpRequestException("The proxy response headers are too long."); + } + + private static bool IsProxySuccess(string headers) + { + int end = headers.IndexOf("\r\n", StringComparison.Ordinal); + string line = end >= 0 ? headers[..end] : headers; + string[] parts = line.Split(' '); + return parts.Length >= 2 && int.TryParse(parts[1], NumberStyles.None, CultureInfo.InvariantCulture, out int status) && status is >= 200 and <= 299; + } + + private SslClientAuthenticationOptions CopySslOptions(SocketsHttpConnectionContext context, bool requireHttp2) + { + string host = _sslOptions.TargetHost ?? string.Empty; + if (host.Length == 0) + { + host = context.InitialRequestMessage.RequestUri?.IdnHost ?? string.Empty; + } + + if (host.Length == 0) + { + host = context.DnsEndPoint.Host; + } + + List protocols = new(); + if (requireHttp2) + { + protocols.Add(SslApplicationProtocol.Http2); + } + + protocols.Add(SslApplicationProtocol.Http11); + return new SslClientAuthenticationOptions + { + TargetHost = host, + ClientCertificates = _sslOptions.ClientCertificates, + CertificateRevocationCheckMode = _sslOptions.CertificateRevocationCheckMode, + CertificateChainPolicy = _sslOptions.CertificateChainPolicy, + EncryptionPolicy = _sslOptions.EncryptionPolicy, + EnabledSslProtocols = _sslOptions.EnabledSslProtocols, + RemoteCertificateValidationCallback = _sslOptions.RemoteCertificateValidationCallback, + LocalCertificateSelectionCallback = _sslOptions.LocalCertificateSelectionCallback, + ClientCertificateContext = _sslOptions.ClientCertificateContext, + CipherSuitesPolicy = _sslOptions.CipherSuitesPolicy, + AllowRenegotiation = false, + ApplicationProtocols = protocols, + }; + } + + private bool TryKnownHttp11(Uri? uri) + { + string key = AuthorityKey(uri); + if (!_alpn.TryGetValue(key, out AlpnEntry entry)) + { + return false; + } + + if (entry.ExpiresAt <= Environment.TickCount64) + { + _alpn.TryRemove(key, out _); + return false; + } + + return entry.Protocol == SslApplicationProtocol.Http11; + } + + private void RememberHttp11(Uri? uri) => Remember(AuthorityKey(uri), SslApplicationProtocol.Http11); + + private void Remember(string key, SslApplicationProtocol protocol) + { + if (key.Length == 0) + { + return; + } + + long now = Environment.TickCount64; + if (_alpn.Count >= MaxAuthorities) + { + foreach (KeyValuePair entry in _alpn) + { + if (entry.Value.ExpiresAt <= now) + { + _alpn.TryRemove(entry.Key, out _); + } + } + } + + if (_alpn.Count >= MaxAuthorities) + { + _alpn.Clear(); + } + + _alpn[key] = new AlpnEntry(protocol, now + (long)TimeSpan.FromMinutes(10).TotalMilliseconds); + } + + private static string AuthorityKey(Uri? uri) + { + if (uri is null) + { + return string.Empty; + } + + return uri.IdnHost + ":" + uri.Port.ToString(CultureInfo.InvariantCulture); + } + + private static bool IsReplaySafe(HttpMethod method) => + method == HttpMethod.Get + || method == HttpMethod.Head + || method == HttpMethod.Options + || method == HttpMethod.Trace; + + private static bool IsSchemeRejection(HttpStatusCode status) => + status == HttpStatusCode.BadRequest || status == HttpStatusCode.MisdirectedRequest; + + private static bool IsAlpnDowngrade(Exception exception) + { + for (Exception? current = exception; current is not null; current = current.InnerException) + { + if (current is ServerChoseHttp11Exception) + { + return true; + } + } + + return false; + } + + private static bool OverrideIsSet() => + string.Equals( + Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE"), + "1", + StringComparison.Ordinal); + + private readonly struct VersionChoice + { + public VersionChoice(Version version, HttpVersionPolicy policy, bool usedH2, bool canFallBack) + { + Version = version; + Policy = policy; + UsedH2 = usedH2; + CanFallBack = canFallBack; + } + + public Version Version { get; } + + public HttpVersionPolicy Policy { get; } + + public bool UsedH2 { get; } + + public bool CanFallBack { get; } + } + + private readonly struct AlpnEntry + { + public AlpnEntry(SslApplicationProtocol protocol, long expiresAt) + { + Protocol = protocol; + ExpiresAt = expiresAt; + } + + public SslApplicationProtocol Protocol { get; } + + public long ExpiresAt { get; } + } + + private sealed class ServerChoseHttp11Exception : HttpRequestException + { + public ServerChoseHttp11Exception() + : base("The server selected HTTP/1.1.") + { + } + } +} diff --git a/src/Titanium.Quic.UdpOffload/BannedSymbols.txt b/src/Titanium.Quic.UdpOffload/BannedSymbols.txt new file mode 100644 index 000000000..7f1eee0da --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/BannedSymbols.txt @@ -0,0 +1,5 @@ +T:System.Diagnostics.Process;The offload project is sockets only. +T:System.Security.Cryptography.Aes;The offload project does not do cryptography. +T:System.Security.Cryptography.RandomNumberGenerator;The offload project does not do cryptography. +T:System.IO.Pipelines.Pipe;The offload project does not use a pipe. +T:System.Threading.Channels.Channel;The offload project does not use a channel. diff --git a/src/Titanium.Quic.UdpOffload/LICENSE b/src/Titanium.Quic.UdpOffload/LICENSE new file mode 100644 index 000000000..c8d930908 --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/Titanium.Quic.UdpOffload/LinuxUdp.cs b/src/Titanium.Quic.UdpOffload/LinuxUdp.cs new file mode 100644 index 000000000..082ad8f9b --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/LinuxUdp.cs @@ -0,0 +1,416 @@ +using System; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; + +namespace Titanium.Quic.UdpOffload; + +internal static unsafe partial class LinuxUdp +{ + internal const int SolUdp = 17; + + internal const int UdpSegment = 103; + + private const int MessageDontWait = 0x40; + + private const int AddressLength = 16; + + [LibraryImport("libc", EntryPoint = "sendmmsg", SetLastError = true)] + private static partial int SendMany(int descriptor, MMsgHdr* messages, uint length, int flags); + + [LibraryImport("libc", EntryPoint = "recvmmsg", SetLastError = true)] + private static partial int ReceiveMany(int descriptor, MMsgHdr* messages, uint length, int flags, IntPtr timeout); + + internal static bool Send(Socket socket, ReadOnlyMemory> datagrams, IPEndPoint destination, bool segment, out int datagramsSent, out int bytes) + { + datagramsSent = 0; + bytes = 0; + if (!TryAddress(destination, out SockAddrIn address)) + { + return false; + } + + using DescriptorLease lease = DescriptorLease.Open(socket); + if (!lease.Held) + { + return false; + } + + return Send(lease.Value, datagrams, address, segment, out datagramsSent, out bytes); + } + + internal static int Receive(Socket socket, Span buffer, Span counts) + { + if (counts.Length == 0 || buffer.Length < counts.Length) + { + return 0; + } + + using DescriptorLease lease = DescriptorLease.Open(socket); + if (!lease.Held) + { + return 0; + } + + return Receive(lease.Value, buffer, counts); + } + + private static bool Send(int descriptor, ReadOnlyMemory> datagrams, SockAddrIn address, bool segment, out int datagramsSent, out int bytes) + { + datagramsSent = 0; + bytes = 0; + int count = datagrams.Length; + if (count == 0 || count > MaxSendBatch) + { + return false; + } + + ReadOnlySpan> items = datagrams.Span; + int total = 0; + int width = items[0].Length; + + // The kernel cuts one segmented send into pieces of the segment size and lets only the last piece be shorter. + bool segmentable = width > 0; + for (int i = 0; i < count; i++) + { + int length = items[i].Length; + if (length == 0) + { + return false; + } + + if (i < count - 1 ? length != width : length > width) + { + segmentable = false; + } + + total += length; + } + + // One scratch buffer per thread holds the copy of the datagrams for the length of this call. The send does not wait, so + // nothing else uses it meanwhile, and a send allocates nothing after the buffer has grown to the size it needs. + byte[] storage = SendScratch; + if (storage.Length < total) + { + storage = GC.AllocateUninitializedArray(Math.Max(total, storage.Length * 2), pinned: true); + SendScratch = storage; + } + + int offset = 0; + for (int i = 0; i < count; i++) + { + items[i].Span.CopyTo(storage.AsSpan(offset)); + offset += items[i].Length; + } + + fixed (byte* raw = storage) + { + SockAddrIn name = address; + if (segment && segmentable && count > 1 && SendSegment(descriptor, raw, total, width, &name)) + { + datagramsSent = count; + bytes = total; + return true; + } + + MMsgHdr* header = stackalloc MMsgHdr[count]; + IoVector* vector = stackalloc IoVector[count]; + int cursor = 0; + for (int i = 0; i < count; i++) + { + int length = items[i].Length; + vector[i] = new IoVector { Base = (IntPtr)(raw + cursor), Length = (nuint)length }; + header[i] = default; + header[i].Header.Name = (IntPtr)(&name); + header[i].Header.NameLength = AddressLength; + header[i].Header.Iov = (IntPtr)(vector + i); + header[i].Header.IovLength = 1; + cursor += length; + } + + int sent = SendMany(descriptor, header, (uint)count, 0); + if (sent <= 0) + { + return false; + } + + for (int i = 0; i < sent; i++) + { + bytes += items[i].Length; + } + + datagramsSent = sent; + return true; + } + } + + private static bool SendSegment(int descriptor, byte* raw, int total, int width, SockAddrIn* name) + { + SegmentControl control = new() + { + Length = 18, + Level = SolUdp, + Type = UdpSegment, + Size = (ushort)width, + }; + IoVector vector = new() { Base = (IntPtr)raw, Length = (nuint)total }; + MMsgHdr header = default; + header.Header.Name = (IntPtr)name; + header.Header.NameLength = AddressLength; + header.Header.Iov = (IntPtr)(&vector); + header.Header.IovLength = 1; + header.Header.Control = (IntPtr)(&control); + header.Header.ControlLength = 24; + return SendMany(descriptor, &header, 1, 0) == 1; + } + + // The most datagrams one call takes. A segmented send is limited by the kernel to 64 pieces and 65,507 bytes, and a refused one falls back to sendmmsg. + private const int MaxSendBatch = 64; + + [ThreadStatic] + private static byte[]? _sendScratch; + + private static byte[] SendScratch + { + get => _sendScratch ??= GC.AllocateUninitializedArray(65536, pinned: true); + set => _sendScratch = value; + } + + private static int Receive(int descriptor, Span buffer, Span counts) + { + int count = counts.Length; + int slice = buffer.Length / count; + if (slice < 1) + { + return 0; + } + + byte[] storage = new byte[slice * count]; + var headers = new MMsgHdr[count]; + var vectors = new IoVector[count]; + fixed (byte* raw = storage) + fixed (MMsgHdr* header = headers) + fixed (IoVector* vector = vectors) + { + for (int i = 0; i < count; i++) + { + vector[i] = new IoVector { Base = (IntPtr)(raw + (i * slice)), Length = (nuint)slice }; + header[i].Header.Iov = (IntPtr)(vector + i); + header[i].Header.IovLength = 1; + } + + int got = ReceiveMany(descriptor, header, (uint)count, MessageDontWait, IntPtr.Zero); + if (got <= 0) + { + return 0; + } + + for (int i = 0; i < got; i++) + { + int length = (int)headers[i].Length; + if (length < 0 || length > slice) + { + return 0; + } + + storage.AsSpan(i * slice, length).CopyTo(buffer[(i * slice)..]); + counts[i] = length; + } + + return got; + } + } + + /// + /// Reads the datagrams a socket already holds with one recvmmsg. The storage, the headers, and the source + /// addresses are allocated once and pinned, so a call allocates nothing. Every message has its own + /// msg_name, so each datagram keeps the address it came from. + /// + internal sealed class ReceiveBatch + { + internal const int Capacity = 32; + + internal const int SliceBytes = 65536; + + private readonly byte[] _storage = GC.AllocateUninitializedArray(Capacity * SliceBytes, pinned: true); + + private readonly MMsgHdr[] _headers = GC.AllocateArray(Capacity, pinned: true); + + private readonly IoVector[] _vectors = GC.AllocateArray(Capacity, pinned: true); + + private readonly SockAddrIn[] _names = GC.AllocateArray(Capacity, pinned: true); + + private int _count; + + internal ReceiveBatch() + { + unsafe + { + byte* raw = (byte*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref _storage[0]); + for (int i = 0; i < Capacity; i++) + { + _vectors[i] = new IoVector { Base = (IntPtr)(raw + ((long)i * SliceBytes)), Length = SliceBytes }; + fixed (IoVector* vector = &_vectors[i]) + fixed (SockAddrIn* name = &_names[i]) + { + _headers[i].Header.Iov = (IntPtr)vector; + _headers[i].Header.IovLength = 1; + _headers[i].Header.Name = (IntPtr)name; + } + } + } + } + + /// Gets how many datagrams the last stored. + internal int Count => _count; + + internal void Clear() => _count = 0; + + internal void Set(int count) => _count = count; + + internal ReadOnlySpan Datagram(int index) => _storage.AsSpan(index * SliceBytes, (int)_headers[index].Length); + + internal IPEndPoint Remote(int index) + { + SockAddrIn name = _names[index]; + int port = (name.Port >> 8) | ((name.Port & 0xff) << 8); + return new IPEndPoint(new IPAddress(name.Address), port); + } + + internal unsafe int Fill(int descriptor, int limit) + { + limit = Math.Min(limit, Capacity); + for (int i = 0; i < limit; i++) + { + _headers[i].Header.NameLength = AddressLength; + _headers[i].Header.Flags = 0; + _headers[i].Length = 0; + } + + fixed (MMsgHdr* header = _headers) + { + int got = ReceiveMany(descriptor, header, (uint)limit, MessageDontWait, IntPtr.Zero); + return got < 0 ? 0 : got; + } + } + } + + /// Stores up to queued datagrams in without waiting. Returns 0 when none are queued. + internal static int Receive(Socket socket, ReceiveBatch batch, int limit) + { + batch.Clear(); + if (socket.AddressFamily != AddressFamily.InterNetwork) + { + return 0; + } + + using DescriptorLease lease = DescriptorLease.Open(socket); + if (!lease.Held) + { + return 0; + } + + int got = batch.Fill(lease.Value, limit); + batch.Set(got); + return got; + } + + private static bool TryAddress(IPEndPoint destination, out SockAddrIn address) + { + address = default; + if (destination.AddressFamily != AddressFamily.InterNetwork) + { + return false; + } + + byte[] ip = destination.Address.GetAddressBytes(); + address.Family = 2; + address.Port = (ushort)((destination.Port >> 8) | (destination.Port << 8)); + address.Address = (uint)ip[0] | ((uint)ip[1] << 8) | ((uint)ip[2] << 16) | ((uint)ip[3] << 24); + return true; + } + + private readonly struct DescriptorLease : IDisposable + { + private readonly SafeSocketHandle _handle; + + private readonly bool _added; + + private DescriptorLease(SafeSocketHandle handle, bool added, int value) + { + _handle = handle; + _added = added; + Value = value; + Held = added && value > 0; + } + + internal int Value { get; } + + internal bool Held { get; } + + internal static DescriptorLease Open(Socket socket) + { + SafeSocketHandle handle = socket.SafeHandle; + bool added = false; + handle.DangerousAddRef(ref added); + long raw = handle.DangerousGetHandle().ToInt64(); + int value = raw > 0 && raw <= int.MaxValue ? (int)raw : 0; + return new DescriptorLease(handle, added, value); + } + + public void Dispose() + { + if (_added) + { + _handle.DangerousRelease(); + } + } + } + + [StructLayout(LayoutKind.Sequential)] + private struct IoVector + { + internal IntPtr Base; + internal nuint Length; + } + + [StructLayout(LayoutKind.Sequential)] + private struct MsgHdr + { + internal IntPtr Name; + internal uint NameLength; + internal uint Pad0; + internal IntPtr Iov; + internal nuint IovLength; + internal IntPtr Control; + internal nuint ControlLength; + internal int Flags; + internal int Pad1; + } + + [StructLayout(LayoutKind.Sequential)] + private struct MMsgHdr + { + internal MsgHdr Header; + internal uint Length; + internal uint Pad; + } + + [StructLayout(LayoutKind.Sequential, Size = 24)] + private struct SegmentControl + { + internal nuint Length; + internal int Level; + internal int Type; + internal ushort Size; + } + + [StructLayout(LayoutKind.Sequential, Size = 16)] + private struct SockAddrIn + { + internal ushort Family; + internal ushort Port; + internal uint Address; + internal ulong Zero; + } +} diff --git a/src/Titanium.Quic.UdpOffload/README.md b/src/Titanium.Quic.UdpOffload/README.md new file mode 100644 index 000000000..61ba661f6 --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/README.md @@ -0,0 +1,5 @@ +# Titanium.Quic.UdpOffload + +Socket batching for Titanium.Quic. This project is the only place that calls `sendmmsg` and `recvmmsg`. Equal-sized datagrams can carry a segmentation control message on that send. Cryptography stays out. `TITANIUM_UDP_OFFLOAD=0` forces the portable socket path. The batch calls are used only after a loopback probe accepts them. + +This package is experimental. It is not a FIPS-validated module. Cryptography stays in Titanium.Quic. diff --git a/src/Titanium.Quic.UdpOffload/Titanium.Quic.UdpOffload.csproj b/src/Titanium.Quic.UdpOffload/Titanium.Quic.UdpOffload.csproj new file mode 100644 index 000000000..787bb8ec6 --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/Titanium.Quic.UdpOffload.csproj @@ -0,0 +1,24 @@ + + + + Titanium.Quic.UdpOffload + UDP socket offload for Titanium.Quic. Sockets only. + Titanium.Quic.UdpOffload + quic;udp;managed + true + ..\Titanium.Quic\StrongNameKey.snk + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + diff --git a/src/Titanium.Quic.UdpOffload/UdpOffloadBatch.cs b/src/Titanium.Quic.UdpOffload/UdpOffloadBatch.cs new file mode 100644 index 000000000..d79090104 --- /dev/null +++ b/src/Titanium.Quic.UdpOffload/UdpOffloadBatch.cs @@ -0,0 +1,175 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace Titanium.Quic.UdpOffload; + +/// Batch send and receive. The portable socket path remains when this is off. +internal static class UdpOffloadBatch +{ + private static readonly object Gate = new(); + + private static bool _probed; + + private static bool _send; + + private static bool _segment; + + private static bool _receive; + + internal static bool IsEnabled + { + get + { + if (string.Equals(Environment.GetEnvironmentVariable("TITANIUM_UDP_OFFLOAD"), "0", StringComparison.Ordinal)) + { + return false; + } + + Probe(); + return _send; + } + } + + internal static bool SegmentSupported + { + get + { + if (!IsEnabled) + { + return false; + } + + return _segment; + } + } + + internal static bool TrySend(Socket socket, ReadOnlyMemory> datagrams, IPEndPoint destination, out int datagramsSent, out int bytes) + { + datagramsSent = 0; + bytes = 0; + if (!IsEnabled || !OperatingSystem.IsLinux()) + { + return false; + } + + return LinuxUdp.Send(socket, datagrams, destination, SegmentSupported, out datagramsSent, out bytes); + } + + internal static int TryReceive(Socket socket, Span buffer, Span counts) + { + if (!IsEnabled || !OperatingSystem.IsLinux()) + { + return 0; + } + + return LinuxUdp.Receive(socket, buffer, counts); + } + + /// True when the batch read is available: Linux, the offload is not switched off, and the probe accepted it. + internal static bool ReceiveEnabled => IsEnabled && _receive && OperatingSystem.IsLinux(); + + /// + /// Takes the storage for from a process-wide pool. The caller owns it until + /// . The storage is large (2 MiB, pinned), so it is built once and shared instead of once per socket. + /// + internal static LinuxUdp.ReceiveBatch RentReceiveBatch() + { + return Pool.TryPop(out LinuxUdp.ReceiveBatch? batch) ? batch : new LinuxUdp.ReceiveBatch(); + } + + internal static void ReturnReceiveBatch(LinuxUdp.ReceiveBatch batch) + { + batch.Clear(); + Pool.Push(batch); + } + + private static readonly System.Collections.Concurrent.ConcurrentStack Pool = new(); + + /// Stores the datagrams the socket already holds, up to . Each keeps its own source address. Returns 0 when none are queued. + internal static int TryReceive(Socket socket, LinuxUdp.ReceiveBatch batch, int limit) + { + return OperatingSystem.IsLinux() ? LinuxUdp.Receive(socket, batch, limit) : 0; + } + + // Two senders, so a call that filled one address for every message would show here. + private static bool ProbeReceive(Socket left, Socket right) + { + using var other = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + other.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + var target = (IPEndPoint)right.LocalEndPoint!; + left.SendTo(new byte[] { 1, 2, 3 }, target); + other.SendTo(new byte[] { 4 }, target); + var batch = new LinuxUdp.ReceiveBatch(); + + // Loopback delivery finishes inside SendTo, so both datagrams are queued by now. + int got = LinuxUdp.Receive(right, batch, 2); + return got == 2 + && batch.Datagram(0).Length == 3 + && batch.Datagram(1).Length == 1 + && batch.Datagram(0)[0] == 1 + && batch.Datagram(1)[0] == 4 + && batch.Remote(0).Equals(left.LocalEndPoint) + && batch.Remote(1).Equals(other.LocalEndPoint); + } + + private static void Probe() + { + if (_probed || !OperatingSystem.IsLinux()) + { + _probed = true; + return; + } + + lock (Gate) + { + if (_probed) + { + return; + } + + _probed = true; + try + { + using var left = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + using var right = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + left.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + right.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + var first = new byte[] { 1, 2 }; + var second = new byte[] { 3, 4 }; + ReadOnlyMemory[] messages = [first, second]; + if (!LinuxUdp.Send(left, messages, (IPEndPoint)right.LocalEndPoint!, false, out int sent, out _) || sent != 2) + { + return; + } + + var buffer = new byte[64]; + var counts = new int[2]; + int slice = buffer.Length / counts.Length; + if (LinuxUdp.Receive(right, buffer, counts) != 2 || counts[0] != 2 || counts[1] != 2 || buffer[0] != 1 || buffer[1] != 2 || buffer[slice] != 3 || buffer[slice + 1] != 4) + { + return; + } + + _send = true; + _receive = ProbeReceive(left, right); + var same = new byte[] { 5, 6 }; + ReadOnlyMemory[] pair = [same, same]; + if (!LinuxUdp.Send(left, pair, (IPEndPoint)right.LocalEndPoint!, true, out int segmented, out _) || segmented != 2) + { + return; + } + + Array.Clear(buffer); + Array.Clear(counts); + if (LinuxUdp.Receive(right, buffer, counts) == 2 && counts[0] == 2 && counts[1] == 2 && buffer[0] == 5 && buffer[slice] == 5) + { + _segment = true; + } + } + catch (SocketException) + { + } + } + } +} diff --git a/src/Titanium.Quic/AssemblyMarker.cs b/src/Titanium.Quic/AssemblyMarker.cs new file mode 100644 index 000000000..5b7c02a9f --- /dev/null +++ b/src/Titanium.Quic/AssemblyMarker.cs @@ -0,0 +1,7 @@ +namespace Titanium.Quic; + +/// Build marker so the test host can load this assembly. +internal static class AssemblyMarker +{ + internal const string Name = "Titanium.Quic"; +} diff --git a/src/Titanium.Quic/BannedSymbols.txt b/src/Titanium.Quic/BannedSymbols.txt new file mode 100644 index 000000000..c231552d7 --- /dev/null +++ b/src/Titanium.Quic/BannedSymbols.txt @@ -0,0 +1,19 @@ +T:System.Runtime.InteropServices.DllImportAttribute;P/Invoke is not allowed in the managed TLS stack. +T:System.Runtime.InteropServices.LibraryImportAttribute;P/Invoke is not allowed in the managed TLS stack. +M:System.Threading.Tasks.Task.Run(System.Action);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task});Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Wait;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Int32);Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Threading.CancellationToken);Blocking on a task hides the caller. Await at the I/O boundary. +P:System.Threading.Tasks.Task`1.Result;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Thread.Sleep(System.Int32);Use TimeProvider and timers, not thread sleeps. +M:System.Random.#ctor;Entropy goes through IEntropySource. +M:System.Random.#ctor(System.Int32);Entropy goes through IEntropySource. +T:System.IO.Pipelines.Pipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeReader;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeWriter;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.IDuplexPipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.Threading.Channels.Channel;No producer and consumer hop on the data path. +T:System.Threading.Channels.Channel`2;No producer and consumer hop on the data path. diff --git a/src/Titanium.Quic/Internal/ChaCha20Block.cs b/src/Titanium.Quic/Internal/ChaCha20Block.cs new file mode 100644 index 000000000..7c5fef2a5 --- /dev/null +++ b/src/Titanium.Quic/Internal/ChaCha20Block.cs @@ -0,0 +1,81 @@ +using System; +using System.Numerics; + +namespace Titanium.Quic; + +/// +/// One ChaCha20 block (RFC 8439 section 2.3). The counter is a parameter because QUIC header protection takes it from the sample. +/// +internal static class ChaCha20Block +{ + internal static void Write(ReadOnlySpan key, uint counter, ReadOnlySpan nonce, Span destination) + { + ArgumentOutOfRangeException.ThrowIfNotEqual(key.Length, 32); + ArgumentOutOfRangeException.ThrowIfNotEqual(nonce.Length, 12); + ArgumentOutOfRangeException.ThrowIfLessThan(destination.Length, 64); + Span state = stackalloc uint[16]; + Span working = stackalloc uint[16]; + state[0] = 0x61707865; + state[1] = 0x3320646e; + state[2] = 0x79622d32; + state[3] = 0x6b206574; + for (int i = 0; i < 8; i++) + { + state[4 + i] = Word(key, i * 4); + } + + state[12] = counter; + state[13] = Word(nonce, 0); + state[14] = Word(nonce, 4); + state[15] = Word(nonce, 8); + state.CopyTo(working); + for (int i = 0; i < 10; i++) + { + Quarter(ref working[0], ref working[4], ref working[8], ref working[12]); + Quarter(ref working[1], ref working[5], ref working[9], ref working[13]); + Quarter(ref working[2], ref working[6], ref working[10], ref working[14]); + Quarter(ref working[3], ref working[7], ref working[11], ref working[15]); + Quarter(ref working[0], ref working[5], ref working[10], ref working[15]); + Quarter(ref working[1], ref working[6], ref working[11], ref working[12]); + Quarter(ref working[2], ref working[7], ref working[8], ref working[13]); + Quarter(ref working[3], ref working[4], ref working[9], ref working[14]); + } + + for (int i = 0; i < 16; i++) + { + working[i] += state[i]; + int at = i * 4; + destination[at] = (byte)working[i]; + destination[at + 1] = (byte)(working[i] >> 8); + destination[at + 2] = (byte)(working[i] >> 16); + destination[at + 3] = (byte)(working[i] >> 24); + } + + state.Clear(); + working.Clear(); + } + + private static uint Word(ReadOnlySpan source, int offset) + { + return source[offset] + | ((uint)source[offset + 1] << 8) + | ((uint)source[offset + 2] << 16) + | ((uint)source[offset + 3] << 24); + } + + private static void Quarter(ref uint a, ref uint b, ref uint c, ref uint d) + { + a += b; + d ^= a; + d = BitOperations.RotateLeft(d, 16); + c += d; + b ^= c; + b = BitOperations.RotateLeft(b, 12); + a += b; + d ^= a; + d = BitOperations.RotateLeft(d, 8); + c += d; + b ^= c; + b = BitOperations.RotateLeft(b, 7); + } +} diff --git a/src/Titanium.Quic/Internal/QuicAckTracker.cs b/src/Titanium.Quic/Internal/QuicAckTracker.cs new file mode 100644 index 000000000..893f62eec --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicAckTracker.cs @@ -0,0 +1,132 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// +/// Received packet numbers for one packet number space, kept as descending ranges so one ACK +/// frame can acknowledge everything that arrived. A receiver that acknowledged only the largest +/// number would strand every older packet as permanently lost once a single ACK was dropped. +/// +internal sealed class QuicAckTracker +{ + internal const int MaxRanges = QuicFrameReader.MaxAckRanges; + + private readonly List _ranges = []; + + internal ulong? Largest => _ranges.Count == 0 ? null : _ranges[0].Largest; + + /// Records a received number. The caller has already rejected duplicates. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Accept(ulong number) + { + for (int i = 0; i < _ranges.Count; i++) + { + Range range = _ranges[i]; + if (number > range.Largest) + { + if (number == range.Largest + 1) + { + range.Largest = number; + _ranges[i] = range; + Join(i); + return; + } + + _ranges.Insert(i, new Range(number, number)); + Prune(); + return; + } + + if (number >= range.Smallest) + { + return; + } + + if (number == range.Smallest - 1) + { + range.Smallest = number; + _ranges[i] = range; + Join(i); + return; + } + } + + _ranges.Add(new Range(number, number)); + Prune(); + } + + /// Writes the ranges newest first. Returns the count, or 0 when nothing is held. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int Fill(Span destination, out ulong largest) + { + largest = 0; + if (_ranges.Count == 0 || destination.Length == 0) + { + return 0; + } + + int count = Math.Min(_ranges.Count, destination.Length); + largest = _ranges[0].Largest; + destination[0] = new QuicAckRange { Length = _ranges[0].Largest - _ranges[0].Smallest }; + for (int i = 1; i < count; i++) + { + Range previous = _ranges[i - 1]; + Range current = _ranges[i]; + destination[i] = new QuicAckRange + { + // RFC 9000 section 19.3.1: the gap counts the unacknowledged numbers between ranges. + Gap = previous.Smallest - current.Largest - 2, + Length = current.Largest - current.Smallest, + }; + } + + return count; + } + + internal void Clear() => _ranges.Clear(); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Join(int index) + { + if (index + 1 >= _ranges.Count) + { + return; + } + + Range upper = _ranges[index]; + Range lower = _ranges[index + 1]; + if (upper.Smallest > lower.Largest && upper.Smallest - 1 != lower.Largest) + { + return; + } + + _ranges[index] = new Range(upper.Largest, lower.Smallest); + _ranges.RemoveAt(index + 1); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Prune() + { + if (_ranges.Count <= MaxRanges) + { + return; + } + + _ranges.RemoveRange(MaxRanges, _ranges.Count - MaxRanges); + } + + private struct Range + { + internal Range(ulong largest, ulong smallest) + { + Largest = largest; + Smallest = smallest; + } + + internal ulong Largest; + + internal ulong Smallest; + } +} diff --git a/src/Titanium.Quic/Internal/QuicAesBlock.cs b/src/Titanium.Quic/Internal/QuicAesBlock.cs new file mode 100644 index 000000000..16e0bc6d6 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicAesBlock.cs @@ -0,0 +1,87 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; + +namespace Titanium.Quic; + +/// +/// One AES-128 block encryption with the AES-NI instructions. Header protection needs a single +/// 16-byte block per packet, and a cipher context from the platform library costs more than the +/// packet's AEAD. The instructions run in constant time. A CPU without them keeps the platform path. +/// +internal sealed class QuicAesBlock +{ + private const int Rounds = 10; + + private readonly Vector128[] _round = new Vector128[Rounds + 1]; + + private QuicAesBlock() + { + } + + internal static bool IsSupported => Aes.IsSupported && Sse2.IsSupported; + + /// Returns null when the instructions are missing or the key is not 16 bytes. + internal static QuicAesBlock? TryCreate(ReadOnlySpan key) + { + if (!IsSupported || key.Length != 16) + { + return null; + } + + var block = new QuicAesBlock(); + Vector128 current = Vector128.Create(key); + block._round[0] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x01)); + block._round[1] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x02)); + block._round[2] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x04)); + block._round[3] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x08)); + block._round[4] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x10)); + block._round[5] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x20)); + block._round[6] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x40)); + block._round[7] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x80)); + block._round[8] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x1B)); + block._round[9] = current; + current = Expand(current, Aes.KeygenAssist(current, 0x36)); + block._round[10] = current; + return block; + } + + /// Encrypts one 16-byte block. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Encrypt(ReadOnlySpan input, Span output) + { + Vector128 state = Sse2.Xor(Vector128.Create(input), _round[0]); + for (int i = 1; i < Rounds; i++) + { + state = Aes.Encrypt(state, _round[i]); + } + + state = Aes.EncryptLast(state, _round[Rounds]); + state.CopyTo(output); + } + + internal void Clear() + { + Array.Clear(_round); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static Vector128 Expand(Vector128 key, Vector128 assist) + { + Vector128 word = Sse2.Shuffle(assist.AsInt32(), 0xFF).AsByte(); + key = Sse2.Xor(key, Sse2.ShiftLeftLogical128BitLane(key, 4)); + key = Sse2.Xor(key, Sse2.ShiftLeftLogical128BitLane(key, 4)); + key = Sse2.Xor(key, Sse2.ShiftLeftLogical128BitLane(key, 4)); + return Sse2.Xor(key, word); + } +} diff --git a/src/Titanium.Quic/Internal/QuicCongestion.cs b/src/Titanium.Quic/Internal/QuicCongestion.cs new file mode 100644 index 000000000..cff557b43 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicCongestion.cs @@ -0,0 +1,357 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// Bytes in flight and the congestion window. Loss recovery calls this; it does not keep a timer. +internal interface ICongestionController +{ + long CongestionWindow { get; } + + long BytesInFlight { get; } + + long MinimumWindow { get; } + + void OnSent(int bytes); + + void OnAcked(int bytes, DateTimeOffset sent, DateTimeOffset now, bool grow); + + void OnLost(int bytes, DateTimeOffset sent, DateTimeOffset now, bool persistentCongestion); + + void OnDiscarded(int bytes); +} + +/// NewReno from RFC 9002 section 7 and Appendix B. +internal sealed class QuicNewReno : ICongestionController +{ + internal const int MaxDatagramSize = 1200; + + private const long InitialWindowBytes = 12000; + + private const long MinimumWindowBytes = 2 * MaxDatagramSize; + + private DateTimeOffset? _recoveryStart; + + internal QuicNewReno() + { + CongestionWindow = InitialWindowBytes; + SlowStartThreshold = long.MaxValue; + } + + public long CongestionWindow { get; private set; } + + public long BytesInFlight { get; private set; } + + public long MinimumWindow => MinimumWindowBytes; + + private long SlowStartThreshold { get; set; } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void OnSent(int bytes) + { + BytesInFlight += bytes; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void OnAcked(int bytes, DateTimeOffset sent, DateTimeOffset now, bool grow) + { + _ = now; + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + + if (!grow) + { + return; + } + + if (_recoveryStart is DateTimeOffset start && sent <= start) + { + return; + } + + if (CongestionWindow < SlowStartThreshold) + { + CongestionWindow += bytes; + return; + } + + CongestionWindow += MaxDatagramSize * (long)bytes / CongestionWindow; + } + + public void OnLost(int bytes, DateTimeOffset sent, DateTimeOffset now, bool persistentCongestion) + { + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + + if (persistentCongestion) + { + CongestionWindow = MinimumWindowBytes; + _recoveryStart = null; + return; + } + + if (_recoveryStart is DateTimeOffset start && sent <= start) + { + return; + } + + _recoveryStart = now; + SlowStartThreshold = CongestionWindow / 2; + CongestionWindow = Math.Max(SlowStartThreshold, MinimumWindowBytes); + } + + public void OnDiscarded(int bytes) + { + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + } +} + +/// +/// CUBIC from RFC 9438. The window is in bytes and one segment is . +/// Slow start follows Reno. Fast convergence stays off because a connection is one flow. +/// A connection uses it only when the caller passes it in. The parameterless constructor stays on NewReno. +/// +internal sealed class QuicCubic : ICongestionController +{ + private const double Beta = 0.7; + + private const double CubicC = 0.4; + + private const long InitialWindowBytes = 12000; + + private const long MinimumWindowBytes = 2 * QuicNewReno.MaxDatagramSize; + + private DateTimeOffset? _recoveryStart; + + private DateTimeOffset? _epoch; + + private DateTimeOffset? _lastAck; + + private double _cwnd = InitialWindowBytes; + + private double _wMax; + + private double _cwndEpoch = InitialWindowBytes; + + private double _cwndPrior = InitialWindowBytes; + + private double _wEst = InitialWindowBytes; + + private double _srttSeconds = 0.001; + + private bool _haveRtt; + + private bool _kZero; + + private bool _alphaIsReno; + + internal QuicCubic() + { + CongestionWindow = InitialWindowBytes; + SlowStartThreshold = long.MaxValue; + } + + public long CongestionWindow { get; private set; } + + public long BytesInFlight { get; private set; } + + public long MinimumWindow => MinimumWindowBytes; + + private long SlowStartThreshold { get; set; } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void OnSent(int bytes) + { + BytesInFlight += bytes; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void OnAcked(int bytes, DateTimeOffset sent, DateTimeOffset now, bool grow) + { + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + + if (now > sent) + { + double sample = (now - sent).TotalSeconds; + _srttSeconds = _haveRtt ? ((_srttSeconds * 7.0) + sample) / 8.0 : sample; + _haveRtt = true; + } + + if (!grow || (_recoveryStart is DateTimeOffset start && sent <= start)) + { + Exclude(now); + return; + } + + if (CongestionWindow < SlowStartThreshold) + { + _cwnd += bytes; + Publish(); + _lastAck = now; + return; + } + + Avoid(bytes, now); + } + + public void OnLost(int bytes, DateTimeOffset sent, DateTimeOffset now, bool persistentCongestion) + { + long flight = BytesInFlight; + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + + if (persistentCongestion) + { + _cwnd = MinimumWindowBytes; + SlowStartThreshold = Math.Max((long)(flight * Beta), MinimumWindowBytes); + _wMax = _cwnd; + _kZero = true; + BeginAvoidance(now); + _recoveryStart = null; + Publish(); + return; + } + + if (_recoveryStart is DateTimeOffset start && sent <= start) + { + return; + } + + _recoveryStart = now; + _wMax = _cwnd; + _cwndPrior = _cwnd; + _kZero = false; + long reduced = (long)(flight * Beta); + if (reduced < MinimumWindowBytes) + { + reduced = MinimumWindowBytes; + } + + SlowStartThreshold = reduced; + _cwnd = reduced; + _alphaIsReno = false; + BeginAvoidance(now); + Publish(); + } + + public void OnDiscarded(int bytes) + { + BytesInFlight -= bytes; + if (BytesInFlight < 0) + { + BytesInFlight = 0; + } + } + + private void BeginAvoidance(DateTimeOffset now) + { + _epoch = now; + _lastAck = now; + _cwndEpoch = _cwnd; + _wEst = _cwnd; + } + + private void Exclude(DateTimeOffset now) + { + if (_epoch is DateTimeOffset epoch && _lastAck is DateTimeOffset last && now > last) + { + _epoch = epoch + (now - last); + } + + _lastAck = now; + } + + private void Avoid(int bytes, DateTimeOffset now) + { + if (_epoch is not DateTimeOffset epoch) + { + BeginAvoidance(now); + epoch = now; + } + + double elapsed = (now - epoch).TotalSeconds; + if (elapsed < 0) + { + elapsed = 0; + } + + double smss = QuicNewReno.MaxDatagramSize; + double cwndSeg = _cwnd / smss; + if (cwndSeg < 1) + { + cwndSeg = 1; + } + + double alpha = _alphaIsReno ? 1.0 : 3.0 * (1.0 - Beta) / (1.0 + Beta); + _wEst += alpha * bytes * smss / _cwnd; + if (_wEst >= _cwndPrior) + { + _alphaIsReno = true; + } + + double k = 0; + if (!_kZero) + { + double gap = (_wMax - _cwndEpoch) / smss; + k = gap > 0 ? Math.Cbrt(gap / CubicC) : 0; + } + + double wMaxSeg = _wMax / smss; + double cubicNow = (CubicC * Math.Pow(elapsed - k, 3)) + wMaxSeg; + double cubicNext = (CubicC * Math.Pow(elapsed + _srttSeconds - k, 3)) + wMaxSeg; + if (cubicNow < _wEst / smss) + { + _cwnd = _wEst; + } + else + { + double target = cubicNext; + if (target < cwndSeg) + { + target = cwndSeg; + } + else if (target > 1.5 * cwndSeg) + { + target = 1.5 * cwndSeg; + } + + _cwnd += bytes * (target - cwndSeg) / cwndSeg; + if (_cwnd < _wEst) + { + _cwnd = _wEst; + } + } + + _lastAck = now; + Publish(); + } + + private void Publish() + { + long window = (long)Math.Round(_cwnd); + if (window < MinimumWindowBytes) + { + window = MinimumWindowBytes; + } + + CongestionWindow = window; + _cwnd = window; + } +} diff --git a/src/Titanium.Quic/Internal/QuicConnectionCore.cs b/src/Titanium.Quic/Internal/QuicConnectionCore.cs new file mode 100644 index 000000000..95c433ce7 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicConnectionCore.cs @@ -0,0 +1,633 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// One network path. Amplification and validation are per path. +internal readonly struct PathInfo : IEquatable +{ + private readonly ushort _localPort; + + private readonly ushort _remotePort; + + private readonly byte _localLength; + + private readonly byte _remoteLength; + + private readonly ulong _localHigh; + + private readonly ulong _localLow; + + private readonly ulong _remoteHigh; + + private readonly ulong _remoteLow; + + internal PathInfo(ReadOnlySpan localAddress, int localPort, ReadOnlySpan remoteAddress, int remotePort) + { + if (localAddress.Length is < 1 or > 16 || remoteAddress.Length is < 1 or > 16) + { + throw new ArgumentOutOfRangeException(nameof(localAddress)); + } + + if ((uint)localPort > ushort.MaxValue || (uint)remotePort > ushort.MaxValue) + { + throw new ArgumentOutOfRangeException(nameof(localPort)); + } + + _localPort = (ushort)localPort; + _remotePort = (ushort)remotePort; + _localLength = (byte)localAddress.Length; + _remoteLength = (byte)remoteAddress.Length; + _localHigh = Pack(localAddress, 0); + _localLow = Pack(localAddress, 8); + _remoteHigh = Pack(remoteAddress, 0); + _remoteLow = Pack(remoteAddress, 8); + } + + public bool Equals(PathInfo other) + { + return _localPort == other._localPort + && _remotePort == other._remotePort + && _localLength == other._localLength + && _remoteLength == other._remoteLength + && _localHigh == other._localHigh + && _localLow == other._localLow + && _remoteHigh == other._remoteHigh + && _remoteLow == other._remoteLow; + } + + public override bool Equals(object? obj) => obj is PathInfo other && Equals(other); + + public override int GetHashCode() => HashCode.Combine(_localPort, _remotePort, _localHigh, _remoteLow); + + private static ulong Pack(ReadOnlySpan address, int offset) + { + ulong value = 0; + int end = Math.Min(address.Length, offset + 8); + for (int i = offset; i < end; i++) + { + value |= (ulong)address[i] << ((i - offset) * 8); + } + + return value; + } +} + +internal readonly struct QuicConnectionId : IEquatable +{ + private readonly byte _length; + + private readonly ulong _first; + + private readonly ulong _second; + + private readonly uint _tail; + + internal QuicConnectionId(ReadOnlySpan bytes) + { + if ((uint)bytes.Length > QuicDatagramReader.MaxConnectionIdLength) + { + throw new ArgumentOutOfRangeException(nameof(bytes)); + } + + _length = (byte)bytes.Length; + _first = Pack(bytes, 0, 8); + _second = Pack(bytes, 8, 8); + _tail = (uint)Pack(bytes, 16, 4); + } + + internal int Length => _length; + + internal bool Matches(ReadOnlySpan bytes) + { + return bytes.Length == _length && new QuicConnectionId(bytes).Equals(this); + } + + public bool Equals(QuicConnectionId other) + { + return _length == other._length && _first == other._first && _second == other._second && _tail == other._tail; + } + + public override bool Equals(object? obj) => obj is QuicConnectionId other && Equals(other); + + public override int GetHashCode() => HashCode.Combine(_length, _first, _second, _tail); + + private static ulong Pack(ReadOnlySpan bytes, int offset, int width) + { + ulong value = 0; + int end = Math.Min(bytes.Length, offset + width); + for (int i = offset; i < end; i++) + { + value |= (ulong)bytes[i] << ((i - offset) * 8); + } + + return value; + } +} + +/// +/// Routes a datagram to a connection that already owns the destination connection ID. +/// An unknown ID does not allocate a connection. +/// +internal sealed class QuicConnectionTable +{ + private readonly List _ids = []; + + private readonly List _cores = []; + + internal int Count => _cores.Count; + + internal void Add(QuicConnectionId id, QuicConnectionCore core) + { + _ids.Add(id); + _cores.Add(core); + } + + internal bool TryDispatch(DateTimeOffset now, ReadOnlySpan datagram, in PathInfo path) + { + if (!TryFind(datagram, out QuicConnectionCore? core) || core is null) + { + return false; + } + + core.HandleDatagram(now, datagram, path); + return true; + } + + private bool TryFind(ReadOnlySpan datagram, out QuicConnectionCore? core) + { + core = null; + if (datagram.IsEmpty) + { + return false; + } + + if ((datagram[0] & 0x80) != 0) + { + if (datagram.Length < 6) + { + return false; + } + + int length = datagram[5]; + if (length > QuicDatagramReader.MaxConnectionIdLength || datagram.Length < 6 + length) + { + return false; + } + + var id = new QuicConnectionId(datagram.Slice(6, length)); + for (int i = 0; i < _ids.Count; i++) + { + if (_ids[i].Equals(id)) + { + core = _cores[i]; + return true; + } + } + + return false; + } + + int best = -1; + for (int i = 0; i < _ids.Count; i++) + { + int length = _ids[i].Length; + if (datagram.Length >= 1 + length && _ids[i].Matches(datagram.Slice(1, length)) && (best < 0 || length > _ids[best].Length)) + { + best = i; + } + } + + if (best < 0) + { + return false; + } + + core = _cores[best]; + return true; + } +} + +/// +/// Sans-IO connection. Time and datagrams come from the caller. There is no socket and no timer here. +/// +internal sealed partial class QuicConnectionCore +{ + private readonly List _paths = []; + + private readonly List _staged = []; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal DateTimeOffset? NextTimeout() + { + // A connection that timed out or took a stateless reset sends nothing more, so no timer can still be due. + if (IdleTimedOut || ClosedByStatelessReset) + { + return null; + } + + DateTimeOffset? soonest = _loss.Timeout; + Consider(PaceDeadline(), ref soonest); + Consider(_idleDeadline, ref soonest); + Consider(_keepAliveDeadline, ref soonest); + Consider(AckDeadline, ref soonest); + return soonest; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Consider(DateTimeOffset? candidate, ref DateTimeOffset? soonest) + { + if (candidate is null) + { + return; + } + + if (soonest is null || candidate.Value < soonest.Value) + { + soonest = candidate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void HandleDatagram(DateTimeOffset now, ReadOnlySpan datagram, in PathInfo path) + { + _now = now; + if (HandshakeComplete) + { + _loss.HandshakeConfirmed = true; + } + + AddReceived(path, datagram.Length); + _path = path; + _hasPath = true; + if (_engine is not null && !IsClosed) + { + AcceptDatagram(datagram); + } + + ArmKeepAlive(); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool HandleTimeout(DateTimeOffset now) + { + _now = now; + if (HandshakeComplete) + { + _loss.HandshakeConfirmed = true; + } + + if (_idleDeadline is DateTimeOffset idle && now >= idle) + { + IdleTimedOut = true; + IsClosed = true; + _idleDeadline = null; + _keepAliveDeadline = null; + return true; + } + + SendDueAcknowledgement(now); + bool sentKeepAlive = false; + if (KeepAliveDue(now)) + { + SendKeepAlive(); + KeepAlivesSent++; + _keepAliveDeadline = now + _keepAliveInterval; + sentKeepAlive = true; + } + else + { + ArmKeepAlive(); + } + + if (_loss.Timeout is DateTimeOffset due && now >= due) + { + _loss.OnTimeout(now); + foreach (QuicRetransmit probe in _loss.Pending) + { + Retransmit(probe.Kind, probe.Payload); + } + + ObservePathMtu(); + return true; + } + + return sentKeepAlive || NextTimeout() is DateTimeOffset pace && now >= pace; + } + + internal void MarkAddressValidated(in PathInfo path) + { + int index = IndexOf(path); + if (index < 0) + { + _paths.Add(new PathState { Path = path, Validated = true }); + return; + } + + PathState state = _paths[index]; + state.Validated = true; + _paths[index] = state; + } + + internal bool TryStageTransmit( + in PathInfo path, + ReadOnlySpan datagram, + bool track = false, + QuicPacketKind kind = default, + ulong number = 0, + byte[]? payload = null, + bool probe = false, + bool pmtu = false, + bool exempt = false) + { + if (datagram.IsEmpty || datagram.Length > 65535) + { + return false; + } + + byte[] rented = ArrayPool.Shared.Rent(datagram.Length); + datagram.CopyTo(rented); + _staged.Add(new Staged + { + Buffer = rented, + Length = datagram.Length, + Path = path, + Track = track, + Kind = kind, + Number = number, + Payload = payload, + Probe = probe, + Pmtu = pmtu, + Exempt = exempt, + }); + return true; + } + + internal void Migrate(in PathInfo path) + { + _path = path; + _hasPath = true; + if (IndexOf(path) < 0) + { + _paths.Add(new PathState { Path = path }); + } + } + + internal TimeSpan SmoothedRtt => _loss.SmoothedRtt; + + /// Moves the clock forward for work the application starts between datagrams, so an acknowledgement it carries reports the time it waited. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void ObserveTime(DateTimeOffset now) + { + if (now > _now) + { + _now = now; + } + } + + internal long CongestionWindow => _loss.CongestionWindow; + + internal long BytesInFlight => _loss.BytesInFlight; + + internal bool IsPathValidated(in PathInfo path) + { + int index = IndexOf(path); + return index >= 0 && _paths[index].Validated; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int PollTransmit(DateTimeOffset now, Span destination, out PathInfo path) + { + _now = now; + path = default; + if (ClosedByStatelessReset || IdleTimedOut) + { + return 0; + } + + // Stream bytes refused by the congestion window stay queued until a later poll. + StageReady(); + + int chosen = SelectStaged(destination.Length, data: true); + if (chosen < 0) + { + chosen = SelectStaged(destination.Length, data: false); + } + + if (chosen < 0) + { + return 0; + } + + Staged staged = _staged[chosen]; + if (!Fits(staged.Path, staged.Length, out int pathIndex)) + { + return 0; + } + + staged.Buffer.AsSpan(0, staged.Length).CopyTo(destination); + ArrayPool.Shared.Return(staged.Buffer); + _staged.RemoveAt(chosen); + PathState state = _paths[pathIndex]; + state.Sent += staged.Length; + _paths[pathIndex] = state; + path = staged.Path; + if (staged.Exempt && !staged.Pmtu && !staged.Probe && QuicPathCounters.Enabled) + { + QuicPathCounters.AckOnly(); + } + + _ids.MarkUsed(DestinationId()); + if (staged.Track && staged.Payload is not null) + { + int accounted = staged.Exempt ? 0 : staged.Length; + _loss.OnPacketSent(staged.Kind, staged.Number, accounted, now, staged.Payload, staged.Pmtu); + if (staged.Kind == QuicPacketKind.OneRtt) + { + LastSentApplication = staged.Number; + } + + if (!staged.Pmtu && !staged.Exempt) + { + NoteAckElicitingSend(); + } + } + + return staged.Length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int SelectStaged(int destinationLength, bool data) + { + bool deferData = false; + for (int i = 0; i < _staged.Count; i++) + { + Staged staged = _staged[i]; + if (destinationLength < staged.Length || !Fits(staged.Path, staged.Length, out _)) + { + continue; + } + + if (!staged.Pmtu && IsPathValidated(staged.Path) && staged.Length > _mtu.Ceiling) + { + continue; + } + + bool counts = staged.Track && !staged.Probe && !staged.Exempt; + if (data) + { + if (!counts || deferData || !_loss.Allows(staged.Length, staged.Kind)) + { + if (counts) + { + deferData = true; + } + + continue; + } + + return i; + } + + if (!counts) + { + // An ACK-only or probe packet never waits for the congestion window. Two peers + // that both hold data behind a closed window open each other's window only + // through ACKs, so an ACK queued behind that data would stall both directions. + // The packet number was assigned when the packet was staged, so this packet can + // reach the peer ahead of an older number. The peer's replay window accepts that. + return i; + } + } + + return -1; + } + + /// Bytes of staged, unsent packets that count against the congestion window. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private long StagedCountedBytes() + { + long bytes = 0; + for (int i = 0; i < _staged.Count; i++) + { + Staged staged = _staged[i]; + if (staged.Track && !staged.Probe && !staged.Exempt && !staged.Pmtu) + { + bytes += staged.Length; + } + } + + return bytes; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private DateTimeOffset? PaceDeadline() + { + for (int i = 0; i < _staged.Count; i++) + { + Staged staged = _staged[i]; + if (staged.Track && !staged.Probe && !_loss.Allows(staged.Length, staged.Kind)) + { + return _now + _loss.SmoothedRtt; + } + } + + return null; + } + + internal long BytesReceived(in PathInfo path) + { + int index = IndexOf(path); + return index < 0 ? 0 : _paths[index].Received; + } + + internal long BytesSent(in PathInfo path) + { + int index = IndexOf(path); + return index < 0 ? 0 : _paths[index].Sent; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void AddReceived(in PathInfo path, int length) + { + int index = IndexOf(path); + if (index < 0) + { + _paths.Add(new PathState { Path = path, Received = length }); + return; + } + + PathState state = _paths[index]; + state.Received += length; + _paths[index] = state; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Fits(in PathInfo path, int length, out int pathIndex) + { + pathIndex = IndexOf(path); + if (pathIndex < 0) + { + return false; + } + + PathState state = _paths[pathIndex]; + if (!_limitAmplification || state.Validated) + { + return true; + } + + long budget = state.Received > long.MaxValue / 3 ? long.MaxValue : state.Received * 3; + return state.Sent <= budget - length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int IndexOf(in PathInfo path) + { + for (int i = 0; i < _paths.Count; i++) + { + if (_paths[i].Path.Equals(path)) + { + return i; + } + } + + return -1; + } + + private struct PathState + { + internal PathInfo Path; + + internal long Received; + + internal long Sent; + + internal bool Validated; + } + + private struct Staged + { + internal byte[] Buffer; + + internal int Length; + + internal PathInfo Path; + + internal bool Track; + + internal bool Probe; + + internal QuicPacketKind Kind; + + internal ulong Number; + + internal byte[]? Payload; + + internal bool Pmtu; + + internal bool Exempt; + } +} diff --git a/src/Titanium.Quic/Internal/QuicConnectionSession.cs b/src/Titanium.Quic/Internal/QuicConnectionSession.cs new file mode 100644 index 000000000..7c3aa52ed --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicConnectionSession.cs @@ -0,0 +1,666 @@ +#pragma warning disable CA1416 // QuicException is the BCL error type. This library does not start the platform QUIC stack. +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Sockets; +using System.Net.Security; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Tls; + +namespace Titanium.Quic; + +/// One connection, its socket sends, and the single wait that drives loss and idle. +internal sealed class QuicConnectionSession : IDisposable +{ + internal const int ConnectionIdLength = 8; + + private readonly object _gate = new(); + + private readonly QuicConnectionCore _core; + + private readonly IUdpPacketTransport _transport; + + private readonly bool _ownsTransport; + + private readonly CancellationTokenSource _stop = new(); + + private readonly TaskCompletionSource _handshake = new(TaskCreationOptions.RunContinuationsAsynchronously); + + private readonly List _streams = []; + + private Task? _loop; + + private bool _disposed; + + internal QuicConnectionSession(QuicConnectionCore core, IUdpPacketTransport transport, IPEndPoint local, IPEndPoint remote, bool ownsTransport) + { + _core = core; + _transport = transport; + LocalEndPoint = local; + RemoteEndPoint = remote; + _ownsTransport = ownsTransport; + } + + internal IPEndPoint LocalEndPoint { get; } + + internal IPEndPoint RemoteEndPoint { get; private set; } + + internal Task Handshake => _handshake.Task; + + internal bool IsClosed + { + get + { + lock (_gate) + { + return _core.IsClosed; + } + } + } + + /// Describes the connection close state for test diagnostics. + internal string CloseDiagnostics() + { + lock (_gate) + { + return "closed=" + _core.IsClosed + + " error=0x" + _core.CloseError.ToString("x", System.Globalization.CultureInfo.InvariantCulture) + + " statelessReset=" + _core.ClosedByStatelessReset + + " detail=" + _core.HandshakeCloseDetail(); + } + } + + internal void StartClientLoop() => _loop = RunClientAsync(_stop.Token); + + internal void SetRemote(IPEndPoint remote) => RemoteEndPoint = remote; + + /// True once the owner disposed this session. A listener drops such a session instead of driving it. + internal bool IsDisposed + { + get + { + lock (_gate) + { + return _disposed; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Handle(ReadOnlySpan datagram, in PathInfo path, DateTimeOffset now, bool holdAcknowledgement = false) + { + lock (_gate) + { + if (_disposed) + { + return; + } + + if (holdAcknowledgement) + { + _core.HoldAcknowledgement(); + } + + _core.HandleDatagram(now, datagram, path); + ObserveHandshake(); + } + } + + /// Ends the hold that started. The packets taken since the last acknowledgement are acknowledged once. + internal void ReleaseAcknowledgement() + { + lock (_gate) + { + if (!_disposed) + { + _core.ReleaseAcknowledgement(); + } + } + } + + /// Raises the flow-control window after the application read. Returns true when credit was staged and needs a flush. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool ExtendReadWindow(ulong streamId, int consumed) + { + lock (_gate) + { + if (!_core.TryExtendReadWindow(streamId, consumed, out ulong streamLimit, out ulong connectionLimit)) + { + return false; + } + + _core.GrantStreamCredit(streamId, streamLimit, connectionLimit); + return true; + } + } + + internal bool TakePendingHello(out string serverName) + { + lock (_gate) + { + serverName = _core.PendingServerName; + return _core.PendingHello; + } + } + + internal bool CompleteHello(X509Certificate2 certificate, string[]? applicationProtocols = null) + { + lock (_gate) + { + bool completed = _core.CompleteHello(certificate, applicationProtocols); + ObserveHandshake(); + return completed; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Timeout(DateTimeOffset now) + { + lock (_gate) + { + if (_disposed) + { + return; + } + + if (_core.NextTimeout() is DateTimeOffset due && due <= now) + { + _core.HandleTimeout(now); + ObserveHandshake(); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal DateTimeOffset? NextTimeout() + { + lock (_gate) + { + return _disposed ? null : _core.NextTimeout(); + } + } + + internal void Close(long errorCode) + { + lock (_gate) + { + _core.Close(errorCode < 0 ? 0 : (ulong)errorCode); + } + } + + internal int CopyReceived(int offset, Span destination) + { + lock (_gate) + { + byte[] all = _core.ReceivedStream; + if (offset >= all.Length || destination.IsEmpty) + { + return 0; + } + + int count = Math.Min(destination.Length, all.Length - offset); + all.AsSpan(offset, count).CopyTo(destination); + return count; + } + } + + internal bool TryOpenLocal(QuicStreamType type, out long id) + { + lock (_gate) + { + if (_core.TryAllocateLocal(type == QuicStreamType.Unidirectional, out ulong allocated)) + { + id = (long)allocated; + return true; + } + } + + id = 0; + return false; + } + + internal bool TryAcceptRemote(QuicStreamType type, out long id) + { + lock (_gate) + { + if (_core.TryAllocateRemote(type == QuicStreamType.Unidirectional, out ulong allocated)) + { + id = (long)allocated; + return true; + } + } + + id = 0; + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int CopyDelivered(ulong streamId, int offset, Span destination) + { + lock (_gate) + { + return _core.CopyDelivered(streamId, offset, destination); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool IsStreamReadClosed(ulong streamId, int offset) + { + lock (_gate) + { + return _core.IsStreamReadClosed(streamId, offset); + } + } + + internal void Ping() + { + lock (_gate) + { + _core.SendKeepAlive(); + } + } + + internal void Finish(ulong streamId) + { + lock (_gate) + { + _core.ObserveTime(TimeProvider.System.GetUtcNow()); + _core.FinishStream(streamId); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Send(ulong streamId, ReadOnlySpan data) + { + lock (_gate) + { + if (_core.IsClosed) + { + string why = _core.ClosedByStatelessReset + ? "a stateless reset" + : "error 0x" + _core.CloseError.ToString("x", System.Globalization.CultureInfo.InvariantCulture); + throw new QuicException(QuicError.ConnectionAborted, (long)_core.CloseError, "The connection closed with " + why + "."); + } + + _core.ObserveTime(TimeProvider.System.GetUtcNow()); + int queued = _core.SendStream(streamId, data); + if (queued != data.Length && !_core.StreamSendBlocked) + { + throw new QuicException(QuicError.InternalError, null, "The stream did not accept the write."); + } + } + } + + // A flush with nothing queued is the common case after a datagram. The first drain runs here, so that case never + // builds an async state machine, and the state machine only starts once there is a datagram to send. + internal ValueTask FlushAsync() + { + byte[] buffer = ArrayPool.Shared.Rent(DrainBufferBytes); + ReadOnlyMemory[] slices = ArrayPool>.Shared.Rent(DrainSlices); + int count; + bool more; + try + { + count = Drain(buffer, slices, out more); + } + catch + { + ReturnDrainBuffers(buffer, slices); + throw; + } + + if (count == 0) + { + ReturnDrainBuffers(buffer, slices); + return default; + } + + return FlushQueuedAsync(buffer, slices, count, more); + } + + private async ValueTask FlushQueuedAsync(byte[] buffer, ReadOnlyMemory[] slices, int count, bool more) + { + try + { + while (true) + { + if (count == 1) + { + await _transport.SendAsync(slices[0], RemoteEndPoint, _stop.Token).ConfigureAwait(false); + } + else + { + await _transport.SendBatchAsync(slices.AsMemory(0, count), RemoteEndPoint, _stop.Token).ConfigureAwait(false); + } + + if (!more) + { + return; + } + + count = Drain(buffer, slices, out more); + if (count == 0) + { + return; + } + } + } + finally + { + ReturnDrainBuffers(buffer, slices); + } + } + + private static void ReturnDrainBuffers(byte[] buffer, ReadOnlyMemory[] slices) + { + // Datagrams are ciphertext. The slices hold references to the buffer, so they are cleared for the collector. + ArrayPool>.Shared.Return(slices, clearArray: true); + ArrayPool.Shared.Return(buffer); + } + + internal void AddStream(ManagedQuicStream stream) + { + lock (_gate) + { + _streams.Add(stream); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void NotifyStreams() + { + ManagedQuicStream[] streams; + lock (_gate) + { + streams = _streams.ToArray(); + } + + for (int i = 0; i < streams.Length; i++) + { + streams[i].Notify(); + } + } + + internal void SignalClosedHandshake() + { + if (_core.IsClosed && !_core.HandshakeComplete) + { + _handshake.TrySetException(new QuicException(QuicError.ConnectionAborted, (long)_core.CloseError, "The connection closed before the handshake completed (" + _core.HandshakeCloseDetail() + ").")); + } + } + + public void Dispose() + { + // The flag and the core change together under the gate. A listener that still tracks this + // session sees the flag instead of driving a core whose keys are gone. + lock (_gate) + { + if (_disposed) + { + return; + } + + _disposed = true; + } + + _stop.Cancel(); + DisposeTransport(); + lock (_gate) + { + _core.Dispose(); + } + + _stop.Dispose(); + } + + internal async Task StopAsync() + { + _stop.Cancel(); + DisposeTransport(); + if (_loop is not null) + { + try + { + await _loop.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + } + catch (ObjectDisposedException) + { + } + catch (SocketException) + { + } + } + } + + private bool _transportDisposed; + + private void DisposeTransport() + { + if (_ownsTransport && !_transportDisposed) + { + _transportDisposed = true; + _transport.Dispose(); + } + } + + // Timers that are all due at once are handled in one pass. More back-to-back passes than this mean a stuck deadline. + internal const int MaxImmediateTimeouts = 16; + + internal static readonly TimeSpan StuckTimerRetry = TimeSpan.FromMilliseconds(1); + + private const int DrainBufferBytes = 65536; + + private const int DrainSlices = 64; + + // A datagram never exceeds the transport maximum, which is below this. A batch stops here and the next round continues. + private const int DrainRoom = 2048; + + /// Polls datagrams into one buffer and records one slice per datagram. is true when the batch stopped for space. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int Drain(byte[] buffer, ReadOnlyMemory[] slices, out bool more) + { + more = false; + lock (_gate) + { + if (_disposed) + { + return 0; + } + + int count = 0; + int offset = 0; + while (true) + { + if (count == slices.Length || buffer.Length - offset < DrainRoom) + { + more = true; + break; + } + + int written = _core.PollTransmit(TimeProvider.System.GetUtcNow(), buffer.AsSpan(offset), out _); + if (written <= 0) + { + break; + } + + slices[count++] = buffer.AsMemory(offset, written); + offset += written; + } + + return count; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ObserveHandshake() + { + if (_core.HandshakeComplete) + { + _handshake.TrySetResult(true); + } + else if (_core.IsClosed) + { + _handshake.TrySetException(new QuicException(QuicError.ConnectionAborted, (long)_core.CloseError, "The connection closed before the handshake completed (" + _core.HandshakeCloseDetail() + ").")); + } + } + + private async Task RunClientAsync(CancellationToken cancellationToken) + { + byte[] buffer = ArrayPool.Shared.Rent(65536); + using var wait = new QuicReceiveWait(cancellationToken); + int immediate = 0; + try + { + await FlushAsync().ConfigureAwait(false); + while (!cancellationToken.IsCancellationRequested) + { + NotifyStreams(); + DateTimeOffset now = TimeProvider.System.GetUtcNow(); + DateTimeOffset? due = NextTimeout(); + TimeSpan? armed = null; + if (due is DateTimeOffset deadline) + { + TimeSpan delay = deadline - now; + if (delay > TimeSpan.Zero) + { + immediate = 0; + armed = delay; + } + else if (immediate < MaxImmediateTimeouts) + { + // The core moves its next deadline past now, so the next pass reads a future one. + immediate++; + Timeout(now); + await FlushAsync().ConfigureAwait(false); + continue; + } + else + { + // A deadline that never advances would spin here. A datagram still wakes this wait. + armed = StuckTimerRetry; + } + } + + wait.Arm(armed); + try + { + UdpReceived received = await _transport.ReceiveAsync(buffer.AsMemory(0, 65536), wait.Token).ConfigureAwait(false); + immediate = 0; + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ClientPass(1); + } + + PathInfo path = PathOf(LocalEndPoint, RemoteEndPoint); + Handle(buffer.AsSpan(0, received.Count), path, TimeProvider.System.GetUtcNow()); + NotifyStreams(); + await FlushAsync().ConfigureAwait(false); + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + Timeout(TimeProvider.System.GetUtcNow()); + await FlushAsync().ConfigureAwait(false); + } + catch (SocketException) when (!cancellationToken.IsCancellationRequested) + { + } + } + } + catch (OperationCanceledException) + { + } + catch (ObjectDisposedException) + { + } + catch (SocketException) + { + } + finally + { + ArrayPool.Shared.Return(buffer); + SignalClosedHandshake(); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static PathInfo PathOf(IPEndPoint local, IPEndPoint remote) + { + return new PathInfo(local.Address.GetAddressBytes(), local.Port, remote.Address.GetAddressBytes(), remote.Port); + } + + internal long DefaultStreamErrorCode { get; set; } + + internal void Reset(ulong streamId, long errorCode, ulong finalSize) + { + lock (_gate) + { + _core.ResetStream(streamId, errorCode, finalSize); + } + } + + internal static byte[] Parameters(bool client, byte[] localId, ulong maxStreamsBidi = 16, ulong maxStreamsUni = 16, ulong idleTimeoutMs = 0) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = localId, + MaxIdleTimeout = idleTimeoutMs, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = maxStreamsBidi, + InitialMaxStreamsUni = maxStreamsUni, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = localId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + internal static byte[] NewConnectionId() + { + byte[] id = new byte[ConnectionIdLength]; + RandomNumberGenerator.Fill(id); + return id; + } + + internal static string[]? ProtocolNames(IList? protocols) + { + if (protocols is null || protocols.Count == 0) + { + return null; + } + + var names = new string[protocols.Count]; + for (int i = 0; i < protocols.Count; i++) + { + names[i] = protocols[i].ToString(); + } + + return names; + } + + internal static void RejectFips(bool allow) + { + if (FipsEnvironment.IsEnabled() && !allow && !FipsEnvironment.OverrideIsSet()) + { + throw new QuicException( + QuicError.ConnectionRefused, + null, + "The managed QUIC stack is disabled while FIPS mode is on. Set AllowManagedStackUnderFips or TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1."); + } + } +} diff --git a/src/Titanium.Quic/Internal/QuicDatagramInject.cs b/src/Titanium.Quic/Internal/QuicDatagramInject.cs new file mode 100644 index 000000000..3d8bc6ecd --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicDatagramInject.cs @@ -0,0 +1,31 @@ +using System; + +namespace Titanium.Quic; + +/// Sees one outbound datagram. The path is the virtual tuple the core used for amplification and validation. +internal interface IQuicOutbound +{ + void OnDatagram(ReadOnlySpan datagram, PathInfo path); +} + +/// Feeds one datagram into a connection and hands each reply to the callback. Relays pass a virtual path, not the socket's own tuple. +internal static class QuicDatagramInject +{ + internal static int Deliver(QuicConnectionCore connection, DateTimeOffset now, ReadOnlySpan datagram, in PathInfo path, Span outbound, ref T callback) + where T : IQuicOutbound + { + connection.HandleDatagram(now, datagram, path); + int replies = 0; + while (true) + { + int count = connection.PollTransmit(now, outbound, out PathInfo replyPath); + if (count <= 0) + { + return replies; + } + + callback.OnDatagram(outbound[..count], replyPath); + replies++; + } + } +} diff --git a/src/Titanium.Quic/Internal/QuicFlow.cs b/src/Titanium.Quic/Internal/QuicFlow.cs new file mode 100644 index 000000000..7cc882ed1 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicFlow.cs @@ -0,0 +1,1227 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// +/// Stream and connection flow control, plus reassembly for CRYPTO and STREAM. +/// A limit that does not increase is ignored. Reset and stop-sending are reported once. +/// +internal sealed class QuicFlow +{ + internal const ulong FlowControlError = 0x03; + + internal const ulong StreamLimitError = 0x04; + + internal const ulong StreamStateError = 0x05; + + internal const ulong FinalSizeError = 0x06; + + internal const ulong CryptoBufferExceeded = 0x0d; + + internal const int ReassemblyCap = 16384; + + // Most application bytes in flight at once. The peer's advertised windows bound it as well. 64 KiB keeps one burst of datagrams inside a default UDP receive buffer. + internal const int ApplicationFlightCap = 65536; + + private readonly CryptoLevel _initialCrypto = new(); + + private readonly CryptoLevel _handshakeCrypto = new(); + + private readonly Dictionary _streams = []; + + private ulong _nextLocalBidi; + + private ulong _nextLocalUni; + + private ulong _nextRemoteBidi; + + private ulong _nextRemoteUni; + + private bool _client; + + private ulong _peerMaxData; + + private ulong _peerBidiLocal; + + private ulong _peerBidiRemote; + + private ulong _peerUni; + + private ulong _peerMaxBidi; + + private ulong _peerMaxUni; + + private ulong _localMaxData; + + private ulong _localBidiLocal; + + private ulong _localBidiRemote; + + private ulong _localUni; + + private ulong _localMaxBidi; + + private ulong _localMaxUni; + + private ulong _dataSent; + + private ulong _dataReceived; + + internal bool SendBlocked { get; private set; } + + internal int ResetsDelivered { get; private set; } + + internal int StopsDelivered { get; private set; } + + internal byte? FirstDelivered { get; private set; } + + internal int ReceivedCount + { + get + { + int count = 0; + foreach (StreamFlow stream in _streams.Values) + { + count += stream.Receive.Held; + } + + return count; + } + } + + internal byte[] Received + { + get + { + int count = ReceivedCount; + if (count == 0) + { + return []; + } + + var all = new byte[count]; + int offset = 0; + foreach (StreamFlow stream in _streams.Values) + { + offset += stream.Receive.CopyTo(stream.Receive.Base, all.AsSpan(offset)); + } + + return all; + } + } + + internal void SetLocal(QuicTransportParameters parameters, bool client) + { + _client = client; + _localMaxData = parameters.InitialMaxData; + _localBidiLocal = parameters.InitialMaxStreamDataBidiLocal; + _localBidiRemote = parameters.InitialMaxStreamDataBidiRemote; + _localUni = parameters.InitialMaxStreamDataUni; + _localMaxBidi = parameters.InitialMaxStreamsBidi; + _localMaxUni = parameters.InitialMaxStreamsUni; + } + + internal void SetPeer(QuicTransportParameters parameters) + { + _peerMaxData = parameters.InitialMaxData; + _peerBidiLocal = parameters.InitialMaxStreamDataBidiLocal; + _peerBidiRemote = parameters.InitialMaxStreamDataBidiRemote; + _peerUni = parameters.InitialMaxStreamDataUni; + _peerMaxBidi = parameters.InitialMaxStreamsBidi; + _peerMaxUni = parameters.InitialMaxStreamsUni; + Flush(); + } + + /// Returns every pooled block once the connection is gone. + internal void Discard() + { + foreach (StreamFlow stream in _streams.Values) + { + stream.Send.Discard(); + stream.Receive.Discard(); + stream.Incoming.Discard(); + } + + _streams.Clear(); + _initialCrypto.Discard(); + _handshakeCrypto.Discard(); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int Queue(ulong streamId, ReadOnlySpan data, out bool blocked) + { + blocked = false; + if (data.IsEmpty || !CanOpen(streamId, peer: true)) + { + blocked = true; + SendBlocked = true; + return 0; + } + + StreamFlow stream = Open(streamId); + int pendingBefore = stream.Send.Pending; + stream.Send.Write(data); + + Flush(); + blocked = stream.Send.Pending > 0; + SendBlocked = blocked; + return pendingBefore + data.Length - stream.Send.Pending; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool TryExtendReadWindow(ulong streamId, int consumed, out ulong streamLimit, out ulong connectionLimit) + { + streamLimit = 0; + connectionLimit = 0; + if (consumed <= 0 || !_streams.TryGetValue(streamId, out StreamFlow? stream)) + { + return false; + } + + ulong end = (ulong)consumed; + if (end <= stream.AppConsumed) + { + return false; + } + + stream.AppConsumed = end; + + // Bytes the application already read no longer need a pooled block, so the ring holds + // the window rather than every byte the stream has ever received. + stream.Receive.Release((long)end); + + const ulong window = 1UL << 20; + ulong half = window / 2; + bool streamTight = stream.ReceiveLimit <= end || stream.ReceiveLimit - end < half; + ulong consumedAll = 0; + foreach (StreamFlow item in _streams.Values) + { + consumedAll += item.AppConsumed; + } + + bool connectionTight = _localMaxData <= consumedAll || _localMaxData - consumedAll < half; + if (!streamTight && !connectionTight) + { + return false; + } + + streamLimit = end + window; + if (streamLimit < stream.ReceiveLimit) + { + streamLimit = stream.ReceiveLimit; + } + + connectionLimit = consumedAll + window; + if (connectionLimit < _localMaxData) + { + connectionLimit = _localMaxData; + } + + return streamLimit > stream.ReceiveLimit || connectionLimit > _localMaxData; + } + + internal bool RaiseSend(ulong? maxData, ulong? streamId, ulong? maxStreamData) + { + if (maxData is ulong data && data > _peerMaxData) + { + _peerMaxData = data; + } + + if (streamId is ulong id && maxStreamData is ulong streamLimit) + { + if (ReceiveOnly(id) || (LocallyInitiated(id) && !_streams.ContainsKey(id))) + { + return false; + } + + StreamFlow stream = Open(id); + if (streamLimit > stream.SendLimit) + { + stream.SendLimit = streamLimit; + } + } + + Flush(); + SendBlocked = PendingBytes() > 0; + return true; + } + + internal bool Grant(ulong streamId, ulong streamLimit, ulong connectionLimit) + { + if (connectionLimit > _localMaxData) + { + _localMaxData = connectionLimit; + } + + StreamFlow stream = Open(streamId); + stream.RaiseReceiveLimit(streamLimit); + + return true; + } + + internal bool PushCrypto(QuicPacketKind kind, ulong offset, ReadOnlySpan data, out ReadOnlySpan ready, out ulong error) + { + CryptoLevel level = kind == QuicPacketKind.Initial ? _initialCrypto : _handshakeCrypto; + long before = level.Writer.End; + ready = default; + if (!level.Reassembly.Push(offset, data, CryptoBufferExceeded, level.Writer, out error)) + { + return false; + } + + ready = level.Writer.Advanced(before); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool AcceptStream(ulong streamId, ulong offset, ReadOnlySpan data, out ulong error, bool fin = false) + { + error = 0; + if (SendOnly(streamId) || (LocallyInitiated(streamId) && !_streams.ContainsKey(streamId))) + { + error = StreamStateError; + return false; + } + + if (!CanOpen(streamId, peer: false)) + { + error = StreamLimitError; + return false; + } + + ulong end = offset + (ulong)data.Length; + if (end < offset) + { + error = QuicFrameReader.ProtocolViolation; + return false; + } + + StreamFlow stream = Open(streamId); + if (fin && ((stream.PeerFinished && stream.FinalSize != end) || end < stream.ReceivedEnd)) + { + error = FinalSizeError; + return false; + } + + if (end > stream.ReceiveLimit || _dataReceived - stream.ReceivedEnd + end > _localMaxData) + { + error = FlowControlError; + return false; + } + + long deliveredBefore = stream.Receive.End; + if (!stream.Incoming.Push(offset, data, FlowControlError, stream.Receive, out error)) + { + return false; + } + + if (end > stream.ReceivedEnd) + { + _dataReceived = _dataReceived - stream.ReceivedEnd + end; + stream.ReceivedEnd = end; + } + + if (FirstDelivered is null && stream.Receive.End > deliveredBefore) + { + FirstDelivered = stream.Receive.First(); + } + + if (fin) + { + stream.PeerFinished = true; + stream.FinalSize = end; + } + + return true; + } + + internal bool TryAllocateLocal(bool unidirectional, out ulong id) => + TryAllocate(unidirectional, local: true, out id); + + internal bool TryAllocateRemote(bool unidirectional, out ulong id) => + TryAllocate(unidirectional, local: false, out id); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int CopyDelivered(ulong streamId, int offset, Span destination) + { + if (!_streams.TryGetValue(streamId, out StreamFlow? stream) || offset < 0 || destination.IsEmpty) + { + return 0; + } + + return stream.Receive.CopyTo(offset, destination); + } + + internal bool IsStreamReadClosed(ulong streamId, int offset) + { + if (!_streams.TryGetValue(streamId, out StreamFlow? stream) || offset < stream.Receive.End) + { + return false; + } + + if (stream.Reset) + { + return true; + } + + return stream.PeerFinished && (ulong)offset >= stream.FinalSize; + } + + internal bool NoteReset(ulong streamId, ulong finalSize, out ulong error) + { + error = 0; + if (SendOnly(streamId)) + { + error = StreamStateError; + return false; + } + + StreamFlow stream = Open(streamId); + if (stream.Reset) + { + if (stream.FinalSize != finalSize) + { + error = FinalSizeError; + } + + return error == 0; + } + + if (finalSize < stream.ReceivedEnd) + { + error = FinalSizeError; + return false; + } + + stream.Reset = true; + stream.FinalSize = finalSize; + ResetsDelivered++; + return true; + } + + internal bool NoteStopSending(ulong streamId, out ulong error) + { + error = 0; + if (ReceiveOnly(streamId) || (LocallyInitiated(streamId) && !_streams.ContainsKey(streamId))) + { + error = StreamStateError; + return false; + } + + StreamFlow stream = Open(streamId); + if (stream.StopSending) + { + return true; + } + + stream.StopSending = true; + StopsDelivered++; + return true; + } + + private bool LocallyInitiated(ulong streamId) => _client ? (streamId & 1) == 0 : (streamId & 1) == 1; + + private bool SendOnly(ulong streamId) => (streamId & 2) != 0 && LocallyInitiated(streamId); + + private bool ReceiveOnly(ulong streamId) => (streamId & 2) != 0 && !LocallyInitiated(streamId); + + /// Puts unframed bytes back at the front of the stream's ready region. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void ReturnReady(ulong streamId, ulong offset) + { + if (_streams.TryGetValue(streamId, out StreamFlow? stream)) + { + stream.Send.Rewind((long)offset); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool TryFinishOffset(ulong streamId, out ulong offset) + { + offset = 0; + if (!_streams.TryGetValue(streamId, out StreamFlow? stream)) + { + return true; + } + + if (stream.Send.Pending > 0 || stream.Send.Ready > 0) + { + stream.FinishRequested = true; + return false; + } + + offset = (ulong)stream.Send.Credited; + return true; + } + + internal bool FinishPending(ulong streamId) => + _streams.TryGetValue(streamId, out StreamFlow? stream) && stream.FinishRequested && stream.Send.Pending == 0; + + internal void ClearFinish(ulong streamId) + { + if (_streams.TryGetValue(streamId, out StreamFlow? stream)) + { + stream.FinishRequested = false; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal IReadOnlyList TakeReady() + { + var ready = new List(); + foreach (KeyValuePair pair in _streams) + { + StreamFlow stream = pair.Value; + + // Every byte below the hand-out cursor survived the previous frame, so its block can + // go back to the pool. A rewind from the last attempt already moved that cursor down. + stream.Send.Collect(); + + int count = stream.Send.Ready; + if (count == 0) + { + continue; + } + + long offset = stream.Send.Framed; + stream.Send.Frame(count); + ready.Add(new Outgoing(pair.Key, stream.Send, offset, count)); + } + + return ready; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Flush() + { + foreach (KeyValuePair pair in _streams) + { + StreamFlow stream = pair.Value; + if (stream.SendLimit == 0) + { + stream.SendLimit = PeerStreamLimit(pair.Key); + } + + while (stream.Send.Pending > 0) + { + ulong credited = (ulong)stream.Send.Credited; + ulong streamRoom = stream.SendLimit > credited ? stream.SendLimit - credited : 0; + ulong connectionRoom = _peerMaxData > _dataSent ? _peerMaxData - _dataSent : 0; + if (streamRoom == 0 || connectionRoom == 0) + { + break; + } + + ulong room = streamRoom < connectionRoom ? streamRoom : connectionRoom; + if ((ulong)stream.Send.Pending < room) + { + room = (ulong)stream.Send.Pending; + } + + int take = (int)room; + stream.Send.Credit(take); + _dataSent += (ulong)take; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int PendingBytes() + { + int count = 0; + foreach (StreamFlow stream in _streams.Values) + { + count += stream.Send.Pending; + } + + return count; + } + + private ulong PeerStreamLimit(ulong streamId) + { + int low = (int)(streamId & 3); + bool localBidi = _client ? low == 0 : low == 1; + bool remoteBidi = _client ? low == 1 : low == 0; + if (localBidi) + { + return _peerBidiRemote; + } + + if (remoteBidi) + { + return _peerBidiLocal; + } + + return _peerUni; + } + + private bool TryAllocate(bool unidirectional, bool local, out ulong id) + { + ulong next = unidirectional + ? (local ? _nextLocalUni : _nextRemoteUni) + : (local ? _nextLocalBidi : _nextRemoteBidi); + ulong limit = unidirectional + ? (local ? _peerMaxUni : _localMaxUni) + : (local ? _peerMaxBidi : _localMaxBidi); + if (next >= limit) + { + id = 0; + return false; + } + + int low = unidirectional + ? (local ? (_client ? 2 : 3) : (_client ? 3 : 2)) + : (local ? (_client ? 0 : 1) : (_client ? 1 : 0)); + id = (next << 2) | (uint)low; + Open(id); + if (unidirectional) + { + if (local) + { + _nextLocalUni = next + 1; + } + else + { + _nextRemoteUni = next + 1; + } + } + else if (local) + { + _nextLocalBidi = next + 1; + } + else + { + _nextRemoteBidi = next + 1; + } + + return true; + } + + private bool CanOpen(ulong streamId, bool peer) + { + int low = (int)(streamId & 3); + bool uni = low >= 2; + ulong sequence = streamId >> 2; + ulong limit = uni + ? (peer ? _peerMaxUni : _localMaxUni) + : (peer ? _peerMaxBidi : _localMaxBidi); + return sequence < limit; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private StreamFlow Open(ulong streamId) + { + if (_streams.TryGetValue(streamId, out StreamFlow? stream)) + { + return stream; + } + + stream = new StreamFlow(LocalStreamLimit(streamId)) { SendLimit = PeerStreamLimit(streamId) }; + _streams.Add(streamId, stream); + return stream; + } + + private ulong LocalStreamLimit(ulong streamId) + { + int low = (int)(streamId & 3); + bool localBidi = _client ? low == 0 : low == 1; + bool remoteBidi = _client ? low == 1 : low == 0; + if (localBidi) + { + return _localBidiLocal; + } + + if (remoteBidi) + { + return _localBidiRemote; + } + + return _localUni; + } + + private sealed class CryptoLevel + { + internal QuicReassembly Reassembly { get; } = new(ReassemblyCap); + + internal QuicCryptoWriter Writer { get; } = new(); + + internal void Discard() + { + Reassembly.Discard(); + Writer.Discard(); + } + } + + private sealed class StreamFlow + { + internal StreamFlow(ulong receiveLimit) + { + ReceiveLimit = receiveLimit; + Incoming = new QuicReassembly(CapFor(receiveLimit)); + } + + internal ulong SendLimit; + + internal ulong ReceiveLimit; + + internal void RaiseReceiveLimit(ulong limit) + { + if (limit <= ReceiveLimit) + { + return; + } + + ReceiveLimit = limit; + Incoming.RaiseCap(CapFor(limit)); + } + + internal ulong ReceivedEnd; + + internal ulong FinalSize; + + internal ulong AppConsumed; + + internal bool Reset; + + internal bool StopSending; + + internal bool FinishRequested; + + internal bool PeerFinished; + + internal QuicSendBuffer Send { get; } = new(); + + internal QuicReceiveRing Receive { get; } = new(); + + internal QuicReassembly Incoming { get; } + + // A sender that fills the window we advertised can leave every byte of it out of + // order, so holding that much is normal rather than an attack. A smaller window + // keeps the older, tighter bound. + private static int CapFor(ulong receiveLimit) + { + if (receiveLimit <= (ulong)ReassemblyCap) + { + return ReassemblyCap; + } + + return receiveLimit > int.MaxValue ? int.MaxValue : (int)receiveLimit; + } + } +} + +/// Bytes a STREAM frame still has to send, held as views over the stream's pooled blocks. +internal readonly struct Outgoing +{ + private readonly QuicSendBuffer _buffer; + + private readonly int _length; + + internal Outgoing(ulong streamId, QuicSendBuffer buffer, long offset, int length) + { + StreamId = streamId; + _buffer = buffer; + Offset = offset; + _length = length; + } + + internal ulong StreamId { get; } + + /// Absolute stream offset of the first byte this slice covers. + internal long Offset { get; } + + internal int Length => _length; + + /// Bytes from up to the end of the block that holds it. + internal int UntilBlockEnd(long at) => _buffer.UntilBlockEnd(at); + + internal ReadOnlySpan Slice(long at, int count) => _buffer.Read(at, count); + + /// Copies the ready bytes out. Used by tests and diagnostics, never by the send path. + internal byte[] ToArray() => _buffer.ToArray(Offset, _length); +} + +/// +/// Stream bytes the application wrote, held in pooled blocks until a STREAM frame frames them. +/// Flow control only moves a cursor, and a refused packer rewinds that cursor. +/// +internal sealed class QuicSendBuffer +{ + internal const int BlockSize = 16 * 1024; + + private readonly List _blocks = []; + + private long _framed; + + private long _credited; + + private long _end; + + /// Absolute offset of the next byte handed to a frame. + internal long Framed => _framed; + + /// Absolute offset up to which bytes count against the peer's limits. + internal long Credited => _credited; + + internal int Pending => (int)(_end - _credited); + + internal int Ready => (int)(_credited - _framed); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Write(ReadOnlySpan data) + { + // Blocks the frames have finished with go back to the pool before this write asks for more, + // so a steady stream reuses them instead of renting a fresh set on every write. + Collect(); + long at = _end; + while (!data.IsEmpty) + { + int index = _blocks.Count == 0 || at >= _blocks[^1].Start + BlockSize ? -1 : _blocks.Count - 1; + if (index < 0) + { + _blocks.Add(new Block(ArrayPool.Shared.Rent(BlockSize), at)); + index = _blocks.Count - 1; + } + + Block block = _blocks[index]; + int used = (int)(at - block.Start); + int take = Math.Min(BlockSize - used, data.Length); + data[..take].CopyTo(block.Data.AsSpan(used, take)); + block.Length = used + take; + _blocks[index] = block; + data = data[take..]; + at += take; + } + + _end = at; + } + + /// Marks bytes up to the end of the pending region as counted against flow control. + internal void Credit(int count) => _credited += count; + + /// Hands the ready region to a frame and reports the offset it started at. + internal void Frame(int count) => _framed += count; + + /// Puts bytes a frame refused back at the front of the ready region. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Rewind(long offset) + { + if (_blocks.Count > 0 && offset < _framed && offset >= _blocks[0].Start) + { + _framed = offset; + } + } + + /// Returns blocks the frames no longer need. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Collect() + { + while (_blocks.Count > 0 && _blocks[0].Start + BlockSize <= _framed) + { + ArrayPool.Shared.Return(_blocks[0].Data); + _blocks.RemoveAt(0); + } + } + + internal int UntilBlockEnd(long at) + { + Block block = _blocks[BlockOf(at)]; + return (int)(block.Start + BlockSize - at); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal ReadOnlySpan Read(long at, int count) + { + Block block = _blocks[BlockOf(at)]; + return block.Data.AsSpan((int)(at - block.Start), count); + } + + internal byte[] ToArray(long at, int count) + { + var copy = new byte[count]; + Copy(at, copy); + return copy; + } + + internal void Discard() + { + for (int i = 0; i < _blocks.Count; i++) + { + ArrayPool.Shared.Return(_blocks[i].Data); + } + + _blocks.Clear(); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Copy(long at, Span destination) + { + int written = 0; + while (written < destination.Length) + { + Block block = _blocks[BlockOf(at + written)]; + int used = (int)(at + written - block.Start); + int take = Math.Min(block.Length - used, destination.Length - written); + block.Data.AsSpan(used, take).CopyTo(destination[written..]); + written += take; + } + } + + private int BlockOf(long at) => (int)((at - _blocks[0].Start) / BlockSize); + + private struct Block + { + internal Block(byte[] data, long start) + { + Data = data; + Start = start; + Length = 0; + } + + internal byte[] Data; + + internal long Start; + + internal int Length; + } +} + +/// +/// Bytes delivered to the application but not read yet, held in pooled blocks. +/// The ring keeps at most the receive window, because the application releases what it read. +/// +internal sealed class QuicReceiveRing : IReceiveSink +{ + private readonly List _blocks = []; + + private long _base; + + private long _end; + + private byte _first; + + /// Absolute offset of the oldest byte still held. + internal long Base => _base; + + public long End => _end; + + internal int Held => (int)(_end - _base); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void Write(long offset, ReadOnlySpan data) + { + if (offset == 0 && !data.IsEmpty) + { + _first = data[0]; + } + + while (!data.IsEmpty) + { + int index = _blocks.Count == 0 || offset >= _blocks[^1].Start + QuicSendBuffer.BlockSize ? -1 : _blocks.Count - 1; + if (index < 0) + { + _blocks.Add(new Block(ArrayPool.Shared.Rent(QuicSendBuffer.BlockSize), offset)); + index = _blocks.Count - 1; + } + + Block block = _blocks[index]; + int used = (int)(offset - block.Start); + int take = Math.Min(QuicSendBuffer.BlockSize - used, data.Length); + data[..take].CopyTo(block.Data.AsSpan(used, take)); + block.Length = used + take; + _blocks[index] = block; + data = data[take..]; + offset += take; + } + + _end = offset; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int CopyTo(long offset, Span destination) + { + if (offset < _base || offset >= _end || destination.IsEmpty) + { + return 0; + } + + int count = (int)Math.Min(destination.Length, _end - offset); + int written = 0; + while (written < count) + { + Block block = _blocks[BlockOf(offset + written)]; + int used = (int)(offset + written - block.Start); + int take = Math.Min(block.Length - used, count - written); + block.Data.AsSpan(used, take).CopyTo(destination[written..]); + written += take; + } + + return count; + } + + /// The first byte the stream ever delivered, kept after the ring releases it. + internal byte First() => _first; + + /// Drops blocks the application already read. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Release(long below) + { + if (below > _end) + { + below = _end; + } + + if (below <= _base) + { + return; + } + + _base = below; + while (_blocks.Count > 0 && _blocks[0].Start + QuicSendBuffer.BlockSize <= _base) + { + ArrayPool.Shared.Return(_blocks[0].Data); + _blocks.RemoveAt(0); + } + } + + internal void Discard() + { + for (int i = 0; i < _blocks.Count; i++) + { + ArrayPool.Shared.Return(_blocks[i].Data); + } + + _blocks.Clear(); + } + + private int BlockOf(long at) => (int)((at - _blocks[0].Start) / QuicSendBuffer.BlockSize); + + private struct Block + { + internal Block(byte[] data, long start) + { + Data = data; + Start = start; + Length = 0; + } + + internal byte[] Data; + + internal long Start; + + internal int Length; + } +} + +/// Grows as handshake bytes arrive in order, so the TLS engine reads them without a copy. +internal sealed class QuicCryptoWriter : IReceiveSink +{ + private byte[]? _buffer; + + private int _length; + + public long End => _length; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + public void Write(long offset, ReadOnlySpan data) + { + int at = (int)offset; + int need = at + data.Length; + if (_buffer is null || need > _buffer.Length) + { + Grow(need); + } + + data.CopyTo(_buffer.AsSpan(at)); + _length = need; + } + + /// Bytes that became contiguous since . + internal ReadOnlySpan Advanced(long from) => + _buffer is null ? default : _buffer.AsSpan((int)from, _length - (int)from); + + internal void Discard() + { + if (_buffer is not null) + { + ArrayPool.Shared.Return(_buffer, clearArray: true); + _buffer = null; + } + + _length = 0; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Grow(int need) + { + int size = _buffer is null ? 4096 : _buffer.Length * 2; + if (size < need) + { + size = need; + } + + byte[] grown = ArrayPool.Shared.Rent(size); + if (_buffer is not null) + { + _buffer.AsSpan(0, _length).CopyTo(grown); + ArrayPool.Shared.Return(_buffer, clearArray: true); + } + + _buffer = grown; + } +} + +/// Where contiguous bytes land once the reassembly can hand them out. +internal interface IReceiveSink +{ + long End { get; } + + void Write(long offset, ReadOnlySpan data); +} + +/// +/// Ordering for CRYPTO and STREAM data. In-order bytes go straight into the sink. +/// Out-of-order bytes wait in pooled pieces, bounded by the advertised window. +/// +internal sealed class QuicReassembly +{ + private readonly List _pieces = []; + + private int _cap; + + private ulong _cursor; + + private int _held; + + internal QuicReassembly(int cap) => _cap = cap; + + /// Grows the cap after the receive window grew, so held bytes stay bounded by what was advertised. + internal void RaiseCap(int cap) + { + if (cap > _cap) + { + _cap = cap; + } + } + + internal void Discard() + { + for (int i = 0; i < _pieces.Count; i++) + { + ArrayPool.Shared.Return(_pieces[i].Data); + } + + _pieces.Clear(); + _held = 0; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Push(ulong offset, ReadOnlySpan data, ulong overflowError, IReceiveSink sink, out ulong error) + { + error = 0; + if (data.IsEmpty) + { + return true; + } + + ulong end = offset + (ulong)data.Length; + if (end < offset) + { + error = QuicFrameReader.ProtocolViolation; + return false; + } + + if (end <= _cursor) + { + return true; + } + + if (offset < _cursor) + { + int skip = (int)(_cursor - offset); + data = data[skip..]; + offset = _cursor; + } + + if (offset > _cursor && offset - _cursor > (ulong)_cap) + { + error = overflowError; + return false; + } + + if (offset != _cursor && _held + data.Length > _cap) + { + error = overflowError; + return false; + } + + if (offset == _cursor) + { + sink.Write((long)_cursor, data); + _cursor = end; + Drain(sink); + return true; + } + + _pieces.Add(new Piece(ArrayPool.Shared.Rent(data.Length), data.Length, offset)); + data.CopyTo(_pieces[^1].Data); + _held += data.Length; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Drain(IReceiveSink sink) + { + bool moved = true; + while (moved) + { + moved = false; + for (int i = 0; i < _pieces.Count; i++) + { + Piece piece = _pieces[i]; + ulong end = piece.Offset + (ulong)piece.Length; + if (end <= _cursor) + { + _held -= piece.Length; + _pieces.RemoveAt(i); + ArrayPool.Shared.Return(piece.Data); + moved = true; + break; + } + + if (piece.Offset > _cursor) + { + continue; + } + + int skip = (int)(_cursor - piece.Offset); + sink.Write((long)_cursor, piece.Data.AsSpan(skip, piece.Length - skip)); + _cursor = end; + _held -= piece.Length; + _pieces.RemoveAt(i); + ArrayPool.Shared.Return(piece.Data); + moved = true; + break; + } + } + } + + private struct Piece + { + internal Piece(byte[] data, int length, ulong offset) + { + Data = data; + Length = length; + Offset = offset; + } + + internal byte[] Data; + + internal int Length; + + internal ulong Offset; + } +} diff --git a/src/Titanium.Quic/Internal/QuicFrames.cs b/src/Titanium.Quic/Internal/QuicFrames.cs new file mode 100644 index 000000000..659a4f279 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicFrames.cs @@ -0,0 +1,750 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +internal enum QuicFrameKind : byte +{ + Padding = 0, + Ping = 1, + Ack = 2, + ResetStream = 3, + StopSending = 4, + Crypto = 5, + NewToken = 6, + Stream = 7, + MaxData = 8, + MaxStreamData = 9, + MaxStreams = 10, + DataBlocked = 11, + StreamDataBlocked = 12, + StreamsBlocked = 13, + NewConnectionId = 14, + RetireConnectionId = 15, + PathChallenge = 16, + PathResponse = 17, + ConnectionClose = 18, + HandshakeDone = 19, + Datagram = 20, +} + +internal struct QuicAckRange +{ + internal ulong Gap; + + internal ulong Length; +} + +/// One decoded frame. Spans point at the packet payload. +internal ref struct QuicFrame +{ + internal QuicFrameKind Kind; + + internal ulong StreamId; + + internal ulong ErrorCode; + + internal ulong Offset; + + internal ulong LargestAcknowledged; + + internal ulong AckDelay; + + internal ulong Limit; + + internal ulong Sequence; + + internal ulong RetirePriorTo; + + internal ulong TriggeringFrame; + + internal ulong Ect0; + + internal ulong Ect1; + + internal ulong Ce; + + internal bool Fin; + + internal bool HasLength; + + internal bool Ecn; + + internal bool Unidirectional; + + internal bool ApplicationClose; + + internal int AckRangeCount; + + internal ReadOnlySpan Data; + + internal ReadOnlySpan Token; +} + +/// Pulls frames from one unprotected payload. An error stops the reader. +internal ref struct QuicFrameReader +{ + internal const int MaxAckRanges = 32; + + internal const ulong FrameEncodingError = 0x07; + + internal const ulong ProtocolViolation = 0x0a; + + internal const ulong MaxStreamsLimit = 1UL << 60; + + private ReadOnlySpan _rest; + + private readonly QuicPacketKind _packet; + + private bool _sawFrame; + + private bool _failed; + + internal QuicFrameReader(ReadOnlySpan payload, QuicPacketKind packet) + { + _rest = payload; + _packet = packet; + } + + internal ulong Error { get; private set; } + + internal bool Completed => Error == 0 && _rest.IsEmpty && _sawFrame; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool TryNext(Span ranges, out QuicFrame frame) + { + frame = default; + if (_failed) + { + return false; + } + + if (_rest.IsEmpty) + { + if (!_sawFrame) + { + return Fail(ProtocolViolation); + } + + return false; + } + + if (!QuicVarInt.TryDecode(_rest, out ulong type, out int used)) + { + return Fail(FrameEncodingError); + } + + if (used != Minimal(type)) + { + return Fail(ProtocolViolation); + } + + _rest = _rest[used..]; + QuicFrame decoded = default; + if (!ReadBody(type, ranges, ref decoded)) + { + frame = default; + return Error == 0 ? Fail(FrameEncodingError) : false; + } + + if (!Allowed(decoded, _packet)) + { + frame = default; + return Fail(ProtocolViolation); + } + + frame = decoded; + _sawFrame = true; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool ReadBody(ulong type, Span ranges, ref QuicFrame frame) + { + switch (type) + { + case 0x00: + frame.Kind = QuicFrameKind.Padding; + return true; + case 0x01: + frame.Kind = QuicFrameKind.Ping; + return true; + case 0x02: + case 0x03: + return ReadAck(type == 0x03, ranges, ref frame); + case 0x04: + frame.Kind = QuicFrameKind.ResetStream; + return Take(out frame.StreamId) && Take(out frame.ErrorCode) && Take(out frame.Limit); + case 0x05: + frame.Kind = QuicFrameKind.StopSending; + return Take(out frame.StreamId) && Take(out frame.ErrorCode); + case 0x06: + frame.Kind = QuicFrameKind.Crypto; + frame.HasLength = true; + return Take(out frame.Offset) && TakeBytes(out frame.Data) && EndFits(frame.Offset, frame.Data.Length); + case 0x07: + frame.Kind = QuicFrameKind.NewToken; + return TakeBytes(out frame.Data) && !frame.Data.IsEmpty; + case >= 0x08 and <= 0x0f: + return ReadStream(type, ref frame); + case 0x10: + frame.Kind = QuicFrameKind.MaxData; + return Take(out frame.Limit); + case 0x11: + frame.Kind = QuicFrameKind.MaxStreamData; + return Take(out frame.StreamId) && Take(out frame.Limit); + case 0x12: + case 0x13: + frame.Kind = QuicFrameKind.MaxStreams; + frame.Unidirectional = type == 0x13; + return Take(out frame.Limit) && frame.Limit <= MaxStreamsLimit; + case 0x14: + frame.Kind = QuicFrameKind.DataBlocked; + return Take(out frame.Limit); + case 0x15: + frame.Kind = QuicFrameKind.StreamDataBlocked; + return Take(out frame.StreamId) && Take(out frame.Limit); + case 0x16: + case 0x17: + frame.Kind = QuicFrameKind.StreamsBlocked; + frame.Unidirectional = type == 0x17; + return Take(out frame.Limit) && frame.Limit <= MaxStreamsLimit; + case 0x18: + return ReadNewConnectionId(ref frame); + case 0x19: + frame.Kind = QuicFrameKind.RetireConnectionId; + return Take(out frame.Sequence); + case 0x1a: + frame.Kind = QuicFrameKind.PathChallenge; + return TakeFixed(8, out frame.Data); + case 0x1b: + frame.Kind = QuicFrameKind.PathResponse; + return TakeFixed(8, out frame.Data); + case 0x1c: + case 0x1d: + return ReadClose(type == 0x1d, ref frame); + case 0x1e: + frame.Kind = QuicFrameKind.HandshakeDone; + return true; + case 0x30: + case 0x31: + frame.Kind = QuicFrameKind.Datagram; + frame.HasLength = type == 0x31; + return frame.HasLength ? TakeBytes(out frame.Data) : TakeRest(out frame.Data); + default: + return Fail(FrameEncodingError); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool ReadAck(bool ecn, Span ranges, ref QuicFrame frame) + { + frame.Kind = QuicFrameKind.Ack; + frame.Ecn = ecn; + if (!Take(out frame.LargestAcknowledged) || !Take(out frame.AckDelay) || !Take(out ulong count) || !Take(out ulong first)) + { + return false; + } + + if (count >= (ulong)MaxAckRanges || first > frame.LargestAcknowledged || ranges.Length < (int)count + 1) + { + return Fail(FrameEncodingError); + } + + ranges[0] = new QuicAckRange { Length = first }; + ulong smallest = frame.LargestAcknowledged - first; + for (int i = 0; i < (int)count; i++) + { + if (!Take(out ulong gap) || !Take(out ulong length)) + { + return false; + } + + if (gap > smallest || smallest - gap < 2 || length > smallest - gap - 2) + { + return Fail(FrameEncodingError); + } + + ulong largest = smallest - gap - 2; + smallest = largest - length; + ranges[i + 1] = new QuicAckRange { Gap = gap, Length = length }; + } + + frame.AckRangeCount = (int)count + 1; + if (!ecn) + { + return true; + } + + return Take(out frame.Ect0) && Take(out frame.Ect1) && Take(out frame.Ce); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool ReadStream(ulong type, ref QuicFrame frame) + { + frame.Kind = QuicFrameKind.Stream; + frame.Fin = (type & 0x01) != 0; + frame.HasLength = (type & 0x02) != 0; + bool hasOffset = (type & 0x04) != 0; + if (!Take(out frame.StreamId)) + { + return false; + } + + if (hasOffset && !Take(out frame.Offset)) + { + return false; + } + + if (!(frame.HasLength ? TakeBytes(out frame.Data) : TakeRest(out frame.Data))) + { + return false; + } + + return EndFits(frame.Offset, frame.Data.Length); + } + + private bool ReadNewConnectionId(ref QuicFrame frame) + { + frame.Kind = QuicFrameKind.NewConnectionId; + if (!Take(out frame.Sequence) || !Take(out frame.RetirePriorTo) || _rest.IsEmpty) + { + return false; + } + + int length = _rest[0]; + _rest = _rest[1..]; + if (length is < 1 or > QuicDatagramReader.MaxConnectionIdLength || frame.RetirePriorTo > frame.Sequence) + { + return Fail(FrameEncodingError); + } + + return TakeFixed(length, out frame.Data) && TakeFixed(16, out frame.Token); + } + + private bool ReadClose(bool application, ref QuicFrame frame) + { + frame.Kind = QuicFrameKind.ConnectionClose; + frame.ApplicationClose = application; + if (!Take(out frame.ErrorCode)) + { + return false; + } + + if (!application && !Take(out frame.TriggeringFrame)) + { + return false; + } + + return TakeBytes(out frame.Data); + } + + private bool EndFits(ulong offset, int length) + { + if (offset > QuicVarInt.MaxValue - (ulong)length) + { + return Fail(FrameEncodingError); + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Take(out ulong value) + { + if (!QuicVarInt.TryDecode(_rest, out value, out int used)) + { + value = 0; + return Fail(FrameEncodingError); + } + + _rest = _rest[used..]; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TakeBytes(out ReadOnlySpan data) + { + data = default; + if (!Take(out ulong length)) + { + return false; + } + + if (length > (ulong)_rest.Length) + { + return Fail(FrameEncodingError); + } + + data = _rest[..(int)length]; + _rest = _rest[(int)length..]; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TakeFixed(int length, out ReadOnlySpan data) + { + data = default; + if (_rest.Length < length) + { + return Fail(FrameEncodingError); + } + + data = _rest[..length]; + _rest = _rest[length..]; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TakeRest(out ReadOnlySpan data) + { + data = _rest; + _rest = default; + return true; + } + + private bool Fail(ulong error) + { + Error = error; + _failed = true; + return false; + } + + private static int Minimal(ulong value) + { + if (value <= 63) + { + return 1; + } + + if (value <= 16_383) + { + return 2; + } + + if (value <= 1_073_741_823) + { + return 4; + } + + return 8; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool Allowed(in QuicFrame frame, QuicPacketKind packet) + { + bool initial = packet == QuicPacketKind.Initial; + bool handshake = packet == QuicPacketKind.Handshake; + bool zero = packet == QuicPacketKind.ZeroRtt; + bool one = packet == QuicPacketKind.OneRtt; + if (!initial && !handshake && !zero && !one) + { + return false; + } + + bool early = zero || one; + switch (frame.Kind) + { + case QuicFrameKind.Padding: + case QuicFrameKind.Ping: + return true; + case QuicFrameKind.Ack: + case QuicFrameKind.Crypto: + return !zero; + case QuicFrameKind.ConnectionClose: + return frame.ApplicationClose ? early : true; + case QuicFrameKind.NewToken: + case QuicFrameKind.PathResponse: + case QuicFrameKind.HandshakeDone: + case QuicFrameKind.RetireConnectionId: + return one; + default: + return early; + } + } +} + +internal static class QuicFrameWriter +{ + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static int Write(in QuicFrame frame, ReadOnlySpan ranges, Span destination) + { + int at = frame.Kind switch + { + QuicFrameKind.Padding => Put(0x00, destination), + QuicFrameKind.Ping => Put(0x01, destination), + QuicFrameKind.Ack => WriteAck(frame, ranges, destination), + QuicFrameKind.ResetStream => Put(0x04, frame.StreamId, frame.ErrorCode, frame.Limit, destination), + QuicFrameKind.StopSending => Put(0x05, frame.StreamId, frame.ErrorCode, destination), + QuicFrameKind.Crypto => WritePrefixed(0x06, frame.Offset, frame.Data, destination), + QuicFrameKind.NewToken => WritePrefixed(0x07, frame.Data, destination), + QuicFrameKind.Stream => WriteStream(frame, destination), + QuicFrameKind.MaxData => Put(0x10, frame.Limit, destination), + QuicFrameKind.MaxStreamData => Put(0x11, frame.StreamId, frame.Limit, destination), + QuicFrameKind.MaxStreams => Put(frame.Unidirectional ? 0x13UL : 0x12, frame.Limit, destination), + QuicFrameKind.DataBlocked => Put(0x14, frame.Limit, destination), + QuicFrameKind.StreamDataBlocked => Put(0x15, frame.StreamId, frame.Limit, destination), + QuicFrameKind.StreamsBlocked => Put(frame.Unidirectional ? 0x17UL : 0x16, frame.Limit, destination), + QuicFrameKind.NewConnectionId => WriteNewConnectionId(frame, destination), + QuicFrameKind.RetireConnectionId => Put(0x19, frame.Sequence, destination), + QuicFrameKind.PathChallenge => WriteFixed(0x1a, frame.Data, 8, destination), + QuicFrameKind.PathResponse => WriteFixed(0x1b, frame.Data, 8, destination), + QuicFrameKind.ConnectionClose => WriteClose(frame, destination), + QuicFrameKind.HandshakeDone => Put(0x1e, destination), + QuicFrameKind.Datagram => WriteDatagram(frame, destination), + _ => 0, + }; + return at; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WriteAck(in QuicFrame frame, ReadOnlySpan ranges, Span destination) + { + if (frame.AckRangeCount < 1 || ranges.Length < frame.AckRangeCount) + { + return 0; + } + + int at = Put(frame.Ecn ? 0x03UL : 0x02, frame.LargestAcknowledged, frame.AckDelay, destination); + if (at == 0) + { + return 0; + } + + int countAndFirst = Put((ulong)(frame.AckRangeCount - 1), ranges[0].Length, destination[at..]); + if (countAndFirst == 0) + { + return 0; + } + + at += countAndFirst; + if (at == 0) + { + return 0; + } + + for (int i = 1; i < frame.AckRangeCount; i++) + { + int used = Put(ranges[i].Gap, ranges[i].Length, destination[at..]); + if (used == 0) + { + return 0; + } + + at += used; + } + + if (!frame.Ecn) + { + return at; + } + + int ecn = Put(frame.Ect0, frame.Ect1, frame.Ce, destination[at..]); + return ecn == 0 ? 0 : at + ecn; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WriteStream(in QuicFrame frame, Span destination) + { + ulong type = 0x08; + if (frame.Fin) + { + type |= 0x01; + } + + if (frame.HasLength) + { + type |= 0x02; + } + + if (frame.Offset != 0) + { + type |= 0x04; + } + + int at = Put(type, frame.StreamId, destination); + if (at == 0) + { + return 0; + } + + if (frame.Offset != 0) + { + int used = Put(frame.Offset, destination[at..]); + if (used == 0) + { + return 0; + } + + at += used; + } + + if (frame.HasLength) + { + int used = QuicVarInt.Encode((ulong)frame.Data.Length, destination[at..]); + if (used == 0) + { + return 0; + } + + at += used; + } + + if (destination.Length < at + frame.Data.Length) + { + return 0; + } + + frame.Data.CopyTo(destination[at..]); + return at + frame.Data.Length; + } + + private static int WriteDatagram(in QuicFrame frame, Span destination) + { + if (!frame.HasLength) + { + return WriteTail(0x30, frame.Data, destination); + } + + int at = Put(0x31, (ulong)frame.Data.Length, destination); + if (at == 0 || destination.Length < at + frame.Data.Length) + { + return 0; + } + + frame.Data.CopyTo(destination[at..]); + return at + frame.Data.Length; + } + + private static int WriteNewConnectionId(in QuicFrame frame, Span destination) + { + if (frame.Data.Length is < 1 or > QuicDatagramReader.MaxConnectionIdLength || frame.Token.Length != 16) + { + return 0; + } + + int at = Put(0x18, frame.Sequence, frame.RetirePriorTo, destination); + if (at == 0 || destination.Length < at + 1 + frame.Data.Length + 16) + { + return 0; + } + + destination[at++] = (byte)frame.Data.Length; + frame.Data.CopyTo(destination[at..]); + at += frame.Data.Length; + frame.Token.CopyTo(destination[at..]); + return at + 16; + } + + private static int WriteClose(in QuicFrame frame, Span destination) + { + int at = frame.ApplicationClose + ? Put(0x1d, frame.ErrorCode, destination) + : Put(0x1c, frame.ErrorCode, frame.TriggeringFrame, destination); + if (at == 0) + { + return 0; + } + + int used = QuicVarInt.Encode((ulong)frame.Data.Length, destination[at..]); + if (used == 0 || destination.Length < at + used + frame.Data.Length) + { + return 0; + } + + at += used; + frame.Data.CopyTo(destination[at..]); + return at + frame.Data.Length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WritePrefixed(ulong type, ulong offset, ReadOnlySpan data, Span destination) + { + int at = Put(type, offset, (ulong)data.Length, destination); + if (at == 0 || destination.Length < at + data.Length) + { + return 0; + } + + data.CopyTo(destination[at..]); + return at + data.Length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WritePrefixed(ulong type, ReadOnlySpan data, Span destination) + { + int at = Put(type, (ulong)data.Length, destination); + if (at == 0 || destination.Length < at + data.Length) + { + return 0; + } + + data.CopyTo(destination[at..]); + return at + data.Length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WriteFixed(ulong type, ReadOnlySpan data, int length, Span destination) + { + if (data.Length != length) + { + return 0; + } + + return WriteTail(type, data, destination); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int WriteTail(ulong type, ReadOnlySpan data, Span destination) + { + int at = Put(type, destination); + if (at == 0 || destination.Length < at + data.Length) + { + return 0; + } + + data.CopyTo(destination[at..]); + return at + data.Length; + } + + private static int Put(ulong value, Span destination) + { + return QuicVarInt.Encode(value, destination); + } + + private static int Put(ulong first, ulong second, Span destination) + { + int at = Put(first, destination); + if (at == 0) + { + return 0; + } + + int used = Put(second, destination[at..]); + return used == 0 ? 0 : at + used; + } + + private static int Put(ulong first, ulong second, ulong third, Span destination) + { + int at = Put(first, second, destination); + if (at == 0) + { + return 0; + } + + int used = Put(third, destination[at..]); + return used == 0 ? 0 : at + used; + } + + private static int Put(ulong first, ulong second, ulong third, ulong fourth, Span destination) + { + int at = Put(first, second, third, destination); + if (at == 0) + { + return 0; + } + + int used = Put(fourth, destination[at..]); + return used == 0 ? 0 : at + used; + } +} diff --git a/src/Titanium.Quic/Internal/QuicHandshake.cs b/src/Titanium.Quic/Internal/QuicHandshake.cs new file mode 100644 index 000000000..77db82c36 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicHandshake.cs @@ -0,0 +1,2174 @@ +using System; +using System.Buffers; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Buffers.Binary; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Titanium.Tls; + +namespace Titanium.Quic; + +internal sealed partial class QuicConnectionCore : IDisposable +{ + private readonly byte[] _secretScratch = new byte[32]; + + private readonly QuicLossRecovery _loss; + + internal QuicConnectionCore() + : this(new QuicNewReno()) + { + } + + internal QuicConnectionCore(ICongestionController controller) + { + ArgumentNullException.ThrowIfNull(controller); + _loss = new QuicLossRecovery(controller); + } + + private DateTimeOffset _now; + + private TlsEngine? _engine; + + private X509Certificate2? _certificate; + + private QuicPacketProtector? _initialSend; + + private QuicPacketProtector? _initialRecv; + + private QuicPacketProtector? _handshakeSend; + + private QuicPacketProtector? _handshakeRecv; + + private QuicPacketProtector? _applicationSend; + + private QuicPacketProtector? _applicationRecv; + + private readonly QuicIdentity _ids = new(); + + private readonly QuicFlow _flow = new(); + + // One scratch for the ACK ranges of every frame in a payload. A fresh array per datagram put + // 1 KiB on the heap for each packet a bulk transfer received. + private readonly QuicAckRange[] _frameRanges = new QuicAckRange[QuicFrameReader.MaxAckRanges]; + + private readonly QuicAckRange[] _ackRanges = new QuicAckRange[QuicFrameReader.MaxAckRanges]; + + private readonly QuicPathMtu _mtu = new(); + + private ulong? _probeNumber; + + private readonly List<(PathInfo Path, byte[] Data)> _challenges = []; + + private byte[] _localId = []; + + private byte[] _remoteId = []; + + private byte[] _originalDestinationId = []; + + private byte[] _initialToken = []; + + private byte[]? _initialFlight; + + private byte[]? _expectedRetryToken; + + private byte[]? _peerSourceId; + + private bool _retryArmed; + + private bool _retryAccepted; + + private byte[] _retryToken = []; + + private PathInfo _path; + + private bool _hasPath; + + private bool _client; + + private bool _limitAmplification = true; + + private bool _parametersChecked; + + private bool _disposed; + + private int _recvInitial; + + private int _recvHandshake; + + private int _sentInitial; + + private int _sentHandshake; + + private ulong _pnInitial; + + private ulong _pnHandshake; + + private ulong _pnApplication; + + private QuicPacketReplayWindow _replayInitial; + + private QuicPacketReplayWindow _replayHandshake; + + private QuicPacketReplayWindow _replayApplication; + + private QuicAckTracker _acksInitial = new(); + + private QuicAckTracker _acksHandshake = new(); + + private QuicAckTracker _acksApplication = new(); + + // Application-space acknowledgements are held back: one packet waits for a second packet, for + // the next STREAM packet this endpoint sends, or for the delay below, whichever comes first. + private int _applicationUnacked; + + // Set by a receive loop that hands the core several datagrams before it sends: the second packet then waits for the end of the + // batch instead of staging an acknowledgement of its own, so the batch is acknowledged once. + private bool _holdAcknowledgement; + + private DateTimeOffset? _applicationAckDeadline; + + private DateTimeOffset _applicationLargestAt; + + internal DateTimeOffset? AckDeadline => _applicationAckDeadline; + + internal bool IsClosed { get; private set; } + + internal bool ClosedByStatelessReset { get; private set; } + + internal ulong CloseError { get; private set; } + + internal bool PeerClosed { get; private set; } + + internal bool ApplicationClose { get; private set; } + + internal ulong TriggeringFrame { get; private set; } + + internal string? CloseReason { get; private set; } + + internal byte[]? ReceivedInitialToken { get; private set; } + + internal byte[]? IssuedNewToken { get; private set; } + + internal int PeerConnectionIds => _ids.PeerActive; + + internal bool HandshakeComplete => _engine?.State == TlsEngineState.Connected; + + internal byte? ReceivedStreamByte { get; private set; } + + internal bool CorruptNextHandshakePayload { get; set; } + + internal void StartClient(in PathInfo path, ReadOnlySpan localId, ReadOnlySpan remoteId, ReadOnlySpan transportParameters, ReadOnlySpan token = default, string? serverName = null, string[]? applicationProtocols = null) + { + _client = true; + _limitAmplification = false; + _localId = localId.ToArray(); + _remoteId = remoteId.ToArray(); + _originalDestinationId = remoteId.ToArray(); + _initialToken = token.ToArray(); + _ids.AddIssued(localId); + _path = path; + _hasPath = true; + AddReceived(path, 0); + InstallInitial(remoteId, clientSend: true); + RememberLocalLimits(transportParameters, fromServer: false); + _engine = new TlsEngine(TlsRole.Client, serverName: string.IsNullOrEmpty(serverName) ? "localhost" : serverName) + { + DatagramTransport = true, + LocalTransportParameters = transportParameters.ToArray(), + ApplicationProtocols = applicationProtocols, + }; + var output = new TlsOutput(); + _engine.AdvanceDatagram([], output); + if (_engine.State == TlsEngineState.Closed) + { + MarkClosed(CryptoError(_engine.LastLocalAlert), send: false); + return; + } + + Emit(output); + } + + internal void StartServer(ReadOnlySpan localId, X509Certificate2? certificate, ReadOnlySpan transportParameters) + { + _localId = localId.ToArray(); + _originalDestinationId = localId.ToArray(); + _ids.AddIssued(localId); + _certificate = certificate; + InstallInitial(localId, clientSend: false); + RememberLocalLimits(transportParameters, fromServer: true); + _engine = new TlsEngine(TlsRole.Server) + { + DatagramTransport = true, + LocalTransportParameters = transportParameters.ToArray(), + }; + } + + internal void SendStreamByte(byte value) + { + if (!HandshakeComplete || IsClosed || !_hasPath || _applicationSend is null) + { + return; + } + + SendStream(0, [value]); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int SendStream(ulong streamId, ReadOnlySpan data) + { + if (!HandshakeComplete || IsClosed || !_hasPath || _applicationSend is null) + { + return 0; + } + + int queued = _flow.Queue(streamId, data, out _); + StageReady(); + return queued; + } + + internal bool TryAllocateLocal(bool unidirectional, out ulong id) => _flow.TryAllocateLocal(unidirectional, out id); + + internal bool TryAllocateRemote(bool unidirectional, out ulong id) => _flow.TryAllocateRemote(unidirectional, out id); + + internal int CopyDelivered(ulong streamId, int offset, Span destination) => _flow.CopyDelivered(streamId, offset, destination); + + internal bool IsStreamReadClosed(ulong streamId, int offset) => _flow.IsStreamReadClosed(streamId, offset); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void FinishStream(ulong streamId) + { + if (!HandshakeComplete || IsClosed || !_hasPath || _applicationSend is null || !_flow.TryFinishOffset(streamId, out ulong offset)) + { + return; + } + + Span frame = stackalloc byte[32]; + var stream = new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = streamId, + Offset = offset, + HasLength = true, + Fin = true, + }; + int count = QuicFrameWriter.Write(in stream, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void GrantStreamCredit(ulong streamId, ulong streamLimit, ulong connectionLimit) + { + if (_applicationSend is null) + { + return; + } + + _flow.Grant(streamId, streamLimit, connectionLimit); + Span frame = stackalloc byte[32]; + var maxData = new QuicFrame { Kind = QuicFrameKind.MaxData, Limit = connectionLimit }; + int count = QuicFrameWriter.Write(in maxData, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + + var maxStream = new QuicFrame { Kind = QuicFrameKind.MaxStreamData, StreamId = streamId, Limit = streamLimit }; + count = QuicFrameWriter.Write(in maxStream, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + internal bool TryExtendReadWindow(ulong streamId, int consumed, out ulong streamLimit, out ulong connectionLimit) => + _flow.TryExtendReadWindow(streamId, consumed, out streamLimit, out connectionLimit); + + internal void InjectApplicationPayload(ReadOnlySpan payload) => TakePayload(QuicPacketKind.OneRtt, payload); + + internal bool StreamSendBlocked => _flow.SendBlocked; + + internal int ReceivedStreamLength => _flow.ReceivedCount; + + internal byte[] ReceivedStream => _flow.Received; + + internal int ResetsDelivered => _flow.ResetsDelivered; + + internal int StopsDelivered => _flow.StopsDelivered; + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _engine?.Dispose(); + _engine = null; + _initialSend?.Dispose(); + _initialRecv?.Dispose(); + _handshakeSend?.Dispose(); + _handshakeRecv?.Dispose(); + _applicationSend?.Dispose(); + _applicationRecv?.Dispose(); + CryptographicOperations.ZeroMemory(_secretScratch); + _flow.Discard(); + for (int i = 0; i < _staged.Count; i++) + { + ArrayPool.Shared.Return(_staged[i].Buffer); + } + + _staged.Clear(); + for (int i = 0; i < _heldApplication.Count; i++) + { + CryptographicOperations.ZeroMemory(_heldApplication[i].Payload); + } + + _heldApplication.Clear(); + } + + private bool _sawInitialPath; + + private PathInfo _initialPath; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void AcceptDatagram(ReadOnlySpan datagram) + { + while (_hasPath && !datagram.IsEmpty && !IsClosed && _engine is not null) + { + if (_client && datagram[0] == 0xF0) + { + AcceptRetry(datagram); + return; + } + + if (!TryLocate(datagram, out QuicPacketKind kind, out int packetLength, out int packetNumberOffset, out int sourceOffset, out int sourceLength, out int tokenOffset, out int tokenLength)) + { + if (_ids.MatchesReset(datagram)) + { + DrainReset(); + } + + return; + } + + byte[] rented = ArrayPool.Shared.Rent(packetLength); + byte[] plain = ArrayPool.Shared.Rent(packetLength); + bool opened = false; + int plainLength = 0; + try + { + datagram[..packetLength].CopyTo(rented); + if (!TryOpen(kind, rented.AsSpan(0, packetLength), packetNumberOffset, plain, out ulong packetNumber, out plainLength)) + { + if (_openError != 0) + { + MarkClosed(_openError, send: true); + return; + } + + if (packetLength < datagram.Length) + { + datagram = datagram[packetLength..]; + continue; + } + + if (_ids.MatchesReset(datagram)) + { + DrainReset(); + } + + return; + } + + opened = true; + if (kind == QuicPacketKind.Initial && _peerSourceId is null) + { + _peerSourceId = datagram.Slice(sourceOffset, sourceLength).ToArray(); + _ids.AddPeer(_peerSourceId); + } + + if (kind == QuicPacketKind.Initial && _retryArmed && tokenLength == 0) + { + SendRetry(); + return; + } + + if (kind == QuicPacketKind.Initial && _expectedRetryToken is not null) + { + ReadOnlySpan token = datagram.Slice(tokenOffset, tokenLength); + if (token.Length != _expectedRetryToken.Length || !CryptographicOperations.FixedTimeEquals(token, _expectedRetryToken)) + { + return; + } + + ReceivedInitialToken = token.ToArray(); + _expectedRetryToken = null; + } + + if (kind == QuicPacketKind.Initial && !_sawInitialPath) + { + _initialPath = _path; + _sawInitialPath = true; + } + + if (kind == QuicPacketKind.Handshake || (kind == QuicPacketKind.OneRtt && _sawInitialPath && _path.Equals(_initialPath))) + { + MarkAddressValidated(_path); + } + + // Acknowledging 1-RTT before the handshake finishes lets the peer drop handshake + // keys and stop resending the packet that would complete this handshake. + bool hold = kind == QuicPacketKind.OneRtt && !HandshakeComplete; + if (hold && _heldApplication.Count >= HeldApplicationLimit) + { + if (!IsClosed) + { + NotePeerPacket(); + } + } + else + { + ulong? previousLargest = Acks(kind).Largest; + bool inOrder = previousLargest is null ? packetNumber == 0 : packetNumber == previousLargest.Value + 1; + Acks(kind).Accept(packetNumber); + if (hold) + { + var saved = new byte[plainLength]; + plain.AsSpan(0, plainLength).CopyTo(saved); + _heldApplication.Add(new HeldApplication(packetNumber, saved)); + } + else + { + bool eliciting = TakePayload(kind, plain.AsSpan(0, plainLength)); + if (eliciting && !IsClosed) + { + AcknowledgeEliciting(kind, inOrder); + } + } + + if (!IsClosed) + { + NotePeerPacket(); + } + } + } + finally + { + // The received packet is ciphertext. Only the decrypted prefix of the plaintext buffer needs zeroing. + ArrayPool.Shared.Return(rented); + CryptographicOperations.ZeroMemory(plain.AsSpan(0, plainLength)); + ArrayPool.Shared.Return(plain); + } + + if (!opened || packetLength >= datagram.Length) + { + return; + } + + datagram = datagram[packetLength..]; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TryLocate( + ReadOnlySpan datagram, + out QuicPacketKind kind, + out int packetLength, + out int packetNumberOffset, + out int sourceOffset, + out int sourceLength, + out int tokenOffset, + out int tokenLength) + { + kind = default; + packetLength = 0; + packetNumberOffset = 0; + sourceOffset = 0; + sourceLength = 0; + tokenOffset = 0; + tokenLength = 0; + if ((datagram[0] & 0x40) == 0) + { + return false; + } + + if ((datagram[0] & 0x80) == 0) + { + byte[]? owned = _ids.LongestOwnedPrefix(datagram[1..]); + if (owned is null) + { + return false; + } + + kind = QuicPacketKind.OneRtt; + packetNumberOffset = 1 + owned.Length; + packetLength = datagram.Length; + return packetLength > packetNumberOffset; + } + + if (datagram.Length < 7) + { + return false; + } + + if (BinaryPrimitives.ReadUInt32BigEndian(datagram[1..]) != 1) + { + return false; + } + + int destinationLength = datagram[5]; + if (destinationLength > QuicDatagramReader.MaxConnectionIdLength || datagram.Length < 6 + destinationLength) + { + return false; + } + + if (!_ids.Owns(datagram.Slice(6, destinationLength))) + { + return false; + } + + int sourceIndex = 6 + destinationLength; + if (datagram.Length <= sourceIndex) + { + return false; + } + + sourceLength = datagram[sourceIndex]; + sourceOffset = sourceIndex + 1; + if (sourceLength > QuicDatagramReader.MaxConnectionIdLength || datagram.Length < sourceOffset + sourceLength) + { + return false; + } + + int at = sourceOffset + sourceLength; + kind = (QuicPacketKind)((datagram[0] >> 4) & 0x03); + if (kind == QuicPacketKind.Initial) + { + if (!QuicVarInt.TryDecode(datagram[at..], out ulong encodedToken, out int tokenUsed) + || encodedToken > (ulong)(datagram.Length - at - tokenUsed)) + { + return false; + } + + tokenOffset = at + tokenUsed; + tokenLength = (int)encodedToken; + at += tokenUsed + tokenLength; + } + else if (kind != QuicPacketKind.Handshake) + { + return false; + } + + if (!QuicVarInt.TryDecode(datagram[at..], out ulong bodyLength, out int lengthUsed) + || bodyLength > (ulong)(datagram.Length - at - lengthUsed)) + { + return false; + } + + at += lengthUsed; + packetNumberOffset = at; + packetLength = at + (int)bodyLength; + return packetLength <= datagram.Length; + } + + private ulong _openError; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TryOpen(QuicPacketKind kind, Span packet, int packetNumberOffset, Span plaintext, out ulong packetNumber, out int plaintextLength) + { + _openError = 0; + QuicPacketProtector? protector = Protector(kind, send: false); + if (protector is null + || !protector.Open(packet, packetNumberOffset, Largest(kind), out packetNumber, plaintext, out plaintextLength)) + { + packetNumber = 0; + plaintextLength = 0; + return false; + } + + if (QuicPacket.ReservedBitsSet(packet[0])) + { + _openError = QuicFrameReader.ProtocolViolation; + packetNumber = 0; + plaintextLength = 0; + return false; + } + + // The network may reorder packets, so a number below the largest is only a problem + // when it has already arrived. A number the window no longer holds is too old to judge. + return Window(kind).TryAccept(packetNumber); + } + + private ref QuicAckTracker Acks(QuicPacketKind kind) + { + if (kind == QuicPacketKind.Handshake) + { + return ref _acksHandshake; + } + + if (kind == QuicPacketKind.OneRtt) + { + return ref _acksApplication; + } + + return ref _acksInitial; + } + + private ref QuicPacketReplayWindow Window(QuicPacketKind kind) + { + if (kind == QuicPacketKind.Handshake) + { + return ref _replayHandshake; + } + + if (kind == QuicPacketKind.OneRtt) + { + return ref _replayApplication; + } + + return ref _replayInitial; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TakePayload(QuicPacketKind kind, ReadOnlySpan plaintext) + { + bool eliciting = false; + var reader = new QuicFrameReader(plaintext, kind); + Span ranges = _frameRanges; + while (reader.TryNext(ranges, out QuicFrame frame)) + { + if (IsClosed) + { + return false; + } + + if (frame.Kind is not (QuicFrameKind.Ack or QuicFrameKind.Padding or QuicFrameKind.ConnectionClose)) + { + eliciting = true; + } + + if (frame.Kind == QuicFrameKind.Ack) + { + TimeSpan delay = TimeSpan.FromTicks((long)frame.AckDelay * 80); + if (!_loss.OnAck(kind, frame.LargestAcknowledged, delay, ranges, frame.AckRangeCount, _now, IsPathValidated(_path))) + { + MarkClosed(QuicFrameReader.ProtocolViolation, send: true); + return false; + } + + ObservePathMtu(); + foreach (QuicRetransmit item in _loss.Pending) + { + Retransmit(item.Kind, item.Payload); + } + + StageReady(); + continue; + } + + if (frame.Kind == QuicFrameKind.ConnectionClose) + { + // An application close is how a finished transfer ends. Keepalives after it + // are undecryptable on the next connection that reuses an empty connection id. + NotePeerClose(frame); + MarkClosed(frame.ErrorCode, send: false); + return false; + } + + if (frame.Kind == QuicFrameKind.Stream) + { + if (!_flow.AcceptStream(frame.StreamId, frame.Offset, frame.Data, out ulong error, frame.Fin)) + { + MarkClosed(error, send: true); + return false; + } + + ReceivedStreamByte ??= _flow.FirstDelivered; + + continue; + } + + if (frame.Kind == QuicFrameKind.ResetStream) + { + if (!_flow.NoteReset(frame.StreamId, frame.Limit, out ulong error)) + { + MarkClosed(error, send: true); + return false; + } + + continue; + } + + if (frame.Kind == QuicFrameKind.StopSending) + { + if (!_flow.NoteStopSending(frame.StreamId, out ulong error)) + { + MarkClosed(error, send: true); + return false; + } + + continue; + } + + if (frame.Kind == QuicFrameKind.MaxData) + { + _flow.RaiseSend(frame.Limit, null, null); + StageReady(); + continue; + } + + if (frame.Kind == QuicFrameKind.MaxStreamData) + { + if (!_flow.RaiseSend(null, frame.StreamId, frame.Limit)) + { + MarkClosed(QuicFlow.StreamStateError, send: true); + return false; + } + + StageReady(); + continue; + } + + if (frame.Kind == QuicFrameKind.NewConnectionId) + { + var retire = new List(); + if (!_ids.TryAddPeer(frame.Sequence, frame.RetirePriorTo, frame.Data, frame.Token, retire, out ulong error)) + { + MarkClosed(error, send: true); + return false; + } + + foreach (ulong sequence in retire) + { + StageRetire(sequence); + } + + continue; + } + + if (frame.Kind == QuicFrameKind.RetireConnectionId) + { + if (!_ids.TryRetire(frame.Sequence, out ulong error)) + { + MarkClosed(error, send: true); + return false; + } + + continue; + } + + if (frame.Kind == QuicFrameKind.NewToken) + { + if (!_client) + { + MarkClosed(QuicFrameReader.ProtocolViolation, send: true); + return false; + } + + IssuedNewToken = frame.Data.ToArray(); + continue; + } + + if (frame.Kind == QuicFrameKind.HandshakeDone) + { + if (!_client) + { + MarkClosed(QuicFrameReader.ProtocolViolation, send: true); + return false; + } + + _loss.HandshakeConfirmed = true; + _loss.DiscardHandshake(); + continue; + } + + if (frame.Kind == QuicFrameKind.PathChallenge) + { + StagePathResponse(frame.Data); + continue; + } + + if (frame.Kind == QuicFrameKind.PathResponse && MatchesChallenge(frame.Data)) + { + MarkAddressValidated(_path); + continue; + } + + if (frame.Kind == QuicFrameKind.Datagram) + { + MarkClosed(QuicFrameReader.ProtocolViolation, send: true); + return false; + } + + if (frame.Kind == QuicFrameKind.Crypto && !TakeCrypto(kind, frame.Offset, frame.Data)) + { + return false; + } + } + + if (reader.Error != 0) + { + MarkClosed(reader.Error, send: true); + return false; + } + + return eliciting; + } + + private bool TakeCrypto(QuicPacketKind kind, ulong offset, ReadOnlySpan data) + { + if (kind == QuicPacketKind.OneRtt) + { + MarkClosed(CryptoError(10), send: true); + return false; + } + + if (kind is not (QuicPacketKind.Initial or QuicPacketKind.Handshake) || _engine is null) + { + return true; + } + + if (offset > (ulong)HandshakeFraming.DefaultMaxMessageBytes + || (ulong)data.Length > (ulong)HandshakeFraming.DefaultMaxMessageBytes + || offset + (ulong)data.Length > (ulong)HandshakeFraming.DefaultMaxMessageBytes) + { + MarkClosed(QuicFlow.CryptoBufferExceeded, send: true); + return false; + } + + if (!_flow.PushCrypto(kind, offset, data, out ReadOnlySpan ready, out ulong flowError)) + { + MarkClosed(flowError, send: true); + return false; + } + + if (ready.Length == 0) + { + return true; + } + + if (kind == QuicPacketKind.Initial) + { + _recvInitial += ready.Length; + } + else + { + _recvHandshake += ready.Length; + } + + var output = new TlsOutput(); + _engine.AdvanceDatagram(ready, output); + if (_engine.State == TlsEngineState.Closed) + { + MarkClosed(CryptoError(_engine.LastLocalAlert), send: true); + return false; + } + + bool hello = _engine.State == TlsEngineState.WaitClientHelloDecision; + bool certificate = _engine.State == TlsEngineState.WaitCertificateDecision; + if (hello || certificate) + { + if (!AcceptParameters()) + { + return false; + } + + if (hello && _certificate is null) + { + PendingHello = true; + return true; + } + + if (hello) + { + _engine.Resume(_ => new TlsServerSelection { Certificate = _certificate! }, output); + } + else + { + _engine.Resume(true, output); + } + + if (_engine.State == TlsEngineState.Closed) + { + MarkClosed(CryptoError(_engine.LastLocalAlert), send: true); + return false; + } + } + else if (!AcceptParameters()) + { + return false; + } + + if (!IsClosed) + { + Emit(output); + SendHandshakeDoneOnce(); + } + + return !IsClosed; + } + + private bool AcceptParameters() + { + if (_parametersChecked || _engine?.PeerTransportParameters is not byte[] encoded) + { + return true; + } + + if (!QuicTransportParametersCodec.TryRead(encoded, fromServer: _client, retryReceived: false, out QuicTransportParameters parsed, out ulong error)) + { + MarkClosed(error, send: true); + return false; + } + + bool match = _client + ? Same(parsed.OriginalDestinationConnectionId, _originalDestinationId) && Same(parsed.InitialSourceConnectionId, _peerSourceId) + : Same(parsed.InitialSourceConnectionId, _peerSourceId); + _parametersChecked = true; + if (match) + { + _flow.SetPeer(parsed); + NotePeerIdle(parsed.MaxIdleTimeout); + if (parsed.MaxUdpPayloadSize <= int.MaxValue) + { + _mtu.SetMaximum((int)parsed.MaxUdpPayloadSize); + } + } + + if (match) + { + if (_client && parsed.StatelessResetToken is byte[] token) + { + _ids.RememberResetToken(_originalDestinationId, token); + } + + return true; + } + + MarkClosed(QuicTransportParametersCodec.TransportParameterError, send: true); + return false; + } + + private void Emit(TlsOutput output) + { + InstallSecrets(); + for (int i = 0; i < output.SegmentCount && !IsClosed; i++) + { + (int level, int offset, int length) = output.Segment(i); + ReadOnlySpan bytes = output.Bytes.Slice(offset, length); + if (level == 0) + { + StageCrypto(QuicPacketKind.Initial, _initialSend, ref _sentInitial, bytes, _client && _pnInitial == 0 ? 1200 : 0, corrupt: false); + } + else if (level == 2) + { + StageCrypto(QuicPacketKind.Handshake, _handshakeSend, ref _sentHandshake, bytes, 0, CorruptNextHandshakePayload); + } + } + } + + private void StageCrypto(QuicPacketKind kind, QuicPacketProtector? protector, ref int cursor, ReadOnlySpan handshake, int minimumDatagram, bool corrupt) + { + if (protector is null || handshake.IsEmpty) + { + return; + } + + byte[] frame = ArrayPool.Shared.Rent(handshake.Length + 32); + int used = 0; + try + { + var crypto = new QuicFrame + { + Kind = QuicFrameKind.Crypto, + Offset = (ulong)cursor, + Data = handshake, + }; + int written = QuicFrameWriter.Write(in crypto, default, frame); + if (written == 0) + { + return; + } + + used = written; + Span payload = frame.AsSpan(0, written); + if (corrupt) + { + payload[^1] ^= 0xFF; + CorruptNextHandshakePayload = false; + } + + if (SealAndStage(kind, protector, payload, minimumDatagram) > 0) + { + cursor += handshake.Length; + } + } + finally + { + CryptographicOperations.ZeroMemory(frame.AsSpan(0, used)); + ArrayPool.Shared.Return(frame); + } + } + + private void Retransmit(QuicPacketKind kind, byte[] payload, bool countCongestion = true) + { + if (kind == QuicPacketKind.Handshake && _loss.HandshakeConfirmed) + { + return; + } + + QuicPacketProtector? protector = Protector(kind, send: true); + if (protector is null || payload.Length == 0 || !_hasPath || IsClosed) + { + return; + } + + SealAndStage(kind, protector, payload, kind == QuicPacketKind.Initial ? 1200 : 0, probe: true, countCongestion: countCongestion); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int SealAndStage(QuicPacketKind kind, QuicPacketProtector protector, ReadOnlySpan payload, int minimumDatagram, bool probe = false, PathInfo? path = null, bool pmtu = false, bool countCongestion = true) + { + byte[] packet = ArrayPool.Shared.Rent(Math.Max(minimumDatagram, payload.Length) + 128 + _initialToken.Length); + try + { + ulong number = kind switch + { + QuicPacketKind.Handshake => _pnHandshake, + QuicPacketKind.OneRtt => _pnApplication, + _ => _pnInitial, + }; + int written = kind == QuicPacketKind.OneRtt + ? QuicPackets.SealShort(packet, DestinationId(), number, payload, protector) + : QuicPackets.SealLong(packet, kind, DestinationId(), _localId, number, payload, protector, minimumDatagram, _initialToken); + byte[] copy = payload.ToArray(); + if (written == 0 || !TryStageTransmit(path ?? _path, packet.AsSpan(0, written), track: true, kind, number, copy, probe, pmtu, exempt: !countCongestion)) + { + return 0; + } + + if (_client && kind == QuicPacketKind.Initial && _initialFlight is null) + { + _initialFlight = copy; + } + + if (kind == QuicPacketKind.Handshake) + { + _pnHandshake++; + } + else if (kind == QuicPacketKind.OneRtt) + { + _pnApplication++; + } + else + { + _pnInitial++; + } + + return written; + } + finally + { + // The sealed packet is ciphertext. The plaintext stays with the caller. + ArrayPool.Shared.Return(packet); + } + } + + private void InstallSecrets() + { + Span secret = _secretScratch; + if (_handshakeSend is null && Copy(application: false, client: _client, secret)) + { + _handshakeSend = QuicPacketProtector.FromSecret(secret); + } + + if (_handshakeRecv is null && Copy(application: false, client: !_client, secret)) + { + _handshakeRecv = QuicPacketProtector.FromSecret(secret); + } + + if (_applicationSend is null && Copy(application: true, client: _client, secret)) + { + _applicationSend = QuicPacketProtector.FromSecret(secret); + } + + if (_applicationRecv is null && Copy(application: true, client: !_client, secret)) + { + _applicationRecv = QuicPacketProtector.FromSecret(secret); + } + + CryptographicOperations.ZeroMemory(secret); + } + + private bool Copy(bool application, bool client, Span secret) + { + secret.Clear(); + return _engine is not null && _engine.TryCopyTrafficSecret(application, client, secret); + } + + internal bool PendingHello { get; private set; } + + internal string PendingServerName => _engine?.ClientHello?.ServerName ?? string.Empty; + + internal bool CompleteHello(X509Certificate2 certificate, string[]? applicationProtocols = null) + { + if (!PendingHello || _engine is null) + { + return false; + } + + _certificate = certificate; + PendingHello = false; + var output = new TlsOutput(); + _engine.Resume(_ => new TlsServerSelection + { + Certificate = certificate, + ApplicationProtocols = applicationProtocols, + RequireApplicationProtocol = applicationProtocols is { Length: > 0 }, + }, output); + if (_engine.State == TlsEngineState.Closed) + { + MarkClosed(CryptoError(_engine.LastLocalAlert), send: true); + return false; + } + + Emit(output); + return !IsClosed; + } + + internal void Close(ulong error) => MarkClosed(error, send: true); + + internal string HandshakeCloseDetail() + { + string code = "0x" + CloseError.ToString("x", System.Globalization.CultureInfo.InvariantCulture); + string alert = CloseError is >= 0x100 and <= 0x1ff + ? " alert " + (CloseError - 0x100).ToString(System.Globalization.CultureInfo.InvariantCulture) + : ""; + if (!PeerClosed) + { + return "local transport " + code + alert; + } + + string kind = ApplicationClose + ? "peer application " + code + : "peer transport " + code + " frame 0x" + TriggeringFrame.ToString("x", System.Globalization.CultureInfo.InvariantCulture); + return CloseReason is null ? kind + alert : kind + alert + " reason " + CloseReason; + } + + private void NotePeerClose(in QuicFrame frame) + { + if (IsClosed) + { + return; + } + + PeerClosed = true; + ApplicationClose = frame.ApplicationClose; + TriggeringFrame = frame.TriggeringFrame; + CloseReason = ReasonText(frame.Data); + } + + private static string? ReasonText(ReadOnlySpan data) + { + if (data.IsEmpty) + { + return null; + } + + int count = Math.Min(data.Length, 80); + for (int i = 0; i < count; i++) + { + if (data[i] is < 0x20 or > 0x7e) + { + return null; + } + } + + return System.Text.Encoding.ASCII.GetString(data[..count]); + } + + private void MarkClosed(ulong error, bool send) + { + if (IsClosed) + { + return; + } + + IsClosed = true; + CloseError = error; + if (!send || !_hasPath) + { + return; + } + + InstallSecrets(); + QuicPacketProtector? protector; + QuicPacketKind kind; + if (_applicationSend is not null) + { + protector = _applicationSend; + kind = QuicPacketKind.OneRtt; + } + else if (_handshakeSend is not null) + { + protector = _handshakeSend; + kind = QuicPacketKind.Handshake; + } + else if (_initialSend is not null) + { + protector = _initialSend; + kind = QuicPacketKind.Initial; + } + else + { + return; + } + + Span frame = stackalloc byte[24]; + var close = new QuicFrame { Kind = QuicFrameKind.ConnectionClose, ErrorCode = error }; + int written = QuicFrameWriter.Write(in close, default, frame); + if (written > 0) + { + SealAndStage(kind, protector, frame[..written], 0); + } + } + + private ulong? Largest(QuicPacketKind kind) => Window(kind).Largest; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private QuicPacketProtector? Protector(QuicPacketKind kind, bool send) + { + if (kind == QuicPacketKind.Handshake) + { + return send ? _handshakeSend : _handshakeRecv; + } + + if (kind == QuicPacketKind.OneRtt) + { + return send ? _applicationSend : _applicationRecv; + } + + return send ? _initialSend : _initialRecv; + } + + internal void ArmRetry(ReadOnlySpan token) + { + _retryToken = token.ToArray(); + _retryArmed = true; + } + + internal void SendApplicationCrypto(ReadOnlySpan data) + { + if (_applicationSend is null || data.IsEmpty) + { + return; + } + + Span frame = stackalloc byte[data.Length + 16]; + var written = new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = 0, Data = data }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + private bool _sentHandshakeDone; + + private const int HeldApplicationLimit = 16; + + private readonly List _heldApplication = new(); + + private readonly struct HeldApplication + { + internal HeldApplication(ulong number, byte[] payload) + { + Number = number; + Payload = payload; + } + + internal ulong Number { get; } + + internal byte[] Payload { get; } + } + + private void SendHandshakeDoneOnce() + { + if (!HandshakeComplete || _applicationSend is null) + { + return; + } + + if (!_client && !_sentHandshakeDone) + { + _sentHandshakeDone = true; + SendHandshakeDone(); + // The peer already has this flight: it had to, to send Finished. Leaving the + // packets in flight fills the congestion window, so the file never goes out. + _loss.DiscardHandshake(); + } + + ReleaseHeldApplication(); + } + + private void ReleaseHeldApplication() + { + if (_heldApplication.Count == 0) + { + return; + } + + HeldApplication[] held = _heldApplication.ToArray(); + _heldApplication.Clear(); + for (int i = 0; i < held.Length; i++) + { + if (IsClosed) + { + return; + } + + Acks(QuicPacketKind.OneRtt).Accept(held[i].Number); + bool eliciting = TakePayload(QuicPacketKind.OneRtt, held[i].Payload); + if (eliciting && !IsClosed) + { + StageAck(QuicPacketKind.OneRtt); + } + } + } + + internal void SendHandshakeDone() + { + if (_applicationSend is null) + { + return; + } + + Span frame = stackalloc byte[8]; + var written = new QuicFrame { Kind = QuicFrameKind.HandshakeDone }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + // Header protection needs four bytes of ciphertext after the packet number. + frame[count] = 0; + frame[count + 1] = 0; + frame[count + 2] = 0; + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..(count + 3)], 0); + } + } + + internal void SendNewToken(ReadOnlySpan token) + { + if (token.IsEmpty || _applicationSend is null) + { + return; + } + + Span frame = stackalloc byte[token.Length + 8]; + var written = new QuicFrame { Kind = QuicFrameKind.NewToken, Data = token }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + internal void IssueConnectionId() + { + if (_applicationSend is null) + { + return; + } + + (ulong sequence, byte[] id, byte[] token) = _ids.Issue(); + Span frame = stackalloc byte[64]; + var written = new QuicFrame + { + Kind = QuicFrameKind.NewConnectionId, + Sequence = sequence, + Data = id, + Token = token, + }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + internal void RetireConnectionId(ulong sequence) + { + if (_applicationSend is null) + { + return; + } + + Span frame = stackalloc byte[16]; + var written = new QuicFrame { Kind = QuicFrameKind.RetireConnectionId, Sequence = sequence }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + internal void SendPathChallenge(in PathInfo path) + { + if (_applicationSend is null) + { + return; + } + + byte[] data = new byte[8]; + RandomNumberGenerator.Fill(data); + _challenges.Add((path, data)); + AddReceived(path, 0); + Span frame = stackalloc byte[16]; + var challenge = new QuicFrame { Kind = QuicFrameKind.PathChallenge, Data = data }; + int count = QuicFrameWriter.Write(in challenge, default, frame); + if (count == 0) + { + return; + } + + int overhead = 1 + DestinationId().Length + 2 + 16; + byte[] body = new byte[Math.Max(count, 1200 - overhead)]; + frame[..count].CopyTo(body); + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, body, 1200, probe: true, path); + } + + private void RememberLocalLimits(ReadOnlySpan encoded, bool fromServer) + { + if (QuicTransportParametersCodec.TryRead(encoded, fromServer, retryReceived: false, out QuicTransportParameters parsed, out _)) + { + _flow.SetLocal(parsed, _client); + _localIdleMs = parsed.MaxIdleTimeout; + ArmIdle(_now); + } + } + + internal void ReportTunnelMaximum(int bytes) => _mtu.SetMaximum(bytes); + + internal bool SendPathMtuProbe(bool confirm = false) + { + if (IsClosed || _applicationSend is null) + { + return false; + } + + int size = _mtu.BeginProbe(confirm); + if (size < QuicPathMtu.Base) + { + return false; + } + + int overhead = 1 + DestinationId().Length + 2 + 16; + if (size <= overhead + 1) + { + _mtu.Cancel(); + return false; + } + + byte[] body = new byte[size - overhead]; + body[0] = 0x01; + ulong number = _pnApplication; + if (SealAndStage(QuicPacketKind.OneRtt, _applicationSend, body, 0, probe: true, pmtu: true) == 0) + { + _mtu.Cancel(); + return false; + } + + _probeNumber = number; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void AcknowledgeApplication(ulong number, DateTimeOffset now) + { + _now = now; + if (HandshakeComplete) + { + _loss.HandshakeConfirmed = true; + } + + Span frame = stackalloc byte[16]; + var ranges = new QuicAckRange[1]; + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = number, + AckRangeCount = 1, + }; + int written = QuicFrameWriter.Write(in ack, ranges, frame); + if (written > 0) + { + TakePayload(QuicPacketKind.OneRtt, frame[..written]); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ObservePathMtu() + { + if (_probeNumber is ulong number) + { + bool acked = false; + bool lost = false; + foreach (ulong item in _loss.AckedPmtu) + { + if (item == number) + { + acked = true; + } + } + + foreach (ulong item in _loss.LostPmtu) + { + if (item == number) + { + lost = true; + } + } + + if (acked) + { + _mtu.Acknowledge(); + _probeNumber = null; + } + else if (lost) + { + _mtu.Lose(); + _probeNumber = null; + } + } + + _loss.AckedPmtu.Clear(); + _loss.LostPmtu.Clear(); + } + + internal void SendKeepAlive() + { + if (IsClosed || _applicationSend is null) + { + return; + } + + Span frame = stackalloc byte[4]; + var ping = new QuicFrame { Kind = QuicFrameKind.Ping }; + int count = QuicFrameWriter.Write(in ping, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame, 0, probe: true); + } + } + + private TimeSpan _keepAliveInterval = Timeout.InfiniteTimeSpan; + + private DateTimeOffset? _keepAliveDeadline; + + internal int KeepAlivesSent { get; private set; } + + internal void SetKeepAlive(TimeSpan interval) => _keepAliveInterval = interval; + + internal void ResetStream(ulong streamId, long errorCode, ulong finalSize) + { + if (IsClosed || _applicationSend is null || errorCode < 0) + { + return; + } + + var reset = new QuicFrame + { + Kind = QuicFrameKind.ResetStream, + StreamId = streamId, + ErrorCode = (ulong)errorCode, + Limit = finalSize, + }; + Span frame = stackalloc byte[32]; + int count = QuicFrameWriter.Write(in reset, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0, probe: true); + } + } + + private bool KeepAliveDue(DateTimeOffset now) => + _keepAliveInterval > TimeSpan.Zero + && _keepAliveInterval != Timeout.InfiniteTimeSpan + && HandshakeComplete + && !IsClosed + && _keepAliveDeadline is DateTimeOffset due + && now >= due; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ArmKeepAlive() + { + if (_keepAliveDeadline is not null + || _keepAliveInterval <= TimeSpan.Zero + || _keepAliveInterval == Timeout.InfiniteTimeSpan + || !HandshakeComplete + || IsClosed + || _now == default) + { + return; + } + + _keepAliveDeadline = _now + _keepAliveInterval; + } + + private ulong _localIdleMs; + + private ulong _peerIdleMs; + + private bool _havePeerIdle; + + private bool _sentSinceReceive; + + private DateTimeOffset? _idleDeadline; + + internal bool IdleTimedOut { get; private set; } + + internal int PathMtu => _mtu.Ceiling; + + internal ulong LastSentApplication { get; private set; } + + private void NotePeerIdle(ulong milliseconds) + { + _peerIdleMs = milliseconds; + _havePeerIdle = true; + ArmIdle(_now); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void NotePeerPacket() + { + _sentSinceReceive = false; + ArmIdle(_now); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void NoteAckElicitingSend() + { + if (_sentSinceReceive) + { + return; + } + + _sentSinceReceive = true; + ArmIdle(_now); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ArmIdle(DateTimeOffset now) + { + ulong chosen = _localIdleMs; + if (_havePeerIdle && _peerIdleMs != 0 && (_localIdleMs == 0 || _peerIdleMs < chosen)) + { + chosen = _peerIdleMs; + } + if (chosen == 0 || now == default) + { + _idleDeadline = null; + return; + } + + TimeSpan period = TimeSpan.FromMilliseconds(chosen); + TimeSpan floor = TimeSpan.FromTicks(_loss.CurrentProbeTimeout().Ticks * 3); + if (period < floor) + { + period = floor; + } + + _idleDeadline = now + period; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void StageReady() + { + if (_applicationSend is null || IsClosed) + { + return; + } + + // A packet number is assigned when a packet is staged, so a packet staged beyond what the + // window will release stays in the queue while ACK-only packets staged later take higher + // numbers and leave first. Stage only what the window still has room for, counting what + // is already staged and unsent. + long held = StagedCountedBytes(); + IReadOnlyList ready = _flow.TakeReady(); + if (ready.Count == 0) + { + return; + } + + // A full packet is the path's largest datagram (1200 until a probe validates more) less the + // short header, the AEAD tag, and the STREAM frame header. The frame is written into one + // rented buffer of exactly the frame size the packet can carry. + int maxDatagram = _mtu.Ceiling; + int frameRoom = maxDatagram - ShortPacketOverhead(DestinationId().Length); + if (frameRoom <= StreamFrameHeaderMaximum) + { + ReturnUnsent(ready, 0, ready[0].Offset); + return; + } + + byte[] frame = ArrayPool.Shared.Rent(frameRoom); + int used = 0; + + // A pending acknowledgement rides in the first packet this call stages. It stays pending + // until that packet is staged, so a packet the window refuses does not lose it. + Span pendingAck = stackalloc byte[16 + (QuicFrameReader.MaxAckRanges * 16)]; + int ackLength = _applicationUnacked > 0 ? WriteApplicationAck(pendingAck) : 0; + if (frameRoom - ackLength <= StreamFrameHeaderMaximum) + { + ackLength = 0; + } + + try + { + for (int i = 0; i < ready.Count; i++) + { + Outgoing outgoing = ready[i]; + long at = outgoing.Offset; + long end = outgoing.Offset + outgoing.Length; + while (at < end) + { + // Frame straight out of the stream's pooled block, so no intermediate array holds + // the payload. A frame never spans two blocks because the writer needs one span. + int header = StreamFrameHeaderSize(outgoing.StreamId, (ulong)at); + int chunk = (int)Math.Min(Math.Min(frameRoom - ackLength - header, end - at), outgoing.UntilBlockEnd(at)); + bool lastByte = at + chunk == end && LastOutgoing(ready, i) && _flow.FinishPending(outgoing.StreamId); + var stream = new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = outgoing.StreamId, + Offset = (ulong)at, + HasLength = true, + Fin = lastByte, + Data = outgoing.Slice(at, chunk), + }; + int count = QuicFrameWriter.Write(in stream, default, frame.AsSpan(ackLength, frameRoom - ackLength)); + if (count > 0 && ackLength > 0) + { + pendingAck[..ackLength].CopyTo(frame); + count += ackLength; + } + + used = count; + if (count == 0 || !_loss.Allows(held + count + 64)) + { + ReturnUnsent(ready, i, at); + return; + } + + int stagedBytes = SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame.AsSpan(0, count), 0); + CryptographicOperations.ZeroMemory(frame.AsSpan(0, count)); + used = 0; + if (stagedBytes == 0) + { + ReturnUnsent(ready, i, at); + return; + } + + if (ackLength > 0) + { + AcknowledgementSent(QuicPacketKind.OneRtt); + ackLength = 0; + } + + held += stagedBytes; + + if (lastByte) + { + _flow.ClearFinish(outgoing.StreamId); + } + + at += chunk; + } + } + } + finally + { + CryptographicOperations.ZeroMemory(frame.AsSpan(0, used)); + ArrayPool.Shared.Return(frame); + } + } + + // Type byte, a stream id and an offset of up to eight bytes each, and a two-byte length for a full frame. + private const int StreamFrameHeaderMaximum = 1 + 8 + 8 + 2; + + // First byte, the destination connection id, a two-byte packet number, and the 16-byte AEAD tag. + private static int ShortPacketOverhead(int destinationIdLength) => 1 + destinationIdLength + 2 + 16; + + // The writer leaves the offset out at zero, and a full frame always carries a two-byte length. + private static int StreamFrameHeaderSize(ulong streamId, ulong offset) => 1 + VarIntSize(streamId) + (offset == 0 ? 0 : VarIntSize(offset)) + 2; + + private static int VarIntSize(ulong value) => value < 64 ? 1 : value < 16384 ? 2 : value < 1073741824 ? 4 : 8; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool LastOutgoing(IReadOnlyList ready, int index) + { + ulong streamId = ready[index].StreamId; + for (int i = index + 1; i < ready.Count; i++) + { + if (ready[i].StreamId == streamId) + { + return false; + } + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ReturnUnsent(IReadOnlyList ready, int index, long at) + { + // A refused packet only moves the stream's hand-out cursor back, so the bytes it would + // have carried are still in the pooled blocks and are framed by the next attempt. + _flow.ReturnReady(ready[index].StreamId, (ulong)at); + for (int i = index + 1; i < ready.Count; i++) + { + _flow.ReturnReady(ready[i].StreamId, (ulong)ready[i].Offset); + } + } + + // Handshake packets and the Initial space are acknowledged at once, as is any 1-RTT packet that + // arrives out of order (RFC 9000 section 13.2.1). Otherwise the second unacknowledged packet is + // acknowledged at once and the first waits for the delay below or for a packet to ride in. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void AcknowledgeEliciting(QuicPacketKind kind, bool inOrder) + { + if (kind != QuicPacketKind.OneRtt || !HandshakeComplete || !inOrder) + { + StageAck(kind); + return; + } + + _applicationLargestAt = _now; + _applicationUnacked++; + if (_applicationUnacked >= 2 && !_holdAcknowledgement) + { + StageAck(kind); + return; + } + + // A held packet keeps the deadline the first one set, so a batch that is never released is still acknowledged on time. + _applicationAckDeadline = _applicationUnacked == 1 ? _now + QuicLossRecovery.MaxAckDelay : _applicationAckDeadline ?? _now + QuicLossRecovery.MaxAckDelay; + } + + /// Makes in-order 1-RTT packets wait for instead of acknowledging every second one. + internal void HoldAcknowledgement() => _holdAcknowledgement = true; + + /// Ends a hold. One acknowledgement covers the packets taken since the last one, if two or more are waiting. + internal void ReleaseAcknowledgement() + { + if (!_holdAcknowledgement) + { + return; + } + + _holdAcknowledgement = false; + if (_applicationUnacked >= 2 && !IsClosed) + { + StageAck(QuicPacketKind.OneRtt); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void SendDueAcknowledgement(DateTimeOffset now) + { + if (_applicationAckDeadline is DateTimeOffset due && now >= due) + { + StageAck(QuicPacketKind.OneRtt); + + // A deadline that outlives a refused acknowledgement would make the timer loop spin. + _applicationAckDeadline = null; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void AcknowledgementSent(QuicPacketKind kind) + { + if (kind == QuicPacketKind.OneRtt) + { + _applicationUnacked = 0; + _applicationAckDeadline = null; + } + } + + // The ACK frame for the 1-RTT space with the delay since the largest packet arrived, or 0 when there is nothing to say. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int WriteApplicationAck(Span frame) + { + Span ranges = _ackRanges; + int rangeCount = _acksApplication.Fill(ranges, out ulong largest); + if (rangeCount == 0) + { + return 0; + } + + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = largest, + AckDelay = AckDelayUnits(), + AckRangeCount = rangeCount, + }; + return QuicFrameWriter.Write(in ack, ranges, frame); + } + + // The peer's ack_delay_exponent is the default of 3, so one unit is 8 microseconds, or 80 ticks. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private ulong AckDelayUnits() + { + if (_applicationUnacked == 0 || _applicationLargestAt == default || _now <= _applicationLargestAt) + { + return 0; + } + + long ticks = (_now - _applicationLargestAt).Ticks; + long units = ticks / 80; + long cap = (long)(QuicLossRecovery.MaxAckDelay.Ticks / 80); + return (ulong)(units > cap ? cap : units); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void StageAck(QuicPacketKind kind) + { + QuicPacketProtector? protector = Protector(kind, send: true); + if (protector is null) + { + return; + } + + Span frame = stackalloc byte[16 + (QuicFrameReader.MaxAckRanges * 16)]; + int written; + if (kind == QuicPacketKind.OneRtt) + { + written = WriteApplicationAck(frame); + } + else + { + Span ranges = _ackRanges; + int rangeCount = Acks(kind).Fill(ranges, out ulong largest); + if (rangeCount == 0) + { + return; + } + + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = largest, + AckRangeCount = rangeCount, + }; + written = QuicFrameWriter.Write(in ack, ranges, frame); + } + + if (written > 0) + { + SealAndStage(kind, protector, frame[..written], 0, countCongestion: false); + AcknowledgementSent(kind); + } + + // The peer repeats an Initial when the ServerHello is lost. Answer that repeat immediately. + // Waiting for the doubled probe timeout lets a 5s idle timer win. + if (kind == QuicPacketKind.Initial && _loss.TryOldestPayload(0, out QuicPacketKind carried, out byte[] flight)) + { + // Another copy on every repeated Initial. It must not occupy the congestion window, + // or the file stays queued behind copies the peer will never acknowledge. + Retransmit(carried, flight, countCongestion: false); + } + } + + private void InstallInitial(ReadOnlySpan destinationId, bool clientSend) + { + _initialSend?.Dispose(); + _initialRecv?.Dispose(); + _initialSend = QuicPacketProtector.FromInitial(destinationId, clientSend); + _initialRecv = QuicPacketProtector.FromInitial(destinationId, !clientSend); + } + + private void AcceptRetry(ReadOnlySpan datagram) + { + if (_retryAccepted || _peerSourceId is not null || datagram.Length < 23 || BinaryPrimitives.ReadUInt32BigEndian(datagram[1..]) != 1) + { + return; + } + + int destinationLength = datagram[5]; + if (destinationLength != _localId.Length || !datagram.Slice(6, destinationLength).SequenceEqual(_localId)) + { + return; + } + + int sourceIndex = 6 + destinationLength; + if (datagram.Length <= sourceIndex) + { + return; + } + + int sourceLength = datagram[sourceIndex]; + int sourceOffset = sourceIndex + 1; + if (sourceLength is < 1 or > QuicDatagramReader.MaxConnectionIdLength || datagram.Length < sourceOffset + sourceLength + 16) + { + return; + } + + if (!QuicRetry.TryVerify(_originalDestinationId, datagram)) + { + return; + } + + _retryAccepted = true; + int tokenStart = sourceOffset + sourceLength; + _initialToken = datagram[tokenStart..^16].ToArray(); + _remoteId = datagram.Slice(sourceOffset, sourceLength).ToArray(); + _ids.AddPeer(_remoteId); + InstallInitial(_remoteId, clientSend: true); + _replayInitial.Reset(); + _pnInitial = 0; + _loss.DiscardInitial(); + if (_initialFlight is not null && _initialSend is not null) + { + SealAndStage(QuicPacketKind.Initial, _initialSend, _initialFlight, 1200, probe: true); + } + } + + private void SendRetry() + { + if (_peerSourceId is null) + { + return; + } + + byte[] source = new byte[8]; + RandomNumberGenerator.Fill(source); + int body = 6 + _peerSourceId.Length + 1 + source.Length + _retryToken.Length; + byte[] packet = new byte[body + 16]; + packet[0] = 0xF0; + BinaryPrimitives.WriteUInt32BigEndian(packet.AsSpan(1), 1); + int at = 5; + packet[at++] = (byte)_peerSourceId.Length; + _peerSourceId.CopyTo(packet.AsSpan(at)); + at += _peerSourceId.Length; + packet[at++] = (byte)source.Length; + source.CopyTo(packet.AsSpan(at)); + at += source.Length; + _retryToken.CopyTo(packet.AsSpan(at)); + if (!QuicRetry.TryWriteTag(_originalDestinationId, packet.AsSpan(0, body), packet.AsSpan(body))) + { + return; + } + + TryStageTransmit(_path, packet); + _expectedRetryToken = _retryToken; + _retryArmed = false; + _ids.AddIssued(source); + InstallInitial(source, clientSend: false); + _replayInitial.Reset(); + _pnInitial = 0; + _loss.DiscardInitial(); + } + + private void DrainReset() + { + if (ClosedByStatelessReset) + { + return; + } + + IsClosed = true; + ClosedByStatelessReset = true; + for (int i = 0; i < _staged.Count; i++) + { + ArrayPool.Shared.Return(_staged[i].Buffer); + } + + _staged.Clear(); + } + + private void StageRetire(ulong sequence) + { + if (_applicationSend is null) + { + return; + } + + Span frame = stackalloc byte[16]; + var written = new QuicFrame { Kind = QuicFrameKind.RetireConnectionId, Sequence = sequence }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + private void StagePathResponse(ReadOnlySpan data) + { + if (data.Length != 8 || _applicationSend is null) + { + return; + } + + byte[] copy = data.ToArray(); + Span frame = stackalloc byte[16]; + var written = new QuicFrame { Kind = QuicFrameKind.PathResponse, Data = copy }; + int count = QuicFrameWriter.Write(in written, default, frame); + if (count > 0) + { + SealAndStage(QuicPacketKind.OneRtt, _applicationSend, frame[..count], 0); + } + } + + private bool MatchesChallenge(ReadOnlySpan data) + { + bool match = false; + for (int i = 0; i < _challenges.Count; i++) + { + if (!_challenges[i].Path.Equals(_path)) + { + continue; + } + + match |= CryptographicOperations.FixedTimeEquals(_challenges[i].Data, data); + } + + if (!match) + { + return false; + } + + for (int i = _challenges.Count - 1; i >= 0; i--) + { + if (_challenges[i].Path.Equals(_path) && CryptographicOperations.FixedTimeEquals(_challenges[i].Data, data)) + { + _challenges.RemoveAt(i); + } + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private byte[] DestinationId() + { + if (!_client) + { + return _peerSourceId ?? []; + } + + return _ids.ActivePeer() ?? _peerSourceId ?? _remoteId; + } + + private static bool Same(byte[]? value, byte[]? expected) + { + return value is not null && expected is not null && value.AsSpan().SequenceEqual(expected); + } + + private static ulong CryptoError(byte alert) => 0x0100UL + alert; +} diff --git a/src/Titanium.Quic/Internal/QuicIdentity.cs b/src/Titanium.Quic/Internal/QuicIdentity.cs new file mode 100644 index 000000000..d0b81fe04 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicIdentity.cs @@ -0,0 +1,388 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; + +namespace Titanium.Quic; + +/// +/// Connection IDs this endpoint has issued and the ones its peer has issued. +/// Reset tokens are compared without an early exit. +/// +internal sealed class QuicIdentity +{ + internal const ulong ConnectionIdLimitError = 0x09; + + internal const int ActiveLimit = 8; + + private readonly List _issued = []; + + private readonly List _peers = []; + + private readonly List _used = []; + + private ulong _retirePriorTo; + + internal int IssuedActive + { + get + { + int count = 0; + foreach (Issued issued in _issued) + { + if (!issued.Retired) + { + count++; + } + } + + return count; + } + } + + internal int PeerActive + { + get + { + int count = 0; + foreach (Peer peer in _peers) + { + if (!peer.Retired && !peer.ResetOnly) + { + count++; + } + } + + return count; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal byte[]? ActivePeer() + { + Peer? chosen = null; + foreach (Peer peer in _peers) + { + if (peer.Retired || peer.ResetOnly) + { + continue; + } + + if (chosen is null || peer.Sequence >= chosen.Value.Sequence) + { + chosen = peer; + } + } + + return chosen?.Id; + } + + internal void AddIssued(ReadOnlySpan id) + { + _issued.Add(new Issued { Sequence = (ulong)_issued.Count, Id = id.ToArray() }); + } + + internal void AddPeer(ReadOnlySpan id) + { + if (id.IsEmpty || FindPeer(id) is not null) + { + return; + } + + _peers.Add(new Peer { Sequence = (ulong)_peers.Count, Id = id.ToArray() }); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Owns(ReadOnlySpan id) + { + foreach (Issued issued in _issued) + { + if (!issued.Retired && issued.Id.AsSpan().SequenceEqual(id)) + { + return true; + } + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal byte[]? LongestOwnedPrefix(ReadOnlySpan datagram) + { + byte[]? match = null; + foreach (Issued issued in _issued) + { + if (issued.Retired || datagram.Length < issued.Id.Length) + { + continue; + } + + if (!datagram[..issued.Id.Length].SequenceEqual(issued.Id)) + { + continue; + } + + if (match is null || issued.Id.Length > match.Length) + { + match = issued.Id; + } + } + + return match; + } + + internal (ulong Sequence, byte[] Id, byte[] Token) Issue() + { + byte[] id = new byte[8]; + byte[] token = new byte[16]; + RandomNumberGenerator.Fill(id); + RandomNumberGenerator.Fill(token); + ulong sequence = (ulong)_issued.Count; + _issued.Add(new Issued { Sequence = sequence, Id = id }); + return (sequence, id, token); + } + + internal bool TryRetire(ulong sequence, out ulong error) + { + error = 0; + Issued? found = null; + ulong highest = 0; + bool any = false; + foreach (Issued issued in _issued) + { + any = true; + if (issued.Sequence > highest) + { + highest = issued.Sequence; + } + + if (issued.Sequence == sequence) + { + found = issued; + } + } + + if (!any || sequence > highest || found is null) + { + error = QuicFrameReader.ProtocolViolation; + return false; + } + + if (found.Retired) + { + return true; + } + + if (IssuedActive <= 1) + { + error = QuicFrameReader.ProtocolViolation; + return false; + } + + found.Retired = true; + RetireReset(found.Id); + return true; + } + + internal bool TryAddPeer(ulong sequence, ulong retirePriorTo, ReadOnlySpan id, ReadOnlySpan token, List retire, out ulong error) + { + error = 0; + if (retirePriorTo > _retirePriorTo) + { + _retirePriorTo = retirePriorTo; + } + + for (int i = 0; i < _peers.Count; i++) + { + Peer peer = _peers[i]; + if (peer.Retired || peer.Sequence >= _retirePriorTo) + { + continue; + } + + peer.Retired = true; + _peers[i] = peer; + RetireReset(peer.Id); + retire.Add(peer.Sequence); + } + + for (int i = 0; i < _peers.Count; i++) + { + Peer peer = _peers[i]; + if (peer.Sequence != sequence) + { + continue; + } + + bool sameId = peer.Id.AsSpan().SequenceEqual(id); + if (!sameId || (peer.Token is not null && !peer.Token.AsSpan().SequenceEqual(token))) + { + error = QuicFrameReader.ProtocolViolation; + return false; + } + + if (peer.Token is null) + { + peer.Token = token.ToArray(); + _peers[i] = peer; + } + + return true; + } + + var added = new Peer + { + Sequence = sequence, + Id = id.ToArray(), + Token = token.ToArray(), + Retired = sequence < _retirePriorTo, + }; + _peers.Add(added); + if (added.Retired) + { + retire.Add(sequence); + } + + if (PeerActive > ActiveLimit) + { + _peers.RemoveAt(_peers.Count - 1); + error = ConnectionIdLimitError; + return false; + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void MarkUsed(ReadOnlySpan connectionId) + { + if (connectionId.IsEmpty || Used(connectionId)) + { + return; + } + + _used.Add(connectionId.ToArray()); + } + + internal void RememberResetToken(ReadOnlySpan connectionId, ReadOnlySpan token) + { + if (connectionId.IsEmpty || token.Length != 16) + { + return; + } + + for (int i = 0; i < _peers.Count; i++) + { + if (!_peers[i].Id.AsSpan().SequenceEqual(connectionId)) + { + continue; + } + + if (_peers[i].Token is not null) + { + return; + } + + Peer peer = _peers[i]; + peer.Token = token.ToArray(); + _peers[i] = peer; + return; + } + + // The token belongs to a connection ID this endpoint chose, not one the + // peer asked us to send to. Keep it for reset checks only. + _peers.Add(new Peer + { + Sequence = ulong.MaxValue, + Id = connectionId.ToArray(), + Token = token.ToArray(), + ResetOnly = true, + }); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool MatchesReset(ReadOnlySpan datagram) + { + if (datagram.Length < 21) + { + return false; + } + + ReadOnlySpan tail = datagram[^16..]; + bool match = false; + foreach (Peer peer in _peers) + { + if (peer.Token is null || peer.Retired || !Used(peer.Id)) + { + continue; + } + + match |= CryptographicOperations.FixedTimeEquals(peer.Token, tail); + } + + return match; + } + + private void RetireReset(byte[] id) + { + for (int i = 0; i < _peers.Count; i++) + { + if (_peers[i].Id.AsSpan().SequenceEqual(id)) + { + Peer peer = _peers[i]; + peer.Retired = true; + _peers[i] = peer; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Used(ReadOnlySpan connectionId) + { + foreach (byte[] used in _used) + { + if (used.AsSpan().SequenceEqual(connectionId)) + { + return true; + } + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private Peer? FindPeer(ReadOnlySpan id) + { + foreach (Peer peer in _peers) + { + if (peer.Id.AsSpan().SequenceEqual(id)) + { + return peer; + } + } + + return null; + } + + private sealed class Issued + { + internal ulong Sequence; + + internal byte[] Id = []; + + internal bool Retired; + } + + private struct Peer + { + internal ulong Sequence; + + internal byte[] Id; + + internal byte[]? Token; + + internal bool Retired; + + internal bool ResetOnly; + } +} diff --git a/src/Titanium.Quic/Internal/QuicLossRecovery.cs b/src/Titanium.Quic/Internal/QuicLossRecovery.cs new file mode 100644 index 000000000..cd5058a76 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicLossRecovery.cs @@ -0,0 +1,723 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +internal readonly struct QuicRetransmit +{ + internal QuicPacketKind Kind { get; init; } + + internal byte[] Payload { get; init; } +} + +/// +/// RFC 9002 loss detection on one clock. The caller supplies time and sends the payloads this class returns. +/// +internal sealed class QuicLossRecovery +{ + internal static readonly TimeSpan InitialRtt = TimeSpan.FromMilliseconds(333); + + internal static readonly TimeSpan Granularity = TimeSpan.FromMilliseconds(1); + + internal static readonly TimeSpan MaxAckDelay = TimeSpan.FromMilliseconds(25); + + private readonly ICongestionController _controller; + + private readonly QuicNumberRanges[] _sent = [new(), new(), new()]; + + private readonly List[] _flight = [[], [], []]; + + private readonly List _ackedSendTimes = []; + + private readonly DateTimeOffset?[] _lossTime = new DateTimeOffset?[3]; + + private readonly DateTimeOffset?[] _lastAckEliciting = new DateTimeOffset?[3]; + + private readonly ulong?[] _largestAcked = new ulong?[3]; + + private TimeSpan _smoothed = InitialRtt; + + private TimeSpan _rttvar = TimeSpan.FromTicks(InitialRtt.Ticks / 2); + + private TimeSpan _latest = InitialRtt; + + private TimeSpan _minRtt = InitialRtt; + + private bool _hasSample; + + private DateTimeOffset? _firstSample; + + private int _ptoCount; + + internal QuicLossRecovery(ICongestionController controller) + { + _controller = controller; + } + + internal ICongestionController Controller => _controller; + + internal bool HandshakeConfirmed { get; set; } + + internal int DeclaredLost { get; private set; } + + internal int InFlight + { + get + { + int count = 0; + for (int i = 0; i < _flight.Length; i++) + { + count += _flight[i].Count; + } + + return count; + } + } + + internal DateTimeOffset? Timeout { get; private set; } + + internal TimeSpan SmoothedRtt => _smoothed; + + internal long CongestionWindow => _controller.CongestionWindow; + + internal long BytesInFlight => _controller.BytesInFlight; + + internal TimeSpan CurrentProbeTimeout() => PtoPeriod(HandshakeConfirmed); + + internal List AckedPmtu { get; } = []; + + internal List LostPmtu { get; } = []; + + // A gap above a CRYPTO buffer's cap closes the connection, so Initial and Handshake flight stays inside that cap. + // Application data is bounded by the stream and connection windows the peer advertised, and by the cap below. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Allows(long bytes, QuicPacketKind kind = QuicPacketKind.OneRtt) + { + long window = _controller.CongestionWindow; + long cap = kind == QuicPacketKind.OneRtt ? QuicFlow.ApplicationFlightCap : QuicFlow.ReassemblyCap; + if (window > cap) + { + window = cap; + } + + return _controller.BytesInFlight + bytes <= window; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void OnPacketSent(QuicPacketKind kind, ulong number, int bytes, DateTimeOffset sent, byte[] payload, bool pmtu = false) + { + int space = Space(kind); + _sent[space].Add(number); + if (bytes == 0) + { + return; + } + + _flight[space].Add(new Flight + { + Number = number, + Sent = sent, + Bytes = bytes, + Kind = kind, + Payload = payload, + Pmtu = pmtu, + }); + if (!pmtu) + { + _lastAckEliciting[space] = sent; + _controller.OnSent(bytes); + } + + Arm(sent); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool OnAck(QuicPacketKind kind, ulong largest, TimeSpan ackDelay, ReadOnlySpan ranges, int rangeCount, DateTimeOffset now, bool grow = true) + { + int space = Space(kind); + if (rangeCount < 1 || AcksUnsent(space, largest, ranges, rangeCount)) + { + return false; + } + + if (_largestAcked[space] is null || largest > _largestAcked[space]) + { + _largestAcked[space] = largest; + } + + var newly = new List(); + RemoveAcked(space, largest, ranges, rangeCount, newly); + if (newly.Count == 0) + { + Arm(now); + return true; + } + + newly.Sort(static (left, right) => left.Number.CompareTo(right.Number)); + if (newly[^1].Number == largest) + { + _latest = now - newly[^1].Sent; + UpdateRtt(ackDelay, now); + } + + foreach (Flight packet in newly) + { + if (packet.Pmtu) + { + AckedPmtu.Add(packet.Number); + continue; + } + + _ackedSendTimes.Add(packet.Sent); + _controller.OnAcked(packet.Bytes, packet.Sent, now, grow); + } + + DeclareLost(space, now); + _ptoCount = 0; + Arm(now); + return true; + } + + internal void OnTimeout(DateTimeOffset now) + { + Pending.Clear(); + if (HandshakeConfirmed) + { + // The peer has dropped handshake keys, so another copy only fills the window. + DiscardHandshake(); + } + + if (EarliestLoss() is int space) + { + DeclareLost(space, now); + AddFinalFrame(space); + Arm(now); + return; + } + + // A lost Handshake packet must be resent even while an Initial packet is still in flight. + for (int probe = 0; probe < 3; probe++) + { + if (HandshakeConfirmed && probe == 1) + { + continue; + } + + if (Oldest(probe) is not Flight packet) + { + continue; + } + + Pending.Add(new QuicRetransmit { Kind = packet.Kind, Payload = packet.Payload }); + AddFinalFrame(probe); + _lastAckEliciting[probe] = now; + } + + _ptoCount++; + Arm(now); + } + + internal List Pending { get; } = []; + + internal void DiscardInitial() => Discard(0); + + internal void DiscardHandshake() => Discard(1); + + private void Discard(int space) + { + int bytes = 0; + foreach (Flight packet in _flight[space]) + { + bytes += packet.Bytes; + } + + _flight[space].Clear(); + _lossTime[space] = null; + _lastAckEliciting[space] = null; + if (bytes > 0) + { + _controller.OnDiscarded(bytes); + } + + if (InFlight == 0) + { + Timeout = null; + } + } + + private void DeclareLost(int space, DateTimeOffset now) + { + Pending.Clear(); + if (_largestAcked[space] is not ulong largest) + { + return; + } + + TimeSpan delay = LossDelay(); + DateTimeOffset lostBefore = now - delay; + DateTimeOffset? next = null; + var lost = new List(); + for (int i = _flight[space].Count - 1; i >= 0; i--) + { + Flight packet = _flight[space][i]; + if (packet.Number > largest) + { + continue; + } + + bool byTime = packet.Sent <= lostBefore; + bool byCount = largest >= packet.Number + 3; + if (!byTime && !byCount) + { + DateTimeOffset due = packet.Sent + delay; + if (next is null || due < next) + { + next = due; + } + + continue; + } + + lost.Add(packet); + _flight[space].RemoveAt(i); + } + + _lossTime[space] = next; + if (lost.Count == 0) + { + return; + } + + DeclaredLost += lost.Count; + var congestion = new List(); + DateTimeOffset newest = default; + int bytes = 0; + foreach (Flight packet in lost) + { + if (packet.Pmtu) + { + LostPmtu.Add(packet.Number); + continue; + } + + bytes += packet.Bytes; + if (congestion.Count == 0 || packet.Sent > newest) + { + newest = packet.Sent; + } + + congestion.Add(packet); + Pending.Add(new QuicRetransmit { Kind = packet.Kind, Payload = packet.Payload }); + } + + if (bytes > 0) + { + _controller.OnLost(bytes, newest, now, InPersistentCongestion(congestion)); + } + } + + private bool InPersistentCongestion(List lost) + { + if (_firstSample is not DateTimeOffset sample) + { + return false; + } + + DateTimeOffset? earliest = null; + DateTimeOffset? latest = null; + int count = 0; + foreach (Flight packet in lost) + { + if (packet.Sent <= sample) + { + continue; + } + + count++; + if (earliest is null || packet.Sent < earliest) + { + earliest = packet.Sent; + } + + if (latest is null || packet.Sent > latest) + { + latest = packet.Sent; + } + } + + if (count < 2 || earliest is null || latest is null || latest.Value - earliest.Value <= PersistentDuration()) + { + return false; + } + + foreach (DateTimeOffset acked in _ackedSendTimes) + { + if (acked > earliest.Value && acked < latest.Value) + { + return false; + } + } + + return true; + } + + private TimeSpan PersistentDuration() + { + long pto = _smoothed.Ticks + Math.Max(4 * _rttvar.Ticks, Granularity.Ticks) + MaxAckDelay.Ticks; + return TimeSpan.FromTicks(pto * 3); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void UpdateRtt(TimeSpan ackDelay, DateTimeOffset now) + { + if (!_hasSample) + { + _minRtt = _latest; + _smoothed = _latest; + _rttvar = TimeSpan.FromTicks(_latest.Ticks / 2); + _firstSample = now; + _hasSample = true; + return; + } + + if (_latest < _minRtt) + { + _minRtt = _latest; + } + + if (HandshakeConfirmed && ackDelay > MaxAckDelay) + { + ackDelay = MaxAckDelay; + } + else if (!HandshakeConfirmed) + { + ackDelay = TimeSpan.Zero; + } + + TimeSpan adjusted = _latest; + if (_latest >= _minRtt + ackDelay) + { + adjusted = _latest - ackDelay; + } + + long variance = _rttvar.Ticks * 3 / 4; + long delta = _smoothed.Ticks - adjusted.Ticks; + if (delta < 0) + { + delta = -delta; + } + + _rttvar = TimeSpan.FromTicks(variance + (delta / 4)); + _smoothed = TimeSpan.FromTicks((_smoothed.Ticks * 7 / 8) + (adjusted.Ticks / 8)); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Arm(DateTimeOffset now) + { + _ = now; + if (EarliestLoss() is int) + { + DateTimeOffset? soonest = null; + for (int i = 0; i < 3; i++) + { + if (_lossTime[i] is DateTimeOffset due && (soonest is null || due < soonest)) + { + soonest = due; + } + } + + Timeout = soonest; + return; + } + + DateTimeOffset? pto = null; + for (int i = 0; i < 3; i++) + { + if (_flight[i].Count == 0 || _lastAckEliciting[i] is not DateTimeOffset sent) + { + continue; + } + + bool application = i == 2 && HandshakeConfirmed; + DateTimeOffset due = sent + PtoPeriod(application); + if (pto is null || due < pto) + { + pto = due; + } + } + + Timeout = pto; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private TimeSpan PtoPeriod(bool includeAckDelay) + { + long duration = _smoothed.Ticks + Math.Max(4 * _rttvar.Ticks, Granularity.Ticks); + if (includeAckDelay) + { + duration += MaxAckDelay.Ticks; + } + + int shift = _ptoCount > 16 ? 16 : _ptoCount; + return TimeSpan.FromTicks(duration << shift); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private TimeSpan LossDelay() + { + long larger = Math.Max(_latest.Ticks, _smoothed.Ticks); + long scaled = larger * 9 / 8; + if (scaled < Granularity.Ticks) + { + scaled = Granularity.Ticks; + } + + return TimeSpan.FromTicks(scaled); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private int? EarliestLoss() + { + int? space = null; + DateTimeOffset? soonest = null; + for (int i = 0; i < 3; i++) + { + if (_lossTime[i] is DateTimeOffset due && (soonest is null || due < soonest)) + { + soonest = due; + space = i; + } + } + + return space; + } + + internal bool TryOldestPayload(int space, out QuicPacketKind kind, out byte[] payload) + { + if (Oldest(space) is not Flight packet || packet.Payload.Length == 0) + { + kind = default; + payload = []; + return false; + } + + kind = packet.Kind; + payload = packet.Payload; + return true; + } + + private void AddFinalFrame(int space) + { + // A keepalive sent after the file becomes the newest packet. The final frame sits + // in the middle of the flight and would otherwise wait there until the peer gives up. + ulong? oldest = Oldest(space)?.Number; + foreach (Flight packet in _flight[space]) + { + if (packet.Pmtu || packet.Number == oldest || !IsFinalStream(packet.Payload)) + { + continue; + } + + Pending.Add(new QuicRetransmit { Kind = packet.Kind, Payload = packet.Payload }); + return; + } + } + + private static bool IsFinalStream(byte[] payload) => + payload.Length > 0 && (payload[0] & 0xF8) == 0x08 && (payload[0] & 0x01) != 0; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private Flight? Oldest(int space) + { + Flight? oldest = null; + foreach (Flight packet in _flight[space]) + { + if (packet.Pmtu) + { + continue; + } + + if (oldest is null || packet.Number < oldest.Value.Number) + { + oldest = packet; + } + } + + return oldest; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool AcksUnsent(int space, ulong largest, ReadOnlySpan ranges, int rangeCount) + { + if (!_sent[space].ContainsAll(largest, largest)) + { + return true; + } + + ulong end = largest; + ulong start = largest - ranges[0].Length; + if (start <= end && !_sent[space].ContainsAll(start, end)) + { + return true; + } + + ulong smallest = start; + for (int i = 1; i < rangeCount; i++) + { + if (ranges[i].Gap + 2 > smallest) + { + return true; + } + + ulong rangeEnd = smallest - ranges[i].Gap - 2; + if (ranges[i].Length > rangeEnd) + { + return true; + } + + ulong rangeStart = rangeEnd - ranges[i].Length; + if (!_sent[space].ContainsAll(rangeStart, rangeEnd)) + { + return true; + } + + smallest = rangeStart; + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void RemoveAcked(int space, ulong largest, ReadOnlySpan ranges, int rangeCount, List newly) + { + Span wanted = stackalloc ulong[64]; + int count = 0; + if (!Remember(largest, ranges, rangeCount, wanted, ref count)) + { + CollectAcked(space, largest, ranges, rangeCount, newly); + return; + } + + for (int i = _flight[space].Count - 1; i >= 0; i--) + { + ulong number = _flight[space][i].Number; + for (int n = 0; n < count; n++) + { + if (wanted[n] != number) + { + continue; + } + + newly.Add(_flight[space][i]); + _flight[space].RemoveAt(i); + break; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void CollectAcked(int space, ulong largest, ReadOnlySpan ranges, int rangeCount, List newly) + { + for (int i = _flight[space].Count - 1; i >= 0; i--) + { + if (Covers(largest, ranges, rangeCount, _flight[space][i].Number)) + { + newly.Add(_flight[space][i]); + _flight[space].RemoveAt(i); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool Remember(ulong largest, ReadOnlySpan ranges, int rangeCount, Span wanted, ref int count) + { + ulong end = largest; + ulong start = largest - ranges[0].Length; + for (ulong number = start; number <= end; number++) + { + if (count == wanted.Length) + { + return false; + } + + wanted[count++] = number; + } + + ulong smallest = start; + for (int i = 1; i < rangeCount; i++) + { + ulong rangeEnd = smallest - ranges[i].Gap - 2; + ulong rangeStart = rangeEnd - ranges[i].Length; + for (ulong number = rangeStart; number <= rangeEnd; number++) + { + if (count == wanted.Length) + { + return false; + } + + wanted[count++] = number; + } + + smallest = rangeStart; + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool Covers(ulong largest, ReadOnlySpan ranges, int rangeCount, ulong number) + { + ulong end = largest; + ulong start = largest - ranges[0].Length; + if (number >= start && number <= end) + { + return true; + } + + ulong smallest = start; + for (int i = 1; i < rangeCount; i++) + { + ulong rangeEnd = smallest - ranges[i].Gap - 2; + ulong rangeStart = rangeEnd - ranges[i].Length; + if (number >= rangeStart && number <= rangeEnd) + { + return true; + } + + smallest = rangeStart; + } + + return false; + } + + private static int Space(QuicPacketKind kind) + { + if (kind == QuicPacketKind.Handshake) + { + return 1; + } + + if (kind == QuicPacketKind.OneRtt) + { + return 2; + } + + return 0; + } + + private struct Flight + { + internal ulong Number; + + internal DateTimeOffset Sent; + + internal int Bytes; + + internal QuicPacketKind Kind; + + internal byte[] Payload; + + internal bool Pmtu; + } +} diff --git a/src/Titanium.Quic/Internal/QuicNumberRanges.cs b/src/Titanium.Quic/Internal/QuicNumberRanges.cs new file mode 100644 index 000000000..0360d0eff --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicNumberRanges.cs @@ -0,0 +1,105 @@ +using System.Collections.Generic; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// +/// The packet numbers one side has sent in one packet number space, kept as descending ranges of +/// consecutive numbers. Numbers are issued in order and nearly always sent in order, so the list stays +/// at one or a few entries however many packets a connection sends, and a membership check costs +/// the number of ranges rather than the number of packets. +/// +internal sealed class QuicNumberRanges +{ + private readonly List _ranges = []; + + internal int RangeCount => _ranges.Count; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Add(ulong number) + { + for (int i = 0; i < _ranges.Count; i++) + { + Range range = _ranges[i]; + if (number > range.Largest) + { + if (number - range.Largest == 1) + { + _ranges[i] = new Range(range.Smallest, number); + Join(i); + return; + } + + _ranges.Insert(i, new Range(number, number)); + return; + } + + if (number >= range.Smallest) + { + return; + } + + if (range.Smallest - number == 1) + { + _ranges[i] = new Range(number, range.Largest); + Join(i); + return; + } + } + + _ranges.Add(new Range(number, number)); + } + + /// True when every number from through was added. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool ContainsAll(ulong smallest, ulong largest) + { + for (int i = 0; i < _ranges.Count; i++) + { + Range range = _ranges[i]; + if (range.Largest < largest) + { + return false; + } + + if (range.Smallest <= largest) + { + return range.Smallest <= smallest; + } + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Join(int index) + { + if (index + 1 >= _ranges.Count) + { + return; + } + + Range upper = _ranges[index]; + Range lower = _ranges[index + 1]; + if (upper.Smallest - lower.Largest > 1) + { + return; + } + + _ranges[index] = new Range(lower.Smallest, upper.Largest); + _ranges.RemoveAt(index + 1); + } + + private readonly struct Range + { + internal Range(ulong smallest, ulong largest) + { + Smallest = smallest; + Largest = largest; + } + + internal ulong Smallest { get; } + + internal ulong Largest { get; } + } +} diff --git a/src/Titanium.Quic/Internal/QuicPacket.cs b/src/Titanium.Quic/Internal/QuicPacket.cs new file mode 100644 index 000000000..2dd5d8060 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPacket.cs @@ -0,0 +1,305 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +internal enum QuicPacketKind : byte +{ + Initial = 0, + ZeroRtt = 1, + Handshake = 2, + Retry = 3, + VersionNegotiation = 4, + OneRtt = 5, +} + +/// One QUIC packet sliced out of a datagram. Spans point at the datagram. +internal ref struct QuicPacket +{ + internal QuicPacketKind Kind; + + internal byte FirstByte; + + internal uint Version; + + internal ReadOnlySpan DestinationConnectionId; + + internal ReadOnlySpan SourceConnectionId; + + internal ReadOnlySpan Token; + + internal ReadOnlySpan PacketNumber; + + internal ReadOnlySpan Payload; + + internal ReadOnlySpan IntegrityTag; + + internal ReadOnlySpan SupportedVersions; + + internal int TotalLength; + + internal bool Spin; + + internal bool KeyPhase; + + internal bool FixedBit => (FirstByte & 0x40) != 0; + + internal static bool ReservedBitsSet(byte first) => (first & 0x80) != 0 ? (first & 0x0c) != 0 : (first & 0x18) != 0; + + internal int PacketNumberLength => PacketNumber.Length; +} + +/// Reads coalesced packets. A short header, a Retry, or a Version Negotiation packet ends the datagram. +internal ref struct QuicDatagramReader +{ + internal const int MaxConnectionIdLength = 20; + + internal const uint Version1 = 0x0000_0001; + + internal static bool TryVersionNegotiation(ReadOnlySpan datagram, Span destination, out int written) + { + written = 0; + if (datagram.Length < 1200 || (datagram[0] & 0x80) == 0 || destination.Length < 11) + { + return false; + } + + uint version = ((uint)datagram[1] << 24) | ((uint)datagram[2] << 16) | ((uint)datagram[3] << 8) | datagram[4]; + if (version is 0 or Version1 || datagram.Length < 7) + { + return false; + } + + int offset = 5; + int destinationLength = datagram[offset++]; + if (destinationLength > MaxConnectionIdLength || datagram.Length < offset + destinationLength + 1) + { + return false; + } + + ReadOnlySpan destinationId = datagram.Slice(offset, destinationLength); + offset += destinationLength; + int sourceLength = datagram[offset++]; + if (sourceLength > MaxConnectionIdLength || datagram.Length < offset + sourceLength) + { + return false; + } + + ReadOnlySpan sourceId = datagram.Slice(offset, sourceLength); + int needed = 7 + sourceId.Length + destinationId.Length + 4; + if (destination.Length < needed) + { + return false; + } + + destination[0] = 0x80; + destination[1] = 0; + destination[2] = 0; + destination[3] = 0; + destination[4] = 0; + destination[5] = (byte)sourceId.Length; + sourceId.CopyTo(destination[6..]); + int at = 6 + sourceId.Length; + destination[at++] = (byte)destinationId.Length; + destinationId.CopyTo(destination[at..]); + at += destinationId.Length; + destination[at++] = 0; + destination[at++] = 0; + destination[at++] = 0; + destination[at++] = 1; + written = at; + return true; + } + + private ReadOnlySpan _remaining; + + private readonly int _shortDestinationIdLength; + + private bool _finished; + + internal QuicDatagramReader(ReadOnlySpan datagram, int shortDestinationIdLength) + { + ArgumentOutOfRangeException.ThrowIfNegative(shortDestinationIdLength); + ArgumentOutOfRangeException.ThrowIfGreaterThan(shortDestinationIdLength, MaxConnectionIdLength); + _remaining = datagram; + _shortDestinationIdLength = shortDestinationIdLength; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool TryRead(out QuicPacket packet) + { + packet = default; + if (_finished || _remaining.IsEmpty) + { + return false; + } + + if (!TryParse(_remaining, _shortDestinationIdLength, out packet) || packet.TotalLength <= 0 || packet.TotalLength > _remaining.Length) + { + return false; + } + + _remaining = _remaining[packet.TotalLength..]; + if (packet.Kind is QuicPacketKind.OneRtt or QuicPacketKind.Retry or QuicPacketKind.VersionNegotiation) + { + _finished = true; + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static bool TryParse(ReadOnlySpan source, int shortDestinationIdLength, out QuicPacket packet) + { + packet = default; + if (source.IsEmpty) + { + return false; + } + + if ((source[0] & 0x80) == 0) + { + return TryParseShort(source, shortDestinationIdLength, out packet); + } + + return TryParseLong(source, out packet); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool TryParseShort(ReadOnlySpan source, int shortDestinationIdLength, out QuicPacket packet) + { + packet = default; + if (shortDestinationIdLength is < 0 or > MaxConnectionIdLength) + { + return false; + } + + int packetNumberLength = (source[0] & 0x03) + 1; + int header = 1 + shortDestinationIdLength + packetNumberLength; + if (source.Length < header) + { + return false; + } + + packet.Kind = QuicPacketKind.OneRtt; + packet.FirstByte = source[0]; + packet.DestinationConnectionId = source.Slice(1, shortDestinationIdLength); + packet.PacketNumber = source.Slice(1 + shortDestinationIdLength, packetNumberLength); + packet.Payload = source[header..]; + packet.Spin = (source[0] & 0x20) != 0; + packet.KeyPhase = (source[0] & 0x04) != 0; + packet.TotalLength = source.Length; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static bool TryParseLong(ReadOnlySpan source, out QuicPacket packet) + { + packet = default; + if (source.Length < 7) + { + return false; + } + + uint version = ((uint)source[1] << 24) | ((uint)source[2] << 16) | ((uint)source[3] << 8) | source[4]; + int offset = 5; + int destinationLength = source[offset++]; + if (version != 0 && destinationLength > MaxConnectionIdLength) + { + return false; + } + + if (source.Length < offset + destinationLength + 1) + { + return false; + } + + ReadOnlySpan destination = source.Slice(offset, destinationLength); + offset += destinationLength; + int sourceLength = source[offset++]; + if (version != 0 && sourceLength > MaxConnectionIdLength) + { + return false; + } + + if (source.Length < offset + sourceLength) + { + return false; + } + + ReadOnlySpan sourceId = source.Slice(offset, sourceLength); + offset += sourceLength; + packet.FirstByte = source[0]; + packet.Version = version; + packet.DestinationConnectionId = destination; + packet.SourceConnectionId = sourceId; + if (version == 0) + { + int versionsBytes = source.Length - offset; + if (versionsBytes < 4 || (versionsBytes & 3) != 0) + { + return false; + } + + packet.Kind = QuicPacketKind.VersionNegotiation; + packet.SupportedVersions = source[offset..]; + packet.TotalLength = source.Length; + return true; + } + + if (version != Version1) + { + return false; + } + + int type = (source[0] >> 4) & 0x03; + if (type == 3) + { + if (source.Length - offset < 16) + { + return false; + } + + packet.Kind = QuicPacketKind.Retry; + packet.Token = source.Slice(offset, source.Length - offset - 16); + packet.IntegrityTag = source[^16..]; + packet.TotalLength = source.Length; + return true; + } + + if (type == 0) + { + if (!QuicVarInt.TryDecode(source[offset..], out ulong tokenLength, out int tokenLengthBytes) || tokenLength > int.MaxValue) + { + return false; + } + + offset += tokenLengthBytes; + if (source.Length < offset + (int)tokenLength) + { + return false; + } + + packet.Token = source.Slice(offset, (int)tokenLength); + offset += (int)tokenLength; + } + + if (!QuicVarInt.TryDecode(source[offset..], out ulong length, out int lengthBytes) || length > int.MaxValue) + { + return false; + } + + offset += lengthBytes; + int packetNumberLength = (source[0] & 0x03) + 1; + if (length < (ulong)packetNumberLength || source.Length < offset + (int)length) + { + return false; + } + + packet.Kind = (QuicPacketKind)type; + packet.PacketNumber = source.Slice(offset, packetNumberLength); + packet.Payload = source.Slice(offset + packetNumberLength, (int)length - packetNumberLength); + packet.TotalLength = offset + (int)length; + return true; + } +} diff --git a/src/Titanium.Quic/Internal/QuicPacketNumber.cs b/src/Titanium.Quic/Internal/QuicPacketNumber.cs new file mode 100644 index 000000000..4f04571e2 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPacketNumber.cs @@ -0,0 +1,105 @@ +using System; +using System.Numerics; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// +/// Packet number truncation from RFC 9000 Appendix A. A value outside the recovery window is rejected. +/// +internal static class QuicPacketNumber +{ + internal const ulong MaxValue = (1UL << 62) - 1; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static bool TryEncode(ulong full, ulong? largestAcked, Span destination, out int written) + { + written = 0; + if (full > MaxValue) + { + return false; + } + + ulong unacked; + if (largestAcked is null) + { + unacked = full + 1; + } + else if (largestAcked.Value > MaxValue || full <= largestAcked.Value) + { + return false; + } + else + { + unacked = full - largestAcked.Value; + } + + int bits = BitOperations.Log2(unacked) + 1; + int bytes = (bits + 7) >> 3; + if (bytes > 4 || destination.Length < bytes) + { + return false; + } + + for (int i = bytes - 1; i >= 0; i--) + { + destination[i] = (byte)full; + full >>= 8; + } + + written = bytes; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static bool TryDecode(ulong? largest, ReadOnlySpan truncated, out ulong full) + { + full = 0; + if (truncated.Length is < 1 or > 4) + { + return false; + } + + if (largest is ulong seen && seen >= MaxValue) + { + return false; + } + + ulong expected = largest is null ? 0 : largest.Value + 1; + int bits = truncated.Length * 8; + ulong window = 1UL << bits; + ulong half = window >> 1; + ulong mask = window - 1; + ulong candidate = (expected & ~mask) | Read(truncated); + if (expected >= half && candidate <= expected - half && candidate < (1UL << 62) - window) + { + candidate += window; + } + else if (candidate > expected + half && candidate >= window) + { + candidate -= window; + } + + bool aboveFloor = expected < half || candidate > expected - half; + bool belowCeil = candidate <= expected + half; + if (!aboveFloor || !belowCeil || candidate > MaxValue) + { + return false; + } + + full = candidate; + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static ulong Read(ReadOnlySpan truncated) + { + ulong value = 0; + for (int i = 0; i < truncated.Length; i++) + { + value = (value << 8) | truncated[i]; + } + + return value; + } +} diff --git a/src/Titanium.Quic/Internal/QuicPacketProtection.cs b/src/Titanium.Quic/Internal/QuicPacketProtection.cs new file mode 100644 index 000000000..482017fe5 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPacketProtection.cs @@ -0,0 +1,202 @@ +using System; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; +using Titanium.Tls; + +namespace Titanium.Quic; + +internal enum QuicHeaderCipher +{ + Aes128 = 0, + Aes256 = 1, + ChaCha20 = 2, +} + +/// QUIC v1 Initial secrets and header protection (RFC 9001 sections 5.2 and 5.4). +internal static class QuicInitial +{ + internal static ReadOnlySpan Salt => + [ + 0x38, 0x76, 0x2c, 0xf7, 0xf5, 0x59, 0x34, 0xb3, 0x4d, 0x17, + 0x9a, 0xe6, 0xa4, 0xc8, 0x0c, 0xad, 0xcc, 0xbb, 0x7f, 0x0a, + ]; + + internal static void Derive(ReadOnlySpan destinationConnectionId, bool client, Span secret, Span key, Span iv, Span headerProtection) + { + Span initial = stackalloc byte[32]; + TlsHkdf.Extract(HashAlgorithmName.SHA256, destinationConnectionId, Salt, initial); + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, initial, client ? "client in"u8 : "server in"u8, ReadOnlySpan.Empty, secret); + CryptographicOperations.ZeroMemory(initial); + DeriveTraffic(HashAlgorithmName.SHA256, secret, key, iv, headerProtection); + } + + internal static void DeriveTraffic(HashAlgorithmName hash, ReadOnlySpan secret, Span key, Span iv, Span headerProtection) + { + TlsHkdf.ExpandLabel(hash, secret, "quic key"u8, ReadOnlySpan.Empty, key); + TlsHkdf.ExpandLabel(hash, secret, "quic iv"u8, ReadOnlySpan.Empty, iv); + TlsHkdf.ExpandLabel(hash, secret, "quic hp"u8, ReadOnlySpan.Empty, headerProtection); + } + + internal static void DeriveUpdate(HashAlgorithmName hash, ReadOnlySpan secret, Span next) + { + TlsHkdf.ExpandLabel(hash, secret, "quic ku"u8, ReadOnlySpan.Empty, next); + } +} + +/// Header protection for one key. AES uses one cached cipher. The mask is XOR, so protect and remove share it. +internal sealed class QuicHeaderProtection : IDisposable +{ + private readonly QuicHeaderCipher _cipher; + private readonly Aes? _aes; + private readonly QuicAesBlock? _block; + private byte[]? _chachaKey; + private bool _disposed; + + internal QuicHeaderProtection(QuicHeaderCipher cipher, ReadOnlySpan headerProtectionKey) + { + _cipher = cipher; + if (cipher == QuicHeaderCipher.ChaCha20) + { + if (headerProtectionKey.Length != 32) + { + throw new ArgumentException("ChaCha20 header protection uses a 32-byte key.", nameof(headerProtectionKey)); + } + + _chachaKey = headerProtectionKey.ToArray(); + return; + } + + int expected = cipher == QuicHeaderCipher.Aes256 ? 32 : 16; + if (headerProtectionKey.Length != expected) + { + throw new ArgumentException("The AES header-protection key length does not match the cipher.", nameof(headerProtectionKey)); + } + + if (cipher == QuicHeaderCipher.Aes128) + { + _block = QuicAesBlock.TryCreate(headerProtectionKey); + if (_block is not null) + { + return; + } + } + + _aes = Aes.Create(); + _aes.Key = headerProtectionKey.ToArray(); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Protect(Span packet, int packetNumberOffset, ReadOnlySpan sample) + { + return Apply(packet, packetNumberOffset, sample, remove: false); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Remove(Span packet, int packetNumberOffset, ReadOnlySpan sample) + { + return Apply(packet, packetNumberOffset, sample, remove: true); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _aes?.Dispose(); + _block?.Clear(); + if (_chachaKey is not null) + { + CryptographicOperations.ZeroMemory(_chachaKey); + _chachaKey = null; + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Apply(Span packet, int packetNumberOffset, ReadOnlySpan sample, bool remove) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (sample.Length != 16 || packet.IsEmpty || packetNumberOffset < 1 || packetNumberOffset >= packet.Length) + { + return false; + } + + Span mask = stackalloc byte[5]; + if (!Mask(sample, mask)) + { + return false; + } + + bool longHeader = (packet[0] & 0x80) != 0; + byte first = (byte)(mask[0] & (longHeader ? 0x0f : 0x1f)); + if (!remove) + { + int length = (packet[0] & 0x03) + 1; + if (packet.Length < packetNumberOffset + length) + { + return false; + } + + packet[0] ^= first; + XorPacketNumber(packet, packetNumberOffset, mask, length); + return true; + } + + packet[0] ^= first; + int revealed = (packet[0] & 0x03) + 1; + if (packet.Length < packetNumberOffset + revealed) + { + packet[0] ^= first; + return false; + } + + XorPacketNumber(packet, packetNumberOffset, mask, revealed); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Mask(ReadOnlySpan sample, Span mask) + { + if (_cipher == QuicHeaderCipher.ChaCha20) + { + Span block = stackalloc byte[64]; + uint counter = (uint)(sample[0] | (sample[1] << 8) | (sample[2] << 16) | (sample[3] << 24)); + ChaCha20Block.Write(_chachaKey, counter, sample[4..], block); + block[..5].CopyTo(mask); + block.Clear(); + return true; + } + + Span encrypted = stackalloc byte[16]; + int written; + if (_block is not null) + { + _block.Encrypt(sample, encrypted); + written = 16; + } + else + { + written = _aes!.EncryptEcb(sample, encrypted, PaddingMode.None); + } + + if (written < 5) + { + return false; + } + + encrypted[..5].CopyTo(mask); + encrypted.Clear(); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void XorPacketNumber(Span packet, int packetNumberOffset, ReadOnlySpan mask, int length) + { + for (int i = 0; i < length; i++) + { + packet[packetNumberOffset + i] ^= mask[1 + i]; + } + } +} diff --git a/src/Titanium.Quic/Internal/QuicPacketProtector.cs b/src/Titanium.Quic/Internal/QuicPacketProtector.cs new file mode 100644 index 000000000..62bbbfb0c --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPacketProtector.cs @@ -0,0 +1,274 @@ +using System; +using System.Buffers; +using System.Buffers.Binary; +using System.Runtime.CompilerServices; +using System.Security.Cryptography; + +namespace Titanium.Quic; + +/// AES-128-GCM packet protection for one direction. The nonce is the IV exclusive-or the packet number. +internal sealed class QuicPacketProtector : IDisposable +{ + private readonly AesGcm _aead; + private readonly QuicHeaderProtection _header; + private readonly byte[] _iv = new byte[12]; + private bool _disposed; + + private QuicPacketProtector(ReadOnlySpan key, ReadOnlySpan iv, ReadOnlySpan headerProtection) + { + _aead = new AesGcm(key, 16); + iv.CopyTo(_iv); + _header = new QuicHeaderProtection(QuicHeaderCipher.Aes128, headerProtection); + } + + internal static QuicPacketProtector FromInitial(ReadOnlySpan destinationConnectionId, bool client) + { + Span secret = stackalloc byte[32]; + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + Span header = stackalloc byte[16]; + QuicInitial.Derive(destinationConnectionId, client, secret, key, iv, header); + var protector = new QuicPacketProtector(key, iv, header); + CryptographicOperations.ZeroMemory(secret); + CryptographicOperations.ZeroMemory(key); + CryptographicOperations.ZeroMemory(header); + return protector; + } + + internal static QuicPacketProtector FromSecret(ReadOnlySpan trafficSecret) + { + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + Span header = stackalloc byte[16]; + QuicInitial.DeriveTraffic(HashAlgorithmName.SHA256, trafficSecret, key, iv, header); + var protector = new QuicPacketProtector(key, iv, header); + CryptographicOperations.ZeroMemory(key); + CryptographicOperations.ZeroMemory(header); + return protector; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal int Seal(Span destination, int headerLength, ulong packetNumber, ReadOnlySpan plaintext) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (headerLength < 1 || destination.Length < headerLength + plaintext.Length + 16) + { + return 0; + } + + int packetNumberLength = (destination[0] & 0x03) + 1; + int packetNumberOffset = headerLength - packetNumberLength; + if (packetNumberOffset < 1 || packetNumberOffset + 4 + 16 > headerLength + plaintext.Length + 16) + { + return 0; + } + + Span nonce = stackalloc byte[12]; + Nonce(packetNumber, nonce); + Span tag = destination.Slice(headerLength + plaintext.Length, 16); + _aead.Encrypt(nonce, plaintext, destination.Slice(headerLength, plaintext.Length), tag, destination[..headerLength]); + int total = headerLength + plaintext.Length + 16; + if (!_header.Protect(destination[..total], packetNumberOffset, destination.Slice(packetNumberOffset + 4, 16))) + { + return 0; + } + + return total; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool Open(Span packet, int packetNumberOffset, ulong? largest, out ulong packetNumber, Span plaintext, out int plaintextLength) + { + ObjectDisposedException.ThrowIf(_disposed, this); + packetNumber = 0; + plaintextLength = 0; + if (packetNumberOffset < 1 || packet.Length < packetNumberOffset + 4 + 16) + { + return false; + } + + Span sample = stackalloc byte[16]; + packet.Slice(packetNumberOffset + 4, 16).CopyTo(sample); + if (!_header.Remove(packet, packetNumberOffset, sample)) + { + return false; + } + + int packetNumberLength = (packet[0] & 0x03) + 1; + if (packet.Length < packetNumberOffset + packetNumberLength + 16) + { + return false; + } + + if (!QuicPacketNumber.TryDecode(largest, packet.Slice(packetNumberOffset, packetNumberLength), out packetNumber)) + { + return false; + } + + int headerLength = packetNumberOffset + packetNumberLength; + int cipherLength = packet.Length - headerLength - 16; + if (cipherLength < 0 || plaintext.Length < cipherLength) + { + return false; + } + + Span nonce = stackalloc byte[12]; + Nonce(packetNumber, nonce); + try + { + _aead.Decrypt( + nonce, + packet.Slice(headerLength, cipherLength), + packet[^16..], + plaintext[..cipherLength], + packet[..headerLength]); + } + catch (AuthenticationTagMismatchException) + { + return false; + } + + plaintextLength = cipherLength; + return true; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _aead.Dispose(); + _header.Dispose(); + CryptographicOperations.ZeroMemory(_iv); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Nonce(ulong packetNumber, Span nonce) + { + _iv.AsSpan().CopyTo(nonce); + for (int i = 0; i < 8; i++) + { + nonce[11 - i] ^= (byte)(packetNumber >> (8 * i)); + } + } +} + +internal static class QuicPackets +{ + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static int SealLong( + Span destination, + QuicPacketKind kind, + ReadOnlySpan destinationId, + ReadOnlySpan sourceId, + ulong packetNumber, + ReadOnlySpan payload, + QuicPacketProtector protector, + int minimumDatagram, + ReadOnlySpan token = default) + { + const int packetNumberLength = 2; + bool initial = kind == QuicPacketKind.Initial; + Span tokenScratch = stackalloc byte[8]; + int tokenField = 0; + if (initial) + { + tokenField = QuicVarInt.Encode((ulong)token.Length, tokenScratch) + token.Length; + } + int lengthField = 1; + int plainLength = payload.Length; + Span lengthScratch = stackalloc byte[8]; + for (int pass = 0; pass < 4; pass++) + { + int header = 7 + destinationId.Length + sourceId.Length + tokenField + lengthField + packetNumberLength; + if (minimumDatagram > header + plainLength + 16) + { + plainLength = minimumDatagram - header - 16; + } + + int needed = QuicVarInt.Encode((ulong)(packetNumberLength + plainLength + 16), lengthScratch); + if (needed == lengthField) + { + break; + } + + lengthField = needed; + plainLength = payload.Length; + } + + int headerLength = 7 + destinationId.Length + sourceId.Length + tokenField + lengthField + packetNumberLength; + if (destination.Length < headerLength + plainLength + 16 || plainLength < payload.Length) + { + return 0; + } + + byte type = kind == QuicPacketKind.Handshake ? (byte)0xE0 : (byte)0xC0; + int at = 0; + destination[at++] = (byte)(type | (packetNumberLength - 1)); + BinaryPrimitives.WriteUInt32BigEndian(destination[at..], 1); + at += 4; + destination[at++] = (byte)destinationId.Length; + destinationId.CopyTo(destination[at..]); + at += destinationId.Length; + destination[at++] = (byte)sourceId.Length; + sourceId.CopyTo(destination[at..]); + at += sourceId.Length; + if (initial) + { + at += QuicVarInt.Encode((ulong)token.Length, destination[at..]); + token.CopyTo(destination[at..]); + at += token.Length; + } + + at += QuicVarInt.Encode((ulong)(packetNumberLength + plainLength + 16), destination[at..]); + for (int i = 0; i < packetNumberLength; i++) + { + destination[at + packetNumberLength - 1 - i] = (byte)(packetNumber >> (8 * i)); + } + + at += packetNumberLength; + // A rented array is dirty. The PADDING frames that fill the tail must be 0x00. + byte[]? rented = plainLength <= 1500 ? null : ArrayPool.Shared.Rent(plainLength); + Span padded = rented is null ? stackalloc byte[1500] : rented; + padded = padded[..plainLength]; + payload.CopyTo(padded); + padded[payload.Length..].Clear(); + int written = protector.Seal(destination, at, packetNumber, padded); + CryptographicOperations.ZeroMemory(padded); + if (rented is not null) + { + ArrayPool.Shared.Return(rented); + } + + return written; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static int SealShort( + Span destination, + ReadOnlySpan destinationId, + ulong packetNumber, + ReadOnlySpan payload, + QuicPacketProtector protector) + { + const int packetNumberLength = 2; + int headerLength = 1 + destinationId.Length + packetNumberLength; + if (destination.Length < headerLength + payload.Length + 16) + { + return 0; + } + + destination[0] = (byte)(0x40 | (packetNumberLength - 1)); + destinationId.CopyTo(destination[1..]); + int at = 1 + destinationId.Length; + for (int i = 0; i < packetNumberLength; i++) + { + destination[at + packetNumberLength - 1 - i] = (byte)(packetNumber >> (8 * i)); + } + + return protector.Seal(destination, headerLength, packetNumber, payload); + } +} diff --git a/src/Titanium.Quic/Internal/QuicPacketReplayWindow.cs b/src/Titanium.Quic/Internal/QuicPacketReplayWindow.cs new file mode 100644 index 000000000..3be244abb --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPacketReplayWindow.cs @@ -0,0 +1,81 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// +/// Received packet numbers for one packet number space. RFC 9000 section 12.3 requires a +/// duplicate check, and a receiver must still accept a packet that the network reordered. +/// The largest number keeps a 64-wide bit mask of the numbers below it: a repeated number +/// is a replay, a number inside the mask is out of order, and a number below the mask is +/// older than any reordering this connection tolerates. +/// +internal struct QuicPacketReplayWindow +{ + internal const int Span = 64; + + private ulong? _largest; + + private ulong _received; + + internal ulong? Largest => _largest; + + /// True when this number already arrived, or is older than the window keeps. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool IsDuplicate(ulong number) + { + if (_largest is not ulong largest) + { + return false; + } + + if (number > largest) + { + return false; + } + + ulong behind = largest - number; + return behind >= Span || (_received & (1UL << (int)behind)) != 0; + } + + /// True when this number is new. A replay returns false and leaves the window unchanged. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal bool TryAccept(ulong number) + { + if (_largest is not ulong largest) + { + _largest = number; + _received = 1; + return true; + } + + if (number > largest) + { + ulong advance = number - largest; + _received = advance >= Span ? 1UL : (_received << (int)advance) | 1UL; + _largest = number; + return true; + } + + ulong behind = largest - number; + if (behind >= Span) + { + return false; + } + + ulong bit = 1UL << (int)behind; + if ((_received & bit) != 0) + { + return false; + } + + _received |= bit; + return true; + } + + internal void Reset() + { + _largest = null; + _received = 0; + } +} diff --git a/src/Titanium.Quic/Internal/QuicPathCounters.cs b/src/Titanium.Quic/Internal/QuicPathCounters.cs new file mode 100644 index 000000000..1b4ec55b1 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPathCounters.cs @@ -0,0 +1,94 @@ +using System.Threading; + +namespace Titanium.Quic; + +/// +/// Counters for the datagram path, read by the benchmark probe. They are off unless a probe turns them on, so the +/// data path pays one load and one branch for each site and nothing else. +/// +internal static class QuicPathCounters +{ + private static long _listenerDatagrams; + + private static long _listenerWakes; + + private static long _clientDatagrams; + + private static long _clientWakes; + + private static long _ackOnlyDatagrams; + + private static long _readerNotifies; + + private static long _readerResumes; + + private static long _sendCalls; + + private static long _sentDatagrams; + + /// Gets or sets whether the counters count. A probe sets this before it opens a connection. + internal static bool Enabled { get; set; } + + /// Counts datagrams the listener handled in one pass of its receive loop. + internal static void ListenerPass(int datagrams) + { + Interlocked.Increment(ref _listenerWakes); + Interlocked.Add(ref _listenerDatagrams, datagrams); + } + + /// Counts datagrams the listener took in the same pass without waiting again. + internal static void ListenerDrained(int datagrams) => Interlocked.Add(ref _listenerDatagrams, datagrams); + + /// Counts datagrams a client connection handled in one pass of its receive loop. + internal static void ClientPass(int datagrams) + { + Interlocked.Increment(ref _clientWakes); + Interlocked.Add(ref _clientDatagrams, datagrams); + } + + internal static void AckOnly() => Interlocked.Increment(ref _ackOnlyDatagrams); + + internal static void ReaderNotify() => Interlocked.Increment(ref _readerNotifies); + + internal static void ReaderResume() => Interlocked.Increment(ref _readerResumes); + + internal static void Send(int datagrams) + { + Interlocked.Increment(ref _sendCalls); + Interlocked.Add(ref _sentDatagrams, datagrams); + } + + internal static Snapshot Read() => new( + Interlocked.Read(ref _listenerDatagrams), + Interlocked.Read(ref _listenerWakes), + Interlocked.Read(ref _clientDatagrams), + Interlocked.Read(ref _clientWakes), + Interlocked.Read(ref _ackOnlyDatagrams), + Interlocked.Read(ref _readerNotifies), + Interlocked.Read(ref _readerResumes), + Interlocked.Read(ref _sendCalls), + Interlocked.Read(ref _sentDatagrams)); + + internal readonly record struct Snapshot( + long ListenerDatagrams, + long ListenerWakes, + long ClientDatagrams, + long ClientWakes, + long AckOnlyDatagrams, + long ReaderNotifies, + long ReaderResumes, + long SendCalls, + long SentDatagrams) + { + internal Snapshot Since(Snapshot earlier) => new( + ListenerDatagrams - earlier.ListenerDatagrams, + ListenerWakes - earlier.ListenerWakes, + ClientDatagrams - earlier.ClientDatagrams, + ClientWakes - earlier.ClientWakes, + AckOnlyDatagrams - earlier.AckOnlyDatagrams, + ReaderNotifies - earlier.ReaderNotifies, + ReaderResumes - earlier.ReaderResumes, + SendCalls - earlier.SendCalls, + SentDatagrams - earlier.SentDatagrams); + } +} diff --git a/src/Titanium.Quic/Internal/QuicPathMtu.cs b/src/Titanium.Quic/Internal/QuicPathMtu.cs new file mode 100644 index 000000000..a76af3130 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicPathMtu.cs @@ -0,0 +1,158 @@ +using System; +using System.Net.Sockets; + +namespace Titanium.Quic; + +/// +/// Datagram packetization-layer path MTU search. The confirmed size starts at 1200 and never drops below that except by returning to it. +/// +internal sealed class QuicPathMtu +{ + internal const int Base = 1200; + + private int _confirmed = Base; + + private int _limit = 65527; + + private int? _probe; + + private bool _confirming; + + internal int Ceiling { get; private set; } = Base; + + internal void SetMaximum(int bytes) + { + if (bytes < Base) + { + bytes = Base; + } + + if (bytes < _limit) + { + _limit = bytes; + } + + if (Ceiling > bytes) + { + Ceiling = bytes; + } + + if (_confirmed > bytes) + { + _confirmed = bytes; + } + } + + internal int BeginProbe(bool confirm) + { + if (_probe is not null) + { + return 0; + } + + int size; + if (confirm) + { + size = Ceiling; + _confirming = true; + } + else + { + int span = _limit - _confirmed; + size = _confirmed + (span / 2); + if (size <= _confirmed || size > _limit) + { + return 0; + } + + _confirming = false; + } + + _probe = size; + return size; + } + + internal void Acknowledge() + { + if (_probe is not int size) + { + return; + } + + _probe = null; + _confirming = false; + if (size > _confirmed) + { + _confirmed = size; + } + + if (_confirmed > Ceiling) + { + Ceiling = _confirmed; + } + + if (Ceiling > _limit) + { + Ceiling = _limit; + } + } + + internal void Lose() + { + if (_probe is not int size) + { + return; + } + + _probe = null; + if (_confirming || size <= Ceiling) + { + _confirmed = Base; + Ceiling = Base; + _confirming = false; + return; + } + + if (size - 1 < _limit) + { + _limit = size - 1; + } + + if (_limit < _confirmed) + { + _limit = _confirmed; + } + + if (Ceiling > _limit) + { + Ceiling = _limit; + } + } + + internal void Cancel() + { + _probe = null; + _confirming = false; + } +} + +/// Sets the socket flag used by path MTU probes, where the platform allows it. +internal static class QuicDatagramSocket +{ + internal static bool TryEnableDontFragment(Socket socket) + { + try + { + socket.DontFragment = true; + return socket.DontFragment; + } + catch (SocketException) + { + return false; + } + catch (NotSupportedException) + { + return false; + } + } +} diff --git a/src/Titanium.Quic/Internal/QuicReceiveWait.cs b/src/Titanium.Quic/Internal/QuicReceiveWait.cs new file mode 100644 index 000000000..d0bec8f20 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicReceiveWait.cs @@ -0,0 +1,61 @@ +using System; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace Titanium.Quic; + +/// +/// The cancellation source a receive loop waits on. It follows the loop's outer token and fires after the next +/// timer delay. One instance lives as long as the loop, and each iteration resets it instead of building a new +/// linked source. +/// +internal sealed class QuicReceiveWait : IDisposable +{ + private readonly CancellationToken _outer; + + private CancellationTokenSource _source; + + private CancellationTokenRegistration _registration; + + internal QuicReceiveWait(CancellationToken outer) + { + _outer = outer; + _source = Create(outer, out _registration); + } + + /// Gets the token the receive waits on. + internal CancellationToken Token => _source.Token; + + /// Prepares the source for the next receive. A source that already fired is replaced. + /// The time after which the receive is cancelled, or to wait without a timer. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Arm(TimeSpan? delay) + { + if (!_source.TryReset()) + { + _registration.Dispose(); + _source.Dispose(); + _source = Create(_outer, out _registration); + } + + if (delay is TimeSpan after) + { + _source.CancelAfter(after); + } + } + + public void Dispose() + { + _registration.Dispose(); + _source.Dispose(); + } + + private static CancellationTokenSource Create(CancellationToken outer, out CancellationTokenRegistration registration) + { + var source = new CancellationTokenSource(); + registration = outer.CanBeCanceled + ? outer.UnsafeRegister(static state => ((CancellationTokenSource)state!).Cancel(), source) + : default; + return source; + } +} diff --git a/src/Titanium.Quic/Internal/QuicRetry.cs b/src/Titanium.Quic/Internal/QuicRetry.cs new file mode 100644 index 000000000..9c6b5fd95 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicRetry.cs @@ -0,0 +1,78 @@ +using System; +using System.Buffers; +using System.Security.Cryptography; + +namespace Titanium.Quic; + +/// +/// Retry integrity tag from RFC 9001 section 5.8. The tag is checked before a Retry is accepted. +/// +internal static class QuicRetry +{ + internal static ReadOnlySpan Key => + [ + 0xbe, 0x0c, 0x69, 0x0b, 0x9f, 0x66, 0x57, 0x5a, + 0x1d, 0x76, 0x6b, 0x54, 0xe3, 0x68, 0xc8, 0x4e, + ]; + + internal static ReadOnlySpan Nonce => + [ + 0x46, 0x15, 0x99, 0xd3, 0x5d, 0x63, 0x2b, 0xf2, 0x23, 0x98, 0x25, 0xbb, + ]; + + internal static bool TryWriteTag(ReadOnlySpan originalDestinationConnectionId, ReadOnlySpan retryWithoutTag, Span tag) + { + if (tag.Length < 16 || !TryWritePseudoPacket(originalDestinationConnectionId, retryWithoutTag, out byte[]? buffer, out int length) || buffer is null) + { + return false; + } + + try + { + using var aes = new AesGcm(Key, 16); + aes.Encrypt(Nonce, ReadOnlySpan.Empty, Span.Empty, tag[..16], buffer.AsSpan(0, length)); + return true; + } + finally + { + CryptographicOperations.ZeroMemory(buffer.AsSpan(0, length)); + ArrayPool.Shared.Return(buffer); + } + } + + internal static bool TryVerify(ReadOnlySpan originalDestinationConnectionId, ReadOnlySpan retryPacket) + { + if (retryPacket.Length < 16) + { + return false; + } + + ReadOnlySpan body = retryPacket[..^16]; + ReadOnlySpan tag = retryPacket[^16..]; + Span computed = stackalloc byte[16]; + if (!TryWriteTag(originalDestinationConnectionId, body, computed)) + { + return false; + } + + return CryptographicOperations.FixedTimeEquals(computed, tag); + } + + private static bool TryWritePseudoPacket(ReadOnlySpan originalDestinationConnectionId, ReadOnlySpan retryWithoutTag, out byte[]? rented, out int length) + { + rented = null; + length = 0; + if (originalDestinationConnectionId.Length > QuicDatagramReader.MaxConnectionIdLength) + { + return false; + } + + length = 1 + originalDestinationConnectionId.Length + retryWithoutTag.Length; + rented = ArrayPool.Shared.Rent(length); + Span pseudo = rented.AsSpan(0, length); + pseudo[0] = (byte)originalDestinationConnectionId.Length; + originalDestinationConnectionId.CopyTo(pseudo[1..]); + retryWithoutTag.CopyTo(pseudo[(1 + originalDestinationConnectionId.Length)..]); + return true; + } +} diff --git a/src/Titanium.Quic/Internal/QuicSimulator.cs b/src/Titanium.Quic/Internal/QuicSimulator.cs new file mode 100644 index 000000000..ef0e15114 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicSimulator.cs @@ -0,0 +1,161 @@ +using System; +using System.Collections.Generic; + +namespace Titanium.Quic; + +/// A debug event list. Nothing is recorded until is set. +internal sealed class QuicQlog +{ + internal bool Enabled { get; init; } + + internal List Events { get; } = []; + + internal void Write(string name) + { + if (Enabled) + { + Events.Add(name); + } + } +} + +/// In-process network. It can drop, reorder, duplicate, delay, corrupt, black-hole, and enforce an MTU. +internal sealed class QuicSimulator +{ + private readonly List _items = []; + + internal int Mtu { get; set; } = 65535; + + internal int DropCount { get; set; } + + internal bool Reorder { get; set; } + + internal bool Duplicate { get; set; } + + internal TimeSpan Delay { get; set; } + + internal int LossEvery { get; set; } + + internal int CorruptCount { get; set; } + + internal bool Blackhole { get; set; } + + internal QuicQlog? Qlog { get; set; } + + private int _lossCount; + + internal void Submit(bool toServer, ReadOnlySpan datagram, DateTimeOffset now) + { + if (datagram.IsEmpty || datagram.Length > Mtu) + { + Qlog?.Write("packet_dropped"); + return; + } + + if (DropCount > 0) + { + DropCount--; + Qlog?.Write("packet_dropped"); + return; + } + + if (LossEvery > 0) + { + _lossCount++; + if (_lossCount % LossEvery == 0) + { + Qlog?.Write("packet_dropped"); + return; + } + } + + if (Blackhole) + { + Qlog?.Write("packet_dropped"); + return; + } + + byte[] copy = datagram.ToArray(); + if (CorruptCount > 0 && copy.Length > 0) + { + CorruptCount--; + copy[^1] ^= 0x01; + } + + Add(toServer, copy, now + Delay); + if (Duplicate) + { + Add(toServer, (byte[])copy.Clone(), now + Delay); + } + } + + internal DateTimeOffset? NextDelivery() + { + DateTimeOffset? next = null; + for (int i = 0; i < _items.Count; i++) + { + if (next is null || _items[i].At < next) + { + next = _items[i].At; + } + } + + return next; + } + + internal void Deliver(QuicConnectionCore core, bool toServer, DateTimeOffset now, in PathInfo path) + { + for (int i = 0; i < _items.Count;) + { + Item item = _items[i]; + if (item.ToServer != toServer || item.At > now) + { + i++; + continue; + } + + _items.RemoveAt(i); + Qlog?.Write("packet_received"); + core.HandleDatagram(now, item.Data, path); + } + } + + private void Add(bool toServer, byte[] data, DateTimeOffset at) + { + _items.Add(new Item(toServer, data, at)); + if (!Reorder || _items.Count < 2) + { + return; + } + + Item newer = _items[^1]; + for (int i = _items.Count - 2; i >= 0; i--) + { + if (_items[i].ToServer != newer.ToServer) + { + continue; + } + + Item older = _items[i]; + _items[i] = newer; + _items[^1] = older; + return; + } + } + + private readonly struct Item + { + internal Item(bool toServer, byte[] data, DateTimeOffset at) + { + ToServer = toServer; + Data = data; + At = at; + } + + internal bool ToServer { get; } + + internal byte[] Data { get; } + + internal DateTimeOffset At { get; } + } +} diff --git a/src/Titanium.Quic/Internal/QuicTransportParameters.cs b/src/Titanium.Quic/Internal/QuicTransportParameters.cs new file mode 100644 index 000000000..bb6012489 --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicTransportParameters.cs @@ -0,0 +1,359 @@ +using System; +using System.Buffers.Binary; + +namespace Titanium.Quic; + +/// One endpoint's transport parameters (RFC 9000 section 18). +internal sealed class QuicTransportParameters +{ + internal byte[]? OriginalDestinationConnectionId; + + internal byte[]? InitialSourceConnectionId; + + internal byte[]? RetrySourceConnectionId; + + internal byte[]? StatelessResetToken; + + internal ulong MaxIdleTimeout; + + internal ulong MaxUdpPayloadSize = 65527; + + internal ulong InitialMaxData; + + internal ulong InitialMaxStreamDataBidiLocal; + + internal ulong InitialMaxStreamDataBidiRemote; + + internal ulong InitialMaxStreamDataUni; + + internal ulong InitialMaxStreamsBidi; + + internal ulong InitialMaxStreamsUni; + + internal ulong AckDelayExponent = 3; + + internal ulong MaxAckDelay = 25; + + internal bool DisableActiveMigration; + + internal bool HasPreferredAddress; + + internal QuicPreferredAddress PreferredAddress = new(); + + internal ulong ActiveConnectionIdLimit = 8; + + internal ulong MaxDatagramFrameSize; + + internal bool GreaseQuicBit; +} + +internal sealed class QuicPreferredAddress +{ + internal byte[] IPv4 = new byte[4]; + + internal ushort IPv4Port; + + internal byte[] IPv6 = new byte[16]; + + internal ushort IPv6Port; + + internal byte[] ConnectionId = []; + + internal byte[] StatelessResetToken = new byte[16]; +} + +/// Reads and writes a transport-parameter list. Unknown parameters, including grease identifiers, are ignored. +internal static class QuicTransportParametersCodec +{ + internal const int MaxParameters = 64; + + internal const ulong TransportParameterError = 0x08; + + internal const ulong MaxStreamsLimit = 1UL << 60; + + internal static bool TryRead(ReadOnlySpan encoded, bool fromServer, bool retryReceived, out QuicTransportParameters parameters, out ulong error) + { + parameters = new QuicTransportParameters(); + error = 0; + Span seen = stackalloc ulong[MaxParameters]; + int seenCount = 0; + while (!encoded.IsEmpty) + { + if (!QuicVarInt.TryDecode(encoded, out ulong id, out int idBytes) + || !QuicVarInt.TryDecode(encoded[idBytes..], out ulong length, out int lengthBytes) + || length > (ulong)(encoded.Length - idBytes - lengthBytes)) + { + return Fail(out error); + } + + int header = idBytes + lengthBytes; + ReadOnlySpan value = encoded.Slice(header, (int)length); + encoded = encoded[(header + (int)length)..]; + if (seenCount == MaxParameters || Contains(seen[..seenCount], id)) + { + return Fail(out error); + } + + seen[seenCount++] = id; + if (!Apply(id, value, parameters)) + { + return Fail(out error); + } + } + + bool serverOnly = parameters.OriginalDestinationConnectionId is not null + || parameters.RetrySourceConnectionId is not null + || parameters.StatelessResetToken is not null + || parameters.HasPreferredAddress; + if (parameters.InitialSourceConnectionId is null + || (!fromServer && serverOnly) + || (fromServer && parameters.OriginalDestinationConnectionId is null) + || (fromServer && retryReceived && parameters.RetrySourceConnectionId is null) + || (fromServer && !retryReceived && parameters.RetrySourceConnectionId is not null)) + { + return Fail(out error); + } + + return true; + } + + internal static int Write(QuicTransportParameters parameters, Span destination) + { + int at = 0; + if (!Append(parameters.OriginalDestinationConnectionId, 0x00, destination, ref at) + || !AppendInteger(0x01, parameters.MaxIdleTimeout, destination, ref at) + || !Append(parameters.StatelessResetToken, 0x02, destination, ref at) + || !AppendInteger(0x03, parameters.MaxUdpPayloadSize, destination, ref at) + || !AppendInteger(0x04, parameters.InitialMaxData, destination, ref at) + || !AppendInteger(0x05, parameters.InitialMaxStreamDataBidiLocal, destination, ref at) + || !AppendInteger(0x06, parameters.InitialMaxStreamDataBidiRemote, destination, ref at) + || !AppendInteger(0x07, parameters.InitialMaxStreamDataUni, destination, ref at) + || !AppendInteger(0x08, parameters.InitialMaxStreamsBidi, destination, ref at) + || !AppendInteger(0x09, parameters.InitialMaxStreamsUni, destination, ref at) + || !AppendInteger(0x0a, parameters.AckDelayExponent, destination, ref at) + || !AppendInteger(0x0b, parameters.MaxAckDelay, destination, ref at) + || !AppendEmpty(parameters.DisableActiveMigration, 0x0c, destination, ref at) + || !AppendPreferred(parameters, destination, ref at) + || !AppendInteger(0x0e, parameters.ActiveConnectionIdLimit, destination, ref at) + || !Append(parameters.InitialSourceConnectionId, 0x0f, destination, ref at) + || !Append(parameters.RetrySourceConnectionId, 0x10, destination, ref at) + || !AppendInteger(0x20, parameters.MaxDatagramFrameSize, destination, ref at) + || !AppendEmpty(parameters.GreaseQuicBit, 0x2ab2, destination, ref at)) + { + return 0; + } + + return at; + } + + private static bool Apply(ulong id, ReadOnlySpan value, QuicTransportParameters parameters) + { + switch (id) + { + case 0x00: + return TakeConnectionId(value, out parameters.OriginalDestinationConnectionId); + case 0x01: + return TakeInteger(value, out parameters.MaxIdleTimeout); + case 0x02: + return TakeFixed(value, 16, out parameters.StatelessResetToken); + case 0x03: + return TakeInteger(value, out parameters.MaxUdpPayloadSize) && parameters.MaxUdpPayloadSize >= 1200; + case 0x04: + return TakeInteger(value, out parameters.InitialMaxData); + case 0x05: + return TakeInteger(value, out parameters.InitialMaxStreamDataBidiLocal); + case 0x06: + return TakeInteger(value, out parameters.InitialMaxStreamDataBidiRemote); + case 0x07: + return TakeInteger(value, out parameters.InitialMaxStreamDataUni); + case 0x08: + return TakeInteger(value, out parameters.InitialMaxStreamsBidi) && parameters.InitialMaxStreamsBidi <= MaxStreamsLimit; + case 0x09: + return TakeInteger(value, out parameters.InitialMaxStreamsUni) && parameters.InitialMaxStreamsUni <= MaxStreamsLimit; + case 0x0a: + return TakeInteger(value, out parameters.AckDelayExponent) && parameters.AckDelayExponent <= 20; + case 0x0b: + return TakeInteger(value, out parameters.MaxAckDelay) && parameters.MaxAckDelay < 1UL << 14; + case 0x0c: + return value.IsEmpty && (parameters.DisableActiveMigration = true); + case 0x0d: + return TakePreferred(value, parameters); + case 0x0e: + return TakeInteger(value, out parameters.ActiveConnectionIdLimit) && parameters.ActiveConnectionIdLimit >= 2; + case 0x0f: + return TakeConnectionId(value, out parameters.InitialSourceConnectionId); + case 0x10: + return TakeConnectionId(value, out parameters.RetrySourceConnectionId); + case 0x20: + return TakeInteger(value, out parameters.MaxDatagramFrameSize); + case 0x2ab2: + return value.IsEmpty && (parameters.GreaseQuicBit = true); + default: + return true; + } + } + + private static bool TakePreferred(ReadOnlySpan value, QuicTransportParameters parameters) + { + if (value.Length < 41) + { + return false; + } + + var address = new QuicPreferredAddress(); + value[..4].CopyTo(address.IPv4); + address.IPv4Port = BinaryPrimitives.ReadUInt16BigEndian(value[4..6]); + value.Slice(6, 16).CopyTo(address.IPv6); + address.IPv6Port = BinaryPrimitives.ReadUInt16BigEndian(value[22..24]); + int connectionIdLength = value[24]; + if (connectionIdLength is < 1 or > QuicDatagramReader.MaxConnectionIdLength || value.Length != 25 + connectionIdLength + 16) + { + return false; + } + + address.ConnectionId = value.Slice(25, connectionIdLength).ToArray(); + value.Slice(25 + connectionIdLength, 16).CopyTo(address.StatelessResetToken); + parameters.PreferredAddress = address; + parameters.HasPreferredAddress = true; + return true; + } + + private static bool TakeConnectionId(ReadOnlySpan value, out byte[]? connectionId) + { + connectionId = null; + if (value.Length > QuicDatagramReader.MaxConnectionIdLength) + { + return false; + } + + connectionId = value.ToArray(); + return true; + } + + private static bool TakeFixed(ReadOnlySpan value, int length, out byte[]? bytes) + { + bytes = null; + if (value.Length != length) + { + return false; + } + + bytes = value.ToArray(); + return true; + } + + private static bool TakeInteger(ReadOnlySpan value, out ulong number) + { + return QuicVarInt.TryDecode(value, out number, out int used) && used == value.Length; + } + + private static bool Append(byte[]? value, ulong id, Span destination, ref int at) + { + if (value is null) + { + return true; + } + + if (id == 0x02) + { + if (value.Length != 16) + { + return false; + } + } + else if (value.Length > QuicDatagramReader.MaxConnectionIdLength) + { + return false; + } + + return AppendRaw(id, value, destination, ref at); + } + + private static bool AppendEmpty(bool present, ulong id, Span destination, ref int at) + { + return !present || AppendRaw(id, ReadOnlySpan.Empty, destination, ref at); + } + + private static bool AppendInteger(ulong id, ulong value, Span destination, ref int at) + { + Span encoded = stackalloc byte[8]; + int length = QuicVarInt.Encode(value, encoded); + if (length == 0) + { + return false; + } + + return AppendRaw(id, encoded[..length], destination, ref at); + } + + private static bool AppendPreferred(QuicTransportParameters parameters, Span destination, ref int at) + { + if (!parameters.HasPreferredAddress) + { + return true; + } + + QuicPreferredAddress address = parameters.PreferredAddress; + if (address.IPv4.Length != 4 + || address.IPv6.Length != 16 + || address.ConnectionId.Length is < 1 or > QuicDatagramReader.MaxConnectionIdLength + || address.StatelessResetToken.Length != 16) + { + return false; + } + + int length = 25 + address.ConnectionId.Length + 16; + Span body = length <= 128 ? stackalloc byte[length] : new byte[length]; + address.IPv4.CopyTo(body); + BinaryPrimitives.WriteUInt16BigEndian(body[4..6], address.IPv4Port); + address.IPv6.CopyTo(body[6..]); + BinaryPrimitives.WriteUInt16BigEndian(body[22..24], address.IPv6Port); + body[24] = (byte)address.ConnectionId.Length; + address.ConnectionId.CopyTo(body[25..]); + address.StatelessResetToken.CopyTo(body[(25 + address.ConnectionId.Length)..]); + return AppendRaw(0x0d, body[..length], destination, ref at); + } + + private static bool AppendRaw(ulong id, ReadOnlySpan value, Span destination, ref int at) + { + if ((uint)at > (uint)destination.Length) + { + return false; + } + + int idBytes = QuicVarInt.Encode(id, destination[at..]); + if (idBytes == 0) + { + return false; + } + + int lengthBytes = QuicVarInt.Encode((ulong)value.Length, destination[(at + idBytes)..]); + if (lengthBytes == 0 || destination.Length < at + idBytes + lengthBytes + value.Length) + { + return false; + } + + value.CopyTo(destination[(at + idBytes + lengthBytes)..]); + at += idBytes + lengthBytes + value.Length; + return true; + } + + private static bool Contains(ReadOnlySpan seen, ulong id) + { + foreach (ulong existing in seen) + { + if (existing == id) + { + return true; + } + } + + return false; + } + + private static bool Fail(out ulong error) + { + error = TransportParameterError; + return false; + } +} diff --git a/src/Titanium.Quic/Internal/QuicVarInt.cs b/src/Titanium.Quic/Internal/QuicVarInt.cs new file mode 100644 index 000000000..f69422d4a --- /dev/null +++ b/src/Titanium.Quic/Internal/QuicVarInt.cs @@ -0,0 +1,115 @@ +using System; +using System.Runtime.CompilerServices; + +namespace Titanium.Quic; + +/// RFC 9000 section 16 variable-length integers. Writers use the shortest form. +internal static class QuicVarInt +{ + internal const ulong MaxValue = (1UL << 62) - 1; + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static int Encode(ulong value, Span destination) + { + int length = Length(value); + if (destination.Length < length) + { + return 0; + } + + switch (length) + { + case 1: + destination[0] = (byte)value; + break; + case 2: + Write(destination, (ushort)(value | 0x4000)); + break; + case 4: + Write(destination, (uint)value | 0x8000_0000); + break; + default: + Write(destination, value | 0xC000_0000_0000_0000); + break; + } + + return length; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static bool TryDecode(ReadOnlySpan source, out ulong value, out int consumed) + { + value = 0; + consumed = 0; + if (source.IsEmpty) + { + return false; + } + + int length = 1 << (source[0] >> 6); + if (source.Length < length) + { + return false; + } + + value = source[0] & 0x3Fu; + for (int i = 1; i < length; i++) + { + value = (value << 8) | source[i]; + } + + consumed = length; + return true; + } + + private static int Length(ulong value) + { + if (value <= 63) + { + return 1; + } + + if (value <= 16_383) + { + return 2; + } + + if (value <= 1_073_741_823) + { + return 4; + } + + if (value <= MaxValue) + { + return 8; + } + + throw new ArgumentOutOfRangeException(nameof(value)); + } + + private static void Write(Span destination, ushort value) + { + destination[0] = (byte)(value >> 8); + destination[1] = (byte)value; + } + + private static void Write(Span destination, uint value) + { + destination[0] = (byte)(value >> 24); + destination[1] = (byte)(value >> 16); + destination[2] = (byte)(value >> 8); + destination[3] = (byte)value; + } + + private static void Write(Span destination, ulong value) + { + destination[0] = (byte)(value >> 56); + destination[1] = (byte)(value >> 48); + destination[2] = (byte)(value >> 40); + destination[3] = (byte)(value >> 32); + destination[4] = (byte)(value >> 24); + destination[5] = (byte)(value >> 16); + destination[6] = (byte)(value >> 8); + destination[7] = (byte)value; + } +} diff --git a/src/Titanium.Quic/Internal/UdpSocketTransport.cs b/src/Titanium.Quic/Internal/UdpSocketTransport.cs new file mode 100644 index 000000000..62949916a --- /dev/null +++ b/src/Titanium.Quic/Internal/UdpSocketTransport.cs @@ -0,0 +1,339 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Quic.UdpOffload; + +namespace Titanium.Quic; + +/// One received UDP datagram and the remote endpoint the socket reported. +internal readonly struct UdpReceived +{ + internal UdpReceived(int count, IPEndPoint remote) + { + Count = count; + Remote = remote; + } + + internal int Count { get; } + + internal IPEndPoint Remote { get; } +} + +/// +/// Packet socket used by the driver. A batch of datagrams uses when its probe accepts the call, and otherwise one send at a time. +/// Received ECN and a portable path-MTU socket API are still gaps. +/// +internal interface IUdpPacketTransport : IDisposable +{ + /// The bound local endpoint. The port is chosen by the operating system. + IPEndPoint LocalEndpoint { get; } + + /// Largest UDP payload this socket will send. + int MaximumDatagramSize { get; } + + /// True when the socket already has a datagram to read. + bool DatagramPending { get; } + + /// Sends one datagram. + ValueTask SendAsync(ReadOnlyMemory datagram, IPEndPoint destination, CancellationToken cancellationToken); + + /// Sends the datagrams. A batch syscall is used when the offload probe has accepted it. + ValueTask SendBatchAsync(ReadOnlyMemory> datagrams, IPEndPoint destination, CancellationToken cancellationToken); + + /// Posts one receive. Callers overlap several of these. + ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken); + + /// + /// Takes up to datagrams the socket already holds, without waiting, and returns how many. Zero means none are queued or this + /// transport has no batch read. Read them with and before the next call. One reader only. + /// + int ReceiveQueued(int limit) => 0; + + /// Ends a read that started, after the caller is done with its datagrams. + void ReleaseQueued() + { + } + + /// The payload of datagram from the last . + ReadOnlySpan QueuedDatagram(int index) => default; + + /// The source address of datagram from the last . + IPEndPoint QueuedRemote(int index) => throw new InvalidOperationException("This transport has no batch read."); +} + +/// UDP socket. Addresses are pooled. Each receive is one . +internal sealed class UdpSocketTransport : IUdpPacketTransport +{ + internal const int RecommendedReceiveOverlap = 4; + + private const int IPv4Payload = 65507; + + private const int IPv6Payload = 65527; + + private const int LinuxReusePort = 15; + + private readonly Socket _socket; + + private readonly Stack _addresses = new(); + + private readonly object _gate = new(); + + private readonly SemaphoreSlim _send = new(1, 1); + + // Storage for the batch read. Null when the offload is off or this is not Linux. + private LinuxUdp.ReceiveBatch? _batch; + + // 0 not decided, 1 the batch read is on, 2 it is off. + private int _batchMode; + + internal UdpSocketTransport(IPEndPoint? local = null) + { + local ??= new IPEndPoint(IPAddress.Loopback, 0); + _socket = new Socket(local.AddressFamily, SocketType.Dgram, ProtocolType.Udp); + TryReusePort(_socket); + QuicDatagramSocket.TryEnableDontFragment(_socket); + _socket.Bind(local); + LocalEndpoint = (IPEndPoint)_socket.LocalEndPoint!; + MaximumDatagramSize = local.AddressFamily == AddressFamily.InterNetworkV6 ? IPv6Payload : IPv4Payload; + } + + public IPEndPoint LocalEndpoint { get; } + + public int MaximumDatagramSize { get; } + + public bool DatagramPending => _socket.Available > 0; + + public async ValueTask SendAsync(ReadOnlyMemory datagram, IPEndPoint destination, CancellationToken cancellationToken) + { + if (datagram.Length > MaximumDatagramSize) + { + throw new ArgumentOutOfRangeException(nameof(datagram)); + } + + // A pooled address can be issued again before the send uses it. + var address = new SocketAddress(destination.AddressFamily); + Write(address, destination); + await _send.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + if (QuicPathCounters.Enabled) + { + QuicPathCounters.Send(1); + } + + return await _socket.SendToAsync(datagram, SocketFlags.None, address, cancellationToken).ConfigureAwait(false); + } + catch (NullReferenceException) + { + // A close that overlaps this send clears the socket handle inside the operation. + return 0; + } + finally + { + _send.Release(); + } + } + + public async ValueTask SendBatchAsync(ReadOnlyMemory> datagrams, IPEndPoint destination, CancellationToken cancellationToken) + { + if (datagrams.Length > 1 && UdpOffloadBatch.TrySend(_socket, datagrams, destination, out int datagramsSent, out int bytes)) + { + if (QuicPathCounters.Enabled) + { + QuicPathCounters.Send(datagramsSent); + } + + for (int i = datagramsSent; i < datagrams.Length; i++) + { + bytes += await SendAsync(datagrams.Span[i], destination, cancellationToken).ConfigureAwait(false); + } + + return bytes; + } + + int sent = 0; + for (int i = 0; i < datagrams.Length; i++) + { + sent += await SendAsync(datagrams.Span[i], destination, cancellationToken).ConfigureAwait(false); + } + + return sent; + } + + public async ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken) + { + SocketAddress address = RentAddress(); + try + { + int count = await _socket.ReceiveFromAsync(buffer, SocketFlags.None, address, cancellationToken).ConfigureAwait(false); + return new UdpReceived(count, ToEndpoint(address)); + } + finally + { + ReturnAddress(address); + } + } + + public int ReceiveQueued(int limit) + { + if (_batchMode == 0) + { + _batchMode = _socket.AddressFamily == AddressFamily.InterNetwork && UdpOffloadBatch.ReceiveEnabled ? 1 : 2; + } + + if (_batchMode != 1) + { + return 0; + } + + // A slice holds 65536 bytes and the largest UDP payload is 65527, so no datagram is cut short. + LinuxUdp.ReceiveBatch batch = _batch ?? UdpOffloadBatch.RentReceiveBatch(); + int count = UdpOffloadBatch.TryReceive(_socket, batch, limit); + if (count == 0) + { + UdpOffloadBatch.ReturnReceiveBatch(batch); + _batch = null; + return 0; + } + + _batch = batch; + return count; + } + + public void ReleaseQueued() + { + LinuxUdp.ReceiveBatch? batch = _batch; + if (batch is not null) + { + _batch = null; + UdpOffloadBatch.ReturnReceiveBatch(batch); + } + } + + public ReadOnlySpan QueuedDatagram(int index) => _batch!.Datagram(index); + + public IPEndPoint QueuedRemote(int index) => _batch!.Remote(index); + + /// Sets an outgoing ECN codepoint when the socket accepts it. Received ECN is not visible through this receive API. + internal bool TrySetEcn(byte codepoint) + { + // RFC 3168 section 5 and RFC 9000 section 13.4.1: a sender marks Not-ECT, ECT(1), or + // ECT(0). CE is a codepoint the network sets, so a sender that marks it lies about + // congestion to the peer, and the kernel accepts it on a privileged handle. + if (codepoint > 2) + { + return false; + } + + try + { + if (_socket.AddressFamily == AddressFamily.InterNetworkV6 && !OperatingSystem.IsWindows()) + { + // SocketOptionName.TypeOfService is the IPv4 IP_TOS option. An IPv6 socket + // takes IPV6_TCLASS, which that enum does not name, and SetSocketOption + // rejects the raw number. 67 is Linux, 36 is macOS and the other BSDs. + int trafficClass = OperatingSystem.IsLinux() ? 67 : 36; + Span value = stackalloc byte[4]; + BitConverter.TryWriteBytes(value, (int)codepoint); + _socket.SetRawSocketOption((int)SocketOptionLevel.IPv6, trafficClass, value); + return true; + } + + SocketOptionLevel level = _socket.AddressFamily == AddressFamily.InterNetworkV6 ? SocketOptionLevel.IPv6 : SocketOptionLevel.IP; + _socket.SetSocketOption(level, SocketOptionName.TypeOfService, codepoint); + return true; + } + catch (SocketException) + { + return false; + } + catch (NotSupportedException) + { + return false; + } + } + + public void Dispose() => _socket.Dispose(); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private SocketAddress RentAddress() + { + lock (_gate) + { + if (_addresses.Count > 0) + { + SocketAddress pooled = _addresses.Pop(); + pooled.Size = pooled.Buffer.Length; + return pooled; + } + } + + return new SocketAddress(_socket.AddressFamily); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void ReturnAddress(SocketAddress address) + { + lock (_gate) + { + if (_addresses.Count < RecommendedReceiveOverlap) + { + _addresses.Push(address); + } + } + } + + private static void TryReusePort(Socket socket) + { + if (!OperatingSystem.IsLinux()) + { + return; + } + + try + { + socket.SetSocketOption(SocketOptionLevel.Socket, (SocketOptionName)LinuxReusePort, 1); + } + catch (SocketException) + { + } + catch (NotSupportedException) + { + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Write(SocketAddress address, IPEndPoint endpoint) + { + Span raw = address.Buffer.Span; + int port = endpoint.Port; + raw[2] = (byte)(port >> 8); + raw[3] = (byte)port; + if (endpoint.AddressFamily == AddressFamily.InterNetwork) + { + endpoint.Address.TryWriteBytes(raw.Slice(4, 4), out _); + address.Size = 16; + return; + } + + endpoint.Address.TryWriteBytes(raw.Slice(8, 16), out _); + address.Size = 28; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static IPEndPoint ToEndpoint(SocketAddress address) + { + ReadOnlySpan raw = address.Buffer.Span; + int port = (raw[2] << 8) | raw[3]; + if (address.Family == AddressFamily.InterNetwork) + { + return new IPEndPoint(new IPAddress(raw.Slice(4, 4)), port); + } + + return new IPEndPoint(new IPAddress(raw.Slice(8, 16)), port); + } +} diff --git a/src/Titanium.Quic/LICENSE b/src/Titanium.Quic/LICENSE new file mode 100644 index 000000000..786bcaca4 --- /dev/null +++ b/src/Titanium.Quic/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/src/Titanium.Quic/ManagedQuicConnection.cs b/src/Titanium.Quic/ManagedQuicConnection.cs new file mode 100644 index 000000000..ba6447b76 --- /dev/null +++ b/src/Titanium.Quic/ManagedQuicConnection.cs @@ -0,0 +1,199 @@ +#pragma warning disable CA1416 // QuicException is the BCL error type. This library does not start the platform QUIC stack. +using System; +using System.Net; +using System.Net.Quic; +using System.Threading; +using System.Threading.Tasks; + +namespace Titanium.Quic; + +/// A managed QUIC connection. Names follow . +public sealed class ManagedQuicConnection : IAsyncDisposable +{ + private readonly QuicConnectionSession _session; + + internal ManagedQuicConnection(QuicConnectionSession session) => _session = session; + + /// Gets the local UDP endpoint. + public IPEndPoint LocalEndPoint => _session.LocalEndPoint; + + /// Gets the remote UDP endpoint. + public IPEndPoint RemoteEndPoint => _session.RemoteEndPoint; + + internal bool HandshakeCompleted => _session.Handshake.IsCompletedSuccessfully; + + /// Connects to a server and waits for the handshake. + /// The remote endpoint, the server name, and the FIPS switch. + /// A token that cancels the handshake. + /// The connected client. + public static async ValueTask ConnectAsync(ManagedQuicClientConnectionOptions options, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(options); + ArgumentNullException.ThrowIfNull(options.RemoteEndPoint); + cancellationToken.ThrowIfCancellationRequested(); + QuicConnectionSession.RejectFips(options.AllowManagedStackUnderFips); + IPEndPoint remote = options.RemoteEndPoint; + IPEndPoint local = options.LocalEndPoint ?? new IPEndPoint( + remote.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6 ? IPAddress.IPv6Loopback : IPAddress.Loopback, + 0); + string serverName = options.ClientAuthenticationOptions?.TargetHost ?? string.Empty; + if (serverName.Length == 0) + { + serverName = "localhost"; + } + + if (options.MaxInboundBidirectionalStreams < 0 || options.MaxInboundUnidirectionalStreams < 0 + || (ulong)options.MaxInboundBidirectionalStreams > QuicTransportParametersCodec.MaxStreamsLimit + || (ulong)options.MaxInboundUnidirectionalStreams > QuicTransportParametersCodec.MaxStreamsLimit) + { + throw new ArgumentOutOfRangeException(nameof(options), "A stream limit is outside the range this connection can advertise."); + } + + if (options.IdleTimeout < TimeSpan.Zero) + { + throw new ArgumentOutOfRangeException(nameof(options), "The idle timeout is negative."); + } + + if (options.KeepAliveInterval < TimeSpan.Zero && options.KeepAliveInterval != Timeout.InfiniteTimeSpan) + { + throw new ArgumentOutOfRangeException(nameof(options), "The keep-alive interval is negative."); + } + + if (options.DefaultStreamErrorCode < 0) + { + throw new ArgumentOutOfRangeException(nameof(options), "The stream error code is negative."); + } + + TimeSpan budget = options.HandshakeTimeout <= TimeSpan.Zero ? TimeSpan.FromSeconds(10) : options.HandshakeTimeout; + ulong idleMs = options.IdleTimeout <= TimeSpan.Zero ? 0UL : (ulong)options.IdleTimeout.TotalMilliseconds; + var transport = new UdpSocketTransport(local); + var core = new QuicConnectionCore(); + var session = new QuicConnectionSession(core, transport, transport.LocalEndpoint, remote, ownsTransport: true); + try + { + byte[] localId = QuicConnectionSession.NewConnectionId(); + byte[] remoteId = QuicConnectionSession.NewConnectionId(); + PathInfo path = QuicConnectionSession.PathOf(transport.LocalEndpoint, remote); + if (options.KeepAliveInterval > TimeSpan.Zero && options.KeepAliveInterval != Timeout.InfiniteTimeSpan) + { + core.SetKeepAlive(options.KeepAliveInterval); + } + + session.DefaultStreamErrorCode = options.DefaultStreamErrorCode; + core.StartClient( + path, + localId, + remoteId, + QuicConnectionSession.Parameters( + client: true, + localId, + (ulong)options.MaxInboundBidirectionalStreams, + (ulong)options.MaxInboundUnidirectionalStreams, + idleMs), + default, + serverName, + QuicConnectionSession.ProtocolNames(options.ClientAuthenticationOptions?.ApplicationProtocols)); + session.StartClientLoop(); + var connection = new ManagedQuicConnection(session); + using var timeout = new CancellationTokenSource(budget); + using var linked = CancellationTokenSource.CreateLinkedTokenSource(timeout.Token, cancellationToken); + try + { + await session.Handshake.WaitAsync(linked.Token).ConfigureAwait(false); + } + catch (OperationCanceledException) when (timeout.IsCancellationRequested && !cancellationToken.IsCancellationRequested) + { + throw new QuicException(QuicError.ConnectionTimeout, null, "The handshake timed out."); + } + + return connection; + } + catch + { + await session.StopAsync().ConfigureAwait(false); + session.Dispose(); + throw; + } + } + + /// Opens a locally initiated stream. Bidirectional ids are 0, 4, 8, and so on for a client. Unidirectional ids are 2, 6, 10, and so on. + /// The stream type. + /// A token that cancels the open. + /// The new stream. + public ValueTask OpenOutboundStreamAsync(QuicStreamType type, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + if (!HandshakeCompleted) + { + throw new QuicException(QuicError.InternalError, null, "The handshake is not complete."); + } + + if (!_session.TryOpenLocal(type, out long id)) + { + throw new QuicException(QuicError.InternalError, null, "The peer's stream limit is exhausted."); + } + + var stream = new ManagedQuicStream(_session, id, type); + _session.AddStream(stream); + return ValueTask.FromResult(stream); + } + + /// Accepts the next remotely initiated bidirectional stream. + /// A token that cancels the accept. + /// The accepted stream. + public ValueTask AcceptInboundStreamAsync(CancellationToken cancellationToken = default) => + AcceptRemoteAsync(QuicStreamType.Bidirectional, cancellationToken); + + /// Accepts the next remotely initiated unidirectional stream. + /// A token that cancels the accept. + /// The accepted stream. + public ValueTask AcceptInboundUnidirectionalStreamAsync(CancellationToken cancellationToken = default) => + AcceptRemoteAsync(QuicStreamType.Unidirectional, cancellationToken); + + private ValueTask AcceptRemoteAsync(QuicStreamType type, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + if (!HandshakeCompleted) + { + throw new QuicException(QuicError.InternalError, null, "The handshake is not complete."); + } + + if (!_session.TryAcceptRemote(type, out long id)) + { + throw new QuicException(QuicError.InternalError, null, "The local stream limit is exhausted."); + } + + var stream = new ManagedQuicStream(_session, id, type); + _session.AddStream(stream); + return ValueTask.FromResult(stream); + } + + /// Sends a ping so a quiet peer still receives a packet. + /// A token that cancels the send. + /// A task that completes when the ping has been sent. + public async ValueTask PingAsync(CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + _session.Ping(); + await _session.FlushAsync().ConfigureAwait(false); + } + + /// Sends CONNECTION_CLOSE with the application error code. + /// The application close code. Zero is no error. + /// A token that cancels the send. + /// A task that completes when the close datagram has been sent. + public async ValueTask CloseAsync(long errorCode, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + _session.Close(errorCode); + await _session.FlushAsync().ConfigureAwait(false); + } + + /// Closes the socket and releases the connection. + /// A task that completes when the connection has stopped. + public async ValueTask DisposeAsync() + { + await _session.StopAsync().ConfigureAwait(false); + _session.Dispose(); + } +} diff --git a/src/Titanium.Quic/ManagedQuicListener.cs b/src/Titanium.Quic/ManagedQuicListener.cs new file mode 100644 index 000000000..ec11ff4ef --- /dev/null +++ b/src/Titanium.Quic/ManagedQuicListener.cs @@ -0,0 +1,803 @@ +#pragma warning disable CA1416 // QuicException is the BCL error type. This library does not start the platform QUIC stack. +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Net.Sockets; +using System.Runtime.CompilerServices; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; + +namespace Titanium.Quic; + +/// A UDP listener that accepts managed QUIC connections. +public sealed class ManagedQuicListener : IAsyncDisposable +{ + // Datagrams one wake of the receive loop takes before it goes back to the timers. + private const int MaxBatch = 32; + + private readonly object _gate = new(); + + private readonly IUdpPacketTransport _transport; + + private readonly ManagedQuicConnectionOptionsCallback _callback; + + private readonly TimeSpan _handshakeTimeout; + + private readonly CancellationTokenSource _stop = new(); + + private readonly Dictionary _connections = new(StringComparer.Ordinal); + + private readonly Queue _ready = new(); + + private readonly Queue> _waiters = new(); + + private readonly Task _loop; + + private readonly bool _injected; + + private ManagedQuicListener(IUdpPacketTransport transport, ManagedQuicConnectionOptionsCallback callback, TimeSpan handshakeTimeout, bool injected) + { + _transport = transport; + _callback = callback; + _handshakeTimeout = handshakeTimeout <= TimeSpan.Zero ? TimeSpan.FromSeconds(10) : handshakeTimeout; + _injected = injected; + LocalEndPoint = transport.LocalEndpoint; + _loop = injected ? Task.CompletedTask : RunAsync(_stop.Token); + } + + /// Gets the bound local endpoint. + public IPEndPoint LocalEndPoint { get; } + + /// Binds a UDP socket and starts accepting. + /// The endpoint, the certificate callback, and the FIPS switch. + /// A token that cancels binding. + /// The listening socket. + public static ValueTask ListenAsync(ManagedQuicListenerOptions options, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(options); + ArgumentNullException.ThrowIfNull(options.ListenEndPoint); + ArgumentNullException.ThrowIfNull(options.ConnectionOptionsCallback); + cancellationToken.ThrowIfCancellationRequested(); + QuicConnectionSession.RejectFips(options.AllowManagedStackUnderFips); + var transport = new UdpSocketTransport(options.ListenEndPoint); + try + { + return ValueTask.FromResult(new ManagedQuicListener(transport, options.ConnectionOptionsCallback, options.HandshakeTimeout, injected: false)); + } + catch + { + transport.Dispose(); + throw; + } + } + + /// + /// Accepts datagrams from the caller. Each reply is handed to before the creating call returns. + /// The listener does not open a socket. + /// + /// The certificate callback and the FIPS switch. The listen endpoint is not bound. + /// The virtual local address. Path checks use this tuple. + /// Receives one outbound datagram and the virtual remote address. + /// The largest payload will be offered. A tunnel lowers this. + /// A listener that reads only through . + public static ManagedQuicListener CreateInjected( + ManagedQuicListenerOptions options, + IPEndPoint local, + Func, IPEndPoint, CancellationToken, ValueTask> send, + int maximumDatagramSize = 65507) + { + ArgumentNullException.ThrowIfNull(options); + ArgumentNullException.ThrowIfNull(local); + ArgumentNullException.ThrowIfNull(send); + ArgumentNullException.ThrowIfNull(options.ConnectionOptionsCallback); + ArgumentOutOfRangeException.ThrowIfLessThan(maximumDatagramSize, 1200); + + QuicConnectionSession.RejectFips(options.AllowManagedStackUnderFips); + return new ManagedQuicListener(new CallbackTransport(local, send, maximumDatagramSize), options.ConnectionOptionsCallback, options.HandshakeTimeout, injected: true); + } + + /// Feeds one datagram from a relay. Replies leave through the callback passed to . + /// The UDP payload. The caller may reuse the buffer after this task completes. + /// The virtual remote address. + /// A token that cancels the certificate callback. + /// A task that completes after the replies for this datagram have been offered. + public ValueTask HandleDatagramAsync(ReadOnlyMemory datagram, IPEndPoint remote, CancellationToken cancellationToken = default) + { + if (!_injected) + { + throw new InvalidOperationException("This listener reads its own socket."); + } + + ArgumentNullException.ThrowIfNull(remote); + cancellationToken.ThrowIfCancellationRequested(); + var copy = new byte[datagram.Length]; + datagram.Span.CopyTo(copy); + return new ValueTask(OnDatagramAsync(copy, remote, cancellationToken)); + } + + /// Runs handshake and loss timers for an injected listener. The caller supplies the clock tick. + /// A token that cancels the flush. + /// A task that completes after the replies for this tick have been offered. + public ValueTask DriveAsync(CancellationToken cancellationToken = default) + { + if (!_injected) + { + throw new InvalidOperationException("This listener reads its own socket."); + } + + cancellationToken.ThrowIfCancellationRequested(); + return new ValueTask(OnTimeoutAsync(TimeProvider.System.GetUtcNow())); + } + + /// Waits for the next connection to finish its handshake. + /// A token that cancels the wait. + /// The accepted connection. + public async ValueTask AcceptConnectionAsync(CancellationToken cancellationToken = default) + { + TaskCompletionSource created = new(TaskCreationOptions.RunContinuationsAsynchronously); + lock (_gate) + { + if (_ready.Count > 0) + { + return _ready.Dequeue(); + } + + _waiters.Enqueue(created); + } + + try + { + return await created.Task.WaitAsync(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + lock (_gate) + { + var kept = new Queue>(); + while (_waiters.Count > 0) + { + TaskCompletionSource waiter = _waiters.Dequeue(); + if (!ReferenceEquals(waiter, created)) + { + kept.Enqueue(waiter); + } + } + + while (kept.Count > 0) + { + _waiters.Enqueue(kept.Dequeue()); + } + } + + throw; + } + } + + /// Stops the socket and the connections it accepted. + /// A task that completes when the socket is closed. + public async ValueTask DisposeAsync() + { + _stop.Cancel(); + _transport.Dispose(); + try + { + await _loop.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + } + catch (ObjectDisposedException) + { + } + + Tracked[] tracked; + TaskCompletionSource[] waiters; + lock (_gate) + { + tracked = new Tracked[_connections.Count]; + _connections.Values.CopyTo(tracked, 0); + _connections.Clear(); + waiters = _waiters.ToArray(); + _waiters.Clear(); + } + + for (int i = 0; i < waiters.Length; i++) + { + waiters[i].TrySetCanceled(); + } + + for (int i = 0; i < tracked.Length; i++) + { + tracked[i].Session.Dispose(); + } + + _stop.Dispose(); + } + + private async Task RunAsync(CancellationToken cancellationToken) + { + byte[] buffer = ArrayPool.Shared.Rent(65536); + using var wait = new QuicReceiveWait(cancellationToken); + int immediate = 0; + ValueTask carried = default; + bool hasCarried = false; + var touched = new List(4); + try + { + while (!cancellationToken.IsCancellationRequested) + { + DateTimeOffset now = TimeProvider.System.GetUtcNow(); + TimeSpan waitFor = NextDelay(now); + TimeSpan? armed = null; + if (waitFor <= TimeSpan.Zero) + { + if (immediate < QuicConnectionSession.MaxImmediateTimeouts) + { + // Each session moves its next deadline past now, so the next pass reads a future one. + immediate++; + await OnTimeoutAsync(now).ConfigureAwait(false); + continue; + } + + // A deadline that never advances would spin here. A datagram still wakes this wait. + armed = QuicConnectionSession.StuckTimerRetry; + } + else if (waitFor < TimeSpan.MaxValue) + { + immediate = 0; + armed = waitFor; + } + + wait.Arm(armed); + try + { + ValueTask next; + if (hasCarried) + { + next = carried; + carried = default; + hasCarried = false; + } + else + { + next = _transport.ReceiveAsync(buffer.AsMemory(0, 65536), wait.Token); + } + + // A receive that finished before it was awaited found a datagram already queued, so more are probably queued behind it. + // That is the only case worth a batch read. A loop that was idle takes its one datagram and waits again without the extra call. + bool backlog = next.IsCompleted; + UdpReceived received = await next.ConfigureAwait(false); + immediate = 0; + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ListenerPass(1); + } + + // The datagrams of one wake form a batch: each goes to its connection's core as it arrives, and each connection that took + // one is sent, woken, and checked once when the batch ends. A batch ends when the queue looks empty or at MaxBatch datagrams. + // A receive that does not finish at once is kept and awaited at the top of the next pass, so no datagram waits behind a + // timer check, and what the cores staged is sent before that receive is posted. + touched.Clear(); + Tracked? first = await AcceptReceivedAsync(buffer, received, cancellationToken).ConfigureAwait(false); + if (!backlog) + { + // Nothing was queued behind this datagram, so the batch is this one connection. Send before the next receive is posted. + if (first is not null) + { + await CompleteAsync(first).ConfigureAwait(false); + } + } + else + { + NoteTouched(touched, first); + } + + int taken = 1; + while (taken < MaxBatch && !cancellationToken.IsCancellationRequested) + { + if (backlog) + { + int queued = _transport.ReceiveQueued(MaxBatch - taken); + if (queued > 0) + { + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ListenerDrained(queued); + } + + try + { + for (int i = 0; i < queued; i++) + { + NoteTouched(touched, await AcceptDatagramAsync(_transport.QueuedDatagram(i).ToArray(), _transport.QueuedRemote(i), cancellationToken).ConfigureAwait(false)); + } + } + finally + { + _transport.ReleaseQueued(); + } + + taken += queued; + continue; + } + + backlog = false; + } + + await CompleteBatchAsync(touched).ConfigureAwait(false); + ValueTask more = _transport.ReceiveAsync(buffer.AsMemory(0, 65536), wait.Token); + if (!more.IsCompleted) + { + carried = more; + hasCarried = true; + break; + } + + backlog = true; + UdpReceived again = await more.ConfigureAwait(false); + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ListenerDrained(1); + } + + NoteTouched(touched, await AcceptReceivedAsync(buffer, again, cancellationToken).ConfigureAwait(false)); + taken++; + } + + await CompleteBatchAsync(touched).ConfigureAwait(false); + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + await OnTimeoutAsync(TimeProvider.System.GetUtcNow()).ConfigureAwait(false); + } + catch (SocketException) + { + // An unreachable peer is reported on the next receive. The listener stays up. + } + } + } + catch (OperationCanceledException) + { + } + catch (ObjectDisposedException) + { + } + catch (SocketException) + { + } + finally + { + // A kept receive still owns the buffer, so that buffer is left to the collector instead of going back to the pool. + if (!hasCarried) + { + ArrayPool.Shared.Return(buffer); + } + } + } + + private ValueTask AcceptReceivedAsync(byte[] buffer, UdpReceived received, CancellationToken cancellationToken) + { + var copy = new byte[received.Count]; + buffer.AsSpan(0, received.Count).CopyTo(copy); + return AcceptDatagramAsync(copy, received.Remote, cancellationToken); + } + + private static void NoteTouched(List touched, Tracked? tracked) + { + if (tracked is not null && !touched.Contains(tracked)) + { + touched.Add(tracked); + } + } + + private Task CompleteBatchAsync(List touched) + { + if (touched.Count == 0) + { + return Task.CompletedTask; + } + + return CompleteBatchSlowAsync(touched); + } + + private async Task CompleteBatchSlowAsync(List touched) + { + for (int i = 0; i < touched.Count; i++) + { + await CompleteAsync(touched[i]).ConfigureAwait(false); + } + + touched.Clear(); + } + + private async Task OnDatagramAsync(byte[] datagram, IPEndPoint remote, CancellationToken cancellationToken) + { + Tracked? tracked = await AcceptDatagramAsync(datagram, remote, cancellationToken).ConfigureAwait(false); + if (tracked is not null) + { + await CompleteAsync(tracked).ConfigureAwait(false); + } + } + + // Routes one datagram to its connection by the connection ID and hands it to that connection's core, with the source address the + // socket reported for this datagram. Nothing is sent and no reader is woken here, so a batch of datagrams can share one flush. + private async ValueTask AcceptDatagramAsync(byte[] datagram, IPEndPoint remote, CancellationToken cancellationToken) + { + if (!TryDestination(datagram, out byte[] id, out bool initial)) + { + await ReplyToUnknownVersionAsync(datagram, remote, cancellationToken).ConfigureAwait(false); + return null; + } + + string key = Convert.ToHexString(id); + Tracked? tracked; + bool created = false; + lock (_gate) + { + if (!_connections.TryGetValue(key, out tracked) && initial) + { + tracked = StartServer(id, remote); + _connections.Add(key, tracked); + created = true; + } + } + + if (tracked is null) + { + return null; + } + + if (tracked.Session.IsDisposed) + { + // The owner disposed this connection. A late datagram for it is dropped, and it must + // not reach a core whose keys are gone, or the exception ends the receive loop. + Forget(key, tracked); + return null; + } + + if (created) + { + tracked.Session.SetRemote(remote); + } + + PathInfo path = QuicConnectionSession.PathOf(LocalEndPoint, tracked.Session.RemoteEndPoint); + tracked.Session.Handle(datagram, path, TimeProvider.System.GetUtcNow(), holdAcknowledgement: true); + if (tracked.Session.TakePendingHello(out string serverName)) + { + await FinishHelloAsync(tracked, serverName, cancellationToken).ConfigureAwait(false); + } + + return tracked; + } + + // The part of a datagram's work that waits for the end of a batch: send what the core staged, wake the readers once, and check the + // handshake deadline. + private async Task CompleteAsync(Tracked tracked) + { + tracked.Session.ReleaseAcknowledgement(); + await tracked.Session.FlushAsync().ConfigureAwait(false); + tracked.Session.NotifyStreams(); + if (Expire(tracked)) + { + await tracked.Session.FlushAsync().ConfigureAwait(false); + return; + } + + Publish(tracked); + } + + private Tracked StartServer(byte[] localId, IPEndPoint remote) + { + var core = new QuicConnectionCore(); + core.StartServer(localId, null, QuicConnectionSession.Parameters(client: false, localId)); + var session = new QuicConnectionSession(core, _transport, LocalEndPoint, remote, ownsTransport: false); + return new Tracked(session, new ManagedQuicConnection(session), localId, TimeProvider.System.GetUtcNow() + _handshakeTimeout); + } + + private async Task FinishHelloAsync(Tracked tracked, string serverName, CancellationToken cancellationToken) + { + ManagedQuicServerConnectionOptions chosen; + try + { + chosen = await _callback(tracked.Connection, new SslClientHelloInfo(serverName, SslProtocols.Tls13), cancellationToken).ConfigureAwait(false); + } + catch (Exception exception) when (exception is not OperationCanceledException) + { + tracked.Session.Close(0); + await tracked.Session.FlushAsync().ConfigureAwait(false); + Fail(tracked, new QuicException(QuicError.CallbackError, null, exception.Message)); + return; + } + + try + { + QuicConnectionSession.RejectFips(chosen.AllowManagedStackUnderFips); + X509Certificate2 certificate = Certificate(chosen); + if (!tracked.Session.CompleteHello(certificate, QuicConnectionSession.ProtocolNames(chosen.ServerAuthenticationOptions?.ApplicationProtocols))) + { + Fail(tracked, new QuicException(QuicError.ConnectionAborted, null, "The handshake did not continue.")); + } + } + catch (Exception exception) when (exception is not OperationCanceledException) + { + Fail(tracked, exception as QuicException ?? new QuicException(QuicError.CallbackError, null, exception.Message)); + } + } + + private async Task OnTimeoutAsync(DateTimeOffset now) + { + Tracked[] tracked; + lock (_gate) + { + tracked = new Tracked[_connections.Count]; + _connections.Values.CopyTo(tracked, 0); + } + + for (int i = 0; i < tracked.Length; i++) + { + if (tracked[i].Session.IsDisposed) + { + Forget(Convert.ToHexString(tracked[i].LocalId), tracked[i]); + continue; + } + + tracked[i].Session.Timeout(now); + await tracked[i].Session.FlushAsync().ConfigureAwait(false); + tracked[i].Session.NotifyStreams(); + if (Expire(tracked[i])) + { + await tracked[i].Session.FlushAsync().ConfigureAwait(false); + } + else + { + Publish(tracked[i]); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Forget(string key, Tracked tracked) + { + lock (_gate) + { + if (_connections.TryGetValue(key, out Tracked? current) && ReferenceEquals(current, tracked)) + { + _connections.Remove(key); + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private TimeSpan NextDelay(DateTimeOffset now) + { + TimeSpan waitFor = TimeSpan.MaxValue; + lock (_gate) + { + foreach (Tracked tracked in _connections.Values) + { + if (tracked.Session.NextTimeout() is not DateTimeOffset due) + { + continue; + } + + TimeSpan delay = due - now; + if (delay < waitFor) + { + waitFor = delay; + } + } + } + + return waitFor; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool Expire(Tracked tracked) + { + if (tracked.Published || tracked.Connection.HandshakeCompleted || TimeProvider.System.GetUtcNow() <= tracked.Deadline) + { + return false; + } + + tracked.Session.Close(0); + Fail(tracked, new QuicException(QuicError.ConnectionTimeout, null, "The handshake timed out.")); + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private void Publish(Tracked tracked) + { + if (!tracked.Connection.HandshakeCompleted || tracked.Published) + { + if (tracked.Session.Handshake.IsFaulted && !tracked.Published) + { + tracked.Published = true; + Exception error = tracked.Session.Handshake.Exception?.InnerException + ?? new QuicException(QuicError.ConnectionAborted, null, "The handshake failed."); + Fail(tracked, error); + } + + return; + } + + tracked.Published = true; + TaskCompletionSource? waiter = null; + lock (_gate) + { + if (_waiters.Count > 0) + { + waiter = _waiters.Dequeue(); + } + else + { + _ready.Enqueue(tracked.Connection); + } + } + + waiter?.TrySetResult(tracked.Connection); + } + + private void Fail(Tracked tracked, Exception error) + { + tracked.Published = true; + TaskCompletionSource? waiter; + lock (_gate) + { + waiter = _waiters.Count > 0 ? _waiters.Dequeue() : null; + } + + waiter?.TrySetException(error); + } + + private static X509Certificate2 Certificate(ManagedQuicServerConnectionOptions options) + { + ArgumentNullException.ThrowIfNull(options); + X509Certificate? certificate = options.ServerAuthenticationOptions?.ServerCertificate + ?? options.ServerAuthenticationOptions?.ServerCertificateContext?.TargetCertificate; + if (certificate is not X509Certificate2 concrete) + { + throw new QuicException(QuicError.CallbackError, null, "The server certificate is missing."); + } + + return concrete; + } + + private async Task ReplyToUnknownVersionAsync(byte[] datagram, IPEndPoint remote, CancellationToken cancellationToken) + { + byte[] reply = new byte[64]; + if (!QuicDatagramReader.TryVersionNegotiation(datagram, reply, out int written)) + { + return; + } + + try + { + await _transport.SendAsync(reply.AsMemory(0, written), remote, cancellationToken).ConfigureAwait(false); + } + catch (SocketException) + { + } + catch (ObjectDisposedException) + { + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private bool TryDestination(ReadOnlySpan datagram, out byte[] id, out bool initial) + { + id = []; + initial = false; + if (datagram.IsEmpty) + { + return false; + } + + if ((datagram[0] & 0x80) == 0) + { + Tracked? match = null; + lock (_gate) + { + foreach (Tracked tracked in _connections.Values) + { + if (datagram.Length > 1 + tracked.LocalId.Length + && datagram.Slice(1, tracked.LocalId.Length).SequenceEqual(tracked.LocalId) + && (match is null || tracked.LocalId.Length > match.LocalId.Length)) + { + match = tracked; + } + } + } + + if (match is null) + { + return false; + } + + id = match.LocalId; + return true; + } + + if (!QuicDatagramReader.TryParse(datagram, 0, out QuicPacket packet) + || packet.DestinationConnectionId.IsEmpty) + { + return false; + } + + id = packet.DestinationConnectionId.ToArray(); + initial = packet.Kind == QuicPacketKind.Initial; + return true; + } + + private sealed class Tracked + { + internal Tracked(QuicConnectionSession session, ManagedQuicConnection connection, byte[] localId, DateTimeOffset deadline) + { + Session = session; + Connection = connection; + LocalId = localId; + Deadline = deadline; + } + + internal byte[] LocalId { get; } + + internal DateTimeOffset Deadline { get; } + + internal QuicConnectionSession Session { get; } + + internal ManagedQuicConnection Connection { get; } + + internal bool Published { get; set; } + } + + private sealed class CallbackTransport : IUdpPacketTransport + { + private readonly Func, IPEndPoint, CancellationToken, ValueTask> _send; + + internal CallbackTransport(IPEndPoint local, Func, IPEndPoint, CancellationToken, ValueTask> send, int maximumDatagramSize) + { + LocalEndpoint = local; + _send = send; + MaximumDatagramSize = maximumDatagramSize; + } + + public IPEndPoint LocalEndpoint { get; } + + public int MaximumDatagramSize { get; } + + public bool DatagramPending => false; + + public async ValueTask SendAsync(ReadOnlyMemory datagram, IPEndPoint destination, CancellationToken cancellationToken) + { + if (datagram.Length > MaximumDatagramSize) + { + throw new ArgumentOutOfRangeException(nameof(datagram)); + } + + await _send(datagram, destination, cancellationToken).ConfigureAwait(false); + return datagram.Length; + } + + public async ValueTask SendBatchAsync(ReadOnlyMemory> datagrams, IPEndPoint destination, CancellationToken cancellationToken) + { + int bytes = 0; + for (int i = 0; i < datagrams.Length; i++) + { + bytes += await SendAsync(datagrams.Span[i], destination, cancellationToken).ConfigureAwait(false); + } + + return bytes; + } + + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken) => + throw new InvalidOperationException("An injected listener does not read a socket."); + + public void Dispose() + { + } + } +} diff --git a/src/Titanium.Quic/ManagedQuicOptions.cs b/src/Titanium.Quic/ManagedQuicOptions.cs new file mode 100644 index 000000000..33b390ca8 --- /dev/null +++ b/src/Titanium.Quic/ManagedQuicOptions.cs @@ -0,0 +1,80 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Threading; +using System.Threading.Tasks; + +namespace Titanium.Quic; + +/// +/// Chooses options for one inbound connection. +/// The platform connection type is sealed, so this callback takes . +/// +/// The connection that received the ClientHello. +/// The server name and protocol from that ClientHello. +/// A token that cancels the selection. +/// The options used to continue the handshake. +public delegate ValueTask ManagedQuicConnectionOptionsCallback( + ManagedQuicConnection connection, + SslClientHelloInfo clientHello, + CancellationToken cancellationToken); + +/// Options for . +public sealed class ManagedQuicListenerOptions +{ + /// Gets or sets the local endpoint. Port 0 asks the operating system for a port. + public IPEndPoint? ListenEndPoint { get; set; } + + /// Gets or sets the callback that supplies the certificate for each connection. + public ManagedQuicConnectionOptionsCallback? ConnectionOptionsCallback { get; set; } + + /// Gets or sets the limit on how long a handshake may run. The default is 10 seconds. + public TimeSpan HandshakeTimeout { get; set; } = TimeSpan.FromSeconds(10); + + /// Gets or sets whether this listener may run while FIPS mode is on. + public bool AllowManagedStackUnderFips { get; set; } +} + +/// Options for . +public sealed class ManagedQuicClientConnectionOptions +{ + /// Gets or sets the server endpoint. + public IPEndPoint? RemoteEndPoint { get; set; } + + /// Gets or sets the local endpoint. Port 0 asks the operating system for a port. + public IPEndPoint? LocalEndPoint { get; set; } + + /// Gets or sets the TLS options. is the server name. + public SslClientAuthenticationOptions? ClientAuthenticationOptions { get; set; } + + /// Gets or sets the limit on how long the handshake may run. The default is 10 seconds. + public TimeSpan HandshakeTimeout { get; set; } = TimeSpan.FromSeconds(10); + + /// Gets or sets how often a PING is sent after the handshake. sends none. The default sends none. + public TimeSpan KeepAliveInterval { get; set; } = Timeout.InfiniteTimeSpan; + + /// Gets or sets the idle timeout advertised to the peer. Zero leaves the timeout disabled. The default is zero. + public TimeSpan IdleTimeout { get; set; } + + /// Gets or sets how many remotely opened bidirectional streams this connection accepts. The default is 16. + public int MaxInboundBidirectionalStreams { get; set; } = 16; + + /// Gets or sets how many remotely opened unidirectional streams this connection accepts. The default is 16. + public int MaxInboundUnidirectionalStreams { get; set; } = 16; + + /// Gets or sets the application error sent when a stream is released before its write side is finished. The default is 0. + public long DefaultStreamErrorCode { get; set; } + + /// Gets or sets whether this connection may run while FIPS mode is on. + public bool AllowManagedStackUnderFips { get; set; } +} + +/// Options returned by . +public sealed class ManagedQuicServerConnectionOptions +{ + /// Gets or sets the certificate presented to the client. + public SslServerAuthenticationOptions? ServerAuthenticationOptions { get; set; } + + /// Gets or sets whether this connection may run while FIPS mode is on. + public bool AllowManagedStackUnderFips { get; set; } +} diff --git a/src/Titanium.Quic/ManagedQuicStream.cs b/src/Titanium.Quic/ManagedQuicStream.cs new file mode 100644 index 000000000..e116106a6 --- /dev/null +++ b/src/Titanium.Quic/ManagedQuicStream.cs @@ -0,0 +1,177 @@ +using System; +using System.IO; +using System.Net.Quic; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Titanium.Quic; + +/// A managed QUIC stream. Names follow . +public sealed class ManagedQuicStream : Stream +{ + private readonly QuicConnectionSession _session; + + private readonly object _readGate = new(); + + private TaskCompletionSource _signal = new(TaskCreationOptions.RunContinuationsAsynchronously); + + private int _offset; + + private ulong _written; + + private bool _writesCompleted; + + private bool _disposed; + + internal ManagedQuicStream(QuicConnectionSession session, long id, QuicStreamType type) + { + _session = session; + Id = id; + Type = type; + } + + /// Gets the stream identifier. + public long Id { get; } + + /// Gets the stream type. + public QuicStreamType Type { get; } + + /// + public override bool CanRead => true; + + /// + public override bool CanSeek => false; + + /// + public override bool CanWrite => true; + + /// + public override long Length => throw new NotSupportedException(); + + /// + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + /// + public override void Flush() + { + } + + /// + public override int Read(byte[] buffer, int offset, int count) => throw new NotSupportedException("Use ReadAsync."); + + /// + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException("Use WriteAsync."); + + /// + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + /// + public override void SetLength(long value) => throw new NotSupportedException(); + + /// Reads bytes that have arrived on this stream. + /// The destination. + /// A token that cancels the read. + /// The number of bytes copied, or zero when the connection is closed and nothing remains. + public override async ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + while (true) + { + cancellationToken.ThrowIfCancellationRequested(); + Task wait; + lock (_readGate) + { + wait = _signal.Task; + } + + int count = _session.CopyDelivered((ulong)Id, _offset, buffer.Span); + if (count > 0) + { + _offset += count; + if (_session.ExtendReadWindow((ulong)Id, _offset)) + { + await _session.FlushAsync().ConfigureAwait(false); + } + + return count; + } + + if (_session.IsClosed || _session.IsStreamReadClosed((ulong)Id, _offset)) + { + return 0; + } + + await wait.WaitAsync(cancellationToken).ConfigureAwait(false); + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ReaderResume(); + } + } + } + + /// Writes bytes on this stream. + /// The bytes to send. + /// A token that cancels the write. + /// A task that completes when the datagram has been sent. + public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + if (buffer.IsEmpty) + { + return; + } + + _session.Send((ulong)Id, buffer.Span); + _written += (ulong)buffer.Length; + await _session.FlushAsync().ConfigureAwait(false); + } + + /// Sends the end of the stream. + /// A token that cancels the send. + /// A task that completes when the final frame has been sent. + public async ValueTask CompleteWritesAsync(CancellationToken cancellationToken = default) + { + cancellationToken.ThrowIfCancellationRequested(); + _writesCompleted = true; + _session.Finish((ulong)Id); + await _session.FlushAsync().ConfigureAwait(false); + } + + /// + protected override void Dispose(bool disposing) + { + if (disposing && !_disposed) + { + _disposed = true; + if (!_writesCompleted) + { + _session.Reset((ulong)Id, _session.DefaultStreamErrorCode, _written); + } + } + + base.Dispose(disposing); + } + + internal string CloseDiagnostics() => _session.CloseDiagnostics(); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal void Notify() + { + TaskCompletionSource current; + lock (_readGate) + { + current = _signal; + _signal = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + } + + current.TrySetResult(true); + if (QuicPathCounters.Enabled) + { + QuicPathCounters.ReaderNotify(); + } + } +} diff --git a/src/Titanium.Quic/PublicAPI.Shipped.txt b/src/Titanium.Quic/PublicAPI.Shipped.txt new file mode 100644 index 000000000..7dc5c5811 --- /dev/null +++ b/src/Titanium.Quic/PublicAPI.Shipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Titanium.Quic/PublicAPI.Unshipped.txt b/src/Titanium.Quic/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..48cf3cab4 --- /dev/null +++ b/src/Titanium.Quic/PublicAPI.Unshipped.txt @@ -0,0 +1,76 @@ +#nullable enable +Titanium.Quic.ManagedQuicClientConnectionOptions +Titanium.Quic.ManagedQuicClientConnectionOptions.AllowManagedStackUnderFips.get -> bool +Titanium.Quic.ManagedQuicClientConnectionOptions.AllowManagedStackUnderFips.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.ClientAuthenticationOptions.get -> System.Net.Security.SslClientAuthenticationOptions? +Titanium.Quic.ManagedQuicClientConnectionOptions.ClientAuthenticationOptions.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.DefaultStreamErrorCode.get -> long +Titanium.Quic.ManagedQuicClientConnectionOptions.DefaultStreamErrorCode.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.HandshakeTimeout.get -> System.TimeSpan +Titanium.Quic.ManagedQuicClientConnectionOptions.HandshakeTimeout.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.IdleTimeout.get -> System.TimeSpan +Titanium.Quic.ManagedQuicClientConnectionOptions.IdleTimeout.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.KeepAliveInterval.get -> System.TimeSpan +Titanium.Quic.ManagedQuicClientConnectionOptions.KeepAliveInterval.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.MaxInboundBidirectionalStreams.get -> int +Titanium.Quic.ManagedQuicClientConnectionOptions.MaxInboundBidirectionalStreams.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.MaxInboundUnidirectionalStreams.get -> int +Titanium.Quic.ManagedQuicClientConnectionOptions.MaxInboundUnidirectionalStreams.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.LocalEndPoint.get -> System.Net.IPEndPoint? +Titanium.Quic.ManagedQuicClientConnectionOptions.LocalEndPoint.set -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.ManagedQuicClientConnectionOptions() -> void +Titanium.Quic.ManagedQuicClientConnectionOptions.RemoteEndPoint.get -> System.Net.IPEndPoint? +Titanium.Quic.ManagedQuicClientConnectionOptions.RemoteEndPoint.set -> void +Titanium.Quic.ManagedQuicConnection +Titanium.Quic.ManagedQuicConnection.AcceptInboundStreamAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.AcceptInboundUnidirectionalStreamAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.CloseAsync(long errorCode, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.DisposeAsync() -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.LocalEndPoint.get -> System.Net.IPEndPoint! +Titanium.Quic.ManagedQuicConnection.PingAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.OpenOutboundStreamAsync(System.Net.Quic.QuicStreamType type, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicConnection.RemoteEndPoint.get -> System.Net.IPEndPoint! +Titanium.Quic.ManagedQuicConnectionOptionsCallback +Titanium.Quic.ManagedQuicListener +Titanium.Quic.ManagedQuicListener.AcceptConnectionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicListener.DisposeAsync() -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicListener.LocalEndPoint.get -> System.Net.IPEndPoint! +Titanium.Quic.ManagedQuicListenerOptions +Titanium.Quic.ManagedQuicListenerOptions.AllowManagedStackUnderFips.get -> bool +Titanium.Quic.ManagedQuicListenerOptions.AllowManagedStackUnderFips.set -> void +Titanium.Quic.ManagedQuicListenerOptions.ConnectionOptionsCallback.get -> Titanium.Quic.ManagedQuicConnectionOptionsCallback? +Titanium.Quic.ManagedQuicListenerOptions.ConnectionOptionsCallback.set -> void +Titanium.Quic.ManagedQuicListenerOptions.HandshakeTimeout.get -> System.TimeSpan +Titanium.Quic.ManagedQuicListenerOptions.HandshakeTimeout.set -> void +Titanium.Quic.ManagedQuicListenerOptions.ListenEndPoint.get -> System.Net.IPEndPoint? +Titanium.Quic.ManagedQuicListenerOptions.ListenEndPoint.set -> void +Titanium.Quic.ManagedQuicListenerOptions.ManagedQuicListenerOptions() -> void +Titanium.Quic.ManagedQuicServerConnectionOptions +Titanium.Quic.ManagedQuicServerConnectionOptions.AllowManagedStackUnderFips.get -> bool +Titanium.Quic.ManagedQuicServerConnectionOptions.AllowManagedStackUnderFips.set -> void +Titanium.Quic.ManagedQuicServerConnectionOptions.ManagedQuicServerConnectionOptions() -> void +Titanium.Quic.ManagedQuicServerConnectionOptions.ServerAuthenticationOptions.get -> System.Net.Security.SslServerAuthenticationOptions? +Titanium.Quic.ManagedQuicServerConnectionOptions.ServerAuthenticationOptions.set -> void +Titanium.Quic.ManagedQuicStream +Titanium.Quic.ManagedQuicStream.CompleteWritesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicStream.Id.get -> long +Titanium.Quic.ManagedQuicStream.Type.get -> System.Net.Quic.QuicStreamType +override Titanium.Quic.ManagedQuicStream.CanRead.get -> bool +override Titanium.Quic.ManagedQuicStream.CanSeek.get -> bool +override Titanium.Quic.ManagedQuicStream.CanWrite.get -> bool +override Titanium.Quic.ManagedQuicStream.Flush() -> void +override Titanium.Quic.ManagedQuicStream.Length.get -> long +override Titanium.Quic.ManagedQuicStream.Position.get -> long +override Titanium.Quic.ManagedQuicStream.Position.set -> void +override Titanium.Quic.ManagedQuicStream.Read(byte[]! buffer, int offset, int count) -> int +override Titanium.Quic.ManagedQuicStream.ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +override Titanium.Quic.ManagedQuicStream.Seek(long offset, System.IO.SeekOrigin origin) -> long +override Titanium.Quic.ManagedQuicStream.SetLength(long value) -> void +override Titanium.Quic.ManagedQuicStream.Write(byte[]! buffer, int offset, int count) -> void +override Titanium.Quic.ManagedQuicStream.WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Titanium.Quic.ManagedQuicConnection.ConnectAsync(Titanium.Quic.ManagedQuicClientConnectionOptions! options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Titanium.Quic.ManagedQuicListener.ListenAsync(Titanium.Quic.ManagedQuicListenerOptions! options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +static Titanium.Quic.ManagedQuicListener.CreateInjected(Titanium.Quic.ManagedQuicListenerOptions! options, System.Net.IPEndPoint! local, System.Func, System.Net.IPEndPoint!, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask>! send, int maximumDatagramSize = 65507) -> Titanium.Quic.ManagedQuicListener! +Titanium.Quic.ManagedQuicListener.DriveAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Quic.ManagedQuicListener.HandleDatagramAsync(System.ReadOnlyMemory datagram, System.Net.IPEndPoint! remote, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +virtual Titanium.Quic.ManagedQuicConnectionOptionsCallback.Invoke(Titanium.Quic.ManagedQuicConnection! connection, System.Net.Security.SslClientHelloInfo clientHello, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask diff --git a/src/Titanium.Quic/README.md b/src/Titanium.Quic/README.md new file mode 100644 index 000000000..c0f970e4a --- /dev/null +++ b/src/Titanium.Quic/README.md @@ -0,0 +1,25 @@ +# Titanium.Quic + +Managed QUIC v1 for .NET, built on Titanium.Tls. The package also depends on Titanium.Quic.UdpOffload for the socket batch path. + +The proxy calls this stack when `UseManagedQuicStack` is on. The library default is off. SOCKS5 UDP ASSOCIATE, CONNECT-UDP, and transparent interception then hand a QUIC datagram to a listener that does not open its own socket. A plain datagram stays on the relay. With the flag off, the relay stays on the platform path, and transparent interception throws. + +```csharp +await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions +{ + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), +}); +``` + +## Limits + +The client Initial offers `TLS_AES_128_GCM_SHA256`. HTTP/3 framing on an accepted proxy connection still uses the platform stream. 0-RTT is not implemented. The first client Initial is padded to 1200 bytes. + +This package is experimental. It is not a FIPS-validated module. While FIPS mode is on, a connection throws unless `AllowManagedStackUnderFips` is set or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. + +`samples/QuicEcho` connects on loopback and echoes two bytes on one stream. diff --git a/src/Titanium.Quic/StrongNameKey.snk b/src/Titanium.Quic/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/src/Titanium.Quic/StrongNameKey.snk differ diff --git a/src/Titanium.Quic/Titanium.Quic.csproj b/src/Titanium.Quic/Titanium.Quic.csproj new file mode 100644 index 000000000..fb1608a0c --- /dev/null +++ b/src/Titanium.Quic/Titanium.Quic.csproj @@ -0,0 +1,32 @@ + + + + Titanium.Quic + Managed QUIC v1 for .NET. + Titanium.Quic + quic;http3;managed + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + diff --git a/src/Titanium.Quic/design/BUG-LEDGER.md b/src/Titanium.Quic/design/BUG-LEDGER.md new file mode 100644 index 000000000..8c0fc8637 --- /dev/null +++ b/src/Titanium.Quic/design/BUG-LEDGER.md @@ -0,0 +1,15 @@ +One row per bug found by the QUIC campaign. A row stays until the fix commit and the regression test both exist. + +| Id | Date | Technique | Symptom | Root cause | Severity | Fix | Regression | +| --- | --- | --- | --- | --- | --- | --- | --- | +| BH2-1 | 2026-11-27 | Managed client, platform listener | The handshake completes. The platform peer does not accept the stream within 15 seconds. | The server's stateless reset token is stored on the client's original destination connection ID. That record used the highest sequence number, so every later packet, including the stream, was sent to an ID the server had stopped using. | major | The reset-token record is not a send target and does not count toward the active connection ID limit. | `AResetTokenForTheOriginalDestinationIsNotTheSendTarget`, `AManagedClientReachesThePlatformListener` | +| BH2-2 | 2026-11-27 | Soak smoke | The listener throws `SocketException` when a peer resets, and disposing a client receive throws `WSACancelBlockingCall`. | Windows reports an unreachable UDP peer and a canceled receive as `SocketException`. | major | The listener stays up. The client loop ends that receive when the socket is closed. | `AResetPeerDoesNotStopTheListener` | +| BH2-3 | 2026-11-27 | 30 minute soak | An abort's close throws `NullReferenceException` inside `Socket.SendToAsync`. | Accepted sessions share the listener socket and flush at the same time. A close can race one send and clear the handle inside the operation. | major | Sends on one socket are serialized. A send that races a close is dropped. | `ThirtyMinutesOfConnectionsStayBounded` | +| BH2-4 | 2026-11-27 | h3spec 0.1.15 | A Handshake packet and a short-header packet with non-zero reserved bits stay open. | Header protection reveals those bits, and the connection treated them as an ordinary packet. | major | A decrypted packet with non-zero reserved bits closes with protocol violation 0x0a. | `ReservedHeaderBitsCloseTheConnection` | +| BH2-5 | 2026-11-27 | h3spec 0.1.15 | A CRYPTO buffer closed with a TLS decode error. Frames on a stream that cannot carry them, and NEW_TOKEN or HANDSHAKE_DONE from a client, left the server open. | The buffer limit used alert 50. Stream direction was not checked. Those two frames had no server rejection. | major | The buffer limit closes with 0x0d. The wrong stream closes with 0x05. The two frames close a server with 0x0a. | `ACryptoOffsetPastTheBufferClosesWithTheBufferError`, `AServerRejectsAClientNewTokenAndHandshakeDone` | + +## What has run + +The in-process network corrupts a datagram and can black-hole every datagram after the handshake. `BytesArriveOnceAndInOrder` sends 256 bytes through delay, reordering, and duplication. `OneCorruptedDatagramIsNotDeliveredAsStreamData` flips one bit of one datagram. `ABlackholeDropsThePayload` sends 32 bytes into a network that drops everything. `AFlippedHandshakeDatagramDoesNotThrow` delivers a bit-flipped Initial and the handshake still completes. An empty datagram is not queued. A DATAGRAM frame closes the connection with protocol violation 0x0a and does not become stream data. Packet and frame seeds already refuse to throw. `MutatedDatagramsDoNotEscapeOrGrowWithoutBound` flips, truncates, inserts, and duplicates a client Initial and a STREAM frame. Nothing throws, and the received stream stays within the mutant. A flipped byte of a sealed stream datagram is discarded and the connection stays open. `AReboundAddressGetsTheReplyWithinTheAmplificationLimit` delivers a stream datagram from a new remote port. The reply uses that port, the path stays unvalidated, and the bytes sent stay within three times the bytes received. Key update is not implemented. A packet the current keys cannot open is discarded. + +On linuxmini, with `TITANIUM_QUIC_PLATFORM_LISTENER=1`, a managed client completes a handshake to a platform listener and both sides exchange 32 bytes. A platform client to the managed listener already exchanges 32 bytes on this PC. A ninth connection ID is rejected and is not kept. Stryker 5.1.0, Standard, Release, four workers, scored twenty-three files. `QuicIdentity.cs` against `QuicIdentityTests` is 52.60 percent: 81 killed, 41 survived, and 32 with no coverage. That file misses 70 percent, and the target is not lowered. `QuicFrames.cs` against the frame and fuzz tests is 78.90 percent: 273 killed, 46 survived, and 27 with no coverage. `QuicVarInt.cs` against `QuicVarIntTests` is 82.09 percent: 55 killed, 12 survived, and none with no coverage. `QuicPacket.cs` against the header, fuzz, Initial, and Retry tests is 70.14 percent: 101 killed, 39 survived, and 4 with no coverage. `QuicPacketNumber.cs` against `QuicPacketNumberTests` is 78.22 percent: 79 killed, 21 survived, and 1 with no coverage. `QuicTransportParameters.cs` against `QuicTransportParameterTests` is 85.43 percent: 170 killed, 21 survived, and 8 with no coverage. `QuicRetry.cs` against `QuicRetryTests` is 87.50 percent: 21 killed, 3 survived, and none with no coverage. The three survivors are the tag-buffer wipe, the rented-buffer return, and a long connection id that still fails because the buffer is empty. `QuicPathMtu.cs` against `QuicPathMtuTests` is 71.21 percent: 47 killed, 16 survived, and 3 with no coverage. The survivors are equality boundaries that store the same value, and the three uncovered mutants are a limit that cannot fall below the confirmed size plus a socket error this host does not throw. `QuicSimulator.cs` against `QuicSimulatorTests` is 73.49 percent: 59 killed, 2 timed out, 21 survived, and 1 with no coverage. The two timeouts are the delivery loop failing to advance, and a timeout counts as detected. The earlier files had no timeouts. `QuicPacketProtection.cs` against `QuicInitialTests` is 83.00 percent: 83 killed, 15 survived, and 2 with no coverage. The two uncovered mutants are the mask-failure returns, which the AES and ChaCha20 masks do not hit. `QuicPacketProtector.cs` against `QuicPacketProtectorTests` is 72.83 percent: 134 killed, 46 survived, and 4 with no coverage. The survivors are secret wiping and length checks that still reject the packet. `ChaCha20Block.cs` against the ChaCha20 tests is 91.67 percent: 54 killed, 1 timed out, 5 survived, and none with no coverage. The timeout is the round loop counting backward. The survivors are the two wipes and three unsigned shifts that match the ordinary shift of a uint. `UdpSocketTransport.cs` against `QuicUdpTransportTests` is 56.67 percent: 34 killed, 18 survived, and 8 with no coverage. That file misses 70 percent, and the target is not lowered. The survivors are await configuration, the address pool, and the Linux reuse-port call on this host. The uncovered mutants are the batch continuation, which this host does not take. `QuicCongestion.cs` against the NewReno and CUBIC tests is 70.19 percent: 113 killed, 38 survived, and 10 with no coverage. The locked windows are 8914 and 9406 bytes. `QuicFlow.cs` against `QuicFlowEdgeTests` is 80.00 percent: 175 killed, 5 timed out, 45 survived, and none with no coverage. The five timeouts are the send loop and the reassembly drain failing to advance, and a timeout counts as detected. The survivors are equality boundaries that store the same limit and drain-loop updates that still deliver the same bytes. `QuicDatagramInject.cs` against `InjectDeliversTheDatagramAndTheCallbackSeesTheReply` is 100.00 percent: 8 killed, 2 timed out, none survived, and none with no coverage. The two timeouts are the reply loop failing to stop, and a timeout counts as detected. `QuicConnectionSession.cs` against `QuicConnectionSessionTests` and `LoopbackConnectsOneBidirectionalStreamAndCloses` is 61.43 percent: 81 killed, 5 timed out, 40 survived, and 14 with no coverage. That file misses 70 percent, and the target is not lowered. The uncovered mutants are the FIPS refusal, which this host does not enter, the already-due timer branch, and the stateless-reset wording. The survivors are equality boundaries and await configuration that still deliver the same bytes. A timeout counts as detected. `QuicConnectionCore.cs` against the core tests and `AStatelessResetClosesWithoutDecrypting` is 77.88 percent: 176 killed, 49 survived, and 1 with no coverage. The uncovered mutant is the handshake-confirmed flag, which these tests do not enter. The survivors are equality and bitwise boundaries that still accept the same datagram. `QuicLossRecovery.cs` against the loss edge tests, `AReorderedPacketIsNotDeclaredLost`, and `PersistentCongestionShrinksTheWindow` is 75.38 percent: 245 killed, 78 survived, and 2 with no coverage. The two uncovered mutants are the persistent-congestion returns these tests do not take. The survivors are equality boundaries in the round-trip update and the loss delay that still time out the same packet. `QuicHandshake.cs` against the handshake, identity, idle, path MTU, flow, campaign, simulator, loss, and connection-core tests is 60.52 percent: 480 killed, 35 timed out, 260 survived, and 76 with no coverage. That file misses 70 percent, and the target is not lowered. The timeouts are loops that fail to advance, and the survivors are equality boundaries that still complete the same handshake. `ManagedQuicConnection.cs` against the connection tests is 71.43 percent: 39 killed, 1 timed out, 16 survived, and none with no coverage. The survivors are an empty server name that the handshake still reads as localhost, and await configuration that still delivers the same stream. `ManagedQuicListener.cs` against the listener and connection tests is 54.35 percent: 78 killed, 22 timed out, 69 survived, and 15 with no coverage. That file misses 70 percent, and the target is not lowered. The timeouts are the accept loop failing to advance, and the survivors are equality boundaries that still accept the same connection. `ManagedQuicStream.cs` against the stream tests is 79.17 percent: 13 killed, 6 timed out, 5 survived, and none with no coverage. The survivors are an empty write and await configuration that still deliver the same bytes. `ManagedQuicOptions.cs` and `AssemblyMarker.cs` produce no mutants. No-coverage mutants stay in the denominator. The `UdpSocketTransport.cs` score above is from before sends on one socket were serialized. h3spec 0.1.15 ran against `QuicInteropHost` on linuxmini at 127.0.0.1:4433 with certificate checks off. The first QUIC section had 30 passes, 13 failures, and one pending 0-RTT case. After BH2-4 and BH2-5, a second run of that section had 41 passes, 2 failures, and the same pending 0-RTT case. A CRYPTO offset past the handshake buffer closes with CRYPTO_BUFFER_EXCEEDED (0x0d). A frame on a send-only stream, a receive-only stream, or a locally initiated stream that has not been created closes with STREAM_STATE_ERROR (0x05). A server that receives NEW_TOKEN or HANDSHAKE_DONE closes with protocol violation 0x0a. A CRYPTO frame in a 1-RTT packet closes with unexpected_message (alert 10). h3spec's Key Update cases now pass. A client that offers only a protocol the server does not support closes with no_application_protocol (alert 120). The QUIC section then had 43 passes, no failures, and one pending 0-RTT case. 0-RTT is not possible on this stack, so that case stays pending. The HTTP/3 section failed because this library does not speak HTTP/3. That layer is a later phase. The public interop runner's handshake case passed: the client downloaded one 1024-byte file. An unknown version of at least 1200 bytes is answered with a Version Negotiation packet that offers version 1. A 1-RTT packet on the handshake path validates that path. Application data that arrives before the handshake finishes is held until the handshake packet arrives, and it is not acknowledged before then. Stream bytes that do not fit the congestion window go out on a later send. The handshake flight leaves the window once the handshake finishes. An application close ends the connection. A probe timeout sends one packet in every space that still has data in flight, and resends a final stream frame that is still unacknowledged. A repeated Initial is answered with the server hello, and that copy does not occupy the congestion window. When the file is still queued, the last byte carries the end of the stream. On linuxmini, one registered client completed the handshake case and all 50 handshake-loss transfers. Other cases exit 127. This stack serves one stream, does not speak HTTP/3, and does not implement retry, resumption, 0-RTT, ChaCha20, version 2, or preferred-address migration. `ThirtyMinutesOfConnectionsStayBounded` ran for 30 minutes and 9 seconds with the default duration and passed. No unexpected exception escaped. In-flight returned to 0. The maximum in flight stayed at the cap of 32. Completed, aborted, and reset connections were all greater than zero. Memory after the drain and dispose stayed within 64 MiB of the post-warmup baseline. Slow-loris, one byte per second, is inside that run. One dropped datagram still closes the receiver with flow-control error 0x03 once the next flight passes the 16384-byte reassembly cap. That limit is recorded and is not a new row. diff --git a/src/Titanium.Quic/design/PHASE-2-SPEC.md b/src/Titanium.Quic/design/PHASE-2-SPEC.md new file mode 100644 index 000000000..3bea8b590 --- /dev/null +++ b/src/Titanium.Quic/design/PHASE-2-SPEC.md @@ -0,0 +1,159 @@ +Phase 2 builds QUIC v1 in `Titanium.Quic` on top of the Phase 1 TLS engine. The proxy still uses `System.Net.Quic`. This spec is the kickoff. It is the task list. Later milestones follow it unless a written reason changes a locked decision. + +## Decisions this kickoff locks + +These follow Part B and Part O. They are not new product choices. + +- QUIC version 1 only. The version field is a number so version 2 can be added later. This phase does not negotiate it. +- The core is sans-IO. `QuicConnectionCore` takes a time and a datagram and returns datagrams and a timeout. `TimeProvider` supplies time. No socket call lives in the core. +- Crypto stays on the caller. The core does not return a `Task` or a `ValueTask`. The UDP driver is the only place that waits. +- Pipes and channels stay banned. Nothing in this phase measures a pipe as faster, so the kickoff does not open that exception. +- The only new managed cipher is the ChaCha20 block used for header protection. AES header protection uses `Aes.EncryptEcb`. Record protection uses the BCL AEAD. +- One shared timer in the driver. The core only reports `NextTimeout`. There is no `Timer` per connection. +- Receive processing and application writes run the core inline under a short per-connection lock. There is no per-connection thread and no queue between the socket and the core. +- Buffers are rented when a datagram arrives and returned when the connection is idle. The 4 KiB idle target is a gate to measure, not a claim. +- Zeroing policy. Pooled buffers that only ever hold ciphertext (drained datagrams, the session and listener receive buffers, staged sealed packets, the sealed packet buffer) are returned without clearing, the same as the platform stack. Pooled buffers that hold plaintext (the decrypted packet, the frame being sealed, the padded plaintext inside `SealLong`) zero only the prefix that was used, then return. `SealLong` clears the padding tail explicitly because a rented array is dirty and QUIC PADDING frames must be `0x00`. +- 0-RTT packets are parsed. This phase does not send or accept early application data. That is Phase 3. +- A Chrome transport-parameter profile is data from a capture. No capture is in the tree yet, so the engine sends a documented layout and the profile task waits. Bytes are not invented. +- `System.Net.Quic` is not used as a listener on this PC. Interop where we are the client of a platform listener runs on `macmini` and `linuxmini`. +- FIPS uses the same fail-closed rule as `TlsStream`. +- NewReno ships first. CUBIC is a later task and becomes the default only after it wins the simulator and the loopback and delay benchmarks. +- UDP offload is a separate project, after the portable socket transport is correct and measured. An offload path that is not faster is not kept. +- Public types stay internal until the public-API task. `PublicAPI.Unshipped.txt` stays empty until then. + +## Core shape + +`QuicConnectionCore.HandleDatagram(DateTimeOffset now, ReadOnlySpan datagram, in PathInfo path)` decrypts, runs frames, and may arm a transmit. `PollTransmit(now, Span destination)` writes one datagram and reports how many bytes were used. `NextTimeout()` and `HandleTimeout(now)` drive loss, PTO, idle, and path probing. The TLS handshake bytes move in CRYPTO frames through `TlsEngine`. There is no TLS record layer on this path. `quic_transport_parameters` is extension 57, which the TLS engine already accepts. Keys are installed per encryption level. + +The driver types are `ManagedQuicListener`, `ManagedQuicConnection`, and `ManagedQuicStream`. They are BCL-shaped and appear in the public-API task, not before it. + +## Tasks + +### T2.1 Variable-length integers + +RFC 9000 section 16. Encode with the shortest form. Decode any legal form, including a longer form than the shortest. A value above 2^62−1 is rejected. A truncated buffer returns false rather than throwing. + +Exit: round trips at 0, 63, 64, 16383, 16384, 2^30−1, 2^30, and 2^62−1, plus a non-minimal encoding and a short buffer. + +### T2.2 Long and short headers + +RFC 9000 section 17.1 and 17.2. Long headers: Initial, 0-RTT, Handshake, Retry. Short headers. Version Negotiation is a first-byte form with version 0. Coalesced packets in one datagram stop at the first short header. Packet-number length comes from the low bits. Connection IDs are bounded by the length byte. A datagram that is not a whole header is rejected, not thrown. + +Exit: fixtures for each long type, a short header, a coalesced Initial plus Handshake, a Version Negotiation packet, and a truncated header. + +### T2.3 Packet numbers + +RFC 9000 Appendix A. Encode the trailing bytes. Decode with the expected next number. A number that does not reconstruct is a protocol error. + +Exit: the appendix examples, plus a reconstruction across a 2-byte boundary. + +### T2.4 Initial secrets and header protection + +RFC 9001 section 5.2 and section 5.4, and RFC 8439 for the ChaCha20 block. The v1 salt is the published salt. AES mask is one `Aes.EncryptEcb` of the 16-byte sample. ChaCha20 uses a managed block whose counter is taken from the sample, because the BCL AEAD starts its counter at 1. One cached `Aes` per header-protection key. + +Exit: RFC 9001 Appendix A sample packets, client and server, for the Initial secret, key, IV, header-protection key, and the protected samples. The ChaCha20 block matches the RFC 8439 block vectors. Header protection is applied and removed on an Appendix A packet. + +### T2.5 Retry integrity + +RFC 9001 section 5.8. The retry integrity tag is checked before a Retry is accepted. A bad tag is discarded. The pseudo-packet layout matches the RFC. + +Exit: the RFC 9001 retry sample, a flipped tag, and a Retry whose original destination connection ID does not match. + +### T2.6 Frames + +RFC 9000 section 12.4 and section 19, plus RFC 9221 DATAGRAM. Parse and write every frame this phase accepts: PADDING, PING, ACK with ECN counts, RESET_STREAM, STOP_SENDING, CRYPTO, NEW_TOKEN, STREAM, MAX_DATA, MAX_STREAM_DATA, MAX_STREAMS, DATA_BLOCKED, STREAM_DATA_BLOCKED, STREAMS_BLOCKED, NEW_CONNECTION_ID, RETIRE_CONNECTION_ID, PATH_CHALLENGE, PATH_RESPONSE, CONNECTION_CLOSE, HANDSHAKE_DONE, DATAGRAM. ACK of ranges is capped. STREAM offsets and lengths are capped. A frame that is illegal in that packet type is a connection error. An unknown frame type is a connection error. + +Exit: one round trip per frame, an ACK with ECN, a STREAM with and without length, a DATAGRAM, an ACK in an Initial (illegal), and a CRYPTO in a 1-RTT packet (legal). + +### T2.7 Transport parameters + +RFC 9000 section 18. Codec and the required checks: `initial_source_connection_id`, `original_destination_connection_id`, `retry_source_connection_id`, `stateless_reset_token`, `preferred_address` parse, `grease_quic_bit`, `max_datagram_frame_size`. A missing required parameter is a transport-parameter error. A duplicate is an error. Grease parameters are ignored. + +Exit: a client and a server parameter list round trip, each missing-required case, a duplicate, and a grease id. + +### T2.8 Connection core + +The four methods above, plus path identity. A datagram for an unknown destination connection ID does not allocate a connection. Anti-amplification is three times the bytes received before the address is validated. The core does not send more than that. + +Exit: a scripted datagram that produces no transmit over the limit, and a timeout that fires from `HandleTimeout` without a socket. + +### T2.9 Handshake over CRYPTO + +Client and server complete a QUIC handshake by feeding CRYPTO bytes to `TlsEngine` and installing packet keys from the TLS secrets at each level. The transport parameters ride in extension 57. Handshake bytes above the TLS cap are a crypto error. The TLS record protector is not used. + +Exit: two in-process cores reach the application level and exchange one STREAM byte. A bad Finished closes the connection. A transport-parameter mismatch closes it. + +### T2.10 Loss recovery + +RFC 9002. RTT samples, time threshold, packet threshold, PTO, persistent congestion. NewReno is the controller behind `ICongestionController`. Pacing uses the shared timeout, not a per-packet timer. An ACK of an unsent packet is `PROTOCOL_VIOLATION`. + +Exit: the simulator drops one packet and it is retransmitted; a reordered packet is not declared lost; persistent congestion shrinks the window; an ACK of an unsent packet closes. + +### T2.11 Identity and address validation + +Connection ID issuance and retirement, stateless reset tokens compared with `FixedTimeEquals`, Retry and NEW_TOKEN, path challenge and response. A retry token that fails integrity is ignored. Retirement of the last active connection ID is an error. + +Exit: a Retry round trip, a NEW_TOKEN used on the next connection, a stateless reset that does not decrypt, and a path challenge that validates a new path. + +### T2.12 Streams and flow control + +Stream state machines, MAX_DATA, MAX_STREAM_DATA, MAX_STREAMS. A flow-control violation is `FLOW_CONTROL_ERROR`. CRYPTO and STREAM reassembly have a byte cap. A gap larger than the cap is an error. Reset and stop-sending are delivered once. + +Exit: a stream that blocks at the credit and resumes, a peer that exceeds the credit, and a reassembly buffer that rejects a huge gap. + +### T2.13 Idle, keep-alive, and migration + +Idle timeout from the transport parameters. A keep-alive is a PING or a PADDING packet under the loss rules, not a private timer. Migration follows a validated path. An unvalidated path does not raise the congestion window. + +Exit: an idle connection times out, a keep-alive prevents it, and a migration before validation does not move the send limit. + +### T2.14 Path MTU discovery + +RFC 8899 and RFC 9000 section 14.3. Start at 1200 bytes. Probe upward with PADDING. Lower the ceiling when the transport reports a tunnel maximum. `Socket.DontFragment` is set where the socket supports it. A probe that is lost shrinks the ceiling. The core never sends a UDP payload above the current ceiling, and never below 1200 once the path is validated, except for the PMTU probes themselves. + +Exit: a simulator MTU of 1400 settles between 1200 and 1400, and a black hole returns the ceiling to 1200. + +### T2.15 UDP transport + +`IUdpPacketTransport`: local endpoint, maximum datagram size, receive, send, optional batch, optional DF and ECN. `UdpSocketTransport` uses `ReceiveFromAsync(Memory, SocketFlags, SocketAddress)`, pooled addresses, and several concurrent receives. `SO_REUSEPORT` is used on Linux when the option exists. `Inject` accepts a datagram and an outbound callback for relays and tunnels. The virtual tuple is what amplification and path validation key on. GSO, GRO, `sendmmsg`, `recvmmsg`, and a portable PMTU socket API are documented gaps, not this task. + +Exit: two loopback sockets exchange one datagram on an ephemeral port. Inject delivers one datagram and the callback sees the reply. No listener is bound to a fixed port. + +### T2.16 Public API + +`ManagedQuicConnection`, `ManagedQuicListener`, `ManagedQuicStream`, and the options and callbacks that the BCL types cannot take because they seal the platform connection. `QuicException` and `QuicError` are the BCL types. Names match the BCL member they stand in for. XML docs on every public member. `PublicAPI.Unshipped.txt` lists exactly those members. + +Exit: a loopback connect, one bidirectional stream, a hash-compared payload, close, and the architecture test still seeing no proxy reference and no P/Invoke. + +### T2.17 Simulator, interop, and negatives + +An in-process network with loss, reordering, duplication, delay, and an MTU. qlog is a debug sink, off by default. Interop with `System.Net.Quic` in both roles runs where a platform listener is allowed. Negative rows go in `TRACEABILITY.md`. Fuzz seeds cover packet and frame parsers and must not throw. + +Exit: the simulator cases from T2.10 through T2.14, one platform interop on a machine that may listen, and a corpus that stays inside the documented errors. + +### T2.18 Benchmarks + +BenchmarkDotNet against `System.Net.Quic`: handshake rate, many small streams, bulk loopback. Report median and the confidence interval. Gates: handshake at least 0.90, small-flow at least 0.90, bulk on the portable path recorded, bulk with offload on Linux at least 0.80 once that project exists. A miss is recorded. The gate is not lowered. Numbers go on `wiki/Performance-Local-Lab.md`. Laptop numbers do not go on `wiki/Performance.md`. + +### Later tasks, not the first milestones + +CUBIC behind `ICongestionController`, default only if it beats NewReno. `Titanium.Quic.UdpOffload` after T2.15 is benchmarked, and only for a measured gain. The Chrome Initial layout when a capture exists. BH-2 at the end of the phase. A whole-library security review and a performance review at the phase gate, then a written report. + +## Self-review + +Checked against Part B and Part O. + +| Rule | How this spec keeps it | +| --- | --- | +| B1, B15 | Version 1 only. No BBR. No QUIC v2 implementation. | +| B2, B4 | ChaCha20 block only. No `Task` in the core. No P/Invoke in this project. | +| B3, O0 | Sans-IO core, one driver timer, inline receive and send. Pipes stay banned. | +| B9, B11 | BCL exception and error types. Public surface delayed. No proxy reference. | +| B12 | Appendix A, RFC 8439, and the simulator are the oracles. The BCL is an interop peer, not the only oracle. | +| B13 | The package README already says experimental. | +| B24 | NewReno first. CUBIC is gated on a measurement. | +| O1 item 2 and 10 | Rent buffers. Short per-connection lock. Shared timeout. | +| O2 QUIC row | The numbers are gates in T2.18. None is claimed here. | +| Test rules | Loopback and ephemeral ports. No platform listener on this PC. No fixed ports from the banned list. | + +No consult. Two limits are recorded so they are not forgotten: the Chrome Initial capture is still absent, and the idle-memory number will be a re-measure after connections exist. diff --git a/src/Titanium.Quic/design/PROGRESS.md b/src/Titanium.Quic/design/PROGRESS.md new file mode 100644 index 000000000..e195e2b1a --- /dev/null +++ b/src/Titanium.Quic/design/PROGRESS.md @@ -0,0 +1,89 @@ +Phase 2 started from the kickoff in `PHASE-2-SPEC.md`. The proxy does not call this library. + +## T2.1 + +Variable-length integers follow RFC 9000 section 16. The shortest encoding is what this stack writes. A longer legal encoding still decodes. A truncated buffer returns false. + +## T2.2 + +Long and short headers follow RFC 9000 section 17. A datagram is a sequence of packets until a short header, a Retry, or a Version Negotiation packet, each of which consumes the rest. A version 1 connection ID longer than 20 bytes is rejected. A Version Negotiation connection ID may be longer, because that packet quotes whatever the peer sent. A truncated header returns false. The header still exposes the truncated packet-number bytes. `QuicPacketNumber` recovers the full value. + +## T2.3 + +Packet numbers follow RFC 9000 Appendix A. The encoder uses the appendix width: 0xac5c02 after an acknowledgment of 0xabe8b3 is two bytes, and 0xace8fe in that same state is three. A 16-bit field of 0x9b32 after 0xa82f30ea decodes to 0xa82f9b32. A two-byte field also reconstructs across 0x10000 in both directions. A candidate left outside the recovery window is rejected, as is a gap that does not fit in four bytes. + +## T2.4 + +Initial secrets use the RFC 9001 salt and `TlsHkdf`. Client and server keys, IVs, and header-protection keys match Appendix A for connection ID `8394c8f03e515708`. AES header protection is one cached ECB encryption of the 16-byte sample. The ChaCha20 block matches the RFC 8439 block vector, and the Appendix A.5 short-header mask uses that block with the counter taken from the sample. Protect and remove are the same exclusive-or, with the packet-number length read after the first byte is uncovered. + +## T2.5 + +The Retry integrity tag is AES-128-GCM over the pseudo-packet: the original destination connection ID length, that connection ID, then the Retry packet without its tag. The published key and nonce match the Expand-Label of the RFC secret. The Appendix A.4 sample verifies. A flipped tag is discarded, and so is a Retry whose original destination connection ID does not match. + +## T2.6 + +Frames follow RFC 9000 section 12.4 and section 19, plus the RFC 9221 DATAGRAM types 0x30 and 0x31. Each accepted frame writes and reads back. An ACK carries ECN counts. A STREAM works with a length and without one, and so does a DATAGRAM. CRYPTO in a 1-RTT packet is legal. RFC 9000 section 17.2.2 allows an ACK in an Initial packet; an ACK in a 0-RTT packet is a protocol violation, and so is a STREAM in an Initial packet. An unknown type is a frame encoding error. ACK ranges are capped at 32. A STREAM whose offset plus length exceeds 2^62−1 is rejected. + +## T2.7 + +Transport parameters follow RFC 9000 section 18, plus `max_datagram_frame_size` (0x20) and `grease_quic_bit` (0x2ab2). A client list and a server list, including a preferred address, round-trip. `initial_source_connection_id` is required from both sides. A server must send `original_destination_connection_id`, and `retry_source_connection_id` only after a Retry. A duplicate is a transport-parameter error. An identifier of the form 31 * N + 27 is ignored. + +## T2.8 + +The core is sans-IO. `HandleDatagram`, `PollTransmit`, `NextTimeout`, and `HandleTimeout` take a time and a datagram. There is no socket and no timer in the core. A datagram whose destination connection ID is not already owned does not allocate a connection. Before the path is validated, bytes sent on that path stay at or below three times the bytes received, including a datagram that is attributed and then discarded. A different path has its own budget. `HandleTimeout` fires the armed deadline with no socket. The one-second deadline was a stand-in; loss recovery now supplies the real one. + +## T2.9 + +A client and a server core complete a QUIC v1 handshake by feeding CRYPTO bytes to `TlsEngine` with datagram transport on. That mode writes the handshake without TLS records, skips the change-cipher-spec byte, and leaves the session id empty. Packet protection is AES-128-GCM with the header protection from T2.4. Initial keys come from the client's first destination connection ID. Handshake and 1-RTT keys come from the TLS traffic secrets, expanded with the QUIC labels. Transport parameters ride in extension 57. The client's first Initial is padded so the server flight fits under the three-times limit. Two cores reach the application level and exchange one STREAM byte. A bad Finished closes with a crypto error. A transport-parameter mismatch closes with a transport-parameter error. Handshake bytes above the TLS cap close with a crypto error. + +## T2.10 + +Loss recovery follows RFC 9002. The initial RTT is 333 ms, so the first probe timeout is that RTT plus four times its variance. A packet is lost when it is three packets behind the largest acknowledgment or older than 9/8 of the RTT, and not before 1 ms. NewReno is the controller behind `ICongestionController`. Its window starts at 12,000 bytes and its floor is 2,400. Persistent congestion, three probe periods with the 25 ms acknowledgment delay included, sets the window to that floor. Pacing shares `NextTimeout` with loss detection; there is still no per-packet timer. A dropped Initial is sent again after the probe timeout. A packet acknowledged three places ahead does not by itself lose the two in between when they were just sent. An acknowledgment of a packet number that was never sent closes with a protocol violation. + +## T2.11 + +Connection IDs, Retry, stateless reset, and path validation follow RFC 9000 sections 5.1, 8.2, 10.3, and 19.15 through 19.18. The initial connection ID is sequence 0. Retiring the last active one closes with a protocol violation. A Retry with a bad integrity tag is ignored. A good Retry changes the destination connection ID, re-derives the Initial keys from that new connection ID, and the next Initial carries the token. A `NEW_TOKEN` is stored and placed on the next connection's first Initial. A stateless reset is the last 16 bytes of a datagram that does not decrypt, compared with `FixedTimeEquals` against every used token, and it enters draining without a `CONNECTION_CLOSE`. A path challenge fills 8 bytes from `RandomNumberGenerator`, pads the datagram to at least 1200 bytes, and a matching response validates that path. + +## T2.12 + +Streams use the peer's initial credit and later MAX_DATA and MAX_STREAM_DATA values. A send that does not fit waits, then continues when the credit grows. Data past the advertised limit closes with FLOW_CONTROL_ERROR (0x03). CRYPTO and STREAM reassembly buffer at most 16,384 bytes of out-of-order data. A larger gap closes CRYPTO with CRYPTO_BUFFER_EXCEEDED (0x0d) and a stream with FLOW_CONTROL_ERROR. RESET_STREAM and STOP_SENDING are delivered once. + +## T2.13 + +The idle timeout is the minimum of the two advertised values, and at least three times the current probe timeout. It shares `NextTimeout` with loss recovery. A silent close discards the connection and sends nothing. A keep-alive is a PING packet, padded so header protection has a sample, and tracked by loss recovery. Receiving it restarts the idle timeout. An acknowledgment on a path that is not validated does not increase the congestion window. + +## T2.14 + +Path MTU discovery starts at 1200 bytes. Probes are padded datagrams. A probe that is acknowledged raises the ceiling. A probe that is lost lowers the search, and a lost probe of the current ceiling returns it to 1200. A reported tunnel maximum lowers the ceiling and never takes it below 1200. Ordinary datagrams on a validated path stay at or below the ceiling. Probes are the packets that may exceed it. `DontFragment` is set on a socket where the platform allows it. + +## T2.15 + +`UdpSocketTransport` binds an ephemeral port and exchanges datagrams with `ReceiveFromAsync` and pooled `SocketAddress` values. Callers overlap receives; four is the overlap the driver is expected to use. Linux sets `SO_REUSEPORT` when that option exists. `DontFragment` is set where the socket supports it. An outgoing ECN codepoint is set only when the socket accepts it, and a received ECN mark is not visible on this receive path. A batch send is one datagram at a time. Generic segmentation, generic receive offload, `sendmmsg`, `recvmmsg`, and a portable path-MTU socket API are not in this task. `QuicDatagramInject` feeds a datagram to a connection on a caller-supplied path and passes each reply to the callback. Amplification and path validation use that path. + +## T2.16 + +`ManagedQuicListener`, `ManagedQuicConnection`, and `ManagedQuicStream` follow the platform connection shape. `QuicException` and `QuicError` are the platform types. The listener callback is `ManagedQuicConnectionOptionsCallback` because the platform connection type is sealed. A loopback listener on an ephemeral port completes a handshake, carries one bidirectional stream, and the payload hash matches after close. The proxy still does not call this library. Unidirectional streams are rejected. FIPS mode refuses the managed stack unless `AllowManagedStackUnderFips` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE` is set. + +## T2.17 + +The in-process network drops, reorders, duplicates, and delays datagrams, and it drops a datagram above its MTU. A dropped Initial is sent again after the probe timeout and the handshake still completes. Reordering and duplication do not close the connection. A delayed datagram is delivered when the clock advances. Idle timeout still fires from that clock. qlog records nothing until it is enabled. Packet and frame seeds do not throw. Negative rows are in TRACEABILITY.md. One platform client completes a handshake to the managed listener. The datagram server selects only TLS_AES_128_GCM_SHA256, which is the packet protection this library installs. The proxy still does not call this library. + +## T2.18 + +BenchmarkDotNet on linuxmini compared this stack with System.Net.Quic. The handshake median ratio is 0.355 and the small-exchange median ratio is 0.306. Both gates are 0.90 and both are missed. The repeated bulk cell is 64 KiB because the stream window is 1 MiB and is not raised; the median ratio is 0.012, and the portable gate is only that the number is recorded. At that run `Titanium.Quic.UdpOffload` did not exist, so the 0.80 Linux offload gate was not measured. The rows are on the local-lab performance page. The proxy still does not call this library. + +## CUBIC + +`QuicCubic` follows RFC 9438 with the window in bytes. A loss keeps 70 percent of the bytes in flight, and the cubic increase is capped at one and a half times the current window. Fast convergence stays off because a connection is one flow. The parameterless connection still constructs `QuicNewReno`. On the in-process network a 64 KiB transfer took the same simulated time for both controllers: 5 ms with no delay, and 720 ms with an 80 ms delay. One dropped datagram at that delay closes the receiver with flow-control error 0x03 for both, because the following flight passes the 16384-byte reassembly cap. CUBIC was not faster, so it is not the default. + +## UDP offload + +`Titanium.Quic.UdpOffload` is the only project that calls `sendmmsg` and `recvmmsg`. A loopback probe has to accept the batch before a connection uses it, and `TITANIUM_UDP_OFFLOAD=0` forces the one-datagram send. Equal-sized datagrams can go out as one segmented send when that probe also accepts the split. A flush of more than one datagram uses the batch. Windows stays on the one-datagram send. The same linuxmini 64 KiB cell, with the batch path on, has platform median 124.8 µs (Error 22.79 µs) and managed median 12.613 ms (Error 5.563 ms). The median ratio is 0.010. The 0.80 gate is missed and is not lowered. The managed row still allocates about 139 MiB. The proxy still does not call this library. + +## BH-2 + +The campaign ledger is `BUG-LEDGER.md`. The in-process network can corrupt one datagram and can drop every datagram after the handshake. Two hundred and fifty-six bytes still arrive once and in order when the network delays, reorders, and duplicates them. A flipped bit is not delivered as stream data. A black hole delivers none of the following payload. A bit-flipped Initial does not throw, and the handshake still completes. An empty datagram is not queued. A DATAGRAM frame closes the connection with protocol violation 0x0a. A datagram that carries more than one QUIC packet is read through the last packet. A fixed-seed mutation of a client Initial and of a STREAM frame does not throw, and a flipped byte of a sealed stream datagram is discarded. A stream datagram that arrives from a new remote port is answered on that port, inside the amplification limit, without marking the path validated. Key update is not implemented. The client sends to the newest connection ID the server has issued, and it accepts eight of those IDs. A ninth is rejected and is not kept. Stryker 5.1.0 scores `QuicIdentity.cs` at 52.60 percent (81 killed, 41 survived, 32 with no coverage), short of 70, and that target stays. `QuicFrames.cs` is 78.90 percent (273 killed, 46 survived, 27 with no coverage). `QuicVarInt.cs` is 82.09 percent (55 killed, 12 survived, none with no coverage). `QuicPacket.cs` is 70.14 percent (101 killed, 39 survived, 4 with no coverage). `QuicPacketNumber.cs` is 78.22 percent (79 killed, 21 survived, 1 with no coverage). `QuicTransportParameters.cs` is 85.43 percent (170 killed, 21 survived, 8 with no coverage). `QuicRetry.cs` is 87.50 percent (21 killed, 3 survived, none with no coverage). `QuicPathMtu.cs` is 71.21 percent (47 killed, 16 survived, 3 with no coverage). `QuicSimulator.cs` is 73.49 percent (59 killed, 2 timed out, 21 survived, 1 with no coverage). `QuicPacketProtection.cs` is 83.00 percent (83 killed, 15 survived, 2 with no coverage). `QuicPacketProtector.cs` is 72.83 percent (134 killed, 46 survived, 4 with no coverage). `ChaCha20Block.cs` is 91.67 percent (54 killed, 1 timed out, 5 survived, none with no coverage). `UdpSocketTransport.cs` is 56.67 percent (34 killed, 18 survived, 8 with no coverage) and misses 70 percent. The target is not lowered. `QuicCongestion.cs` is 70.19 percent (113 killed, 38 survived, 10 with no coverage). `QuicFlow.cs` is 80.00 percent (175 killed, 5 timed out, 45 survived, none with no coverage). `QuicDatagramInject.cs` is 100.00 percent (8 killed, 2 timed out, none survived, none with no coverage). `QuicConnectionSession.cs` is 61.43 percent (81 killed, 5 timed out, 40 survived, 14 with no coverage) and misses 70 percent. The target is not lowered. `QuicConnectionCore.cs` is 77.88 percent (176 killed, 49 survived, 1 with no coverage). `QuicLossRecovery.cs` is 75.38 percent (245 killed, 78 survived, 2 with no coverage). `QuicHandshake.cs` is 60.52 percent (480 killed, 35 timed out, 260 survived, 76 with no coverage) and misses 70 percent. The target is not lowered. `ManagedQuicConnection.cs` is 71.43 percent (39 killed, 1 timed out, 16 survived, none with no coverage). `ManagedQuicListener.cs` is 54.35 percent (78 killed, 22 timed out, 69 survived, 15 with no coverage) and misses 70 percent. The target is not lowered. `ManagedQuicStream.cs` is 79.17 percent (13 killed, 6 timed out, 5 survived, none with no coverage). `ManagedQuicOptions.cs` and `AssemblyMarker.cs` produce no mutants. The `UdpSocketTransport.cs` score is from before sends on one socket were serialized. On linuxmini the managed client finishes a handshake with a platform listener and both sides exchange 32 bytes. The platform peer had ignored the stream because the reset token for the original destination connection ID was chosen as the send target. BH2-1 is fixed. A peer reset no longer stops the listener, and a send that races a close is dropped. BH2-2 and BH2-3 are fixed. `ThirtyMinutesOfConnectionsStayBounded` passed in 30 minutes and 9 seconds. In-flight returned to 0, the maximum stayed at 32, and completed, aborted, and reset connections were all greater than zero. Memory after the drain and dispose stayed within 64 MiB of the post-warmup baseline. Slow-loris, one byte per second, is inside that run. h3spec 0.1.15 on linuxmini now reports 43 QUIC passes, no QUIC failures, and one pending 0-RTT case. 0-RTT is not possible on this stack. BH2-4 and BH2-5 are fixed. A client that offers only an unknown protocol closes with no_application_protocol. The HTTP/3 section fails because HTTP/3 is a later phase. The public interop runner's handshake case passed: the client downloaded one 1024-byte file. An unknown version of at least 1200 bytes is answered with a Version Negotiation packet that offers version 1. A 1-RTT packet on the handshake path validates that path. Application data that arrives before the handshake finishes is held until the handshake packet arrives, and it is not acknowledged before then. Stream bytes that do not fit the congestion window go out on a later send. The handshake flight leaves the window once the handshake finishes. An application close ends the connection. A probe timeout sends one packet in every space that still has data in flight, and resends a final stream frame that is still unacknowledged. A repeated Initial is answered with the server hello, and that copy does not occupy the congestion window. When the file is still queued, the last byte carries the end of the stream. On linuxmini, one registered client completed the handshake case and all 50 handshake-loss transfers. Other cases exit 127. This stack serves one stream, does not speak HTTP/3, and does not implement retry, resumption, 0-RTT, ChaCha20, version 2, or preferred-address migration. + +## Phase 3 + +The kickoff is `src/Titanium.Net.Compatibility/design/PHASE-3-SPEC.md`. The read-only proxy survey is `TWP-TOUCH-MAP.md` beside it. Ten creation sites construct `SslStream`, `QuicConnection`, or `QuicListener`. Four sites branch on the platform type. `QuicClientOptionsAdapter` and `QuicListenerOptionsAdapter` copy the platform option objects. The managed client now applies a keep-alive, an idle timeout, both inbound stream limits, and the stream error used when a stream is released early. A host name, a connection close code, a receive window, a stream-capacity callback, and listener application protocols stay refused. `ProxyServer.UseManagedTlsStack` and `ProxyServer.UseManagedQuicStack` default to false, and assigning a different value after start throws. `TlsStream` calls the client-certificate selection callback when the server requests a certificate, and that certificate replaces the collection. `TcpConnectionFactory`, `ExplicitClientHandler`, both transparent client handshakes, both TLS-terminate handshakes, the MASQUE handshake, the WebTransport client handshake, and the WebTransport origin handshake use a `TlsStream` when `UseManagedTlsStack` is set. The origin helper takes the flag from its caller and defaults to the platform stream. The mirror dispatcher reads the flag when a copy opens TLS and otherwise keeps `SslStream`. `QuicConnectionFactory` resolves the host and connects a `ManagedQuicConnection` when `UseManagedQuicStack` is set. The flag defaults to false, so the factory still calls `QuicConnection.ConnectAsync`. HTTP/3 framing still reads the platform stream, so a request on the managed connection throws. `QuicClientHandler` binds a `ManagedQuicListener` when `UseManagedQuicStack` is set and keeps HTTP/3 on the server authentication options. The flag defaults to false, so the handler still calls `QuicListener.ListenAsync`. An accepted managed connection is closed until HTTP/3 framing can read it. `server.managedStack` sets both flags, and `server.managedTls` and `server.managedQuic` override it. Omit them and the library default stays off. `titanium run --managed-stack` and `TITANIUM_MANAGED_STACK` override the file, and the flag wins. The proxy and gateway charts write `server.managedStack: false`. Startup refuses the managed stacks while FIPS mode is on unless `server.managedStackFipsOverride` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1` is set. With the override the handshake uses FIPS-approved algorithms and logs that fingerprint fidelity is reduced. `TWP_MANAGED_TLS=1` turns both flags on for a new `ProxyServer`. The soft workflow `managed-stack-proxy.yml` runs the existing proxy suites with that variable. `httpClient.fingerprint: chrome` throws `ManagedStackRequiredException` while the managed TLS flag is off, and refuses the handshake while the ClientHello is still the built-in one. The QUIC variable-length integer, the HTTP/3 frame types, the stream types, the error codes, the capsule reader, the SETTINGS payload, the Huffman coding, and the QPACK static and dynamic tables, and the QPACK encoder and decoder, and the HTTP/3 frame byte layout now live in `Titanium.Http3`. The flag defaults to false, so those sites still construct `SslStream`. A server `TlsStream` reports the ClientHello server name from `TargetHostName`. `QuicConnectionFactory` calls `QuicClientOptionsAdapter`. `QuicClientHandler` calls `QuicListenerOptionsAdapter`. `TitaniumHttpHandler` sends HTTP/1.1 and HTTP/2 through an inner handler whose connect callback owns the managed TLS stream. HTTP/3 on that handler throws until the managed QUIC client is connected. A managed connection opens more than one stream. Each stream reads its own bytes, and a peer FIN ends that read. `TitaniumHttpHandler` sends an HTTP/3 request on that connection and reuses it for the same authority until 16 request streams, the idle timeout, or the connection lifetime. The call returns after the response headers, and the body is read as the caller reads it. A GOAWAY on the peer's control stream stops new requests on that connection. The dynamic table is capped at 4096 bytes. Requests use the static table, and a peer insert is decoded. When Alt-Svc is enabled, a later request that allows a higher version uses HTTP/3 after `Alt-Svc: h3` from the same origin. The cache holds 256 origins and honors `ma`. A managed listener can take one datagram from the caller and hand each reply to a callback, without opening a socket. When the managed QUIC stack is on, SOCKS5 UDP ASSOCIATE, CONNECT-UDP, and transparent interception feed a QUIC datagram to that listener. The transparent local address is the origin the client addressed. The reply goes back to the caller. The operator page is `wiki/Managed-TLS-and-QUIC.md`. Inspector still leaves both flags off. Cancelling an HTTP/3 body read stops it while it waits for the next frame. An HTTP redirect is followed by the handler, so an https Location stays on the managed stream. Cookies and decompression stay on the inner handler. A cleartext hop from HTTP/3 still decompresses gzip and sends a cookie stored for that http URI. A Set-Cookie on that hop is stored for the next request. A caller http URI is sent as cleartext, including when it asks for version 3. Cancelling an HTTP/1.1 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/1.1 request stops it while the status line is still waiting. An HTTP/1.1 connection is reused until `PooledConnectionLifetime` elapses. The next request opens another connection. While that connection is busy, `MaxConnectionsPerServer` of 1 keeps the next HTTP/1.1 request waiting. An http request is sent to the configured proxy. The request line is the absolute URI. UseProxy false sends an http request to the origin even when a proxy is set. The request line is the origin path. Changing MaxConnectionsPerServer after the first request throws. An https request opens a CONNECT tunnel to that proxy, then the managed TLS handshake. A proxy that refuses the CONNECT tunnel fails the request before the TLS handshake. An exact HTTP/2 request that the server resets does not fall back to HTTP/1.1. A POST that allows a lower version is not retried after that reset. A POST body is sent when ALPN selects HTTP/1.1 and a lower version is allowed. An exact HTTP/2 request is not retried when ALPN selects HTTP/1.1. A request that starts at HTTP/1.1 and allows a higher version is retried, and the next request reuses that connection. Another port is remembered on its own and still tries a higher version. A certificate in SslOptions.ClientCertificates is presented when the server asks for one. LocalCertificateSelectionCallback chooses which certificate is presented. A certificate without a private key is skipped. SslOptions.TargetHost is the name sent on the handshake, including HTTP/3. The connection still goes to the URI host. QuicOptions.LocalEndPoint is the local UDP address of an HTTP/3 connection. When ConnectTimeout is infinite, QuicOptions.HandshakeTimeout stops a silent HTTP/3 handshake. EnabledSslProtocols that omit TLS 1.3 fail the request before it is sent. An empty SslOptions.TargetHost sends the URI host on an HTTP/3 handshake and on an HTTP/1.1 handshake. Assigning null to SslOptions is rejected. AutomaticDecompression gzip decodes an HTTPS HTTP/1.1 response. An HTTP/3 response with Content-Encoding gzip stays compressed. A direct HTTP/3 request leaves CookieContainer unchanged. An HTTPS HTTP/1.1 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off the request, and Set-Cookie stays out of the container. A Cookie header on a direct HTTP/3 request is sent. A direct HTTP/3 request sends Authorization. An HTTPS HTTP/1.1 request sends Authorization. An HTTPS HTTP/1.1 request sends a caller Host. A direct HTTP/3 request uses the URI as :authority and leaves a caller Host off the request. A caller header is sent on HTTP/3. An HTTP/3 request sends every value of a repeated header. An HTTPS HTTP/1.1 request sends every value of a repeated header. Connection, Upgrade, Keep-Alive, Proxy-Connection, and Transfer-Encoding are left off. An HTTPS HTTP/1.1 request sends a caller header. An HTTP/3 POST sends Content-Type with the body. An HTTPS HTTP/1.1 POST sends Content-Type with the body. An empty HTTP/3 POST sends no DATA frame. An HTTP/3 request keeps the query on :path. An HTTPS HTTP/1.1 request keeps the query. A DATA frame before the response headers fails the request. A truncated HTTP/3 frame fails the request. An unknown HTTP/3 frame before the response headers is skipped. An unknown HTTP/3 frame while the body is read is skipped. An empty DATA frame while the body is read is skipped. An HTTP/3 response with no headers fails the request. An HTTP/3 response Content-Type is available on the response content headers. An HTTP/3 response Content-Length is available on the response content headers. An HTTP/3 response keeps every value of a repeated header. An HTTP/3 404 is returned with its body. An HTTPS HTTP/1.1 404 is returned with its body. A direct HTTP/3 HEAD sends :method HEAD and returns an empty body. An HTTPS HTTP/1.1 HEAD sends the method and returns an empty body. An HTTP/3 204 is returned with an empty body. An HTTPS HTTP/1.1 204 is returned with an empty body. An HTTP/3 request to a host that does not resolve fails before a connection is opened. A completed HTTP/2 400 is retried once over HTTP/1.1 when the request allows a lower version. A completed HTTP/2 421 is retried once over HTTP/1.1 when the request allows a lower version. An exact HTTP/2 request returns a completed 400 and does not open another connection. An HTTP/2 POST returns a completed 400 and does not open another connection. An HTTP/2 HEAD that receives a completed 400 is retried once over HTTP/1.1, and the retry stays HEAD. An HTTP/2 OPTIONS that receives a completed 400 is retried once over HTTP/1.1, and the retry stays OPTIONS. An HTTP/2 TRACE that receives a completed 400 is retried once over HTTP/1.1, and the retry stays TRACE. After an HTTP/2 400 is retried, the next request to that authority uses HTTP/1.1. An exact HTTP/2 request still tries HTTP/2 after that and returns the 400. An HTTP/2 500 is returned and does not open another connection. An HTTP/2 200 returns its DATA frame as the response body. An HTTP/2 response header is available on the response. An HTTP/2 POST body is returned in the response. An HTTP/2 response Content-Type is available on the response content headers. An HTTP/2 response Content-Length is available on the response content headers. An HTTP/2 response keeps every value of a repeated header. An HTTP/2 trailer is available on the response trailing headers. An HTTP/2 302 is followed, and the next hop stays on HTTP/2. An HTTP/2 303 turns POST into GET. An HTTP/2 303 leaves HEAD as HEAD. An HTTP/2 307 keeps POST and sends the body again. An HTTP/2 redirect drops Authorization when the host changes, and the same host keeps it. An HTTP/2 redirect copies a Cookie header only when UseCookies is false. An HTTP/2 redirect leaves a caller Host off, and the next hop's :authority is the URI authority. AllowAutoRedirect false returns an HTTP/2 redirect. MaxAutomaticRedirections stops a longer HTTP/2 chain. An HTTP/2 request keeps the query on :path. An HTTP/2 request sends a caller header. Connection, Upgrade, and Proxy-Connection stay off, and Keep-Alive is sent. An HTTP/2 request joins every value of a repeated header into one comma-separated value. An HTTP/2 POST sends Content-Type with the body. An empty HTTP/2 POST sends an empty DATA frame. An HTTP/2 request leaves Transfer-Encoding off. An HTTP/2 request reuses the connection for the same authority. PooledConnectionLifetime opens another HTTP/2 connection after it expires. A short PooledConnectionIdleTimeout still reuses an HTTP/2 connection. MaxConnectionsPerServer of one carries two in-flight HTTP/2 requests on that connection. AutomaticDecompression gzip returns the decoded HTTP/2 body. A GOAWAY opens another HTTP/2 connection for the next request. An HTTP/2 request presents the client certificate. SslOptions.TargetHost is the server name on an HTTP/2 handshake. An empty SslOptions.TargetHost sends the URI host on an HTTP/2 handshake. A caller Host on a direct HTTP/2 request becomes `:authority` and the host field stays off. The certificate selection callback chooses the HTTP/2 client certificate. An HTTP/2 client certificate without a private key is skipped. An HTTPS HTTP/2 request sends a stored cookie, and a Set-Cookie on that response is stored. UseCookies false leaves that stored cookie off an HTTP/2 request, and Set-Cookie stays out of the container. Cancelling an HTTP/2 body read stops it while the rest of the body is still waiting. Cancelling an HTTP/2 request stops it while the response headers are still waiting. EnabledSslProtocols that omit TLS 1.3 fail an HTTP/2 request before it is sent. ConnectTimeout stops an HTTP/2 request while the TCP peer stays silent. An exact HTTPS HTTP/2 request with a proxy set fails before a connection is opened. UseProxy false sends that HTTP/2 request to the origin. An HTTP/2 request that allows a lower version still fails before a connection when a proxy is set. An exact HTTPS HTTP/3 request with a proxy set still reaches the origin. An HTTP/1.1 request that allows a higher version still fails before a connection when a proxy is set. A proxy that closes before the CONNECT response fails the request before the TLS handshake. A proxy whose CONNECT response fills the header buffer fails the request before the TLS handshake. Credentials on the proxy are left off the CONNECT request. Credentials on the proxy are left off a cleartext request. The request line stays the absolute URI. BypassProxyOnLocal sends an HTTPS request for a loopback origin to that origin. A bypass list entry that matches the origin sends that HTTPS request to the origin while local bypass is off. An entry that does not match still opens a CONNECT tunnel. A cleartext POST sends its body to the proxy. The origin is not contacted. An HTTPS POST sends its body through the CONNECT tunnel. The proxy sees only CONNECT and Host. An HTTPS request through the proxy delivers a caller header to the origin. The CONNECT request leaves that header off. A CONNECT response that includes extra headers still opens the tunnel. A second HTTPS request to the same origin reuses that tunnel. A short pooled connection lifetime opens another CONNECT tunnel for the next HTTPS request. A short idle timeout leaves that tunnel in place. One connection per server keeps a second in-flight HTTPS request on that tunnel. A second origin waits while that request is still outstanding. An HTTP/2 upload of one mebibyte and the download that follows match their hashes. An Alt-Svc entry ends when its ma elapses, and the next request stays on HTTP/1.1. A missing ma lasts 24 hours, and the next request uses HTTP/3. The cache holds 256 origins. A further origin drops expired entries, then replaces the cache when every entry is still live. A 302 with no Location is returned, and the origin is contacted once. In one Alt-Svc header, clear followed by h3 uses the advertised port, and h3 followed by clear drops the entry. An authority with a host and no port uses 443. An IPv6 authority in brackets matches the origin, and a different address leaves the entry in place. A Set-Cookie path limits where that cookie is sent later. A relative Location is resolved against the request path. Disposing the handler again is safe. A later request is rejected, and the origin is not contacted again. An expired Set-Cookie drops the stored cookie, and the next request leaves it off. An exact HTTP/1.0 request is sent as HTTP/1.1. The caller's request version stays 1.0. An HTTP/1.0 request that allows a higher version uses HTTP/2 when the server selects it, and the caller's request version stays 1.0. An HTTPS HTTP/1.1 request with Expect: 100-continue delivers that header and its body. An unseekable HTTPS HTTP/1.1 POST is sent with Content-Length. Transfer-Encoding is left off. With automatic redirects off, that POST uses Transfer-Encoding: chunked and leaves Content-Length off. Deflate decodes an HTTPS HTTP/1.1 response. An HTTPS request to an IPv6 loopback origin reaches that origin and sends Host with the bracketed address and port. A CONNECT tunnel to that origin uses the same bracketed authority. The request inside the tunnel is the absolute http URI. An HTTPS request to an IPv6 address on the default port sends Host in brackets. An international host on that port is sent as punycode. A user name and password in an HTTPS URI stay off the request. Host is the address and port. A cleartext request through a proxy leaves that user info off the absolute URI. The origin is not contacted. An HTTP/3 request to an IPv6 origin sends :authority in brackets. User info stays off that field. An HTTP/3 GET sends :scheme https and the request path. An HTTP/2 GET sends :scheme http, the path, and the address and port as :authority. A fragment on an HTTP/2 request stays off :path. The query stays on that path. A percent-encoded HTTP/2 path and query stay encoded. An HTTPS HTTP/1.1 request keeps that encoding on the request line. A plus in an HTTPS HTTP/1.1 query stays a plus, and %2B stays encoded. A non-ASCII character in an HTTPS HTTP/1.1 path is sent as UTF-8 percent-encoding. An HTTPS HTTP/1.1 request sends a custom method as written. An HTTPS HTTP/1.1 GET sends its body with Content-Length. An HTTPS HTTP/1.1 caller header keeps the case of its name. An empty HTTPS HTTP/1.1 POST sends Content-Length 0 and no body. An HTTPS HTTP/1.1 request sends Connection: close, Upgrade: websocket, Keep-Alive: timeout=5, and Proxy-Connection: keep-alive. An HTTPS HTTP/1.1 request sends Connection: close, x-trace and still sends the named X-Trace header. An HTTPS HTTP/1.1 200 Fine response keeps the reason phrase Fine. An HTTPS HTTP/1.1 response keeps every value of a repeated header. An HTTPS HTTP/1.1 response Content-Type text/plain is available on the response content headers. An HTTPS HTTP/1.1 response header keeps the case of its name. An HTTPS HTTP/1.1 chunked response returns the decoded body and reports Content-Length 2. An HTTPS HTTP/1.1 response with no length returns the body after the TLS close and reports Content-Length 2. An HTTPS HTTP/1.1 response keeps an empty X-Trace value. An HTTPS HTTP/1.1 response trims spaces around a header value. X-Trace is one. An HTTPS HTTP/1.1 request leaves a fragment off the request line. The line is GET /hello?x=1 and the fragment stays #section. An HTTPS HTTP/1.1 response Content-Length is available on the response content headers. The length is 5 and the body is hello. An HTTPS HTTP/1.1 response Content-Type charset is utf-8. The media type stays text/plain. An HTTPS HTTP/1.1 request keeps spaces in a caller header. X-Trace is sent with three spaces before one and one space after it. An HTTPS HTTP/1.1 request sends an empty caller header. The line is X-Trace followed by a colon and a space. An HTTPS HTTP/1.1 request leaves User-Agent off. An HTTPS HTTP/1.1 request sends a caller User-Agent as User-Agent: Titanium. An HTTPS HTTP/1.1 request that receives HTTP/1.0 reports version 1.0. An HTTPS HTTP/1.1 chunked response joins its chunks. The body is abc and Content-Length is 3. An HTTPS HTTP/1.1 chunked response reads a hexadecimal chunk size. A size of a returns 0123456789 and Content-Length is 10. An HTTPS HTTP/1.1 chunked response ignores a chunk extension. A size of 2;ext=1 returns ok and Content-Length is 2. An HTTPS HTTP/1.1 response keeps a comma inside one header value. X-Trace is one, two. An HTTPS HTTP/1.1 request keeps a comma inside one caller header. The line is X-Trace: one, two. An HTTPS HTTP/1.1 response reorders Cache-Control. no-cache, no-store is exposed as no-store, no-cache. An HTTPS HTTP/1.1 response exposes an ETag. The tag is "abc". An HTTPS HTTP/1.1 response with Connection: close opens another connection for the next request. An HTTPS HTTP/1.1 304 returns an empty body. The server sent Content-Length 4. An HTTPS HTTP/1.1 201 returns its body and keeps Location. The request stays on /hello. An unsolicited HTTPS HTTP/1.1 100 Continue is not the response. The caller sees 200 and the body ok. An HTTPS HTTP/1.1 401 returns its body and WWW-Authenticate. The challenge is Basic realm="origin". The request does not send Authorization. An HTTPS HTTP/1.1 response Date is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. An HTTPS HTTP/1.1 response with Content-Encoding identity leaves the body unchanged. The encoding stays identity. An HTTPS HTTP/1.1 206 returns the partial body. Content-Range is bytes 0-4/10. An HTTPS HTTP/1.1 response Retry-After of 120 is a two-minute delta. An HTTPS HTTP/1.1 request leaves Accept off. An HTTPS HTTP/1.1 405 returns its body and Allow. Allow is GET, HEAD. The request stays POST /hello. An HTTPS HTTP/1.1 response Content-Disposition attachment keeps the file name report.txt. An HTTPS HTTP/1.1 request sends If-None-Match: "abc". An HTTPS HTTP/1.1 request sends Range: bytes=0-4. An HTTPS HTTP/1.1 417 is returned. The request carries Expect: 100-continue and the body is not in that header block. An exact HTTPS HTTP/1.0 request is sent as HTTP/1.1. The caller's version stays 1.0. An HTTPS HTTP/1.1 500 returns its body. The body is down. The request stays GET /hello. An HTTPS HTTP/1.1 response Last-Modified is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date stays unset. An HTTPS HTTP/1.1 response Age of 30 is a thirty-second delta. An HTTPS HTTP/1.1 response Server origin/1.0 stays origin/1.0. An HTTPS HTTP/1.1 request sends Referer: https://example.test/from. An HTTPS HTTP/1.1 response Content-Language en stays en. An HTTPS HTTP/1.1 request sends From: ada@example.test. An HTTPS HTTP/1.1 response Vary Accept stays Accept. An HTTPS HTTP/1.1 response Via 1.1 edge stays 1.1 edge. An HTTPS HTTP/1.1 response Content-Location /report stays relative. The caller scheme stays https. An HTTPS HTTP/1.1 response Warning stays 199 - "stale". An HTTPS HTTP/1.1 TRACE sends Max-Forwards: 4. An HTTPS HTTP/1.1 request sends a caller Proxy-Authorization: Basic dTpw. An HTTPS HTTP/1.1 response Pragma no-cache stays no-cache. Cache-Control stays unset. An HTTPS HTTP/1.1 request sends a caller Accept: text/plain. An HTTPS HTTP/1.1 request sends If-Match: "abc". An HTTPS HTTP/1.1 gzip body stays compressed when decompression is off. Content-Encoding stays gzip. Accept-Encoding stays off. An HTTPS HTTP/1.1 response Expires is the parsed instant. Sun, 06 Nov 1994 08:49:37 GMT is 1994-11-06 08:49:37Z. Date and Last-Modified stay unset. An HTTPS HTTP/1.1 response Content-Location https://example.test/report stays that absolute URI. The caller scheme stays https. An HTTPS HTTP/1.1 request sends Accept-Language: en. An HTTPS HTTP/1.1 request sends If-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT. An HTTPS HTTP/1.1 502 returns its body. The body is miss. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps the Link target /style.css with rel stylesheet. An HTTPS HTTP/1.1 request sends TE: trailers. An HTTPS HTTP/1.1 response keeps Upgrade websocket when the caller left it off the request. An HTTPS HTTP/1.1 deflate body stays compressed when decompression is off. Content-Encoding stays deflate. Accept-Encoding stays off. An HTTPS HTTP/1.1 request sends Accept-Charset: utf-8. An HTTPS HTTP/1.1 407 returns the body no and Proxy-Authenticate Basic realm="proxy". The request leaves Proxy-Authorization off. An HTTPS HTTP/1.1 request sends If-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT and leaves If-Modified-Since off. An HTTPS HTTP/1.1 response keeps Accept-Ranges bytes. The request leaves Range off. An HTTPS HTTP/1.1 request sends Forwarded: for=192.0.2.43 and leaves Via off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Origin https://example.test. The request leaves Origin off. An HTTPS HTTP/1.1 412 returns the body no. The request leaves If-Match and If-Unmodified-Since off. An HTTPS HTTP/1.1 request sends Prefer: return=minimal and leaves Preference-Applied off. An HTTPS HTTP/1.1 Retry-After HTTP-date is 1994-11-06 08:49:37Z. The delta stays unset. The Date header stays unset. An HTTPS HTTP/1.1 response keeps Content-Disposition filename* UTF-8''report%20name.txt as the decoded name report name.txt. The plain file name stays unset. The request leaves Content-Disposition off. An HTTPS HTTP/1.1 response keeps a weak ETag. The tag stays the quoted tag abc and the validator stays weak. The request leaves If-None-Match and If-Match off. An HTTPS HTTP/1.1 response keeps Preference-Applied return=minimal when the caller left Prefer off the request. An HTTPS HTTP/1.1 request sends If-Range with the quoted tag abc and leaves Range off. An HTTPS HTTP/1.1 503 returns the body busy. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Accept-Patch application/merge-patch+json. The request leaves Accept-Patch off. An HTTPS HTTP/1.1 request sends Origin https://example.test. The response leaves Access-Control-Allow-Origin off. An HTTPS HTTP/1.1 Cache-Control max-age=60 is a sixty-second max age. No-cache and no-store stay off. Pragma stays empty. The request leaves Cache-Control off. An HTTPS HTTP/1.1 response keeps Content-MD5 REvLOj/Pg4kpbElGfyfh1g==. The request leaves Content-MD5 off. An HTTPS HTTP/1.1 response keeps X-Content-Type-Options nosniff. Content-Type stays unset. The request leaves X-Content-Type-Options off. An HTTPS HTTP/1.1 504 returns the body late. Retry-After stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Server-Timing app;dur=12. The request leaves Server-Timing off. An HTTPS HTTP/1.1 request sends Priority u=1. The response leaves Priority off. An HTTPS HTTP/1.1 request sends Cache-Control no-cache and leaves no-store off. The response leaves Cache-Control off. Pragma stays empty. An HTTPS HTTP/1.1 response keeps Referrer-Policy no-referrer. The request leaves Referer and Referrer-Policy off. An HTTPS HTTP/1.1 409 returns the body clash. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps X-Frame-Options DENY. The request leaves X-Frame-Options off. An HTTPS HTTP/1.1 response keeps Strict-Transport-Security max-age=31536000. Cache-Control stays unset. The request leaves Strict-Transport-Security off. An HTTPS HTTP/1.1 request sends Save-Data on. The response leaves Save-Data off. An HTTPS HTTP/1.1 response keeps Permissions-Policy camera=(). The request leaves Permissions-Policy off. An HTTPS HTTP/1.1 response keeps Accept-CH Sec-CH-UA. The request leaves Accept-CH and Sec-CH-UA off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Embedder-Policy require-corp. The request leaves Cross-Origin-Embedder-Policy and Origin off. An HTTPS HTTP/1.1 410 returns the body gone. Location stays unset. The request stays GET /hello. An HTTPS HTTP/1.1 response keeps Content-Security-Policy default-src 'none'. The request leaves Content-Security-Policy off. An HTTPS HTTP/1.1 response keeps Clear-Site-Data "cache". The request leaves Clear-Site-Data off. An HTTPS HTTP/1.1 response keeps Timing-Allow-Origin *. Server-Timing stays off. The request leaves Timing-Allow-Origin off. An HTTPS HTTP/1.1 response keeps Origin-Agent-Cluster ?1. The request leaves Origin-Agent-Cluster and Origin off. An HTTPS HTTP/1.1 response keeps X-DNS-Prefetch-Control off. The request leaves X-DNS-Prefetch-Control off. An HTTPS HTTP/1.1 request sends DNT 1. The response leaves DNT and Tk off. An HTTPS HTTP/1.1 response keeps Accept-Post application/json. The request leaves Accept-Post off. An HTTPS HTTP/1.1 response keeps Service-Worker-Allowed /. The request leaves Service-Worker-Allowed off. An HTTPS HTTP/1.1 response keeps Supports-Loading-Mode credentialed-prerender. The request leaves Supports-Loading-Mode off. An HTTPS HTTP/1.1 response keeps X-Robots-Tag noindex. The request leaves X-Robots-Tag off. An HTTPS HTTP/1.1 request sends Sec-Fetch-Dest document. Sec-Fetch-Mode and Sec-Fetch-Site stay off. The response leaves Sec-Fetch-Dest off. An HTTPS HTTP/1.1 response keeps Reporting-Endpoints default="https://example.test/reports". Report-To stays off. The request leaves Reporting-Endpoints off. An HTTPS HTTP/1.1 response keeps Refresh 5. Location stays unset. The request leaves Refresh off. An HTTPS HTTP/1.1 response keeps Document-Policy force-load-at-top. The request leaves Document-Policy and Require-Document-Policy off. An HTTPS HTTP/1.1 request sends Sec-CH-Prefers-Color-Scheme dark. Sec-CH-Prefers-Reduced-Motion stays off. The response leaves Sec-CH-Prefers-Color-Scheme off. An HTTPS HTTP/1.1 response keeps X-XSS-Protection 0. The request leaves X-XSS-Protection off. An HTTPS HTTP/1.1 response keeps X-Permitted-Cross-Domain-Policies none. The request leaves X-Permitted-Cross-Domain-Policies off. An HTTPS HTTP/1.1 response keeps X-Download-Options noopen. The request leaves X-Download-Options off. An HTTPS HTTP/1.1 request sends Want-Digest sha-256. Content-Digest stays off the response. The request leaves Content-Digest off. An HTTPS HTTP/1.1 response keeps Sunset Sun, 06 Nov 1994 08:49:37 GMT. Date stays unset. The request leaves Sunset off. An HTTPS HTTP/1.1 request sends A-IM identity. IM stays off the response. The request leaves IM off. An HTTPS HTTP/1.1 request sends Upgrade-Insecure-Requests 1. Upgrade stays off the response. The request leaves Upgrade off. An HTTPS HTTP/1.1 response keeps Cross-Origin-Opener-Policy same-origin. Cross-Origin-Embedder-Policy stays off. The request leaves Cross-Origin-Opener-Policy and Origin off. An HTTPS HTTP/1.1 response keeps CDN-Cache-Control no-store. Cache-Control stays unset. The request leaves CDN-Cache-Control and Cache-Control off. An HTTPS HTTP/1.1 response keeps Access-Control-Allow-Methods GET. Access-Control-Allow-Origin stays off. The request leaves Access-Control-Allow-Methods and Origin off. An HTTPS HTTP/1.1 response keeps X-UA-Compatible IE=edge. The request leaves X-UA-Compatible off. An HTTPS HTTP/1.1 request sends ECT 4g. RTT and Downlink stay off. The response leaves ECT off. An HTTPS HTTP/1.1 request sends Service-Worker script. Service-Worker-Allowed stays off the response. The request leaves Service-Worker-Allowed off. A one-mebibyte upload and download round-trip keeps its SHA-256. The sample is `samples/HttpClientManagedStack`. A request inserts a field that is not in the static table when the peer allows a dynamic table and at least one blocked stream. `ConnectTimeout` bounds a silent TCP handshake and a silent HTTP/3 handshake. A one-mebibyte HTTP/3 upload and download keeps its SHA-256. Reading stream data opens the receive window. A HEADERS frame after an HTTP/3 body is applied to the response trailers while that read runs. An HTTP/3 connection idle past `PooledConnectionIdleTimeout` is not reused. A connection older than `PooledConnectionLifetime` is not reused even when it has no idle timeout. The 17th request on one HTTP/3 connection opens another connection. With `MaxConnectionsPerServer` at 1, that request waits until the busy connection finishes. Each finished request returns its in-flight place. A GOAWAY closes that HTTP/3 connection once nothing is in flight. A failed HTTP/3 connect, before any request byte, falls back to the adapter when the request allows a lower version. The same fallback runs when an Alt-Svc upgrade fails. After the server selects HTTP/1.1, the next request to that authority reuses that choice. `Alt-Svc: clear` drops the cached HTTP/3 port. An Alt-Svc host other than the origin is ignored. A redirect drops Authorization when the host changes, including on HTTP/3. The same host keeps it. A 300 or 302 turns POST into GET, including on HTTP/3. An HTTP/3 redirect to an http URL is fetched as HTTP/1.1. A later https hop returns to HTTP/3. Cancelling the request stops an HTTP/3 redirect while the next hop is waiting. A 303 turns POST into GET and leaves HEAD as HEAD. `MaxAutomaticRedirections` stops a longer chain, including an HTTP/3 chain. `AllowAutoRedirect` false returns the redirect response, including an HTTP/3 response. A redirect copies a `Cookie` header only when `UseCookies` is false, including on HTTP/3. It does not copy `Host`, including on HTTP/3, where the next hop's `:authority` is the URI authority. An HTTP/3 redirect is followed on that connection. A 307 POST sends the same body on the next hop, including a cleartext hop. A 303 on HTTP/3 turns POST into GET and leaves HEAD as HEAD. A 301 on HTTP/3 turns POST into GET, and a 308 sends the same body again. A 307 keeps the method and body. A 301 turns POST into GET. A 308 keeps the method and body. `EnableAltSvc` is read. A later request that allows a higher version uses HTTP/3 after `Alt-Svc: h3` from the same origin. Single-header HTTPS HTTP/1.1 cases stop at Service-Worker script. An HTTP/3 GET and an HTTP/3 POST against a loopback Kestrel listener, which uses the platform QUIC stack, return the body on linuxmini when `TITANIUM_QUIC_PLATFORM_LISTENER` is 1 and `libmsquic` from `/opt/titanium-inspector` is on the loader path. That listener is not started on Windows. When `FingerprintProfile` is set, the TCP ClientHello is the profile's hello. Its JA4 matches a hello from that profile for the same server name and ALPN, for HTTP/1.1 and for HTTP/2. An HTTPS HTTP/1.1 GET with the Chrome profile completes against loopback Kestrel. A profile hello can negotiate `TLS_AES_256_GCM_SHA384` or `TLS_CHACHA20_POLY1305_SHA256` as well as `TLS_AES_128_GCM_SHA256`. QUIC still sends the short hello. The HTTP/1.1 comparison against `SocketsHttpHandler` was measured in Release on this PC, with a pooled connection and the body read, outside the benchmark project. A small GET was about 66 to 69 percent of the platform request rate and about 2.2 to 2.3 times the allocated bytes. A 64 KiB body was about 68 to 85 percent of the platform request rate and about 1.02 times the allocated bytes. That sample checked the operating-system FIPS flag before the allow flag, so every request read the registry. The handler now checks the allow flag first. A re-measure was 5623.7 requests per second and 941544 bytes against 6621.2 and 495144 for a small GET, about 85 percent of the request rate and 1.90 times the bytes, and 3126.9 against 3642.1 with 10960928 against 10786608 bytes for a 64 KiB body, about 86 percent of the request rate and 1.02 times the bytes. The managed small-GET rate stayed about 5600 requests per second. Cloning the inner request costs about 1.3 microseconds and 1112 bytes, so it does not explain the rate gap. A one-record `WriteAsync` now protects and writes on the calling thread when the write lock is free. A re-measure after that was 5860.6 requests per second and 941544 bytes against 6981.7 and 495144 for a small GET, about 84 percent of the request rate and 1.90 times the bytes, and 3438.5 against 3640.3 with 10929104 against 10752088 bytes for a 64 KiB body. Reading a record already waiting in the socket, then falling back when the record was incomplete, measured 5657.0 requests per second and 959432 bytes against 6649.3 and 495144 for a small GET. That path was removed. On one reused connection, a cleartext GET was 8208.4 requests per second, platform HTTPS was 6560.0, and the managed handler was 4941.3. The timed loops opened no further connection. The gap is about 50 microseconds per request on that connection, above the platform TLS cost of about 30 microseconds over cleartext. The receive buffer now stays for the next record and only the bytes just read are cleared. A record with no alert does not enter the alert writer. A re-measure on that pooled GET was 5660.8 managed requests per second against 6797.0 platform, about 83 percent, and the timed loops opened no further connection. The response read now waits on the socket inside the one read method. A later pooled GET was 7078.5 against 8220.5, about 86 percent, again with no further connection. A plain HTTP/1.1 request is now sent from the handler entry point, so that call does not pass through another async method. A re-measure on that pooled GET was 7177.5 managed requests per second and 835432 bytes against 8916.7 and 518360, about 80 percent and 1.61 times the bytes, with no further connection. The platform sample was faster than the 8220.5 run, and the managed rate stayed near 7200. Taking a complete application record outside the handshake loop measured 6812.3 against 8333.0 with the same byte counts and was removed. The 90 percent gate is not met. Copying a small application record straight into the caller buffer measured 7051.8 managed requests per second and 835432 bytes against 8184.0 and 518072, about 86 percent and 1.61 times the bytes, with no further connection, and that copy was removed. The 90 percent gate is still not met. A 64-byte echo is 34.81 microseconds on the managed stream and 30.70 on the platform stream, and one AES-GCM open of 180 bytes is 0.20 microseconds. On one pooled GET the inner send was 157.3 microseconds against a platform request of 156.3, with one write and one read, and building the inner request was 10.8 microseconds. Caching the rewritten URI brought that build to 8.4 microseconds on the next sample, where the managed request was 186.9 microseconds against 156.4. A plain HTTP/1.1 send now uses a small method of its own, the rewritten host is cached with the URI, and an empty header set is not copied. Samples after the small method were 177.1 microseconds against 157.8 (89.1 percent), 177.2 against 163.9 (92.5 percent), and 159.5 against 146.7 (92.0 percent). After the host cache, a sample was 158.5 against 146.7 (92.5 percent). A run that also counted allocations was 165.2 microseconds and 711424 bytes against 148.4 and 492840, 89.8 percent and 1.44 times the bytes. A pooled headerless HTTPS request now keeps that prepared inner message when the next request matches the origin, method, and version, and a plain HTTP/1.1 choice skips the ALPN authority string. Five samples were 151.4 microseconds against 146.6 (96.8 percent, 494440 bytes against 492840), 154.5 against 146.3 (94.7 percent, 494440 against 528200), 161.0 against 159.5 (99.1 percent, 529992 against 492992), 167.6 against 162.0 (96.7 percent, 528936 against 492992), and 160.7 against 158.3 (98.5 percent, 494440 against 492840). Those HTTP/1.1 samples sit above 90 percent. The warmup body was ok. Chrome GET, a cross-scheme redirect, the query, the bracketed IPv6 host, a POST content type, tunnel reuse, a caller header through a tunnel, an HTTP/2 origin request, and an HTTP/2 retry after ALPN selected HTTP/1.1 passed. On linuxmini at c2b34a92, with `TITANIUM_QUIC_PLATFORM_LISTENER` set and libmsquic on the library path, the Kestrel HTTP/3 GET and POST and the proxy listener GET and POST passed, and the governor stayed powersave. The first client Initial was 4096 bytes. macOS MsQuic did not answer that datagram: a loopback capture showed 4096 bytes out and nothing back, while a platform HTTP/3 client on the same machine completed with datagrams of about 1220 bytes. The first Initial and an Initial retransmission are now padded to 1200 bytes. With that local change, macmini Kestrel GET and POST passed in 949 ms, and linuxmini Kestrel GET and POST passed again. The proxy listener tests on macOS failed while the test CA loaded a PKCS12 with EphemeralKeySet, which that platform rejects. Windows still sets that flag. With the flag omitted on macOS, the proxy GET and POST passed on macmini in 1 s, and linuxmini passed them again. Both remotes were returned to a clean c2b34a92 tree. The Windows unit job still returns before it would bind the platform listener. `.github/workflows/handler-platform-http3.yml` runs the Kestrel GET and POST and the proxy listener GET and POST on Ubuntu and macOS with `TITANIUM_QUIC_PLATFORM_LISTENER` set. Draft pull request 1331 ran that workflow. On Ubuntu, Kestrel GET and POST passed in 1 s and the proxy listener passed in 1 s. On macOS, Kestrel GET and POST passed in 1 s and the proxy listener passed in 3 s. The five libraries and Titanium.Quic.UdpOffload pack to 0.1.0-preview.1 with a readme, an icon, a symbols package, and a repository URL. Source Link maps the TLS pdb to this repository. `tools/managed-stack/pack-and-build-samples.ps1` built HttpClientManagedStack, TlsStreamEcho, and QuicEcho from that local feed. TlsStreamEcho and QuicEcho each printed ok. The packages are not published. `.github/workflows/managed-package-feed.yml` repeats that pack on Ubuntu. The same pack and both echo programs printed ok on linuxmini and on macmini. linuxmini stayed on powersave. Both remotes were returned to a clean 3bd067d1 tree. The website page is `website/docs/managed-stack.md`. Ubuntu CI job local-feed on pull request 1331 packed the six packages and both echo programs printed ok in 50 s. Transparent QUIC injection passed 2 tests in 366 ms. SOCKS5 UDP ASSOCIATE and CONNECT-UDP each answered a long header and left the plain datagram on the relay, 2 tests in 2 s. The platform path stays the default. Inspector still leaves both flags off. That default waits on the end-to-end throughput comparison, which has not been run. The wiki limits now list the RSA-PSS schemes. `UpstreamTlsTests.AcceptAnyServerCertificate_StillWorksOnTcp` returned 200 against its RSA-2048 origin with `TWP_MANAGED_TLS=1` in 4 s, and the same test without that variable returned 200 in 4 s. The flag unit tests passed, 6 in 362 ms. CLI help tests passed, 9 in 1 s. The root README, the CLI help, the chart notes, and the website pages state that the stacks stay off and are not a FIPS-validated module. The pack script now checks the strong name, the MIT license expression, the readme, the icon, the symbols package, Source Link, the PublicAPI files, and the package dependencies. A local run printed packages ok, then both echo programs printed ok. The TLS handshake corpus passed in 480 ms. `fuzz-nightly.yml` runs that corpus on Ubuntu, Windows, and macOS. `tools/packaging/smoke/cli-managed-stack.ps1` starts the CLI with `--managed-stack` and a loopback reverse proxy. It printed managed-stack smoke ok twice, in about 9 s and 7 s. The smoke matrix coverage tests passed, 2 in 729 ms. `product-smoke.yml` runs that script on Ubuntu, Windows, and macOS, and a pull request run stays advisory. `fuzz-nightly.yml` also runs `QuicFuzzTests` on those three systems. That test passed twice, in 73 ms and 56 ms. `soak.yml` has a separate job for the existing 30 minute TLS and QUIC tests. That job does not set `TITANIUM_SOAK_SECONDS`, and it has not been started. The pull-request and release unit jobs now pass `TestCategory!=Slow` for the TLS and QUIC projects. Listing tests showed the two 30 minute methods only under `TestCategory=Slow`. The TLS corpus and the QUIC fuzz test still match the unit filter: the corpus passed again, and `QuicFuzzTests` passed again. The handshake sample of 10,000 stays out of the nightly file until a runner has OpenSSL 3.5. tlsfuzzer `test-tls13-conversation.py` ran against a loopback TLS 1.3 probe. All three sanity attempts failed: the script's first record is version `0x0300`, and the probe answers with alert 10. OpenSSL 3.5.9 sends record version `0x0301` and completes with `TLS_AES_256_GCM_SHA384`. That failure is recorded with this reason. TLS-Anvil's feature scan of the same probe reported TLS 1.3, groups X25519, secp256r1, and secp384r1, and ciphers `TLS_AES_128_GCM_SHA256`, `TLS_AES_256_GCM_SHA384`, and `TLS_CHACHA20_POLY1305_SHA256`. The scan took about 4.5 minutes. A strength-1 run of 27 RFC 8446 templates was stopped during the first template, so those templates have no pass or fail result. The state-machine package scheduled one server template, `sendEmptyRecordFinished`. The first run failed all 14 cases in 7 minutes 44 seconds because the handshake held the write lock and then waited on that same lock to flush the alert, so the socket stayed open. After the handshake writes that alert without taking the lock again, a strength-1 re-run scored the template STRICTLY_SUCCEEDED in under a second. The five cases still say the tool did not parse a fatal alert, and the probe log shows local alert 10. That score is not a clean pass. A metadata tag scheduled 0 templates. h3spec 0.1.15 against the loopback HTTP/3 probe reported 86 examples, 77 failures, and 5 pending in 164 seconds. Four transport checks passed. The probe answers a request with status 200 and does not implement the connection errors the other cases require. The quic-go interop client completed the handshake case against the loopback HTTP/0.9 server. It downloaded a 64-byte file, then that file and a 1000-byte file, and both runs exited 0. The full interop runner matrix is not this job. The BoGo shim completed a TLS 1.3 server slice against BoringSSL a003590712db258f80de823b660ee788589c98cf: 49 passed, 248 failed, and 7821 exited 89. Thirteen of the failures are handshakes the runner expected the server to reject. The 10,000-handshake sample stays out until a runner has OpenSSL 3.5, and it was not run. The RPS comparison and the Inspector default stay out until the user asks for that gate. `mutation.yml` still names only the configuration project. These workflow edits are on origin/feat/managed-tls-quic-stack at 469dd8b0. linuxmini and macmini fast-forwarded, and linuxmini is powersave. An Inspector default-on leg is not added. An HTTP/3 GET and an HTTP/3 POST from the handler reach the proxy platform HTTP/3 listener on linuxmini when `TITANIUM_QUIC_PLATFORM_LISTENER` is 1. The first attempt closed with peer transport `0x128` frame `0x0`, TLS alert 40, because the short hello offered only `ecdsa_secp256r1_sha256` and the proxy leaf is RSA-2048. The short hello now also offers `ecdsa_secp384r1_sha384`, `rsa_pss_rsae_sha256`, and `rsa_pss_rsae_sha384`, and a selected cipher must be one that hello offered. That listener is not started on Windows, and the test returns before it would bind. diff --git a/src/Titanium.Quic/design/TRACEABILITY.md b/src/Titanium.Quic/design/TRACEABILITY.md new file mode 100644 index 000000000..a63741032 --- /dev/null +++ b/src/Titanium.Quic/design/TRACEABILITY.md @@ -0,0 +1,17 @@ +Rows are `RFC | section | requirement | test id | status`. A test id is `Class.Method`. These are the negative and simulator rows for the QUIC stack. + +| RFC | Section | Requirement | Test id | Status | +| --- | --- | --- | --- | --- | +| RFC 9000 | 12.4 | A truncated header or varint does not throw | QuicFuzzTests.PacketAndFrameSeedsDoNotThrow | negative | +| RFC 9000 | 12.4 | An unknown frame type is a frame encoding error | QuicFrameTests.UnknownTypeAndNonMinimalTypeAndEmptyPayloadAreErrors | negative | +| RFC 9000 | 17.2 | A truncated or oversized header is rejected | QuicPacketHeaderTests.TruncatedAndOversizedHeadersAreRejected | negative | +| RFC 9000 | 13.2.3 | An acknowledgment of a packet that was never sent closes the connection | QuicLossTests.AnAckOfAnUnsentPacketCloses | negative | +| RFC 9000 | 4.6 | Data past the advertised limit closes with a flow-control error | QuicFlowTests.APeerThatExceedsTheCreditClosesTheConnection | negative | +| RFC 9000 | 7.5 | A reassembly gap above the cap is rejected | QuicFlowTests.AHugeReassemblyGapIsRejected | negative | +| RFC 9001 | 5.8 | A Retry with a bad integrity tag is ignored | QuicIdentityTests.ARetryWithABadTagIsIgnored | negative | +| RFC 9000 | 10.1 | An idle connection times out | QuicIdleTests.AnIdleConnectionTimesOut | negative | +| RFC 9002 | 6.2 | A dropped datagram is retransmitted and the handshake still completes | QuicSimulatorTests.ADroppedDatagramIsRetransmittedAndTheHandshakeCompletes | pass | +| RFC 9002 | 6.2 | Reordered datagrams are not treated as a failed handshake | QuicSimulatorTests.ReorderedDatagramsStillCompleteTheHandshake | pass | +| RFC 9002 | 6.2 | A duplicated datagram does not close the connection | QuicSimulatorTests.ADuplicatedDatagramDoesNotCloseTheConnection | pass | +| RFC 9000 | 14.3 | A datagram above the simulator MTU is dropped and one at 1200 is delivered | QuicSimulatorTests.AnMtuOf1400DropsTheOversizedDatagram | pass | +| RFC 9000 | 14.3 | A path MTU of 1400 settles between 1200 and 1400, and a black hole returns the ceiling to 1200 | QuicPathMtuTests.APathOf1400SettlesBetween1200And1400 | pass | diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk-offload.md b/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk-offload.md new file mode 100644 index 000000000..0fef17007 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk-offload.md @@ -0,0 +1,3 @@ +linuxmini, 2026-11-27, after `sendmmsg` was accepted by the loopback probe. Same host, SDK, runtime, and BenchmarkDotNet job as `linuxmini.md`. The full exporter file was removed by the runner's artifact cleanup, so this note records the summary table. + +64 KiB loopback, 8 KiB writes. Platform median 124.767 µs, Error 22.79 µs. Managed median 12.613 ms, Error 5.563 ms. Ratio 0.010, which is the platform median divided by the managed median. The 0.80 gate is missed and is not lowered. Allocated on the managed row: 142598.59 KB. The CPU governor was performance for the timed job and powersave afterwards. diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk.json b/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk.json new file mode 100644 index 000000000..bda26e1e5 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini-bulk.json @@ -0,0 +1,970 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261127-093814", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 162653,170777,155249,157574,138578,127848,128149,131846,163124 + ], + "N":9, + "Min":127848, + "LowerFence":85635.5, + "Q1":131846, + "Median":155249, + "Mean":148422, + "Q3":162653, + "UpperFence":208863.5, + "Max":170777, + "InterquartileRange":30807, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":5596.049375328198, + "Variance":281841917.5, + "StandardDeviation":16788.148125984593, + "Skewness":-0.09939737798759263, + "Kurtosis":1.090544414598095, + "ConfidenceInterval":{ + "N":9, + "Mean":148422, + "StandardError":5596.049375328198, + "Level":12, + "Margin":28211.394105917974, + "Lower":120210.60589408202, + "Upper":176633.39410591798 + }, + "Percentiles":{ + "P0":127848, + "P25":131846, + "P50":155249, + "P67":159402.44, + "P80":162841.4, + "P85":163029.8, + "P90":164654.59999999998, + "P95":167715.8, + "P100":170777 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":84960 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":191226 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":12878506 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2754894 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1369647 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":162733 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170857 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":155329 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":157654 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":138658 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":127928 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":128229 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":131926 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":163204 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":162653 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170777 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":155249 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":157574 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":138578 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":127848 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":128149 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":131846 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":163124 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":84960, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 7677621.5,8821929.5,8988890.5,13236892.5,14661823.5,11789249.5,12978662.5,13800731.5,13382143.5,17627199.5 + ], + "N":10, + "Min":7677621.5, + "LowerFence":3678323.875, + "Q1":9688980.25, + "Median":13107777.5, + "Mean":12296514.4, + "Q3":13696084.5, + "UpperFence":19706740.875, + "Max":17627199.5, + "InterquartileRange":4007104.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":962672.1652284039, + "Variance":9267376977055.434, + "StandardDeviation":3044236.6821677047, + "Skewness":-0.022196613210682673, + "Kurtosis":1.8244834545224768, + "ConfidenceInterval":{ + "N":10, + "Mean":12296514.4, + "StandardError":962672.1652284039, + "Level":12, + "Margin":4602451.469601335, + "Lower":7694062.930398665, + "Upper":16898965.869601335 + }, + "Percentiles":{ + "P0":7677621.5, + "P25":9688980.25, + "P50":13107777.5, + "P67":13394701.14, + "P80":13972949.9, + "P85":14360441.3, + "P90":14958361.1, + "P95":16292780.299999997, + "P100":17627199.5 + } + }, + "Memory":{ + "Gen0Collections":28, + "Gen1Collections":28, + "Gen2Collections":28, + "TotalOperations":1, + "BytesAllocatedPerOperation":142577064 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":148266 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":11245218 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":11555465 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7677742 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":8822050 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":8989011 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":13237013 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":14661944 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":11789370 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":12978783 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":13800852 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":13382264 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":17627320 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7677621.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":8821929.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":8988890.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":13236892.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":14661823.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":11789249.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":12978662.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":13800731.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":13382143.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":17627199.5 + } + ], + "Metrics":[ + { + "Value":28000, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":28000, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":28000, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":142577064, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini-handshake.json b/src/Titanium.Quic/design/perf-baselines/linuxmini-handshake.json new file mode 100644 index 000000000..d03c26b08 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini-handshake.json @@ -0,0 +1,977 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261127-093814", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1546140.1,1660140.3,1587665.3,1533680.9,1547127.9,1619183.9,1658569.1,1534624.7,1564317.7,1551041.3 + ], + "N":10, + "Min":1533680.9, + "LowerFence":1449011.250000001, + "Q1":1546387.0500000003, + "Median":1557679.5, + "Mean":1580249.1199999999, + "Q3":1611304.2499999998, + "UpperFence":1708680.0499999989, + "Max":1660140.3, + "InterquartileRange":64917.19999999949, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":15529.56710234313, + "Variance":2411674543.8617806, + "StandardDeviation":49108.803119825476, + "Skewness":0.6322671195207162, + "Kurtosis":1.599846136739851, + "ConfidenceInterval":{ + "N":10, + "Mean":1580249.1199999999, + "StandardError":15529.56710234313, + "Level":12, + "Margin":74245.5027932523, + "Lower":1506003.6172067476, + "Upper":1654494.622793252 + }, + "Percentiles":{ + "P0":1533680.9, + "P25":1546387.0500000003, + "P50":1557679.5, + "P67":1588610.858, + "P80":1627060.94, + "P85":1644784.28, + "P90":1658726.22, + "P95":1659433.2600000002, + "P100":1660140.3 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":110682 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":164045 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":74120026 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":321 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":240 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":9971178 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":7730801 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":8300802 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7938427 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7668505 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7735740 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":8096020 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":8292946 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7673224 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7821689 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":7755307 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":7730700.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":8300701.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7938326.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7668404.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7735639.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":8095919.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":8292845.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7673123.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7821588.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":7755206.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":110682, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 4454698.5,4425167.5,4412087.1,4226586.1,4407867.3,4375348.9,4383920.7,4368654.5,4270157.1 + ], + "N":9, + "Min":4226586.1, + "LowerFence":4303505.600000001, + "Q1":4368654.5, + "Median":4383920.7, + "Mean":4369387.522222222, + "Q3":4412087.1, + "UpperFence":4477235.999999999, + "Max":4454698.5, + "InterquartileRange":43432.59999999963, + "LowerOutliers":[ + 4226586.1,4270157.1 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 4226586.1,4270157.1 + ], + "StandardError":24771.042563320367, + "Variance":5522440947.064463, + "StandardDeviation":74313.1276899611, + "Skewness":-0.8004793237033284, + "Kurtosis":2.116806298625677, + "ConfidenceInterval":{ + "N":9, + "Mean":4369387.522222222, + "StandardError":24771.042563320367, + "Level":12, + "Margin":124878.39139684406, + "Lower":4244509.130825378, + "Upper":4494265.913619066 + }, + "Percentiles":{ + "P0":4226586.1, + "P25":4368654.5, + "P50":4383920.7, + "P67":4409386.427999999, + "P80":4417319.26, + "P85":4422551.42, + "P90":4431073.7, + "P95":4442886.1, + "P100":4454698.5 + } + }, + "Memory":{ + "Gen0Collections":1, + "Gen1Collections":1, + "Gen2Collections":1, + "TotalOperations":5, + "BytesAllocatedPerOperation":963333 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":168213 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":119180126 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":25053163 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":22273623 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":22125968 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":22509702 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":22060566 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":21133061 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":22039467 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":21876875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":21919734 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":21843403 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":21350916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":22273492.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":22125837.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":22060435.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":21132930.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":22039336.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":21876744.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":21919603.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":21843272.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":21350785.5 + } + ], + "Metrics":[ + { + "Value":200, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":963333, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini-small.json b/src/Titanium.Quic/design/perf-baselines/linuxmini-small.json new file mode 100644 index 000000000..ba941a197 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini-small.json @@ -0,0 +1,977 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261127-093815", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 36137.02,35518.68,34286.18,34659.08,34936.2,34641.64,34620.8,36427.16,36932.12 + ], + "N":9, + "Min":34286.18, + "LowerFence":32398.570000000003, + "Q1":34641.64, + "Median":34936.2, + "Mean":35350.986666666664, + "Q3":36137.02, + "UpperFence":38380.09, + "Max":36932.12, + "InterquartileRange":1495.3799999999974, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":314.57737145785524, + "Variance":890630.3037000007, + "StandardDeviation":943.7321143735657, + "Skewness":0.44065578691608875, + "Kurtosis":1.4085339717200869, + "ConfidenceInterval":{ + "N":9, + "Mean":35350.986666666664, + "StandardError":314.57737145785524, + "Level":12, + "Margin":1585.8806110839262, + "Lower":33765.106055582735, + "Upper":36936.86727775059 + }, + "Percentiles":{ + "P0":34286.18, + "P25":34641.64, + "P50":34936.2, + "P67":35741.2824, + "P80":36253.076, + "P85":36369.132, + "P90":36528.152, + "P95":36730.136000000006, + "P100":36932.12 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":66269 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":190525 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4312602 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2482418 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2068538 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1806931 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1776014 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1714389 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1733034 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1746890 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1732162 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1731120 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1821438 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1846686 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1806851 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1775934 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1714309 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1732954 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1746810 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1732082 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1731040 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1821358 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1846606 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":66269, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 131719.8,94766.46,102143.4,127853.02,99371.44,94908.72,125990.76,133912.68,148000.1,96693.86 + ], + "N":10, + "Min":94766.46, + "LowerFence":47278.48000000002, + "Q1":97363.255, + "Median":114067.07999999999, + "Mean":115536.02400000002, + "Q3":130753.105, + "UpperFence":180837.87999999998, + "Max":148000.1, + "InterquartileRange":33389.84999999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":6295.576907593174, + "Variance":396342885.99420434, + "StandardDeviation":19908.362212753826, + "Skewness":0.2106182395049641, + "Kurtosis":1.2234918910421961, + "ConfidenceInterval":{ + "N":10, + "Mean":115536.02400000002, + "StandardError":6295.576907593174, + "Level":12, + "Margin":30098.60286493876, + "Lower":85437.42113506126, + "Upper":145634.62686493876 + }, + "Percentiles":{ + "P0":94766.46, + "P25":97363.255, + "P50":114067.07999999999, + "P67":127969.0234, + "P80":132158.376, + "P85":133145.172, + "P90":135321.422, + "P95":141660.761, + "P100":148000.1 + } + }, + "Memory":{ + "Gen0Collections":4, + "Gen1Collections":1, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":636195 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":175396 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":9621407 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":301 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":231 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5972170 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6586101 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4738434 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5107281 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":6392762 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4968683 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4745547 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":6299649 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":6695745 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":7400116 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4834804 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6585990 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4738323 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5107170 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":6392651 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4968572 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4745436 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":6299538 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":6695634 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":7400005 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4834693 + } + ], + "Metrics":[ + { + "Value":80, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":20, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":636195, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini.md b/src/Titanium.Quic/design/perf-baselines/linuxmini.md new file mode 100644 index 000000000..e3ef0fbb0 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini.md @@ -0,0 +1,7 @@ +linuxmini, 2026-11-27. Ubuntu 26.04.1, AMD Ryzen 5 7640HS (6 cores, 12 threads), 12.9 GiB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0 switched the CPU governor to performance for the timed job and restored powersave afterwards. One warmup, 10 iterations, one invocation, one launch. + +The JSON files are the full exporter output. Medians are nanoseconds. A ratio is the platform median divided by the managed median. The Error column in the run is half the width of the 99.9% confidence interval of the mean. + +Handshake medians are 1.558 ms platform and 4.384 ms managed, ratio 0.355, gate 0.90 missed. The small-exchange medians are 34.94 µs and 114.1 µs, ratio 0.306, gate 0.90 missed. The bulk medians are 155.2 µs and 13.11 ms for 64 KiB, ratio 0.012, recorded with no portable numeric gate. The stream window is 1 MiB and is not raised, so the repeated bulk cell is 64 KiB. At that run `Titanium.Quic.UdpOffload` did not exist, so the 0.80 Linux offload gate was not measured. + +The same 64 KiB cell was timed again after the batch probe accepted `sendmmsg`. The exporter output for that run was cleaned on the machine. Platform median 124.8 µs, Error 22.79 µs. Managed median 12.613 ms, Error 5.563 ms. Ratio 0.010. The 0.80 gate is missed and is not lowered. The managed row allocated about 139 MiB. The governor was restored to powersave. diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/README.md b/src/Titanium.Quic/design/perf-baselines/linuxmini/README.md new file mode 100644 index 000000000..1ee039f0b --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/README.md @@ -0,0 +1,15 @@ +linuxmini, 2026-11-29. Ubuntu 26.04.1 LTS, kernel 7.0.0-44-generic, AMD Ryzen 5 7640HS (6 physical cores, 12 logical), 30.8 GB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs (`run1` to `run3`). The CPU governor was set to `performance` before the timed job and restored to `powersave` afterwards. + +The platform half of these cells is `System.Net.Quic` over a `libmsquic` 2.6.4 build extracted under `~/opt/msquic/extract`, reached with `LD_LIBRARY_PATH` and `TITANIUM_QUIC_PLATFORM_LISTENER=1`. It is not a system package. `QuicConnection.IsSupported` is false on this machine until that library is on the loader path. + +Each `runN-.json` is the full exporter output for one class in one run. Medians in this file are the median of the three run medians. A ratio is the platform median divided by the managed median. + +| Cell | Platform median | Managed median | Ratio | +| --- | ---: | ---: | ---: | +| Handshake, loopback | 1.536 ms | 2.262 ms | 0.68 | +| 100-byte exchange, 50 on one stream | 38.15 µs | 108.1 µs | 0.35 | +| 64 KiB, loopback, 8 KiB writes | 129.6 µs | 1.820 ms | 0.07 | + +The platform bulk cell moved between 112.2, 201.1, and 129.6 µs across the three runs, so its median carries little weight. The managed bulk cell is the stable side at 1.717 to 2.016 ms. Allocation per operation is 66 to 68 KB platform and 354 to 357 KB managed for the bulk cell, 110 to 111 KB against 166 to 169 KB for the handshake, and 66 KB against 71 KB for the small exchange. + +The batch-send row that the older `linuxmini.md` in the parent folder records (platform 124.8 µs against managed 12.613 ms, ratio 0.010) came from a tree before D3 and D4. The managed bulk rate here is 6.9 times faster than that row and needs the same `LD_LIBRARY_PATH` platform half to be comparable. diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-bulk.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-bulk.json new file mode 100644 index 000000000..5fb3f063d --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-bulk.json @@ -0,0 +1,970 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171847", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 164737,117730,122357,104805,106779,106398,104575,117639 + ], + "N":8, + "Min":104575, + "LowerFence":86669.25, + "Q1":105999.75, + "Median":112209, + "Mean":118127.5, + "Q3":118886.75, + "UpperFence":138217.25, + "Max":164737, + "InterquartileRange":12887, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 164737 + ], + "AllOutliers":[ + 164737 + ], + "StandardError":7094.086677347146, + "Variance":402608526.28571427, + "StandardDeviation":20065.107183509244, + "Skewness":1.4452609763593434, + "Kurtosis":3.7174438813744906, + "ConfidenceInterval":{ + "N":8, + "Mean":118127.5, + "StandardError":7094.086677347146, + "Level":12, + "Margin":38363.98732306103, + "Lower":79763.51267693896, + "Upper":156491.48732306104 + }, + "Percentiles":{ + "P0":104575, + "P25":105999.75, + "P50":112209, + "P67":117701.79, + "P80":120506.20000000001, + "P85":122125.65000000001, + "P90":135071, + "P95":149903.99999999997, + "P100":164737 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":68080 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":196215 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":15586754 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":241 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2887513 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":426304 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":234206 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":164837 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":117830 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":122457 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":104905 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":106879 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":106498 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":104675 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":117739 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":164737 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":117730 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":122357 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":104805 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":106779 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":106398 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":104575 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":117639 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":68080, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1212045,1512295,1679134,1784240,1826289,2206566,2671843,2750278,2479434,2491387 + ], + "N":10, + "Min":1212045, + "LowerFence":530928.125, + "Q1":1705410.5, + "Median":2016427.5, + "Mean":2061351.1, + "Q3":2488398.75, + "UpperFence":3662881.125, + "Max":2750278, + "InterquartileRange":782988.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":167632.21328680302, + "Variance":281005589314.3222, + "StandardDeviation":530099.6032014382, + "Skewness":-0.10611599135300058, + "Kurtosis":1.356112156624635, + "ConfidenceInterval":{ + "N":10, + "Mean":2061351.1, + "StandardError":167632.21328680302, + "Level":12, + "Margin":801434.9580901408, + "Lower":1259916.1419098591, + "Upper":2862786.058090141 + }, + "Percentiles":{ + "P0":1212045, + "P25":1705410.5, + "P50":2016427.5, + "P67":2479792.5900000003, + "P80":2527478.1999999997, + "P85":2608683.4, + "P90":2679686.5, + "P95":2714982.25, + "P100":2750278 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":356320 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":152704 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7582059 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1770545 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1212125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1512375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1679214 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1784320 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1826369 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2206646 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2671923 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2750358 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2479514 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2491467 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1212045 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1512295 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1679134 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1784240 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1826289 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2206566 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2671843 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2750278 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2479434 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2491387 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":356320, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-handshake.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-handshake.json new file mode 100644 index 000000000..f79f47ffd --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-handshake.json @@ -0,0 +1,956 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171848", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1750433.4,1536132.8,1594613.4,1403660.2,1385704.6,1588568.2,1440578.8,1517754.4,1567194.4 + ], + "N":9, + "Min":1385704.6, + "LowerFence":1218594.7000000002, + "Q1":1440578.8, + "Median":1536132.8, + "Mean":1531626.688888889, + "Q3":1588568.2, + "UpperFence":1810552.2999999998, + "Max":1750433.4, + "InterquartileRange":147989.3999999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":37734.86491607684, + "Variance":12815280272.111101, + "StandardDeviation":113204.59474823052, + "Skewness":0.3825748279830276, + "Kurtosis":2.1042898230982687, + "ConfidenceInterval":{ + "N":9, + "Mean":1531626.688888889, + "StandardError":37734.86491607684, + "Level":12, + "Margin":190232.9794255232, + "Lower":1341393.7094633658, + "Upper":1721859.6683144122 + }, + "Percentiles":{ + "P0":1385704.6, + "P25":1440578.8, + "P50":1536132.8, + "P67":1574888.9679999999, + "P80":1590986.28, + "P85":1593404.3599999999, + "P90":1625777.4, + "P95":1688105.4, + "P100":1750433.4 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":110682 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":163504 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":70150301 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":341 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":261 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":7938692 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":9020576 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":8752297 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7680794 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7973197 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7018431 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":6928653 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7942971 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7203024 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7588902 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":7836102 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8752167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":7680664 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7973067 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7018301 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":6928523 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":7942841 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7202894 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7588772 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7835972 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":110682, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2301020,2138381.2,2209994.6,2276865,2193087,2226491.2,2266351.6,2268168.8,2232464.2,2201789.2 + ], + "N":10, + "Min":2138381.2, + "LowerFence":2108029.625000001, + "Q1":2203840.5500000003, + "Median":2229477.7, + "Mean":2231461.28, + "Q3":2267714.5, + "UpperFence":2363525.425, + "Max":2301020, + "InterquartileRange":63873.94999999972, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":15263.658603193526, + "Variance":2329792739.548438, + "StandardDeviation":48267.92661331578, + "Skewness":-0.33524400845547614, + "Kurtosis":2.0113980010044075, + "ConfidenceInterval":{ + "N":10, + "Mean":2231461.28, + "StandardError":15263.658603193526, + "Level":12, + "Margin":72974.21750331123, + "Lower":2158487.0624966887, + "Upper":2304435.497503311 + }, + "Percentiles":{ + "P0":2138381.2, + "P25":2203840.5500000003, + "P50":2229477.7, + "P67":2266406.1160000004, + "P80":2269908.04, + "P85":2273821.33, + "P90":2279280.5, + "P95":2290150.25, + "P100":2301020 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":166670 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":160378 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":108116320 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":311 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":12137657 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":11505220 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":10692026 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":11050093 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11384445 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":10965555 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11132576 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":11331878 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11340964 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11162441 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11009066 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":11505100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":10691906 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":11049973 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11384325 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":10965435 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11132456 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":11331758 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11340844 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11162321 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11008946 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":166670, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-smallflow.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-smallflow.json new file mode 100644 index 000000000..c272ea79d --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run1-smallflow.json @@ -0,0 +1,970 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171849", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 40877.08,34774.5,34757.48,34935.6,34822.02,40801.72,35496.86,50170.58,46265.9,48180.46 + ], + "N":10, + "Min":34757.48, + "LowerFence":19747.99499999999, + "Q1":34850.415, + "Median":38149.29, + "Mean":40108.22000000001, + "Q3":44918.69500000001, + "UpperFence":60021.11500000002, + "Max":50170.58, + "InterquartileRange":10068.280000000006, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1939.2002792079008, + "Variance":37604977.228800006, + "StandardDeviation":6132.289721531429, + "Skewness":0.47266369455342605, + "Kurtosis":1.379924113581187, + "ConfidenceInterval":{ + "N":10, + "Mean":40108.22000000001, + "StandardError":1939.2002792079008, + "Level":12, + "Margin":9271.147018958585, + "Lower":30837.072981041423, + "Upper":49379.3670189586 + }, + "Percentiles":{ + "P0":34757.48, + "P25":34850.415, + "P50":38149.29, + "P67":41038.744600000005, + "P80":46648.812000000005, + "P85":47510.363999999994, + "P90":48379.472, + "P95":49275.026, + "P100":50170.58 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":66262 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":189333 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4116149 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":260 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2225070 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2043974 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1738845 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1737994 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1746900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1741221 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2040206 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1774963 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2508649 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2313415 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2409143 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2043854 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1738725 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1737874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1746780 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1741101 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2040086 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1774843 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2508529 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2313295 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2409023 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":66262, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 93196.62,105496.3,93036.32,118462.02,108971.38,98754.56,108148.42,111975.16,110803.98 + ], + "N":9, + "Min":93036.32, + "LowerFence":80680.43, + "Q1":98754.56, + "Median":108148.42, + "Mean":105427.19555555556, + "Q3":110803.98, + "UpperFence":128878.10999999999, + "Max":118462.02, + "InterquartileRange":12049.419999999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2909.057263323899, + "Variance":76163527.45167778, + "StandardDeviation":8727.171789971697, + "Skewness":-0.2195637400307688, + "Kurtosis":1.5263248743281277, + "ConfidenceInterval":{ + "N":9, + "Mean":105427.19555555556, + "StandardError":2909.057263323899, + "Level":12, + "Margin":14665.446179609618, + "Lower":90761.74937594595, + "Upper":120092.64173516518 + }, + "Percentiles":{ + "P0":93036.32, + "P25":98754.56, + "P50":108148.42, + "P67":109631.11600000001, + "P80":111272.452, + "P85":111740.924, + "P90":113272.532, + "P95":115867.276, + "P100":118462.02 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":71014 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":192548 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":11076902 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":220 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":221 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4512367 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4659952 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5274936 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4651937 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5923222 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":5448690 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4937849 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5407542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5598879 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":6544008 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":5540320 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4659831 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5274815 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4651816 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5923101 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":5448569 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4937728 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5407421 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5598758 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":5540199 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71014, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-bulk.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-bulk.json new file mode 100644 index 000000000..afbe5affb --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-bulk.json @@ -0,0 +1,984 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171916", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 271158.5,176874.5,273323.5,252143.5,204685.5,201089.5,170351.5,130497.5,138693.5 + ], + "N":9, + "Min":130497.5, + "LowerFence":47663.5, + "Q1":170351.5, + "Median":201089.5, + "Mean":202090.83333333334, + "Q3":252143.5, + "UpperFence":374831.5, + "Max":273323.5, + "InterquartileRange":81792, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":17929.458914652783, + "Variance":2893189472.75, + "StandardDeviation":53788.37674395835, + "Skewness":0.10463843517876113, + "Kurtosis":1.3091425009936253, + "ConfidenceInterval":{ + "N":9, + "Mean":202090.83333333334, + "StandardError":17929.458914652783, + "Level":12, + "Margin":90387.87859470394, + "Lower":111702.9547386294, + "Upper":292478.7119280373 + }, + "Percentiles":{ + "P0":130497.5, + "P25":170351.5, + "P50":201089.5, + "P67":221770.38, + "P80":259749.5, + "P85":267355.5, + "P90":271591.5, + "P95":272457.5, + "P100":273323.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":68248 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":196055 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":12027582 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":3511435 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1448555 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":271264 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":176980 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":273429 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":252249 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":204791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":201195 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":170457 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130603 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":138799 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271158.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":176874.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":273323.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":252143.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":204685.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":201089.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":170351.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":130497.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":138693.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":68248, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1296473,1556396,1486817,1505852,1680648,1753082,2227115,1889176,1969235,1963715 + ], + "N":10, + "Min":1296473, + "LowerFence":878599.625, + "Q1":1518488, + "Median":1716865, + "Mean":1732850.9, + "Q3":1945080.25, + "UpperFence":2584968.625, + "Max":2227115, + "InterquartileRange":426592.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":89110.90698355742, + "Variance":79407537434.32222, + "StandardDeviation":281793.43043144606, + "Skewness":0.15536340887326572, + "Kurtosis":1.741314860513799, + "ConfidenceInterval":{ + "N":10, + "Mean":1732850.9, + "StandardError":89110.90698355742, + "Level":12, + "Margin":426031.4566243582, + "Lower":1306819.4433756417, + "Upper":2158882.3566243583 + }, + "Percentiles":{ + "P0":1296473, + "P25":1518488, + "P50":1716865, + "P67":1891412.17, + "P80":1964819, + "P85":1967303, + "P90":1995023, + "P95":2111069, + "P100":2227115 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":357048 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":186647 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":8273466 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":30 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2139591 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1296543 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1556466 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1486887 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1505922 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1680718 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1753152 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2227185 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1889246 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":1969305 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":1963785 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1296473 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1556396 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1486817 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1505852 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1680648 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1753082 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2227115 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1889176 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":1969235 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":1963715 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":357048, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-handshake.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-handshake.json new file mode 100644 index 000000000..84b1b6264 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-handshake.json @@ -0,0 +1,1005 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171916", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1609492.9,1514614.5,1432273.1,1491471.5,1503000.9,1447080.7,1593535.3,1574201.3,1623875.9,1601391.9 + ], + "N":10, + "Min":1432273.1, + "LowerFence":1336743.0000000005, + "Q1":1494353.85, + "Median":1544407.9, + "Mean":1539093.8000000003, + "Q3":1599427.7499999998, + "UpperFence":1757038.5999999992, + "Max":1623875.9, + "InterquartileRange":105073.89999999967, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":22178.16594952491, + "Variance":4918710448.8466625, + "StandardDeviation":70133.51872568966, + "Skewness":-0.22114572109596312, + "Kurtosis":1.2841298157080137, + "ConfidenceInterval":{ + "N":10, + "Mean":1539093.8000000003, + "StandardError":22178.16594952491, + "Level":12, + "Margin":106031.87269181626, + "Lower":1433061.927308184, + "Upper":1645125.6726918165 + }, + "Percentiles":{ + "P0":1432273.1, + "P25":1494353.85, + "P50":1544407.9, + "P67":1593770.9980000001, + "P80":1603012.0999999999, + "P85":1606657.5499999998, + "P90":1610931.2, + "P95":1617403.5499999998, + "P100":1623875.9 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":110614 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":165508 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":71352308 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":461 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8279007 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8047565 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":7573173 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7161466 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7457458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7515105 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":7235504 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7967777 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7871107 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":8119480 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":8007060 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8047464.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":7573072.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":7161365.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7457357.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7515004.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":7235403.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7967676.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7871006.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":8119379.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":8006959.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":110614, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2404334.2,2303001.6,2197204.8,2246556.6,2206526.2,2290684.6,2320600.4,2303302.2,2379209.4,2384807.8 + ], + "N":10, + "Min":2197204.8, + "LowerFence":2097135.7750000004, + "Q1":2257588.6, + "Median":2303151.9000000004, + "Mean":2303622.7800000003, + "Q3":2364557.15, + "UpperFence":2525009.9749999996, + "Max":2404334.2, + "InterquartileRange":106968.54999999981, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":22830.861337554084, + "Variance":5212482294.146221, + "StandardDeviation":72197.52277014925, + "Skewness":-0.08376630784480994, + "Kurtosis":1.497274976202124, + "ConfidenceInterval":{ + "N":10, + "Mean":2303622.7800000003, + "StandardError":22830.861337554084, + "Level":12, + "Margin":109152.35228636666, + "Lower":2194470.4277136335, + "Upper":2412775.132286367 + }, + "Percentiles":{ + "P0":2197204.8, + "P25":2257588.6, + "P50":2303151.9000000004, + "P67":2322358.67, + "P80":2380329.08, + "P85":2382848.36, + "P90":2386760.4399999995, + "P95":2395547.3200000003, + "P100":2404334.2 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":165549 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":159046 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":108754468 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":330 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":12234026 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":12021811 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":11515148 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":10986164 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11232923 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":11032771 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11453563 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":11603142 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11516651 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11896187 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11924179 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":12021671 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":11515008 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":10986024 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11232783 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":11032631 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11453423 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":11603002 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11516511 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11896047 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11924039 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":165549, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-smallflow.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-smallflow.json new file mode 100644 index 000000000..af7a79d50 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run2-smallflow.json @@ -0,0 +1,956 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171917", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 37099.82,35274.22,36138.44,34833.42,35144.98,36708.08,38102.5,35122.14,35381.04 + ], + "N":9, + "Min":34833.42, + "LowerFence":32800.33, + "Q1":35144.98, + "Median":35381.04, + "Mean":35978.293333333335, + "Q3":36708.08, + "UpperFence":39052.729999999996, + "Max":38102.5, + "InterquartileRange":1563.0999999999985, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":371.16346642835293, + "Variance":1239860.8693, + "StandardDeviation":1113.4903992850589, + "Skewness":0.6534731669770079, + "Kurtosis":1.8313567865068572, + "ConfidenceInterval":{ + "N":9, + "Mean":35978.293333333335, + "StandardError":371.16346642835293, + "Level":12, + "Margin":1871.1483989568644, + "Lower":34107.14493437647, + "Upper":37849.4417322902 + }, + "Percentiles":{ + "P0":34833.42, + "P25":35144.98, + "P50":35381.04, + "P67":36343.5104, + "P80":36864.776, + "P85":37021.472, + "P90":37300.356, + "P95":37701.428, + "P100":38102.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":66256 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":188461 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3467312 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2401740 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1855122 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1763842 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1807053 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1741802 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1757380 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2042811 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1835535 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1905256 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1756238 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1769183 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1854991 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1763711 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1806922 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1741671 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1757249 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1835404 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1905125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1756107 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1769052 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":66256, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 80814.78,87354.96,99989.48,106210.24,97864.72,106279.18,110715.84,104815.66,119073.18 + ], + "N":9, + "Min":80814.78, + "LowerFence":85243.03000000001, + "Q1":97864.72, + "Median":104815.66, + "Mean":101457.55999999998, + "Q3":106279.18, + "UpperFence":118900.86999999998, + "Max":119073.18, + "InterquartileRange":8414.459999999992, + "LowerOutliers":[ + 80814.78 + ], + "UpperOutliers":[ + 119073.18 + ], + "AllOutliers":[ + 80814.78,119073.18 + ], + "StandardError":3896.5976786735937, + "Variance":136651261.22499993, + "StandardDeviation":11689.793036020781, + "Skewness":-0.3570681327011867, + "Kurtosis":1.9405041343804648, + "ConfidenceInterval":{ + "N":9, + "Mean":101457.55999999998, + "StandardError":3896.5976786735937, + "Level":12, + "Margin":19643.939038479046, + "Lower":81813.62096152094, + "Upper":121101.49903847903 + }, + "Percentiles":{ + "P0":80814.78, + "P25":97864.72, + "P50":104815.66, + "P67":106235.05840000001, + "P80":108053.844, + "P85":109828.508, + "P90":112387.30799999999, + "P95":115730.24399999999, + "P100":119073.18 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":71079 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160138 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":11506843 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":211 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4245420 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4040869 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4367878 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4999604 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5310642 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4893366 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5314089 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5535922 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5240913 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":6832334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":5953789 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4040739 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4367748 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4999474 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5310512 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4893236 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5313959 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5535792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5240783 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":5953659 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71079, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-bulk.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-bulk.json new file mode 100644 index 000000000..330dd34ae --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-bulk.json @@ -0,0 +1,970 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171944", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 129622,159968,178012,172611,126065,129301,122257,129661 + ], + "N":8, + "Min":122257, + "LowerFence":76536.875, + "Q1":128492, + "Median":129641.5, + "Mean":143437.125, + "Q3":163128.75, + "UpperFence":215083.875, + "Max":178012, + "InterquartileRange":34636.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":8074.059590170548, + "Variance":521523506.125, + "StandardDeviation":22836.889151655487, + "Skewness":0.5023014037394227, + "Kurtosis":1.2099853897255497, + "ConfidenceInterval":{ + "N":8, + "Mean":143437.125, + "StandardError":8074.059590170548, + "Level":12, + "Margin":43663.56570635747, + "Lower":99773.55929364252, + "Upper":187100.69070635748 + }, + "Percentiles":{ + "P0":122257, + "P25":128492, + "P50":129641.5, + "P67":150572.83000000002, + "P80":167553.80000000002, + "P85":171978.85, + "P90":174231.3, + "P95":176121.65, + "P100":178012 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":68584 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":164406 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":12031219 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":3562880 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":447213 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":250065 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":129752 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160098 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":178142 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":172741 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":126195 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":129431 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":122387 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":129791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":129622 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":159968 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":178012 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":172611 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":126065 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":129301 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":122257 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":129661 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":68584, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1366433,1784501,1462972,1433938,1677422,1855593,2417328,1991767,2069932,2153107 + ], + "N":10, + "Min":1366433, + "LowerFence":715875.125, + "Q1":1516584.5, + "Median":1820047, + "Mean":1821299.3, + "Q3":2050390.75, + "UpperFence":2851100.125, + "Max":2417328, + "InterquartileRange":533806.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":108771.18945505643, + "Variance":118311716554.6778, + "StandardDeviation":343964.70248366735, + "Skewness":0.16552589429652967, + "Kurtosis":1.609064254178366, + "ConfidenceInterval":{ + "N":10, + "Mean":1821299.3, + "StandardError":108771.18945505643, + "Level":12, + "Margin":520025.54850948026, + "Lower":1301273.7514905198, + "Upper":2341324.8485094802 + }, + "Percentiles":{ + "P0":1366433, + "P25":1516584.5, + "P50":1820047, + "P67":1994111.95, + "P80":2086567, + "P85":2123995.75, + "P90":2179529.1, + "P95":2298428.55, + "P100":2417328 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":353936 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":206273 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7638193 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":260 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2236912 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1366543 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1784611 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1463082 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1434048 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1677532 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1855703 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2417438 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1991877 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2070042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2153217 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1366433 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1784501 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1462972 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":1433938 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1677422 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1855593 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2417328 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1991767 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2069932 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2153107 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":353936, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-handshake.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-handshake.json new file mode 100644 index 000000000..61741eb1d --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-handshake.json @@ -0,0 +1,956 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171944", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1613360.2,1708954,1616129.2,1473770.4,1566084.2,1429409.8,1423066,1524136,1486830.8,1469879.2 + ], + "N":10, + "Min":1423066, + "LowerFence":1274818.2000000002, + "Q1":1470852, + "Median":1505483.4, + "Mean":1531161.98, + "Q3":1601541.2, + "UpperFence":1797575, + "Max":1708954, + "InterquartileRange":130689.19999999995, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":29421.79411264075, + "Variance":8656419688.066221, + "StandardDeviation":93039.8822444774, + "Skewness":0.49766611145443673, + "Kurtosis":1.8296158119970682, + "ConfidenceInterval":{ + "N":10, + "Mean":1531161.98, + "StandardError":29421.79411264075, + "Level":12, + "Margin":140663.02573514564, + "Lower":1390498.9542648543, + "Upper":1671825.0057351456 + }, + "Percentiles":{ + "P0":1423066, + "P25":1470852, + "P50":1505483.4, + "P67":1567502.48, + "P80":1613914, + "P85":1615160.0499999998, + "P90":1625411.68, + "P95":1667182.8399999999, + "P100":1708954 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":110624 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":167161 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":70418189 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":251 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":161 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8931600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8066952 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":8544921 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":8080797 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7369003 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7830572 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":7147200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7115481 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7620831 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7434305 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":7349547 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":8066801 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":8544770 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":8080646 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":7368852 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":7830421 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":7147049 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":7115330 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":7620680 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":7434154 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":7349396 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":110624, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2361103.6,2254299,2319808.8,2269964.2,2308409.8,2201064,2191722.6,2278181.4,2202382.4,2208217.2 + ], + "N":10, + "Min":2191722.6, + "LowerFence":2058323.6999999995, + "Q1":2203841.0999999996, + "Median":2262131.6, + "Mean":2259515.3, + "Q3":2300852.6999999997, + "UpperFence":2446370.0999999996, + "Max":2361103.6, + "InterquartileRange":97011.6000000001, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":18480.933576256353, + "Variance":3415449058.499995, + "StandardDeviation":58441.84338725119, + "Skewness":0.2801727476425446, + "Kurtosis":1.5082797250501094, + "ConfidenceInterval":{ + "N":10, + "Mean":2259515.3, + "StandardError":18480.933576256353, + "Level":12, + "Margin":88355.72791020184, + "Lower":2171159.572089798, + "Upper":2347871.027910202 + }, + "Percentiles":{ + "P0":2191722.6, + "P25":2203841.0999999996, + "P50":2262131.6, + "P67":2279088.252, + "P80":2310689.5999999996, + "P85":2315819.1499999994, + "P90":2323938.28, + "P95":2342520.94, + "P100":2361103.6 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":169107 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":160969 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":108420657 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":270 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":12267187 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":11805638 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":11271615 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":11599164 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11349941 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":11542169 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11005440 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":10958733 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11391027 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11012032 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11041206 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":11805518 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":11271495 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":11599044 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":11349821 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":11542049 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":11005320 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":10958613 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":11390907 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":11011912 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":11041086 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":169107, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-smallflow.json b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-smallflow.json new file mode 100644 index 000000000..d224a3513 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/linuxmini/run3-smallflow.json @@ -0,0 +1,956 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171945", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Platform)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 44465.54,39125.02,38292.86,37501.38,35867.54,40300.6,49410.94,47896.32,46933.94,59769.42 + ], + "N":10, + "Min":35867.54, + "LowerFence":24768.662500000006, + "Q1":38500.9, + "Median":42383.07, + "Mean":43956.356, + "Q3":47655.725, + "UpperFence":61387.962499999994, + "Max":59769.42, + "InterquartileRange":9154.824999999997, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2310.1978671539514, + "Variance":53370141.854026675, + "StandardDeviation":7305.487105869579, + "Skewness":0.78549282579875, + "Kurtosis":2.5102299189698485, + "ConfidenceInterval":{ + "N":10, + "Mean":43956.356, + "StandardError":2310.1978671539514, + "Level":12, + "Margin":11044.854056032551, + "Lower":32911.50194396745, + "Upper":55001.21005603255 + }, + "Percentiles":{ + "P0":35867.54, + "P25":38500.9, + "P50":42383.07, + "P67":46962.8114, + "P80":48199.244, + "P85":48880.823000000004, + "P90":50446.788, + "P95":55108.10399999999, + "P100":59769.42 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":66275 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":158926 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4133763 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":260 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2541350 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2223417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1956391 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1914783 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1875209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1793517 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2015170 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2470687 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2394956 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2346837 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2988611 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2223277 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1956251 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1914643 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1875069 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1793377 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2015030 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2470547 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2394816 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2346697 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2988471 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":66275, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 91931.18,98874.7,85206.66,98042.76,111220.08,115717.64,123601.9,118888.54,131565.34,121904.56 + ], + "N":10, + "Min":85206.66, + "LowerFence":63901.03, + "Q1":98250.745, + "Median":113468.86, + "Mean":109695.33600000001, + "Q3":121150.555, + "UpperFence":155500.27, + "Max":131565.34, + "InterquartileRange":22899.809999999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4844.231298901865, + "Variance":234665768.77260447, + "StandardDeviation":15318.804417205818, + "Skewness":-0.1995097731149952, + "Kurtosis":1.4313472382740875, + "ConfidenceInterval":{ + "N":10, + "Mean":109695.33600000001, + "StandardError":4844.231298901865, + "Level":12, + "Margin":23159.84637971731, + "Lower":86535.4896202827, + "Upper":132855.18237971733 + }, + "Percentiles":{ + "P0":85206.66, + "P25":98250.745, + "P50":113468.86, + "P67":118979.0206, + "P80":122244.02799999999, + "P85":123007.831, + "P90":124398.24399999999, + "P95":127981.79199999999, + "P100":131565.34 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":71305 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":186196 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":11262337 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4394317 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4596644 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4943820 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4260418 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4902223 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":5561089 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5785967 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":6180180 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5944512 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":6578352 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":6095313 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4596559 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4943735 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4260333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4902138 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":5561004 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5785882 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":6180095 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":5944427 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":6578267 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":6095228 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71305, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/README.md b/src/Titanium.Quic/design/perf-baselines/local-windows/README.md new file mode 100644 index 000000000..e51ccb17f --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/README.md @@ -0,0 +1,13 @@ +This PC, 2026-11-29. Windows 11 (10.0.26300.10075), AMD Ryzen 5 7640HS (6 cores, 12 threads), 13.8 GiB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs (`run1` to `run3`). The runner switched the power plan to High performance for the timed job and the plan was restored to Balanced afterwards. + +Each `runN-.json` is the full exporter output for one class in one run. Medians in this file are the median of the three run medians. + +**These cells are managed-only.** This run did not set `TITANIUM_QUIC_PLATFORM_LISTENER=1`, so `QuicHandshakeBenchmarks`, `QuicSmallFlowBenchmarks`, and `QuicBulkBenchmarks` report only the managed stack here and there is no platform median to divide by. A later run can include the platform listener on this PC: inbound UDP for `C:\Program Files\dotnet\dotnet.exe` is already allowed on the Private and Domain profiles, and the benchmark apphost needs the same allow before `dotnet run` listens. Cell parity for QUIC on the 2026-11-29 table was computed on linuxmini. + +| Cell | Managed median | Allocated per operation | +| --- | ---: | ---: | +| Handshake, loopback | 3.878 ms | 171 to 187 KB | +| 100-byte exchange, 50 on one stream | 160.8 µs | 72.5 KB | +| 64 KiB, loopback, 8 KiB writes | 2.692 ms | 334 to 355 KB | + +The managed QUIC handshake here is slower than on linuxmini even though both machines have the same CPU model. The linuxmini run pinned the CPU governor to performance for the timed job; this run used the Balanced plan outside the BDN job window. Do not compare the two absolute figures directly. diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run1-bulk.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-bulk.json new file mode 100644 index 000000000..89c454a15 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-bulk.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171609", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3902300,3154600,2821000,2676600,2254400,2221600,2911200,3383400,2435000,2733900 + ], + "N":10, + "Min":2221600, + "LowerFence":1597875, + "Q1":2495400, + "Median":2777450, + "Mean":2849400, + "Q3":3093750, + "UpperFence":3991275, + "Max":3902300, + "InterquartileRange":598350, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":165146.82154575866, + "Variance":272734726666.66666, + "StandardDeviation":522240.10442196665, + "Skewness":0.5702416089455906, + "Kurtosis":2.191634190606319, + "ConfidenceInterval":{ + "N":10, + "Mean":2849400, + "StandardError":165146.82154575866, + "Level":12, + "Margin":789552.5174376778, + "Lower":2059847.4825623222, + "Upper":3638952.517437678 + }, + "Percentiles":{ + "P0":2221600, + "P25":2495400, + "P50":2777450, + "P67":2918502, + "P80":3200360, + "P85":3303320, + "P90":3435290, + "P95":3668794.999999999, + "P100":3902300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":338488 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":10359200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2261100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":3902500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":3154800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2821200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2676800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2254600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2221800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2911400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3383600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2435200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2734100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":3902300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":3154600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2821000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2676600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2254400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2221600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2911200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3383400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2435000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2733900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":338488, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run1-handshake.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-handshake.json new file mode 100644 index 000000000..694401247 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-handshake.json @@ -0,0 +1,473 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171610", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 4055360,4031200,3877580,3810740,3800040,3995020,3787500,3922120,3811760 + ], + "N":9, + "Min":3787500, + "LowerFence":3534320, + "Q1":3810740, + "Median":3877580, + "Mean":3899035.5555555555, + "Q3":3995020, + "UpperFence":4271440, + "Max":4055360, + "InterquartileRange":184280, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":35309.0416147633, + "Variance":11220555777.777777, + "StandardDeviation":105927.1248442899, + "Skewness":0.30892864781040086, + "Kurtosis":1.197828518577306, + "ConfidenceInterval":{ + "N":9, + "Mean":3899035.5555555555, + "StandardError":35309.0416147633, + "Level":12, + "Margin":178003.66324286145, + "Lower":3721031.892312694, + "Upper":4077039.218798417 + }, + "Percentiles":{ + "P0":3787500, + "P25":3810740, + "P50":3877580, + "P67":3948364, + "P80":4009492, + "P85":4023964, + "P90":4036032, + "P95":4045696, + "P100":4055360 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":172637 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":191600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":119564100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":20064700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":31632800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":20277000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":20156200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19388100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":19053900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19000400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":19975300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":18937700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19610800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":19059000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":20276800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":20156000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":19387900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19053700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":19000200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19975100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":18937500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":19610600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19058800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172637, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run1-smallflow.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-smallflow.json new file mode 100644 index 000000000..94684482f --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run1-smallflow.json @@ -0,0 +1,480 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171611", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 124630,136674,134738,146786,171510,162554,163374,168954,201892,175838 + ], + "N":10, + "Min":124630, + "LowerFence":91698.5, + "Q1":139202, + "Median":162964, + "Mean":158695, + "Q3":170871, + "UpperFence":218374.5, + "Max":201892, + "InterquartileRange":31669, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":7323.652915193497, + "Variance":536358920.2222222, + "StandardDeviation":23159.424004543424, + "Skewness":0.1878942659635983, + "Kurtosis":1.9251378645498416, + "ConfidenceInterval":{ + "N":10, + "Mean":158695, + "StandardError":7323.652915193497, + "Level":12, + "Margin":35013.74438761833, + "Lower":123681.25561238168, + "Upper":193708.74438761832 + }, + "Percentiles":{ + "P0":124630, + "P25":139202, + "P50":162964, + "P67":169030.68, + "P80":172375.59999999998, + "P85":174323.19999999998, + "P90":178443.4, + "P95":190167.69999999995, + "P100":201892 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":72461 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":178300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":15018900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6585700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6231700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":6833900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6737100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7339500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8575700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":8127900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":8168900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8447900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10094800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8792100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6231500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":6833700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6736900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7339300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8575500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":8127700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":8168700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8447700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10094600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8791900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":72461, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run2-bulk.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-bulk.json new file mode 100644 index 000000000..f495e8748 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-bulk.json @@ -0,0 +1,480 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171656", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2223700,3715100,2152500,2445800,1881500,2067200,3686400,2937600,3592700,3864400 + ], + "N":10, + "Min":1881500, + "LowerFence":-68712.5, + "Q1":2170300, + "Median":2691700, + "Mean":2856690, + "Q3":3662975, + "UpperFence":5901987.5, + "Max":3864400, + "InterquartileRange":1492675, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":250082.28621351367, + "Variance":625411498777.7778, + "StandardDeviation":790829.626896829, + "Skewness":0.10808628581812003, + "Kurtosis":1.0404011976841647, + "ConfidenceInterval":{ + "N":10, + "Mean":2856690, + "StandardError":250082.28621351367, + "Level":12, + "Margin":1195621.5493480724, + "Lower":1661068.4506519276, + "Upper":4052311.549348072 + }, + "Percentiles":{ + "P0":1881500, + "P25":2170300, + "P50":2691700, + "P67":3595511, + "P80":3692140, + "P85":3705055, + "P90":3730030, + "P95":3797215, + "P100":3864400 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":333848 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":174100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":9968100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2739800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2223900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":3715300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2152700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2446000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1881700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2067400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3686600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2937800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3592900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3864600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2223700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":3715100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2152500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2445800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1881500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2067200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3686400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2937600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3592700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3864400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":333848, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run2-handshake.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-handshake.json new file mode 100644 index 000000000..79f9b2b46 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-handshake.json @@ -0,0 +1,473 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171656", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3938840,3860520,3870940,3852000,3914640,3875440,3801920,3951060,3897320 + ], + "N":9, + "Min":3801920, + "LowerFence":3779340, + "Q1":3860520, + "Median":3875440, + "Mean":3884742.222222222, + "Q3":3914640, + "UpperFence":3995820, + "Max":3951060, + "InterquartileRange":54120, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":15443.452925806616, + "Variance":2146502144.4444444, + "StandardDeviation":46330.358777419846, + "Skewness":-0.15883595344805554, + "Kurtosis":1.8646527684917473, + "ConfidenceInterval":{ + "N":9, + "Mean":3884742.222222222, + "StandardError":15443.452925806616, + "Level":12, + "Margin":77855.16310255403, + "Lower":3806887.059119668, + "Upper":3962597.385324776 + }, + "Percentiles":{ + "P0":3801920, + "P25":3860520, + "P50":3875440, + "P67":3903555.2, + "P80":3924320, + "P85":3934000, + "P90":3941284, + "P95":3946172, + "P100":3951060 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":171232 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":172600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":117645000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":20364100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":19694400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":19302800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":19354900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19260200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":33926100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19573400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":19377400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":19009800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19755500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":19486800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":19694200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":19302600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":19354700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19260000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":19573200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19377200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":19009600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":19755300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19486600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":171232, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run2-smallflow.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-smallflow.json new file mode 100644 index 000000000..dfac8fffd --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run2-smallflow.json @@ -0,0 +1,494 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171657", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 124486,142722,134664,144912,172218,157106,157136,167700,205686,177730 + ], + "N":10, + "Min":124486, + "LowerFence":101541, + "Q1":143269.5, + "Median":157121, + "Mean":158436, + "Q3":171088.5, + "UpperFence":212817, + "Max":205686, + "InterquartileRange":27819, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":7477.064123779541, + "Variance":559064879.1111112, + "StandardDeviation":23644.5528422745, + "Skewness":0.4324196643479861, + "Kurtosis":2.210382048854507, + "ConfidenceInterval":{ + "N":10, + "Mean":158436, + "StandardError":7477.064123779541, + "Level":12, + "Margin":35747.189965368714, + "Lower":122688.81003463129, + "Upper":194183.1899653687 + }, + "Percentiles":{ + "P0":124486, + "P25":143269.5, + "P50":157121, + "P67":167835.54, + "P80":173320.4, + "P85":175800.8, + "P90":180525.59999999998, + "P95":193105.8, + "P100":205686 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":72461 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":15233100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6308600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6224400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":7136200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6733300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7245700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8611000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":7855400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":7856900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8385100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10284400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8886600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6224300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":7136100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6733200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7245600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8610900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":7855300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":7856800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8385000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10284300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8886500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":72461, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run3-bulk.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-bulk.json new file mode 100644 index 000000000..3decf5de8 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-bulk.json @@ -0,0 +1,473 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171742", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1724500,1739800,3705700,2436800,2935900,2968300,2444400,2652800,2891700 + ], + "N":9, + "Min":1724500, + "LowerFence":1688150, + "Q1":2436800, + "Median":2652800, + "Mean":2611100, + "Q3":2935900, + "UpperFence":3684550, + "Max":3705700, + "InterquartileRange":499100, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 3705700 + ], + "AllOutliers":[ + 3705700 + ], + "StandardError":208003.20243261216, + "Variance":389387990000, + "StandardDeviation":624009.6072978365, + "Skewness":0.020665989547445557, + "Kurtosis":1.9530069439328706, + "ConfidenceInterval":{ + "N":9, + "Mean":2611100, + "StandardError":208003.20243261216, + "Level":12, + "Margin":1048607.6740120447, + "Lower":1562492.3259879553, + "Upper":3659707.6740120444 + }, + "Percentiles":{ + "P0":1724500, + "P25":2436800, + "P50":2652800, + "P67":2907612, + "P80":2948860, + "P85":2961820, + "P90":3115779.9999999995, + "P95":3410740, + "P100":3705700 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":355088 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":177900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":10230300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2308500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1724700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":4460500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1740000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":3705900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2437000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2936100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2968500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2444600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2653000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2891900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1724500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1739800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":3705700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2436800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2935900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2968300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2444400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2652800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2891700 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":355088, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run3-handshake.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-handshake.json new file mode 100644 index 000000000..55431ef0f --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-handshake.json @@ -0,0 +1,480 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171742", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3943540,3871760,3897540,3926400,3903820,3933100,3997080,3899320,3980240 + ], + "N":9, + "Min":3871760, + "LowerFence":3832990, + "Q1":3899320, + "Median":3926400, + "Mean":3928088.888888889, + "Q3":3943540, + "UpperFence":4009870, + "Max":3997080, + "InterquartileRange":44220, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":13575.416143042914, + "Variance":1658627311.1111112, + "StandardDeviation":40726.24842912874, + "Skewness":0.3761629172759581, + "Kurtosis":1.699574701413201, + "ConfidenceInterval":{ + "N":9, + "Mean":3928088.888888889, + "StandardError":13575.416143042914, + "Level":12, + "Margin":68437.81912499001, + "Lower":3859651.069763899, + "Upper":3996526.708013879 + }, + "Percentiles":{ + "P0":3871760, + "P25":3899320, + "P50":3926400, + "P67":3936858.4, + "P80":3958220, + "P85":3972900, + "P90":3983608, + "P95":3990344, + "P100":3997080 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":187376 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":230700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":122224800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":19871500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":19717900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":31622800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":19359000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19487900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":19632200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19519300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":19665700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":19985600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19496800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":19901400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":19717700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":19358800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":19487700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":19632000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":19519100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":19665500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":19985400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":19496600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":19901200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":187376, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/local-windows/run3-smallflow.json b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-smallflow.json new file mode 100644 index 000000000..7ecd0454a --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/local-windows/run3-smallflow.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171743", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 128612,137114,137702,148292,176674,159264,162398,177114,196794,176180 + ], + "N":10, + "Min":128612, + "LowerFence":86048, + "Q1":140349.5, + "Median":160831, + "Mean":160014.4, + "Q3":176550.5, + "UpperFence":230852, + "Max":196794, + "InterquartileRange":36201, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":6941.057990441131, + "Variance":481782860.2666667, + "StandardDeviation":21949.552621105213, + "Skewness":0.07489093916437599, + "Kurtosis":1.5401531847943244, + "ConfidenceInterval":{ + "N":10, + "Mean":160014.4, + "StandardError":6941.057990441131, + "Level":12, + "Margin":33184.59149705901, + "Lower":126829.80850294098, + "Upper":193198.991497059 + }, + "Percentiles":{ + "P0":128612, + "P25":140349.5, + "P50":160831, + "P67":176194.81999999998, + "P80":176762, + "P85":176960, + "P90":179082, + "P95":187938, + "P100":196794 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":72478 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":172900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":15401600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6216500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6430800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":6855900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6885300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7414800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8833900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":7963400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":8120100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8855900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":9839900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8809200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6430600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":6855700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":6885100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":7414600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8833700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":7963200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":8119900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":8855700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":9839700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":8809000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":72478, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/README.md b/src/Titanium.Quic/design/perf-baselines/macmini/README.md new file mode 100644 index 000000000..edc5d5f81 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/README.md @@ -0,0 +1,13 @@ +macmini, 2026-11-29. macOS 26.6.2 (25G83), Darwin 25.6.0, Apple M1 (8 cores, 8 logical), 16 GB RAM, .NET SDK 10.0.404, runtime 10.0.15, Arm64. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs. + +**These cells are managed-only.** `QuicBenchHarness.PlatformListenerAllowed` is `!OperatingSystem.IsWindows() && TITANIUM_QUIC_PLATFORM_LISTENER == "1"`, and the flag was not set on this machine, so no platform `QuicListener` was started and there is no platform median to divide by. The platform QUIC comparison lives in the `linuxmini` folder, where `libmsquic` is available. + +Medians below are the median of the three run medians. + +| Cell | Managed median | Allocated per operation | +| --- | ---: | ---: | +| Handshake, loopback | 12.53 ms | 142 to 236 KB | +| 100-byte exchange, 50 on one stream | 184.9 µs | 70.8 KB | +| 64 KiB, loopback, 8 KiB writes | 2.815 ms | 334 KB | + +The handshake cell is the widest of the three: 13.58, 12.53, and 10.03 ms across the three runs, with 236, 210, and 142 KB allocated in the same order. The small-flow and bulk cells reproduce to within about 3 percent in both time and allocation. The machine runs a window server and other background work, so treat the handshake row as a coarse figure and do not read a trend into its allocation spread. diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run1-bulk.json b/src/Titanium.Quic/design/perf-baselines/macmini/run1-bulk.json new file mode 100644 index 000000000..b2917ac1a --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run1-bulk.json @@ -0,0 +1,501 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171908", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2164291,2347583,2469042,2626458,2689708,2862041,3329041,3044958,3168958,3514791 + ], + "N":10, + "Min":2164291, + "LowerFence":1564053, + "Q1":2508396, + "Median":2775874.5, + "Mean":2821687.1, + "Q3":3137958, + "UpperFence":4082301, + "Max":3514791, + "InterquartileRange":629562, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":139312.28656307462, + "Variance":194079131874.32227, + "StandardDeviation":440544.1315853864, + "Skewness":0.08463961010999686, + "Kurtosis":1.5095108273285236, + "ConfidenceInterval":{ + "N":10, + "Mean":2821687.1, + "StandardError":139312.28656307462, + "Level":12, + "Margin":666039.8640212258, + "Lower":2155647.2359787743, + "Upper":3487726.964021226 + }, + "Percentiles":{ + "P0":2164291, + "P25":2508396, + "P50":2775874.5, + "P67":3048678, + "P80":3200974.5999999996, + "P85":3273011.9499999997, + "P90":3347616, + "P95":3431203.5, + "P100":3514791 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":334296 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":109750 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7561750 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":291 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":166 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2400792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2164333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2347625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2469084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2626500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2689750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2862083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3329083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3045000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3169000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3514833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2164291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2347583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2469042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2626458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2689708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2862041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3329041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3044958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3168958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3514791 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":334296, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run1-handshake.json b/src/Titanium.Quic/design/perf-baselines/macmini/run1-handshake.json new file mode 100644 index 000000000..3a979104c --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run1-handshake.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171909", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 10044558.2,10696624.8,11371408.2,13361233.2,13789483.2,14555850,14476441.6,14680000,15791391.6,11455433.4 + ], + "N":10, + "Min":10044558.2, + "LowerFence":6677039.399999995, + "Q1":11392414.499999998, + "Median":13575358.2, + "Mean":13022242.419999998, + "Q3":14535997.9, + "UpperFence":19251373.000000004, + "Max":15791391.6, + "InterquartileRange":3143583.4000000022, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":623981.9509380069, + "Variance":3893534750964.012, + "StandardDeviation":1973204.1837995409, + "Skewness":-0.18694416894115695, + "Kurtosis":1.3063579692699911, + "ConfidenceInterval":{ + "N":10, + "Mean":13022242.419999998, + "StandardError":623981.9509380069, + "Level":12, + "Margin":2983203.16181362, + "Lower":10039039.258186378, + "Upper":16005445.581813619 + }, + "Percentiles":{ + "P0":10044558.2, + "P25":11392414.499999998, + "P50":13575358.2, + "P67":14478823.852, + "P80":14580680, + "P85":14636547.5, + "P90":14791139.16, + "P95":15291265.379999999, + "P100":15791391.6 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":235570 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":114375 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":124310042 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":292 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":53400500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50222833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":53483166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":56857083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":66806208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":68947458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":72779292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":72382250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":73400042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":78957000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":57277209 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50222791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":53483124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":56857041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":66806166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":68947416 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":72779250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":72382208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":73400000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":78956958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":57277167 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235570, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run1-smallflow.json b/src/Titanium.Quic/design/perf-baselines/macmini/run1-smallflow.json new file mode 100644 index 000000000..6343523e3 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run1-smallflow.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171910", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 168809.16,177078.32,183066.66,189600,167086.66,184523.32,194846.66,201225,217279.16 + ], + "N":9, + "Min":167086.66, + "LowerFence":150425.81, + "Q1":177078.32, + "Median":184523.32, + "Mean":187057.21555555554, + "Q3":194846.66, + "UpperFence":221499.16999999998, + "Max":217279.16, + "InterquartileRange":17768.339999999997, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":5316.341914251835, + "Variance":254371422.14307776, + "StandardDeviation":15949.025742755504, + "Skewness":0.43332605521421214, + "Kurtosis":1.9892137825317349, + "ConfidenceInterval":{ + "N":9, + "Mean":187057.21555555554, + "StandardError":5316.341914251835, + "Level":12, + "Margin":26801.30336340586, + "Lower":160255.91219214967, + "Upper":213858.5189189614 + }, + "Percentiles":{ + "P0":167086.66, + "P25":177078.32, + "P50":184523.32, + "P67":191488.7976, + "P80":197397.99599999998, + "P85":199949.332, + "P90":204435.832, + "P95":210857.49599999998, + "P100":217279.16 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":70809 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":113250 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":13038959 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8195792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8440500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8853958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9153375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9480042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8354375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":9226208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9742375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":10061292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":12280292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":10864000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8440458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8853916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9153333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9480000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":8354333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":9226166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9742333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":10061250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10863958 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":70809, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run2-bulk.json b/src/Titanium.Quic/design/perf-baselines/macmini/run2-bulk.json new file mode 100644 index 000000000..7724f446a --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run2-bulk.json @@ -0,0 +1,501 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-171941", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2205208,2308041,2551041,2584124,2809792,2922958,3290458,3084041,3238500,3449666 + ], + "N":10, + "Min":2205208, + "LowerFence":1598451.5, + "Q1":2559311.75, + "Median":2866375, + "Mean":2844382.9, + "Q3":3199885.25, + "UpperFence":4160745.5, + "Max":3449666, + "InterquartileRange":640573.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":134803.43087897776, + "Variance":181719649767.43335, + "StandardDeviation":426285.87798264367, + "Skewness":-0.09338939761587198, + "Kurtosis":1.4018996497031455, + "ConfidenceInterval":{ + "N":10, + "Mean":2844382.9, + "StandardError":134803.43087897776, + "Level":12, + "Margin":644483.4191389035, + "Lower":2199899.4808610966, + "Upper":3488866.319138903 + }, + "Percentiles":{ + "P0":2205208, + "P25":2559311.75, + "P50":2866375, + "P67":3088674.77, + "P80":3248891.6, + "P85":3272272.7, + "P90":3306378.8, + "P95":3378022.4, + "P100":3449666 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":334232 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":110667 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7070500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":166 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":167 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2420167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2205250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2308083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2551083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2584166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2809834 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2923000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3290500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3084083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3238542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3449708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2205208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2308041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2551041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2584124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2809792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2922958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3290458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3084041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3238500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3449666 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":334232, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run2-handshake.json b/src/Titanium.Quic/design/perf-baselines/macmini/run2-handshake.json new file mode 100644 index 000000000..6fa797602 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run2-handshake.json @@ -0,0 +1,494 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-171941", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 10076891.6,11055908.2,12247400,12815525,14318941.6,15024983.2,15827516.6,14725891.6,8206633.2,7658133.2 + ], + "N":10, + "Min":7658133.2, + "LowerFence":3867883.2250000006, + "Q1":10321645.75, + "Median":12531462.5, + "Mean":12195782.419999998, + "Q3":14624154.1, + "UpperFence":21077916.625, + "Max":15827516.6, + "InterquartileRange":4302508.35, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":911546.0389530867, + "Variance":8309161811310.625, + "StandardDeviation":2882561.6751963217, + "Skewness":-0.29790879190959624, + "Kurtosis":1.4462423751659323, + "ConfidenceInterval":{ + "N":10, + "Mean":12195782.419999998, + "StandardError":911546.0389530867, + "Level":12, + "Margin":4358021.929088934, + "Lower":7837760.490911064, + "Upper":16553804.349088933 + }, + "Percentiles":{ + "P0":7658133.2, + "P25":10321645.75, + "P50":12531462.5, + "P67":14331150.1, + "P80":14785709.92, + "P85":14920301.139999999, + "P90":15105236.54, + "P95":15466376.569999997, + "P100":15827516.6 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":209522 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":113042 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":128375584 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":53230500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50384500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":55279583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":61237042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":64077667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":71594750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":75124958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":79137625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":73629500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":41033208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":38290708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50384458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":55279541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":61237000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":64077625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":71594708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":75124916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":79137583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":73629458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":41033166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":38290666 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":209522, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run2-smallflow.json b/src/Titanium.Quic/design/perf-baselines/macmini/run2-smallflow.json new file mode 100644 index 000000000..408096a8a --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run2-smallflow.json @@ -0,0 +1,494 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-171942", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 165919.16,177552.5,185684.16,188124.16,190599.16,183254.16,187765.84,201470,214844.16 + ], + "N":9, + "Min":165919.16, + "LowerFence":172236.66, + "Q1":183254.16, + "Median":187765.84, + "Mean":188357.03333333333, + "Q3":190599.16, + "UpperFence":201616.66, + "Max":214844.16, + "InterquartileRange":7345, + "LowerOutliers":[ + 165919.16 + ], + "UpperOutliers":[ + 214844.16 + ], + "AllOutliers":[ + 165919.16,214844.16 + ], + "StandardError":4613.278410347438, + "Variance":191541039.2224, + "StandardDeviation":13839.835231042312, + "Skewness":0.34112327930621855, + "Kurtosis":2.3913882107204776, + "ConfidenceInterval":{ + "N":9, + "Mean":188357.03333333333, + "StandardError":4613.278410347438, + "Level":12, + "Margin":23256.945503094576, + "Lower":165100.08783023874, + "Upper":211613.9788364279 + }, + "Percentiles":{ + "P0":165919.16, + "P25":183254.16, + "P50":187765.84, + "P67":189015.16, + "P80":194947.496, + "P85":199295.832, + "P90":204144.832, + "P95":209494.49599999998, + "P100":214844.16 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":70813 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":110833 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":13380584 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":292 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8107459 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8296000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8877667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9284250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9406250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":9530000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":9162750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9388334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":10073542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":11776375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":10742250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8295958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8877625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9284208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9406208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":9529958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":9162708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9388292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":10073500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10742208 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":70813, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run3-bulk.json b/src/Titanium.Quic/design/perf-baselines/macmini/run3-bulk.json new file mode 100644 index 000000000..0b3f523df --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run3-bulk.json @@ -0,0 +1,494 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-172013", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2299749,2403833,2657750,2683874,2771916,2859041,3386167,3198375,3315833,3479124 + ], + "N":10, + "Min":2299749, + "LowerFence":1730999.75, + "Q1":2664281, + "Median":2815478.5, + "Mean":2905566.2, + "Q3":3286468.5, + "UpperFence":4219749.75, + "Max":3479124, + "InterquartileRange":622187.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":131796.95975070473, + "Variance":173704385995.28888, + "StandardDeviation":416778.5814977647, + "Skewness":0.02292885005410228, + "Kurtosis":1.3317584144180714, + "ConfidenceInterval":{ + "N":10, + "Mean":2905566.2, + "StandardError":131796.95975070473, + "Level":12, + "Margin":630109.7434864542, + "Lower":2275456.456513546, + "Upper":3535675.9434864544 + }, + "Percentiles":{ + "P0":2299749, + "P25":2664281, + "P50":2815478.5, + "P67":3201898.7399999998, + "P80":3329899.8, + "P85":3361550.0999999996, + "P90":3395462.7, + "P95":3437293.3499999996, + "P100":3479124 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":334144 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":108584 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7368375 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":667 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2394041 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2299791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2403875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2657792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2683916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2771958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2859083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3386209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3198417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3315875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3479166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2299749 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":2403833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":2657750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2683874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2771916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2859041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3386167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":3198375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":3315833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":3479124 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":334144, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run3-handshake.json b/src/Titanium.Quic/design/perf-baselines/macmini/run3-handshake.json new file mode 100644 index 000000000..b241c0657 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run3-handshake.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks-20261129-172013", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicHandshakeBenchmarks.Handshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicHandshakeBenchmarks", + "Method":"Handshake", + "MethodTitle":"Handshake", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicHandshakeBenchmarks.Handshake(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 10118824.8,10680208.2,12507274.8,9951150,8537333.4,8589200,8415800,9100700,11138483.2,12473424.8 + ], + "N":10, + "Min":8415800, + "LowerFence":5256815.825000001, + "Q1":8717075, + "Median":10034987.4, + "Mean":10151239.919999998, + "Q3":11023914.45, + "UpperFence":14484173.624999998, + "Max":12507274.8, + "InterquartileRange":2306839.4499999993, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":487613.63610426575, + "Variance":2377670581148.233, + "StandardDeviation":1541969.7082459931, + "Skewness":0.3355317923153332, + "Kurtosis":1.4849402288130857, + "ConfidenceInterval":{ + "N":10, + "Mean":10151239.919999998, + "StandardError":487613.63610426575, + "Level":12, + "Margin":2331238.1692819227, + "Lower":7820001.750718076, + "Upper":12482478.08928192 + }, + "Percentiles":{ + "P0":8415800, + "P25":8717075, + "P50":10034987.4, + "P67":10693956.45, + "P80":11405471.52, + "P85":12006195.239999998, + "P90":12476809.8, + "P95":12492042.3, + "P100":12507274.8 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":5, + "BytesAllocatedPerOperation":142230 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":119334 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":133213833 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":166 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":5, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":5, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":5, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":59494584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50594166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":53401083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":62536416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":49755792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":42686709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42946042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":42079042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":45503542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":55692458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":62367166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":5, + "Nanoseconds":50594124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":5, + "Nanoseconds":53401041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":5, + "Nanoseconds":62536374 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":5, + "Nanoseconds":49755750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":5, + "Nanoseconds":42686667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":5, + "Nanoseconds":42946000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":5, + "Nanoseconds":42079000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":5, + "Nanoseconds":45503500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":5, + "Nanoseconds":55692416 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":5, + "Nanoseconds":62367124 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":142230, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Quic/design/perf-baselines/macmini/run3-smallflow.json b/src/Titanium.Quic/design/perf-baselines/macmini/run3-smallflow.json new file mode 100644 index 000000000..a71ca3968 --- /dev/null +++ b/src/Titanium.Quic/design/perf-baselines/macmini/run3-smallflow.json @@ -0,0 +1,487 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks-20261129-172014", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicSmallFlowBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicSmallFlowBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicSmallFlowBenchmarks.Small100(Stack: Managed)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 161158.34,177864.18,184926.68,187132.5,190505,178882.5,184921.68,199137.5,213621.68 + ], + "N":9, + "Min":161158.34, + "LowerFence":161448.75, + "Q1":178882.5, + "Median":184926.68, + "Mean":186461.11777777775, + "Q3":190505, + "UpperFence":207938.75, + "Max":213621.68, + "InterquartileRange":11622.5, + "LowerOutliers":[ + 161158.34 + ], + "UpperOutliers":[ + 213621.68 + ], + "AllOutliers":[ + 161158.34,213621.68 + ], + "StandardError":4846.946721906992, + "Variance":211436032.72504443, + "StandardDeviation":14540.840165720976, + "Skewness":0.17571733959971964, + "Kurtosis":2.4579597953771155, + "ConfidenceInterval":{ + "N":9, + "Mean":186461.11777777775, + "StandardError":4846.946721906992, + "Level":12, + "Margin":24434.938831125994, + "Lower":162026.17894665175, + "Upper":210896.05660890375 + }, + "Percentiles":{ + "P0":161158.34, + "P25":178882.5, + "P50":184926.68, + "P67":188346.6, + "P80":193958, + "P85":197411, + "P90":202034.336, + "P95":207828.00799999997, + "P100":213621.68 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":70810 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":111666 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":13327208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8614958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8057958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8893250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9246375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9356666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":9525291 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":8944166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9246125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":9956916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":11528500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":10681125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":8057917 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":8893209 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":9246334 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":9356625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":9525250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":8944125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":9246084 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":9956875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":10681084 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":70810, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/AssemblyMarker.cs b/src/Titanium.Tls/AssemblyMarker.cs new file mode 100644 index 000000000..88002dc9a --- /dev/null +++ b/src/Titanium.Tls/AssemblyMarker.cs @@ -0,0 +1,7 @@ +namespace Titanium.Tls; + +/// Build marker so the test host can load this assembly. +internal static class AssemblyMarker +{ + internal const string Name = "Titanium.Tls"; +} diff --git a/src/Titanium.Tls/BannedSymbols.txt b/src/Titanium.Tls/BannedSymbols.txt new file mode 100644 index 000000000..c231552d7 --- /dev/null +++ b/src/Titanium.Tls/BannedSymbols.txt @@ -0,0 +1,19 @@ +T:System.Runtime.InteropServices.DllImportAttribute;P/Invoke is not allowed in the managed TLS stack. +T:System.Runtime.InteropServices.LibraryImportAttribute;P/Invoke is not allowed in the managed TLS stack. +M:System.Threading.Tasks.Task.Run(System.Action);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Action,System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task});Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Run(System.Func{System.Threading.Tasks.Task},System.Threading.CancellationToken);Crypto and protocol work stay on the caller. Do not hop threads. +M:System.Threading.Tasks.Task.Wait;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Int32);Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Tasks.Task.Wait(System.Threading.CancellationToken);Blocking on a task hides the caller. Await at the I/O boundary. +P:System.Threading.Tasks.Task`1.Result;Blocking on a task hides the caller. Await at the I/O boundary. +M:System.Threading.Thread.Sleep(System.Int32);Use TimeProvider and timers, not thread sleeps. +M:System.Random.#ctor;Entropy goes through IEntropySource. +M:System.Random.#ctor(System.Int32);Entropy goes through IEntropySource. +T:System.IO.Pipelines.Pipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeReader;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.PipeWriter;The managed stack uses the caller-driven stream model, not a pipe. +T:System.IO.Pipelines.IDuplexPipe;The managed stack uses the caller-driven stream model, not a pipe. +T:System.Threading.Channels.Channel;No producer and consumer hop on the data path. +T:System.Threading.Channels.Channel`2;No producer and consumer hop on the data path. diff --git a/src/Titanium.Tls/Fingerprint/CertificateCompression.cs b/src/Titanium.Tls/Fingerprint/CertificateCompression.cs new file mode 100644 index 000000000..42a6164f3 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/CertificateCompression.cs @@ -0,0 +1,46 @@ +using System; +using System.Buffers; +using System.IO.Compression; + +namespace Titanium.Tls; + +/// RFC 8879 certificate decompression. Brotli is algorithm 2. +internal static class CertificateCompression +{ + internal const ushort Brotli = 2; + + internal static bool TryDecompress( + ushort algorithm, + ReadOnlySpan compressed, + int uncompressedLength, + int maxOutput, + Span destination, + out int written, + out HandshakeAlert alert) + { + written = 0; + alert = HandshakeAlert.DecodeError; + if (algorithm != Brotli || compressed.IsEmpty || uncompressedLength <= 0 || uncompressedLength > maxOutput || destination.Length < uncompressedLength) + { + return false; + } + + var decoder = new BrotliDecoder(); + try + { + OperationStatus status = decoder.Decompress(compressed, destination[..uncompressedLength], out int consumed, out written); + if (status != OperationStatus.Done || written != uncompressedLength || consumed != compressed.Length) + { + written = 0; + return false; + } + } + finally + { + decoder.Dispose(); + } + + alert = default; + return true; + } +} diff --git a/src/Titanium.Tls/Fingerprint/ClientHelloBuilder.cs b/src/Titanium.Tls/Fingerprint/ClientHelloBuilder.cs new file mode 100644 index 000000000..fa2fed6e9 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/ClientHelloBuilder.cs @@ -0,0 +1,881 @@ +using System; +using System.Buffers; +using System.Collections.Generic; + +namespace Titanium.Tls; + +internal static class ClientHelloBuilder +{ + internal static void Write(ClientHelloTemplate template, ClientHelloContext context, IEntropySource entropy, IBufferWriter destination) + { + ArgumentNullException.ThrowIfNull(template); + ArgumentNullException.ThrowIfNull(context); + ArgumentNullException.ThrowIfNull(entropy); + ArgumentNullException.ThrowIfNull(destination); + TemplateGuard.Check(template); + bool retry = context.HelloRetryState is not null; + RetryPins pins = retry ? ReadPins(context.HelloRetryState!) : new RetryPins(); + PlannedExtension[] plan = Plan(template, context, entropy, out GreaseDraw grease); + List rendered = Render(template, context, entropy, grease, plan, pins, out int paddingAt); + int padding = PaddingLength(template, context, rendered); + if (padding >= 0) + { + rendered.Insert(paddingAt < 0 ? rendered.Count : paddingAt, new RenderedExtension(ExtensionType.Padding, new byte[padding])); + } + + if (context.SessionTicket is not null) + { + rendered.Add(new RenderedExtension(ExtensionType.PreSharedKey, PskBody(context))); + } + + byte[] handshake = WriteHandshake(template, entropy, grease, rendered, pins); + if (!retry) + { + context.HelloRetryState = WithPins(context.HelloRetryState!, pins); + } + + if (template.SplitAcrossRecords && handshake.Length >= 2) + { + int mid = handshake.Length / 2; + WriteRecord(handshake.AsSpan(0, mid), template.RecordVersion, destination); + WriteRecord(handshake.AsSpan(mid), template.RecordVersion, destination); + } + else + { + WriteRecord(handshake, template.RecordVersion, destination); + } + } + + private static PlannedExtension[] Plan(ClientHelloTemplate template, ClientHelloContext context, IEntropySource entropy, out GreaseDraw grease) + { + if (context.HelloRetryState is not null) + { + return Restore(template, context.HelloRetryState, out grease); + } + + grease = DrawGrease(template, entropy); + ExtensionSpec[] specs = Order(template, entropy); + var plan = new PlannedExtension[specs.Length]; + for (int i = 0; i < specs.Length; i++) + { + plan[i] = new PlannedExtension(specs[i], ResolveType(specs[i], grease)); + } + + context.HelloRetryState = Save(grease, plan); + return plan; + } + + private static GreaseDraw DrawGrease(ClientHelloTemplate template, IEntropySource entropy) + { + ushort cipher = Uses(template.Ciphers, static code => code.Grease) ? EntropyDraw.GreaseValue(entropy) : (ushort)0; + ushort extFirst = 0; + ushort extLast = 0; + int greaseExtensions = 0; + foreach (ExtensionSpec extension in template.Extensions) + { + if (extension.Kind is ExtensionKind.GreaseEmpty or ExtensionKind.GreaseOneByte) + { + greaseExtensions++; + } + } + + if (greaseExtensions > 0) + { + extFirst = EntropyDraw.GreaseValue(entropy); + } + + if (greaseExtensions > 1) + { + int draws = 0; + do + { + extLast = EntropyDraw.GreaseValue(entropy); + if (++draws > 32) + { + throw new InvalidOperationException("The entropy source did not produce two different GREASE values."); + } + } + while (template.ExtensionGreaseValuesDiffer && extLast == extFirst); + } + + bool groupGrease = Uses(template.Groups, static code => code.Grease) || UsesKeyShareGrease(template); + ushort group = groupGrease ? EntropyDraw.GreaseValue(entropy) : (ushort)0; + ushort version = Uses(template.Versions, static code => code.Grease) ? EntropyDraw.GreaseValue(entropy) : (ushort)0; + ushort signature = Uses(template.SignatureAlgorithms, static code => code.Grease) ? EntropyDraw.GreaseValue(entropy) : (ushort)0; + return new GreaseDraw + { + Cipher = cipher, + ExtensionFirst = extFirst, + ExtensionLast = extLast, + Group = group, + Version = version, + Signature = signature, + }; + } + + private static ExtensionSpec[] Order(ClientHelloTemplate template, IEntropySource entropy) + { + var specs = (ExtensionSpec[])template.Extensions.Clone(); + if (template.Order == ExtensionOrderPolicy.Fixed) + { + return specs; + } + + if (template.Order == ExtensionOrderPolicy.PermuteExceptFixed) + { + var moving = new List(); + foreach (ExtensionSpec spec in specs) + { + if (!spec.Fixed) + { + moving.Add(spec); + } + } + + ExtensionSpec[] shuffled = moving.ToArray(); + EntropyDraw.Shuffle(shuffled, entropy); + int next = 0; + for (int i = 0; i < specs.Length; i++) + { + if (!specs[i].Fixed) + { + specs[i] = shuffled[next++]; + } + } + + return specs; + } + + var seen = new HashSet(); + foreach (ExtensionSpec spec in specs) + { + if (spec.PermuteGroup >= 0) + { + seen.Add(spec.PermuteGroup); + } + } + + foreach (int group in seen) + { + var indexes = new List(); + for (int i = 0; i < specs.Length; i++) + { + if (specs[i].PermuteGroup == group) + { + indexes.Add(i); + } + } + + var members = new ExtensionSpec[indexes.Count]; + for (int n = 0; n < indexes.Count; n++) + { + members[n] = specs[indexes[n]]; + } + + EntropyDraw.Shuffle(members, entropy); + for (int n = 0; n < indexes.Count; n++) + { + specs[indexes[n]] = members[n]; + } + } + + return specs; + } + + private static List Render( + ClientHelloTemplate template, + ClientHelloContext context, + IEntropySource entropy, + GreaseDraw grease, + PlannedExtension[] plan, + RetryPins pins, + out int paddingAt) + { + var rendered = new List(plan.Length); + paddingAt = -1; + foreach (PlannedExtension planned in plan) + { + if (planned.Spec.Kind == ExtensionKind.Padding) + { + paddingAt = rendered.Count; + continue; + } + + byte[]? body = Body(template, context, entropy, grease, planned, pins); + if (body is null) + { + continue; + } + + rendered.Add(new RenderedExtension(planned.Type, body)); + } + + return rendered; + } + + private static byte[]? Body(ClientHelloTemplate template, ClientHelloContext context, IEntropySource entropy, GreaseDraw grease, PlannedExtension planned, RetryPins pins) + { + return planned.Spec.Kind switch + { + ExtensionKind.Empty or ExtensionKind.GreaseEmpty => [], + ExtensionKind.GreaseOneByte => pins.GreaseOneByte ??= EntropyDraw.Bytes(entropy, 1), + ExtensionKind.Constant => planned.Spec.ConstantBody ?? [], + ExtensionKind.ServerName => ServerName(context.ServerName), + ExtensionKind.Alpn => Alpn(context.ApplicationProtocols ?? template.ApplicationProtocols), + ExtensionKind.NamedGroups => Codes(template.Groups, grease.Group, template.Fidelity), + ExtensionKind.Versions => VersionList(template.Versions, grease.Version), + ExtensionKind.SignatureAlgorithms => Codes(template.SignatureAlgorithms, grease.Signature, template.Fidelity), + ExtensionKind.KeyShare => KeyShares(template, context, entropy, grease), + ExtensionKind.EncryptedClientHelloGrease => pins.Ech ??= Ech(template, entropy), + ExtensionKind.Padding => [], + _ => throw new TlsProtocolViolation("The template has an unknown extension generator."), + }; + } + + private static byte[]? ServerName(string? name) + { + if (name is null) + { + return null; + } + + byte[] host = System.Text.Encoding.ASCII.GetBytes(name); + var buffer = new byte[2 + 1 + 2 + host.Length]; + buffer[0] = (byte)((host.Length + 3) >> 8); + buffer[1] = (byte)(host.Length + 3); + buffer[2] = 0; + buffer[3] = (byte)(host.Length >> 8); + buffer[4] = (byte)host.Length; + host.CopyTo(buffer.AsSpan(5)); + return buffer; + } + + private static byte[] Alpn(IReadOnlyList protocols) + { + int payload = 0; + foreach (string protocol in protocols) + { + payload += 1 + System.Text.Encoding.ASCII.GetByteCount(protocol); + } + + var buffer = new byte[2 + payload]; + buffer[0] = (byte)(payload >> 8); + buffer[1] = (byte)payload; + int offset = 2; + foreach (string protocol in protocols) + { + byte[] bytes = System.Text.Encoding.ASCII.GetBytes(protocol); + buffer[offset++] = (byte)bytes.Length; + bytes.CopyTo(buffer.AsSpan(offset)); + offset += bytes.Length; + } + + return buffer; + } + + private static byte[] Codes(AdvertisedCode[] codes, ushort grease, TlsFingerprintFidelity fidelity) + { + int count = 0; + foreach (AdvertisedCode code in codes) + { + if (Include(code, fidelity)) + { + count++; + } + } + + var buffer = new byte[2 + (count * 2)]; + buffer[0] = (byte)((count * 2) >> 8); + buffer[1] = (byte)(count * 2); + int offset = 2; + foreach (AdvertisedCode code in codes) + { + if (!Include(code, fidelity)) + { + continue; + } + + ushort value = code.Grease ? grease : code.Value; + buffer[offset++] = (byte)(value >> 8); + buffer[offset++] = (byte)value; + } + + return buffer; + } + + private static byte[] VersionList(AdvertisedCode[] versions, ushort grease) + { + var buffer = new byte[1 + (versions.Length * 2)]; + buffer[0] = (byte)(versions.Length * 2); + int offset = 1; + foreach (AdvertisedCode version in versions) + { + ushort value = version.Grease ? grease : version.Value; + buffer[offset++] = (byte)(value >> 8); + buffer[offset++] = (byte)value; + } + + return buffer; + } + + private static byte[] KeyShares(ClientHelloTemplate template, ClientHelloContext context, IEntropySource entropy, GreaseDraw grease) + { + var entries = new List(); + int payload = 0; + if (context.AnswersHelloRetry && context.KeyShares is not null) + { + foreach (KeyValuePair share in context.KeyShares) + { + var retryEntry = new byte[4 + share.Value.Length]; + retryEntry[0] = (byte)(share.Key >> 8); + retryEntry[1] = (byte)share.Key; + retryEntry[2] = (byte)(share.Value.Length >> 8); + retryEntry[3] = (byte)share.Value.Length; + share.Value.CopyTo(retryEntry.AsSpan(4)); + entries.Add(retryEntry); + payload += retryEntry.Length; + } + + return JoinKeyShares(entries, payload); + } + + foreach (KeyShareSlot slot in template.KeyShares) + { + if (slot.OmitWhenReduced && template.Fidelity == TlsFingerprintFidelity.ReducedNoPostQuantum) + { + continue; + } + + if (template.Fidelity == TlsFingerprintFidelity.ReducedFipsPolicy && + !slot.Grease && + !TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, slot.Group)) + { + continue; + } + + byte[] key; + if (slot.Grease) + { + key = EntropyDraw.Bytes(entropy, slot.Length); + } + else + { + key = RequiredShare(context, slot); + } + + ushort group = slot.Grease ? (template.KeyShareGreaseMatchesGroup ? grease.Group : grease.ExtensionFirst) : slot.Group; + var entry = new byte[4 + key.Length]; + entry[0] = (byte)(group >> 8); + entry[1] = (byte)group; + entry[2] = (byte)(key.Length >> 8); + entry[3] = (byte)key.Length; + key.CopyTo(entry.AsSpan(4)); + entries.Add(entry); + payload += entry.Length; + } + + return JoinKeyShares(entries, payload); + } + + private static byte[] JoinKeyShares(List entries, int payload) + { + var buffer = new byte[2 + payload]; + buffer[0] = (byte)(payload >> 8); + buffer[1] = (byte)payload; + int offset = 2; + foreach (byte[] entry in entries) + { + entry.CopyTo(buffer.AsSpan(offset)); + offset += entry.Length; + } + + return buffer; + } + + private static byte[] RequiredShare(ClientHelloContext context, KeyShareSlot slot) + { + if (context.KeyShares is null || !context.KeyShares.TryGetValue(slot.Group, out byte[]? share) || share.Length != slot.Length) + { + throw new InvalidOperationException($"The ClientHello is missing a {slot.Length}-byte key share for group 0x{slot.Group:x4}."); + } + + return share; + } + + private static byte[] Ech(ClientHelloTemplate template, IEntropySource entropy) + { + if (template.EchPayloadLengths is null || template.EchPayloadLengths.Length == 0) + { + throw new TlsProtocolViolation("The template advertises encrypted client hello without a payload length."); + } + + int payloadLength = template.EchPayloadLengths[EntropyDraw.Below(entropy, template.EchPayloadLengths.Length)]; + byte[] enc = EntropyDraw.Bytes(entropy, 32); + byte[] payload = EntropyDraw.Bytes(entropy, payloadLength); + byte config = EntropyDraw.Byte(entropy); + var buffer = new byte[1 + 4 + 1 + 2 + enc.Length + 2 + payload.Length]; + buffer[0] = 0; + buffer[1] = 0; + buffer[2] = 1; + buffer[3] = 0; + buffer[4] = 1; + buffer[5] = config; + buffer[6] = 0; + buffer[7] = 32; + enc.CopyTo(buffer.AsSpan(8)); + int payloadAt = 8 + enc.Length; + buffer[payloadAt] = (byte)(payload.Length >> 8); + buffer[payloadAt + 1] = (byte)payload.Length; + payload.CopyTo(buffer.AsSpan(payloadAt + 2)); + return buffer; + } + + private static byte[] PskBody(ClientHelloContext context) + { + byte[] ticket = context.SessionTicket ?? throw new InvalidOperationException("A resumed hello needs a session ticket."); + byte[] binder = context.PskBinder ?? throw new InvalidOperationException("A resumed hello needs a PSK binder."); + if (binder.Length is < 32 or > 255) + { + throw new InvalidOperationException("A PSK binder is 32 to 255 bytes."); + } + + int identity = 2 + ticket.Length + 4; + var buffer = new byte[2 + identity + 2 + 1 + binder.Length]; + int offset = 0; + offset = WriteU16(buffer, offset, identity); + offset = WriteU16(buffer, offset, ticket.Length); + ticket.CopyTo(buffer.AsSpan(offset)); + offset += ticket.Length; + offset += 4; + offset = WriteU16(buffer, offset, 1 + binder.Length); + buffer[offset++] = (byte)binder.Length; + binder.CopyTo(buffer.AsSpan(offset)); + return buffer; + } + + private static int PaddingLength(ClientHelloTemplate template, ClientHelloContext context, List rendered) + { + if (template.Padding == PaddingPolicy.None) + { + return -1; + } + + int extra = context.SessionTicket is null ? 0 : 4 + PskBody(context).Length; + int record = 5 + HandshakeLength(template, rendered) + extra; + bool withinBand = template.Padding != PaddingPolicy.PadWithinBand || (record >= template.PaddingBandMin && record <= template.PaddingBandMax); + if (!withinBand || record >= template.PaddingTarget) + { + return -1; + } + + int deficit = template.PaddingTarget - record; + return deficit > 4 ? deficit - 4 : 0; + } + + private static byte[] WriteHandshake(ClientHelloTemplate template, IEntropySource entropy, GreaseDraw grease, List rendered, RetryPins pins) + { + var buffer = new byte[HandshakeLength(template, rendered)]; + TlsWriter writer = TlsWriter.Over(buffer); + if (!writer.TryWriteUInt8((byte)HandshakeType.ClientHello) || !writer.TryReserveLength(3, out int lengthAt)) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + + if (!writer.TryWriteUInt16(template.LegacyVersion) || !writer.TryWrite(pins.Random ??= EntropyDraw.Bytes(entropy, 32))) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + + if (!writer.TryWriteVector8(pins.SessionId ??= EntropyDraw.Bytes(entropy, template.SessionIdLength))) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + + int cipherCount = IncludedCount(template.Ciphers, template.Fidelity); + var ciphers = new byte[cipherCount * 2]; + int cipherAt = 0; + foreach (AdvertisedCode code in template.Ciphers) + { + if (!Include(code, template.Fidelity)) + { + continue; + } + + ushort value = code.Grease ? grease.Cipher : code.Value; + ciphers[cipherAt++] = (byte)(value >> 8); + ciphers[cipherAt++] = (byte)value; + } + + if (!writer.TryWriteVector16(ciphers) || !writer.TryWriteVector8([0])) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + + if (!writer.TryReserveLength(2, out int extensionsAt)) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + + foreach (RenderedExtension extension in rendered) + { + if (!writer.TryWriteUInt16(extension.Type) || !writer.TryWriteVector16(extension.Body)) + { + throw new TlsProtocolViolation("The ClientHello buffer is short."); + } + } + + if (!writer.TryPatchLength(extensionsAt, 2) || !writer.TryPatchLength(lengthAt, 3) || writer.Written != buffer.Length) + { + throw new TlsProtocolViolation("The ClientHello length does not match the bytes written."); + } + + return buffer; + } + + private static int HandshakeLength(ClientHelloTemplate template, List rendered) + { + int extensions = 0; + foreach (RenderedExtension extension in rendered) + { + extensions += 4 + extension.Body.Length; + } + + return 4 + 2 + 32 + 1 + template.SessionIdLength + 2 + (IncludedCount(template.Ciphers, template.Fidelity) * 2) + 2 + 2 + extensions; + } + + private static void WriteRecord(ReadOnlySpan handshake, ushort version, IBufferWriter destination) + { + Span header = destination.GetSpan(5 + handshake.Length); + header[0] = 22; + header[1] = (byte)(version >> 8); + header[2] = (byte)version; + header[3] = (byte)(handshake.Length >> 8); + header[4] = (byte)handshake.Length; + handshake.CopyTo(header[5..]); + destination.Advance(5 + handshake.Length); + } + + private static ushort ResolveType(ExtensionSpec spec, GreaseDraw grease) + { + if (spec.Kind == ExtensionKind.GreaseEmpty) + { + return grease.ExtensionFirst; + } + + if (spec.Kind == ExtensionKind.GreaseOneByte) + { + return grease.ExtensionLast == 0 ? grease.ExtensionFirst : grease.ExtensionLast; + } + + return spec.Type; + } + + private static byte[] Save(GreaseDraw grease, PlannedExtension[] plan) + { + var buffer = new byte[15 + (plan.Length * 2)]; + buffer[0] = 1; + WriteU16(buffer, 1, grease.Cipher); + WriteU16(buffer, 3, grease.ExtensionFirst); + WriteU16(buffer, 5, grease.ExtensionLast); + WriteU16(buffer, 7, grease.Group); + WriteU16(buffer, 9, grease.Version); + WriteU16(buffer, 11, grease.Signature); + WriteU16(buffer, 13, plan.Length); + for (int i = 0; i < plan.Length; i++) + { + WriteU16(buffer, 15 + (i * 2), plan[i].Type); + } + + return buffer; + } + + private static PlannedExtension[] Restore(ClientHelloTemplate template, byte[] state, out GreaseDraw grease) + { + if (state.Length < 15 || state[0] != 1) + { + throw new ArgumentException("The HelloRetryRequest state is not a ClientHello plan.", nameof(state)); + } + + grease = new GreaseDraw + { + Cipher = ReadU16(state, 1), + ExtensionFirst = ReadU16(state, 3), + ExtensionLast = ReadU16(state, 5), + Group = ReadU16(state, 7), + Version = ReadU16(state, 9), + Signature = ReadU16(state, 11), + }; + int count = ReadU16(state, 13); + if (state.Length < 15 + (count * 2)) + { + throw new ArgumentException("The HelloRetryRequest state is truncated.", nameof(state)); + } + + var remaining = new List(template.Extensions); + var plan = new PlannedExtension[count]; + for (int i = 0; i < count; i++) + { + ushort type = ReadU16(state, 15 + (i * 2)); + ExtensionSpec? match = null; + foreach (ExtensionSpec spec in remaining) + { + bool greaseExtension = spec.Kind is ExtensionKind.GreaseEmpty or ExtensionKind.GreaseOneByte; + if (greaseExtension == Grease.IsGrease(type) && (greaseExtension || spec.Type == type)) + { + match = spec; + break; + } + } + + if (match is null) + { + throw new ArgumentException("The HelloRetryRequest state does not match this profile.", nameof(state)); + } + + remaining.Remove(match); + plan[i] = new PlannedExtension(match, type); + } + + return plan; + } + + private static int IncludedCount(AdvertisedCode[] codes, TlsFingerprintFidelity fidelity) + { + int count = 0; + foreach (AdvertisedCode code in codes) + { + if (Include(code, fidelity)) + { + count++; + } + } + + return count; + } + + private static bool Include(AdvertisedCode code, TlsFingerprintFidelity fidelity) + { + if (fidelity == TlsFingerprintFidelity.ReducedFipsPolicy) + { + return code.Grease || TlsAlgorithmSet.IsApprovedOffer(code.Value); + } + + return fidelity != TlsFingerprintFidelity.ReducedNoPostQuantum || code.Value != 0x11EC; + } + + private static bool Uses(AdvertisedCode[] codes, Func predicate) + { + foreach (AdvertisedCode code in codes) + { + if (predicate(code)) + { + return true; + } + } + + return false; + } + + private static bool UsesKeyShareGrease(ClientHelloTemplate template) + { + foreach (KeyShareSlot slot in template.KeyShares) + { + if (slot.Grease) + { + return true; + } + } + + return false; + } + + // RFC 8446 section 4.1.2: the ClientHello that answers a HelloRetryRequest keeps the random, + // the legacy session id, and every extension it does not have to change. The values that the + // profile draws from entropy are pinned in the state tail so the second hello repeats them. + private sealed class RetryPins + { + internal byte[]? Random { get; set; } + + internal byte[]? SessionId { get; set; } + + internal byte[]? GreaseOneByte { get; set; } + + internal byte[]? Ech { get; set; } + } + + private static int PlanLength(byte[] state) + { + return 15 + (ReadU16(state, 13) * 2); + } + + private static byte[] WithPins(byte[] plan, RetryPins pins) + { + byte[]?[] values = [pins.Random, pins.SessionId, pins.GreaseOneByte, pins.Ech]; + int length = PlanLength(plan); + int total = length + 1; + byte flags = 0; + for (int i = 0; i < values.Length; i++) + { + if (values[i] is not null) + { + flags |= (byte)(1 << i); + total += 2 + values[i]!.Length; + } + } + + var state = new byte[total]; + plan.AsSpan(0, length).CopyTo(state); + state[length] = flags; + int at = length + 1; + for (int i = 0; i < values.Length; i++) + { + if (values[i] is null) + { + continue; + } + + at = WriteU16(state, at, values[i]!.Length); + values[i]!.CopyTo(state, at); + at += values[i]!.Length; + } + + return state; + } + + private static RetryPins ReadPins(byte[] state) + { + var pins = new RetryPins(); + if (state.Length < 15) + { + return pins; + } + + int at = PlanLength(state); + if (at >= state.Length) + { + return pins; + } + + byte flags = state[at++]; + byte[]?[] values = new byte[]?[4]; + for (int i = 0; i < values.Length; i++) + { + if ((flags & (1 << i)) == 0) + { + continue; + } + + if (at + 2 > state.Length) + { + throw new ArgumentException("The HelloRetryRequest state is truncated.", nameof(state)); + } + + int length = ReadU16(state, at); + at += 2; + if (at + length > state.Length) + { + throw new ArgumentException("The HelloRetryRequest state is truncated.", nameof(state)); + } + + values[i] = state.AsSpan(at, length).ToArray(); + at += length; + } + + pins.Random = values[0]; + pins.SessionId = values[1]; + pins.GreaseOneByte = values[2]; + pins.Ech = values[3]; + return pins; + } + + private static int WriteU16(byte[] buffer, int offset, int value) + { + buffer[offset] = (byte)(value >> 8); + buffer[offset + 1] = (byte)value; + return offset + 2; + } + + private static ushort ReadU16(byte[] buffer, int offset) + { + return (ushort)((buffer[offset] << 8) | buffer[offset + 1]); + } + + private readonly struct PlannedExtension + { + internal PlannedExtension(ExtensionSpec spec, ushort type) + { + Spec = spec; + Type = type; + } + + internal ExtensionSpec Spec { get; } + + internal ushort Type { get; } + } + + private readonly struct RenderedExtension + { + internal RenderedExtension(ushort type, byte[] body) + { + Type = type; + Body = body; + } + + internal ushort Type { get; } + + internal byte[] Body { get; } + } +} + +internal static class EntropyDraw +{ + internal static byte Byte(IEntropySource entropy) + { + Span one = stackalloc byte[1]; + entropy.Fill(one); + return one[0]; + } + + internal static byte[] Bytes(IEntropySource entropy, int count) + { + var buffer = new byte[count]; + if (count > 0) + { + entropy.Fill(buffer); + } + + return buffer; + } + + internal static ushort GreaseValue(IEntropySource entropy) + { + return Grease.Values[Byte(entropy) & 15]; + } + + internal static int Below(IEntropySource entropy, int exclusiveMax) + { + if (exclusiveMax <= 1) + { + return 0; + } + + int limit = 256 - (256 % exclusiveMax); + byte value; + do + { + value = Byte(entropy); + } + while (value >= limit); + + return value % exclusiveMax; + } + + internal static void Shuffle(T[] items, IEntropySource entropy) + { + for (int i = items.Length - 1; i > 0; i--) + { + int j = Below(entropy, i + 1); + (items[i], items[j]) = (items[j], items[i]); + } + } +} diff --git a/src/Titanium.Tls/Fingerprint/ClientHelloContext.cs b/src/Titanium.Tls/Fingerprint/ClientHelloContext.cs new file mode 100644 index 000000000..44daa42d0 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/ClientHelloContext.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; + +namespace Titanium.Tls; + +/// +/// Inputs for one ClientHello. Pass the same on the +/// ClientHello that follows a HelloRetryRequest so the extension order and GREASE values stay put. +/// +public sealed class ClientHelloContext +{ + /// The DNS name to put in the server_name extension. A null name omits that extension. + public string? ServerName { get; set; } + + /// Protocols for the ALPN extension. Null uses the profile's own list. + public IReadOnlyList? ApplicationProtocols { get; set; } + + /// + /// Key-share bytes keyed by the named group. The profile places these bytes; it does not invent them. + /// A GREASE share is the exception and is filled from the entropy source. + /// + public IReadOnlyDictionary? KeyShares { get; set; } + + /// A session ticket. When set, the profile appends pre_shared_key as the last extension. + public byte[]? SessionTicket { get; set; } + + /// The PSK binder that matches . + public byte[]? PskBinder { get; set; } + + /// Opaque state written by the profile on the first ClientHello and read back after a HelloRetryRequest. + public byte[]? HelloRetryState { get; set; } + + /// + /// True for the ClientHello that answers a HelloRetryRequest. The key_share extension then carries + /// exactly the entries in , because the server named the one group it wants. + /// + internal bool AnswersHelloRetry { get; set; } +} diff --git a/src/Titanium.Tls/Fingerprint/ClientHelloTemplate.cs b/src/Titanium.Tls/Fingerprint/ClientHelloTemplate.cs new file mode 100644 index 000000000..4df1aff62 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/ClientHelloTemplate.cs @@ -0,0 +1,221 @@ +using System; + +namespace Titanium.Tls; + +internal enum ExtensionOrderPolicy +{ + Fixed, + PermuteExceptFixed, + Groups, +} + +internal enum PaddingPolicy +{ + None, + PadToLength, + PadWithinBand, +} + +internal enum ExtensionKind +{ + Empty, + Constant, + ServerName, + Alpn, + NamedGroups, + Versions, + SignatureAlgorithms, + KeyShare, + EncryptedClientHelloGrease, + GreaseEmpty, + GreaseOneByte, + Padding, +} + +internal readonly struct AdvertisedCode +{ + internal AdvertisedCode(ushort value, bool implemented = false, bool grease = false) + { + Value = value; + Implemented = implemented; + Grease = grease; + } + + internal ushort Value { get; } + + internal bool Implemented { get; } + + internal bool Grease { get; } +} + +internal readonly struct KeyShareSlot +{ + internal KeyShareSlot(ushort group, int length, bool grease = false, bool omitWhenReduced = false) + { + Group = group; + Length = length; + Grease = grease; + OmitWhenReduced = omitWhenReduced; + } + + internal ushort Group { get; } + + internal int Length { get; } + + internal bool Grease { get; } + + internal bool OmitWhenReduced { get; } +} + +internal sealed class ExtensionSpec +{ + internal required ushort Type { get; init; } + + internal ExtensionKind Kind { get; init; } + + internal bool Fixed { get; init; } + + internal int PermuteGroup { get; init; } = -1; + + internal bool Implemented { get; init; } + + internal byte[]? ConstantBody { get; init; } +} + +internal sealed class ClientHelloTemplate +{ + internal required string Name { get; set; } + + internal required string Version { get; set; } + + internal TlsFingerprintFidelity Fidelity { get; set; } + + internal ushort RecordVersion { get; set; } = 0x0301; + + internal ushort LegacyVersion { get; set; } = 0x0303; + + internal int SessionIdLength { get; set; } = 32; + + internal bool SplitAcrossRecords { get; set; } + + internal ExtensionOrderPolicy Order { get; set; } + + internal PaddingPolicy Padding { get; set; } + + internal int PaddingTarget { get; set; } + + internal int PaddingBandMin { get; set; } + + internal int PaddingBandMax { get; set; } + + internal bool ExtensionGreaseValuesDiffer { get; set; } + + internal bool KeyShareGreaseMatchesGroup { get; set; } + + internal required AdvertisedCode[] Ciphers { get; set; } + + internal required AdvertisedCode[] Groups { get; set; } + + internal required AdvertisedCode[] Versions { get; set; } + + internal required AdvertisedCode[] SignatureAlgorithms { get; set; } + + internal required KeyShareSlot[] KeyShares { get; set; } + + internal required string[] ApplicationProtocols { get; set; } + + internal int[]? EchPayloadLengths { get; set; } + + internal required ExtensionSpec[] Extensions { get; set; } +} + +internal static class Grease +{ + internal static readonly ushort[] Values = + [ + 0x0A0A, 0x1A1A, 0x2A2A, 0x3A3A, 0x4A4A, 0x5A5A, 0x6A6A, 0x7A7A, + 0x8A8A, 0x9A9A, 0xAAAA, 0xBABA, 0xCACA, 0xDADA, 0xEAEA, 0xFAFA, + ]; + + internal static bool IsGrease(ushort value) + { + return (value & 0x0F0F) == 0x0A0A; + } +} + +internal readonly struct GreaseDraw +{ + internal ushort Cipher { get; init; } + + internal ushort ExtensionFirst { get; init; } + + internal ushort ExtensionLast { get; init; } + + internal ushort Group { get; init; } + + internal ushort Version { get; init; } + + internal ushort Signature { get; init; } +} + +internal static class EngineCapabilities +{ + internal static bool Cipher(ushort value) + { + return value is 0x1301 or 0x1302 or 0x1303; + } + + internal static bool Group(ushort value) + { + return value is 0x0017 or 0x0018 or 0x001D or 0x11EC; + } + + internal static bool Version(ushort value) + { + return value == 0x0304; + } + + internal static bool Extension(ushort value) + { + return value is 0 or 10 or 13 or 16 or 21 or 27 or 41 or 43 or 45 or 51; + } +} + +internal static class TemplateGuard +{ + internal static void Check(ClientHelloTemplate template) + { + foreach (AdvertisedCode cipher in template.Ciphers) + { + Reject(cipher.Implemented && (cipher.Grease || !EngineCapabilities.Cipher(cipher.Value)), "cipher", cipher.Value); + } + + foreach (AdvertisedCode group in template.Groups) + { + Reject(group.Implemented && (group.Grease || !EngineCapabilities.Group(group.Value)), "group", group.Value); + } + + foreach (AdvertisedCode version in template.Versions) + { + Reject(version.Implemented && (version.Grease || !EngineCapabilities.Version(version.Value)), "version", version.Value); + } + + foreach (ExtensionSpec extension in template.Extensions) + { + if (extension.Kind is ExtensionKind.GreaseEmpty or ExtensionKind.GreaseOneByte) + { + continue; + } + + Reject(extension.Implemented && !EngineCapabilities.Extension(extension.Type), "extension", extension.Type); + } + } + + private static void Reject(bool failed, string kind, ushort value) + { + if (failed) + { + throw new TlsProtocolViolation($"The template marks {kind} 0x{value:x4} implemented, and the engine cannot select it."); + } + } +} diff --git a/src/Titanium.Tls/Fingerprint/Profiles/ChromeFingerprintProfile.cs b/src/Titanium.Tls/Fingerprint/Profiles/ChromeFingerprintProfile.cs new file mode 100644 index 000000000..40ca008db --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/Profiles/ChromeFingerprintProfile.cs @@ -0,0 +1,172 @@ +using System; +using System.Buffers; + +namespace Titanium.Tls; + +/// The profiles this assembly ships. +public static class TlsFingerprintProfiles +{ + /// The captured browser profile. + public static ChromeFingerprintProfile Chrome { get; } = new(); +} + +/// +/// ClientHello shape measured from Chrome 158.0.8127.89 on Windows. +/// The middle extensions move. The first and last extensions are GREASE, and those two values differ. +/// The GREASE value in supported_groups is the same value as the GREASE key share. +/// +public sealed class ChromeFingerprintProfile : TlsFingerprintProfile +{ + private readonly IEntropySource _entropy; + private readonly TlsFingerprintFidelity? _forced; + + /// Uses the process entropy source and the current post-quantum capability. + public ChromeFingerprintProfile() + : this(new SystemEntropy(), null) + { + } + + internal ChromeFingerprintProfile(IEntropySource entropy, TlsFingerprintFidelity? fidelity) + { + _entropy = entropy; + _forced = fidelity; + } + + /// + public override string Name => "Chrome"; + + /// + public override string Version => "158.0.8127.89"; + + /// + public override TlsFingerprintFidelity Fidelity + { + get + { + if (_forced is TlsFingerprintFidelity forced) + { + return forced; + } + + if (FipsEnvironment.SystemIsEnabled()) + { + return TlsFingerprintFidelity.ReducedFipsPolicy; + } + + return TlsFingerprint.Current; + } + } + + /// + public override void BuildClientHello(ClientHelloContext context, IBufferWriter destination) + { + ClientHelloBuilder.Write(Create(Fidelity), context, _entropy, destination); + } + + private static ClientHelloTemplate Create(TlsFingerprintFidelity fidelity) + { + return new ClientHelloTemplate + { + Name = "Chrome", + Version = "158.0.8127.89", + Fidelity = fidelity, + RecordVersion = 0x0301, + LegacyVersion = 0x0303, + SessionIdLength = 32, + Order = ExtensionOrderPolicy.PermuteExceptFixed, + ExtensionGreaseValuesDiffer = true, + KeyShareGreaseMatchesGroup = true, + EchPayloadLengths = EchPayloadLengths, + ApplicationProtocols = ["h2", "http/1.1"], + Ciphers = + [ + new AdvertisedCode(0, grease: true), + new AdvertisedCode(0x1301, implemented: true), + new AdvertisedCode(0x1302, implemented: true), + new AdvertisedCode(0x1303, implemented: true), + new AdvertisedCode(0xC02B), + new AdvertisedCode(0xC02F), + new AdvertisedCode(0xC02C), + new AdvertisedCode(0xC030), + new AdvertisedCode(0xCCA9), + new AdvertisedCode(0xCCA8), + new AdvertisedCode(0xC013), + new AdvertisedCode(0xC014), + new AdvertisedCode(0x009C), + new AdvertisedCode(0x009D), + new AdvertisedCode(0x002F), + new AdvertisedCode(0x0035), + ], + Groups = + [ + new AdvertisedCode(0, grease: true), + new AdvertisedCode(0x11EC, implemented: true), + new AdvertisedCode(0x001D, implemented: true), + new AdvertisedCode(0x0017, implemented: true), + new AdvertisedCode(0x0018, implemented: true), + ], + Versions = + [ + new AdvertisedCode(0, grease: true), + new AdvertisedCode(0x0304, implemented: true), + new AdvertisedCode(0x0303), + ], + SignatureAlgorithms = + [ + new AdvertisedCode(0, grease: true), + new AdvertisedCode(0x0904), + new AdvertisedCode(0x0905), + new AdvertisedCode(0x0906), + new AdvertisedCode(0x0403), + new AdvertisedCode(0x0804), + new AdvertisedCode(0x0401), + new AdvertisedCode(0x0503), + new AdvertisedCode(0x0805), + new AdvertisedCode(0x0501), + new AdvertisedCode(0x0806), + new AdvertisedCode(0x0601), + ], + KeyShares = + [ + new KeyShareSlot(0, 1, grease: true), + new KeyShareSlot(0x11EC, 1216, omitWhenReduced: true), + new KeyShareSlot(0x001D, 32), + ], + Extensions = + [ + new ExtensionSpec { Type = 0, Kind = ExtensionKind.GreaseEmpty, Fixed = true }, + new ExtensionSpec { Type = ExtensionType.ExtendedMasterSecret, Kind = ExtensionKind.Empty }, + new ExtensionSpec { Type = ExtensionType.ApplicationSettings, Kind = ExtensionKind.Constant, ConstantBody = [0x00, 0x03, 0x02, 0x68, 0x32] }, + new ExtensionSpec { Type = ExtensionType.ApplicationLayerProtocolNegotiation, Kind = ExtensionKind.Alpn, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.SupportedVersions, Kind = ExtensionKind.Versions, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.KeyShare, Kind = ExtensionKind.KeyShare, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.SessionTicket, Kind = ExtensionKind.Empty }, + new ExtensionSpec { Type = ExtensionType.SignedCertificateTimestamp, Kind = ExtensionKind.Empty }, + new ExtensionSpec { Type = ExtensionType.SignatureAlgorithms, Kind = ExtensionKind.SignatureAlgorithms, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.RenegotiationInfo, Kind = ExtensionKind.Constant, ConstantBody = [0x00] }, + new ExtensionSpec { Type = ExtensionType.ServerName, Kind = ExtensionKind.ServerName, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.PskKeyExchangeModes, Kind = ExtensionKind.Constant, ConstantBody = [0x01, 0x01], Implemented = true }, + new ExtensionSpec { Type = ExtensionType.CompressCertificate, Kind = ExtensionKind.Constant, ConstantBody = [0x02, 0x00, 0x02], Implemented = true }, + new ExtensionSpec { Type = ExtensionType.StatusRequest, Kind = ExtensionKind.Constant, ConstantBody = [0x01, 0x00, 0x00, 0x00, 0x00] }, + new ExtensionSpec { Type = ExtensionType.SupportedGroups, Kind = ExtensionKind.NamedGroups, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.EncryptedClientHello, Kind = ExtensionKind.EncryptedClientHelloGrease }, + new ExtensionSpec { Type = 0xCA34, Kind = ExtensionKind.Constant, ConstantBody = UnknownExtension }, + new ExtensionSpec { Type = ExtensionType.EcPointFormats, Kind = ExtensionKind.Constant, ConstantBody = [0x01, 0x00] }, + new ExtensionSpec { Type = 0, Kind = ExtensionKind.GreaseOneByte, Fixed = true }, + ], + }; + } + + private static readonly int[] EchPayloadLengths = + [ + 208, 208, 240, 144, 208, 208, 240, 240, 240, 240, 144, 208, 176, 144, 176, 144, 208, 176, 176, 176, + 208, 240, 144, 208, 176, 208, 176, 208, 208, 176, 144, 240, 176, 144, 240, 208, 176, 176, 208, 144, + 208, 176, 208, 240, 208, 208, 176, 240, 208, 144, + ]; + + private static readonly byte[] UnknownExtension = Convert.FromHexString( + "00B80582DF1302010582DF1302060582DF13020D0582DF13020E0582DF13020F0582DF1302120582DF1302130582DF130214" + + "08839A648C9B2D010708839A648C9B2D010808839A648C9B2D010908839A648C9B2D010A08839A648C9B2D010B08839A648C9B2D010C" + + "08839A648C9B2D010D08839A648C9B2D011208839A648C9B2D011304D679090104D679090404D679090504D679090604D679090704D6790908" + + "04D679090A04D679090B04D679090C04D679090D04D679090F"); +} diff --git a/src/Titanium.Tls/Fingerprint/TemplateFingerprintProfile.cs b/src/Titanium.Tls/Fingerprint/TemplateFingerprintProfile.cs new file mode 100644 index 000000000..19e510ae6 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/TemplateFingerprintProfile.cs @@ -0,0 +1,26 @@ +using System.Buffers; + +namespace Titanium.Tls; + +internal sealed class TemplateFingerprintProfile : TlsFingerprintProfile +{ + private readonly ClientHelloTemplate _template; + private readonly IEntropySource _entropy; + + internal TemplateFingerprintProfile(ClientHelloTemplate template, IEntropySource? entropy = null) + { + _template = template; + _entropy = entropy ?? new SystemEntropy(); + } + + public override string Name => _template.Name; + + public override string Version => _template.Version; + + public override TlsFingerprintFidelity Fidelity => _template.Fidelity; + + public override void BuildClientHello(ClientHelloContext context, IBufferWriter destination) + { + ClientHelloBuilder.Write(_template, context, _entropy, destination); + } +} diff --git a/src/Titanium.Tls/Fingerprint/TlsFingerprintProfile.cs b/src/Titanium.Tls/Fingerprint/TlsFingerprintProfile.cs new file mode 100644 index 000000000..27c29ac34 --- /dev/null +++ b/src/Titanium.Tls/Fingerprint/TlsFingerprintProfile.cs @@ -0,0 +1,24 @@ +using System.Buffers; + +namespace Titanium.Tls; + +/// +/// A browser ClientHello shape. The engine asks the profile for the hello and checks the +/// peer's reply against what that hello offered. +/// +public abstract class TlsFingerprintProfile +{ + /// A short profile name, such as the browser family. + public abstract string Name { get; } + + /// The captured browser version this profile was measured from. + public abstract string Version { get; } + + /// Whether this profile can offer every captured group. + public abstract TlsFingerprintFidelity Fidelity { get; } + + /// Writes one or more TLS records containing a ClientHello. + /// Server name, key shares, and any HelloRetryRequest state. + /// Receives the record bytes. + public abstract void BuildClientHello(ClientHelloContext context, IBufferWriter destination); +} diff --git a/src/Titanium.Tls/FipsEnvironment.cs b/src/Titanium.Tls/FipsEnvironment.cs new file mode 100644 index 000000000..50fd57771 --- /dev/null +++ b/src/Titanium.Tls/FipsEnvironment.cs @@ -0,0 +1,156 @@ +using System; +using System.IO; + +namespace Titanium.Tls; + +/// Reads the operating system's FIPS mode without native calls. +public static class FipsEnvironment +{ + private static IFipsProbe _probe = SystemFipsProbe.Instance; + + /// + /// True when Windows reports FipsAlgorithmPolicy\Enabled as 1, or Linux /proc/sys/crypto/fips_enabled is 1. + /// macOS is false. + /// + /// when FIPS mode is on. + public static bool IsEnabled() => Evaluate(_probe); + + /// + /// Returns the startup refusal when FIPS mode is on, the managed stack was requested, and neither + /// nor TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1 is set. + /// + /// True when a managed TLS or QUIC flag is on. + /// True when server.managedStackFipsOverride is true. + /// The error text, or null when the stack may run. + public static string? ManagedStackRefusal(bool managedRequested, bool configOverride) + { + if (!managedRequested || !IsEnabled() || configOverride || OverrideIsSet()) + { + return null; + } + + return "FIPS mode is on. The managed TLS and QUIC stacks refuse to start unless server.managedStackFipsOverride is true or TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1. With the override the managed stack is not FIPS-validated and fingerprint fidelity is reduced."; + } + + internal static bool SystemIsEnabled() => Evaluate(SystemFipsProbe.Instance); + + internal static bool Evaluate(IFipsProbe probe) + { + if (probe.IsMacOs) + { + return false; + } + + if (probe.IsWindows) + { + return probe.WindowsEnabled == 1; + } + + if (!probe.IsLinux) + { + return false; + } + + string? text = probe.LinuxFile; + if (text is null) + { + return false; + } + + ReadOnlySpan trimmed = text.AsSpan().Trim(); + return trimmed.Length == 1 && trimmed[0] == '1'; + } + + internal static bool OverrideIsSet() + { + return string.Equals( + Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE"), + "1", + StringComparison.Ordinal); + } + + internal static void Use(IFipsProbe probe) => _probe = probe; + + internal static void Reset() => _probe = SystemFipsProbe.Instance; +} + +internal interface IFipsProbe +{ + bool IsWindows { get; } + + bool IsLinux { get; } + + bool IsMacOs { get; } + + int? WindowsEnabled { get; } + + string? LinuxFile { get; } +} + +internal sealed class SystemFipsProbe : IFipsProbe +{ + internal static SystemFipsProbe Instance { get; } = new(); + + public bool IsWindows => OperatingSystem.IsWindows(); + + public bool IsLinux => OperatingSystem.IsLinux(); + + public bool IsMacOs => OperatingSystem.IsMacOS(); + + public int? WindowsEnabled + { + get + { + if (!OperatingSystem.IsWindows()) + { + return null; + } + + try + { + object? value = Microsoft.Win32.Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy", + "Enabled", + null); + return value is int number ? number : null; + } + catch (System.Security.SecurityException) + { + return null; + } + catch (UnauthorizedAccessException) + { + return null; + } + catch (IOException) + { + return null; + } + } + } + + public string? LinuxFile + { + get + { + if (!OperatingSystem.IsLinux()) + { + return null; + } + + try + { + const string path = "/proc/sys/crypto/fips_enabled"; + return File.Exists(path) ? File.ReadAllText(path) : null; + } + catch (UnauthorizedAccessException) + { + return null; + } + catch (IOException) + { + return null; + } + } + } +} diff --git a/src/Titanium.Tls/ITlsKeyLogSink.cs b/src/Titanium.Tls/ITlsKeyLogSink.cs new file mode 100644 index 000000000..7e179201b --- /dev/null +++ b/src/Titanium.Tls/ITlsKeyLogSink.cs @@ -0,0 +1,11 @@ +namespace Titanium.Tls; + +/// +/// Receives NSS key-log lines. Opt in only for a debug session: the lines are the traffic secrets. +/// +public interface ITlsKeyLogSink +{ + /// Accepts one key-log line without a trailing line break. + /// The NSS key-log line. + void Write(string line); +} diff --git a/src/Titanium.Tls/Internal/CryptoExecutionPolicy.cs b/src/Titanium.Tls/Internal/CryptoExecutionPolicy.cs new file mode 100644 index 000000000..ce4c0cb28 --- /dev/null +++ b/src/Titanium.Tls/Internal/CryptoExecutionPolicy.cs @@ -0,0 +1,40 @@ +using System; + +namespace Titanium.Tls; + +internal enum CryptoOffloadReason +{ + None = 0, + OnlineRevocation = 1, + ExternalPrivateKey = 2, +} + +/// +/// Decides which calls stay on the caller and which must leave it. +/// The thread hop itself waits for certificate validation. Running it here would schedule work the handshake does not do yet. +/// +internal static class CryptoExecutionPolicy +{ + internal static int HandshakeConcurrencyLimit(int processorCount) + { + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(processorCount); + return processorCount * 4; + } + + internal static CryptoOffloadReason Revocation(bool checksOnlineRevocation) + { + return checksOnlineRevocation ? CryptoOffloadReason.OnlineRevocation : CryptoOffloadReason.None; + } + + internal static CryptoOffloadReason Signing(bool softwareKey) + { + return softwareKey ? CryptoOffloadReason.None : CryptoOffloadReason.ExternalPrivateKey; + } + + internal static void Run(CryptoOffloadReason reason, Action action) + { + ArgumentNullException.ThrowIfNull(action); + _ = reason; + action(); + } +} diff --git a/src/Titanium.Tls/Internal/Curve25519Field.cs b/src/Titanium.Tls/Internal/Curve25519Field.cs new file mode 100644 index 000000000..8de960d8a --- /dev/null +++ b/src/Titanium.Tls/Internal/Curve25519Field.cs @@ -0,0 +1,508 @@ +using System; +using System.Buffers.Binary; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics.Arm; +using System.Runtime.Intrinsics.X86; + +namespace Titanium.Tls; + +/// +/// The prime field 2^255 - 19 as five 51-bit limbs. X25519 and Ed25519 share it. +/// After Carry each limb is below 2^52. Add and Sub stay below 2^54 +/// (Sub adds a multiple of the prime first). Multiply and square inputs are at most 2^54, +/// so a precomputed 19 * limb still fits in 64 bits. +/// +internal struct Curve25519Field +{ + private const int LimbBits = 51; + private const ulong LimbMask = (1UL << LimbBits) - 1; + + private ulong _z0; + private ulong _z1; + private ulong _z2; + private ulong _z3; + private ulong _z4; + + internal static Curve25519Field Zero => default; + + internal static Curve25519Field One => new() { _z0 = 1 }; + + internal static Curve25519Field FromLimbs(ulong z0, ulong z1, ulong z2, ulong z3, ulong z4) + { + return new Curve25519Field { _z0 = z0, _z1 = z1, _z2 = z2, _z3 = z3, _z4 = z4 }; + } + + internal static Curve25519Field FromUInt64(ulong value) + { + ArgumentOutOfRangeException.ThrowIfGreaterThan(value, LimbMask); + + Curve25519Field result = default; + result._z0 = value; + return result; + } + + internal readonly Curve25519Field Reduced() + { + Span bytes = stackalloc byte[32]; + ToBytes(bytes); + return FromBytes(bytes); + } + + internal readonly Curve25519Field MultiplyReduced(Curve25519Field other) + { + return Reduced() * other.Reduced(); + } + + internal readonly Curve25519Field SquareReduced() + { + return Reduced().Square(); + } + + internal readonly bool Equals(Curve25519Field other) + { + Span difference = stackalloc byte[32]; + (this - other).ToBytes(difference); + return difference.IndexOfAnyExcept((byte)0) < 0; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static Curve25519Field FromBytes(ReadOnlySpan bytes) + { + ulong b0 = Load(bytes, 0); + ulong b1 = Load(bytes, 6); + ulong b2 = Load(bytes, 12); + ulong b3 = Load(bytes, 19); + ulong b4 = Load(bytes, 24); + Curve25519Field value = default; + value._z0 = b0 & LimbMask; + value._z1 = (b1 >> 3) & LimbMask; + value._z2 = (b2 >> 6) & LimbMask; + value._z3 = (b3 >> 1) & LimbMask; + value._z4 = (b4 >> 12) & LimbMask; + return value; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal readonly void ToBytes(Span destination) + { + Curve25519Field reduced = CarryFull(this); + ulong q = (reduced._z0 + 19) >> LimbBits; + q = (reduced._z1 + q) >> LimbBits; + q = (reduced._z2 + q) >> LimbBits; + q = (reduced._z3 + q) >> LimbBits; + q = (reduced._z4 + q) >> LimbBits; + reduced._z0 += (ulong)(19 * q); + ulong carryOut = reduced._z0 >> LimbBits; + reduced._z0 &= LimbMask; + reduced._z1 += carryOut; + carryOut = reduced._z1 >> LimbBits; + reduced._z1 &= LimbMask; + reduced._z2 += carryOut; + carryOut = reduced._z2 >> LimbBits; + reduced._z2 &= LimbMask; + reduced._z3 += carryOut; + carryOut = reduced._z3 >> LimbBits; + reduced._z3 &= LimbMask; + reduced._z4 = (reduced._z4 + carryOut) & LimbMask; + + Span packed = stackalloc byte[32]; + Store(packed, 0, reduced._z0 | (reduced._z1 << 51)); + Store(packed, 8, (reduced._z1 >> 13) | (reduced._z2 << 38)); + Store(packed, 16, (reduced._z2 >> 26) | (reduced._z3 << 25)); + Store(packed, 24, (reduced._z3 >> 39) | (reduced._z4 << 12)); + packed.CopyTo(destination); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal Curve25519Field Square() + { + Curve25519Field result = default; + Square(ref result, in this); + return result; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal Curve25519Field Invert() + { + // z^(2^255 - 21), the public exponent p - 2. 254 squares and 11 multiplies. + Curve25519Field z2 = default; + Curve25519Field z9 = default; + Curve25519Field z11 = default; + Curve25519Field z2_5 = default; + Curve25519Field z2_10 = default; + Curve25519Field z2_20 = default; + Curve25519Field z2_40 = default; + Curve25519Field z2_50 = default; + Curve25519Field z2_100 = default; + Curve25519Field z2_200 = default; + Curve25519Field z2_250 = default; + Curve25519Field result = default; + Square(ref z2, in this); + SquareTimes(ref z9, in z2, 2); + Mul(ref z9, in z9, in this); + Mul(ref z11, in z2, in z9); + Square(ref z2_5, in z11); + Mul(ref z2_5, in z2_5, in z9); + SquareTimes(ref z2_10, in z2_5, 5); + Mul(ref z2_10, in z2_10, in z2_5); + SquareTimes(ref z2_20, in z2_10, 10); + Mul(ref z2_20, in z2_20, in z2_10); + SquareTimes(ref z2_40, in z2_20, 20); + Mul(ref z2_40, in z2_40, in z2_20); + SquareTimes(ref z2_50, in z2_40, 10); + Mul(ref z2_50, in z2_50, in z2_10); + SquareTimes(ref z2_100, in z2_50, 50); + Mul(ref z2_100, in z2_100, in z2_50); + SquareTimes(ref z2_200, in z2_100, 100); + Mul(ref z2_200, in z2_200, in z2_100); + SquareTimes(ref z2_250, in z2_200, 50); + Mul(ref z2_250, in z2_250, in z2_50); + SquareTimes(ref result, in z2_250, 5); + Mul(ref result, in result, in z11); + return result; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Add(ref Curve25519Field result, in Curve25519Field left, in Curve25519Field right) + { + result._z0 = left._z0 + right._z0; + result._z1 = left._z1 + right._z1; + result._z2 = left._z2 + right._z2; + result._z3 = left._z3 + right._z3; + result._z4 = left._z4 + right._z4; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void Sub(ref Curve25519Field result, in Curve25519Field left, in Curve25519Field right) + { + result._z0 = (left._z0 + 0xFFFFFFFFFFFDAUL) - right._z0; + result._z1 = (left._z1 + 0xFFFFFFFFFFFFEUL) - right._z1; + result._z2 = (left._z2 + 0xFFFFFFFFFFFFEUL) - right._z2; + result._z3 = (left._z3 + 0xFFFFFFFFFFFFEUL) - right._z3; + result._z4 = (left._z4 + 0xFFFFFFFFFFFFEUL) - right._z4; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static void Mul(ref Curve25519Field result, in Curve25519Field left, in Curve25519Field right) + { + ulong b0 = right._z0; + ulong b1 = right._z1; + ulong b2 = right._z2; + ulong b3 = right._z3; + ulong b4 = right._z4; + ulong b1_19 = b1 * 19; + ulong b2_19 = b2 * 19; + ulong b3_19 = b3 * 19; + ulong b4_19 = b4 * 19; + ulong a0 = left._z0; + ulong a1 = left._z1; + ulong a2 = left._z2; + ulong a3 = left._z3; + ulong a4 = left._z4; + + // One column at a time. The carry out of a column is the starting value of the next + // column's low accumulator, so only one 128-bit accumulator is live and no carry is added later. + ulong lo = 0, hi = 0; + Accum(ref lo, ref hi, a0, b0); + Accum(ref lo, ref hi, a1, b4_19); + Accum(ref lo, ref hi, a2, b3_19); + Accum(ref lo, ref hi, a3, b2_19); + Accum(ref lo, ref hi, a4, b1_19); + ulong z0 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0, b1); + Accum(ref lo, ref hi, a1, b0); + Accum(ref lo, ref hi, a2, b4_19); + Accum(ref lo, ref hi, a3, b3_19); + Accum(ref lo, ref hi, a4, b2_19); + ulong z1 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0, b2); + Accum(ref lo, ref hi, a1, b1); + Accum(ref lo, ref hi, a2, b0); + Accum(ref lo, ref hi, a3, b4_19); + Accum(ref lo, ref hi, a4, b3_19); + ulong z2 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0, b3); + Accum(ref lo, ref hi, a1, b2); + Accum(ref lo, ref hi, a2, b1); + Accum(ref lo, ref hi, a3, b0); + Accum(ref lo, ref hi, a4, b4_19); + ulong z3 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0, b4); + Accum(ref lo, ref hi, a1, b3); + Accum(ref lo, ref hi, a2, b2); + Accum(ref lo, ref hi, a3, b1); + Accum(ref lo, ref hi, a4, b0); + ulong z4 = lo & LimbMask; + Fold(ref result, z0, z1, z2, z3, z4, Shift51(lo, hi)); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static void Square(ref Curve25519Field result, in Curve25519Field value) + { + ulong a0 = value._z0; + ulong a1 = value._z1; + ulong a2 = value._z2; + ulong a3 = value._z3; + ulong a4 = value._z4; + ulong a0_2 = a0 << 1; + ulong a1_2 = a1 << 1; + ulong a3_19 = a3 * 19; + ulong a3_38 = a3 * 38; + ulong a4_19 = a4 * 19; + ulong a4_38 = a4 * 38; + ulong lo = 0, hi = 0; + Accum(ref lo, ref hi, a0, a0); + Accum(ref lo, ref hi, a1, a4_38); + Accum(ref lo, ref hi, a2, a3_38); + ulong z0 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0_2, a1); + Accum(ref lo, ref hi, a2, a4_38); + Accum(ref lo, ref hi, a3, a3_19); + ulong z1 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0_2, a2); + Accum(ref lo, ref hi, a1, a1); + Accum(ref lo, ref hi, a3, a4_38); + ulong z2 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0_2, a3); + Accum(ref lo, ref hi, a1_2, a2); + Accum(ref lo, ref hi, a4, a4_19); + ulong z3 = lo & LimbMask; + lo = Shift51(lo, hi); + hi = 0; + Accum(ref lo, ref hi, a0_2, a4); + Accum(ref lo, ref hi, a1_2, a3); + Accum(ref lo, ref hi, a2, a2); + ulong z4 = lo & LimbMask; + Fold(ref result, z0, z1, z2, z3, z4, Shift51(lo, hi)); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static void MulSmall(ref Curve25519Field result, in Curve25519Field value, ulong small) + { + ulong z0 = 0, z0h = 0, z1 = 0, z1h = 0, z2 = 0, z2h = 0, z3 = 0, z3h = 0, z4 = 0, z4h = 0; + Accum(ref z0, ref z0h, value._z0, small); + Accum(ref z1, ref z1h, value._z1, small); + Accum(ref z2, ref z2h, value._z2, small); + Accum(ref z3, ref z3h, value._z3, small); + Accum(ref z4, ref z4h, value._z4, small); + Carry(ref result, z0, z0h, z1, z1h, z2, z2h, z3, z3h, z4, z4h); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void SquareTimes(ref Curve25519Field result, in Curve25519Field value, int count) + { + Square(ref result, in value); + for (int i = 1; i < count; i++) + { + Square(ref result, in result); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static void ConditionalSwap(ref Curve25519Field left, ref Curve25519Field right, uint swap) + { + ulong mask = 0UL - swap; + Swap(ref left._z0, ref right._z0, mask); + Swap(ref left._z1, ref right._z1, mask); + Swap(ref left._z2, ref right._z2, mask); + Swap(ref left._z3, ref right._z3, mask); + Swap(ref left._z4, ref right._z4, mask); + } + + /// Copies into when is all ones, and leaves it alone when the mask is zero. No branch and no index depends on the mask. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal static void ConditionalMove(ref Curve25519Field target, in Curve25519Field source, ulong mask) + { + target._z0 ^= (target._z0 ^ source._z0) & mask; + target._z1 ^= (target._z1 ^ source._z1) & mask; + target._z2 ^= (target._z2 ^ source._z2) & mask; + target._z3 ^= (target._z3 ^ source._z3) & mask; + target._z4 ^= (target._z4 ^ source._z4) & mask; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Curve25519Field operator +(Curve25519Field left, Curve25519Field right) + { + Curve25519Field sum = default; + Add(ref sum, in left, in right); + return sum; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Curve25519Field operator -(Curve25519Field left, Curve25519Field right) + { + Curve25519Field difference = default; + Sub(ref difference, in left, in right); + return difference; + } + + public static Curve25519Field operator *(Curve25519Field left, ulong small) + { + Curve25519Field result = default; + MulSmall(ref result, in left, small); + return result; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Curve25519Field operator *(Curve25519Field left, Curve25519Field right) + { + Curve25519Field result = default; + Mul(ref result, in left, in right); + return result; + } + + private static Curve25519Field CarryFull(Curve25519Field value) + { + return CarryLimbs(value._z0, value._z1, value._z2, value._z3, value._z4); + } + + private static Curve25519Field CarryLimbs(ulong z0, ulong z1, ulong z2, ulong z3, ulong z4) + { + for (int pass = 0; pass < 2; pass++) + { + z1 += z0 >> LimbBits; + z0 &= LimbMask; + z2 += z1 >> LimbBits; + z1 &= LimbMask; + z3 += z2 >> LimbBits; + z2 &= LimbMask; + z4 += z3 >> LimbBits; + z3 &= LimbMask; + z0 += (z4 >> LimbBits) * 19; + z4 &= LimbMask; + } + + z1 += z0 >> LimbBits; + z0 &= LimbMask; + Curve25519Field result = default; + result._z0 = z0; + result._z1 = z1; + result._z2 = z2; + result._z3 = z3; + result._z4 = z4; + return result; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Carry( + ref Curve25519Field result, + ulong z0, ulong z0h, ulong z1, ulong z1h, ulong z2, ulong z2h, ulong z3, ulong z3h, ulong z4, ulong z4h) + { + ulong carry = Shift51(z0, z0h); + z0 &= LimbMask; + AddCarry(ref z1, ref z1h, carry); + carry = Shift51(z1, z1h); + z1 &= LimbMask; + AddCarry(ref z2, ref z2h, carry); + carry = Shift51(z2, z2h); + z2 &= LimbMask; + AddCarry(ref z3, ref z3h, carry); + carry = Shift51(z3, z3h); + z3 &= LimbMask; + AddCarry(ref z4, ref z4h, carry); + carry = Shift51(z4, z4h); + z4 &= LimbMask; + Fold(ref result, z0, z1, z2, z3, z4, carry); + } + + /// Folds the carry out of the top limb back into the bottom, and leaves every limb below 2^52. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Fold(ref Curve25519Field result, ulong z0, ulong z1, ulong z2, ulong z3, ulong z4, ulong carry) + { + z0 += carry * 19; + carry = z0 >> LimbBits; + z0 &= LimbMask; + z1 += carry; + carry = z1 >> LimbBits; + z1 &= LimbMask; + z2 += carry; + carry = z2 >> LimbBits; + z2 &= LimbMask; + z3 += carry; + carry = z3 >> LimbBits; + z3 &= LimbMask; + z4 += carry; + carry = z4 >> LimbBits; + z4 &= LimbMask; + z0 += carry * 19; + carry = z0 >> LimbBits; + z0 &= LimbMask; + z1 += carry; + + result._z0 = z0; + result._z1 = z1; + result._z2 = z2; + result._z3 = z3; + result._z4 = z4; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ulong Shift51(ulong lo, ulong hi) => (lo >> LimbBits) | (hi << (64 - LimbBits)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void AddCarry(ref ulong lo, ref ulong hi, ulong carry) + { + lo += carry; + hi += lo < carry ? 1UL : 0UL; + } + + /// + /// The high 64 bits of a 64 by 64 bit product, in a register. Math.BigMul with an out low half + /// keeps the low half in a stack slot, which costs a store and a reload on every product. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static ulong High(ulong left, ulong right) + { + if (Bmi2.X64.IsSupported) + { + return Bmi2.X64.MultiplyNoFlags(left, right); + } + + if (ArmBase.Arm64.IsSupported) + { + return ArmBase.Arm64.MultiplyHigh(left, right); + } + + return Math.BigMul(left, right, out _); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void Accum(ref ulong lo, ref ulong hi, ulong left, ulong right) + { + ulong low = left * right; + ulong high = High(left, right); + lo += low; + hi += high + (lo < low ? 1UL : 0UL); + } + + private static ulong Load(ReadOnlySpan bytes, int offset) + { + return BinaryPrimitives.ReadUInt64LittleEndian(bytes.Slice(offset, 8)); + } + + private static void Store(Span destination, int offset, ulong value) + { + BinaryPrimitives.WriteUInt64LittleEndian(destination.Slice(offset, 8), value); + } + + private static void Swap(ref ulong left, ref ulong right, ulong mask) + { + ulong difference = (left ^ right) & mask; + left ^= difference; + right ^= difference; + } +} diff --git a/src/Titanium.Tls/Internal/Ed25519Verifier.cs b/src/Titanium.Tls/Internal/Ed25519Verifier.cs new file mode 100644 index 000000000..fbb8f89b5 --- /dev/null +++ b/src/Titanium.Tls/Internal/Ed25519Verifier.cs @@ -0,0 +1,276 @@ +using System; +using System.Globalization; +using System.Numerics; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// RFC 8032 Ed25519 verification only. The check is the cofactorless equation +/// [S]B = R + [k]A, which section 5.1.7 allows in place of the multiply-by-8 form. +/// Public keys of small order are rejected. There is no signing operation. +/// +internal static class Ed25519Verifier +{ + internal const int PublicKeyLength = 32; + internal const int SignatureLength = 64; + + private static readonly BigInteger Order = (BigInteger.One << 252) + BigInteger.Parse("27742317777372353535851937790883648493", CultureInfo.InvariantCulture); + private static readonly Curve25519Field D; + private static readonly Curve25519Field SqrtNegativeOne; + private static readonly Point BasePoint; + private static readonly byte[] Cofactor = [8]; + + static Ed25519Verifier() + { + D = Curve25519Field.Zero - (Curve25519Field.FromUInt64(121665) * Curve25519Field.FromUInt64(121666).Invert()); + SqrtNegativeOne = PowerOfTwo(); + Curve25519Field y = Curve25519Field.FromUInt64(4) * Curve25519Field.FromUInt64(5).Invert(); + Span encoded = stackalloc byte[PublicKeyLength]; + y.ToBytes(encoded); + if (!TryDecode(encoded, out Point basePoint)) + { + throw new InvalidOperationException("The Ed25519 base point did not decode."); + } + + BasePoint = basePoint; + } + + internal static bool Verify( + ReadOnlySpan publicKey, + ReadOnlySpan message, + ReadOnlySpan signature, + TlsAlgorithmPolicy policy = TlsAlgorithmPolicy.Default) + { + if (policy == TlsAlgorithmPolicy.FipsApprovedOnly) + { + return false; + } + + if (publicKey.Length != PublicKeyLength || signature.Length != SignatureLength) + { + return false; + } + + if (!TryDecode(signature[..PublicKeyLength], out Point r) || !TryDecode(publicKey, out Point a)) + { + return false; + } + + if (IsSmallOrder(a)) + { + return false; + } + + ReadOnlySpan sBytes = signature[PublicKeyLength..]; + BigInteger s = new(sBytes, isUnsigned: true, isBigEndian: false); + if (s < 0 || s >= Order) + { + return false; + } + + Span digest = stackalloc byte[64]; + using (IncrementalHash hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA512)) + { + hash.AppendData(signature[..PublicKeyLength]); + hash.AppendData(publicKey); + hash.AppendData(message); + hash.GetHashAndReset(digest); + } + + BigInteger k = new BigInteger(digest, isUnsigned: true, isBigEndian: false) % Order; + Span kBytes = stackalloc byte[32]; + kBytes.Clear(); + if (!k.TryWriteBytes(kBytes, out _, isUnsigned: true, isBigEndian: false)) + { + return false; + } + + Point left = Multiply(BasePoint, sBytes); + Point right = r.Add(Multiply(a, kBytes)); + return left.Equals(right); + } + + internal static bool VerifyScheme( + SignatureScheme scheme, + ReadOnlySpan publicKey, + ReadOnlySpan message, + ReadOnlySpan signature, + TlsAlgorithmPolicy policy = TlsAlgorithmPolicy.Default) + { + return scheme == SignatureScheme.Ed25519 && Verify(publicKey, message, signature, policy); + } + + private static bool IsSmallOrder(Point point) + { + return Multiply(point, Cofactor).Equals(Point.Identity); + } + + private static Point Multiply(Point point, ReadOnlySpan scalar) + { + Point result = Point.Identity; + Point addend = point; + for (int i = 0; i < scalar.Length; i++) + { + int bits = scalar[i]; + for (int bit = 0; bit < 8; bit++) + { + if ((bits & 1) == 1) + { + result = result.Add(addend); + } + + addend = addend.Double(); + bits >>= 1; + } + } + + return result; + } + + private static bool TryDecode(ReadOnlySpan encoded, out Point point) + { + point = default; + Span yBytes = stackalloc byte[PublicKeyLength]; + encoded.CopyTo(yBytes); + int sign = yBytes[31] >> 7; + yBytes[31] &= 0x7F; + Curve25519Field y = Curve25519Field.FromBytes(yBytes); + Span canonical = stackalloc byte[PublicKeyLength]; + y.ToBytes(canonical); + if (!canonical.SequenceEqual(yBytes)) + { + return false; + } + + Curve25519Field y2 = y.SquareReduced(); + Curve25519Field u = y2 - Curve25519Field.One; + Curve25519Field v = y2.MultiplyReduced(D) + Curve25519Field.One; + Curve25519Field v3 = v.SquareReduced().MultiplyReduced(v); + Curve25519Field v7 = v3.SquareReduced().MultiplyReduced(v); + Curve25519Field x = u.MultiplyReduced(v3).MultiplyReduced(Pow(u.MultiplyReduced(v7))); + Curve25519Field vx2 = v.MultiplyReduced(x.SquareReduced()); + if (!vx2.Equals(u)) + { + if (!vx2.Equals(Curve25519Field.Zero - u)) + { + return false; + } + + x = x.MultiplyReduced(SqrtNegativeOne); + } + + Span xBytes = stackalloc byte[PublicKeyLength]; + x.ToBytes(xBytes); + bool xIsZero = true; + for (int i = 0; i < PublicKeyLength; i++) + { + if (xBytes[i] != 0) + { + xIsZero = false; + break; + } + } + + if (xIsZero && sign == 1) + { + return false; + } + + if ((xBytes[0] & 1) != sign) + { + x = Curve25519Field.Zero - x; + } + + point = Point.Affine(x, y); + return true; + } + + /// (p-5)/8 = 2^252 - 3. Bit 1 is clear; the other bits below 252 are set. + private static Curve25519Field Pow(Curve25519Field value) + { + Curve25519Field result = Curve25519Field.One; + for (int bit = 251; bit >= 0; bit--) + { + result = result.SquareReduced(); + if (bit != 1) + { + result = result.MultiplyReduced(value); + } + } + + return result; + } + + /// 2^((p-1)/4). The exponent is 2^253 - 5, whose bit 2 is clear. + private static Curve25519Field PowerOfTwo() + { + Curve25519Field result = Curve25519Field.One; + Curve25519Field value = Curve25519Field.FromUInt64(2); + for (int bit = 252; bit >= 0; bit--) + { + result = result.SquareReduced(); + if (bit != 2) + { + result = result.MultiplyReduced(value); + } + } + + return result; + } + + private readonly struct Point + { + internal static Point Identity { get; } = new(Curve25519Field.Zero, Curve25519Field.One, Curve25519Field.One, Curve25519Field.Zero); + + private readonly Curve25519Field _x; + private readonly Curve25519Field _y; + private readonly Curve25519Field _z; + private readonly Curve25519Field _t; + + private Point(Curve25519Field x, Curve25519Field y, Curve25519Field z, Curve25519Field t) + { + _x = x; + _y = y; + _z = z; + _t = t; + } + + internal static Point Affine(Curve25519Field x, Curve25519Field y) + { + return new Point(x, y, Curve25519Field.One, x.MultiplyReduced(y)); + } + + internal Point Add(Point other) + { + Curve25519Field two = Curve25519Field.FromUInt64(2); + Curve25519Field a = (_y - _x).MultiplyReduced(other._y - other._x); + Curve25519Field b = (_y + _x).MultiplyReduced(other._y + other._x); + Curve25519Field c = _t.MultiplyReduced(other._t).MultiplyReduced(D + D); + Curve25519Field doubledZ = _z.MultiplyReduced(other._z).MultiplyReduced(two); + Curve25519Field e = b - a; + Curve25519Field f = doubledZ - c; + Curve25519Field g = doubledZ + c; + Curve25519Field h = b + a; + return new Point(e.MultiplyReduced(f), g.MultiplyReduced(h), f.MultiplyReduced(g), e.MultiplyReduced(h)); + } + + internal Point Double() + { + Curve25519Field a = _x.SquareReduced(); + Curve25519Field b = _y.SquareReduced(); + Curve25519Field c = _z.SquareReduced().MultiplyReduced(Curve25519Field.FromUInt64(2)); + Curve25519Field h = a + b; + Curve25519Field e = h - (_x + _y).SquareReduced(); + Curve25519Field g = a - b; + Curve25519Field f = c + g; + return new Point(e.MultiplyReduced(f), g.MultiplyReduced(h), f.MultiplyReduced(g), e.MultiplyReduced(h)); + } + + internal readonly bool Equals(Point other) + { + return _x.MultiplyReduced(other._z).Equals(other._x.MultiplyReduced(_z)) + && _y.MultiplyReduced(other._z).Equals(other._y.MultiplyReduced(_z)); + } + } +} diff --git a/src/Titanium.Tls/Internal/ExtensionRules.cs b/src/Titanium.Tls/Internal/ExtensionRules.cs new file mode 100644 index 000000000..4763ed831 --- /dev/null +++ b/src/Titanium.Tls/Internal/ExtensionRules.cs @@ -0,0 +1,125 @@ +using System; + +namespace Titanium.Tls; + +/// +/// RFC 8446 section 4.2 allow-lists. A known extension on the wrong message is +/// illegal_parameter. An unknown extension is kept. A duplicate of either is illegal_parameter. +/// +internal static class ExtensionRules +{ + internal static bool TryValidate(HandshakeMessageKind message, ReadOnlySpan extensions, out HandshakeAlert alert) + { + alert = default; + Span seen = stackalloc ushort[48]; + int count = 0; + bool sawPreSharedKey = false; + TlsReader reader = new(extensions); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort type) || !reader.TryReadVector16(out _)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (count == seen.Length) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + for (int i = 0; i < count; i++) + { + if (seen[i] == type) + { + alert = HandshakeAlert.IllegalParameter; + return false; + } + } + + seen[count++] = type; + if (message == HandshakeMessageKind.ClientHello && sawPreSharedKey) + { + alert = HandshakeAlert.IllegalParameter; + return false; + } + + if (type == ExtensionType.PreSharedKey) + { + sawPreSharedKey = true; + } + + if (ExtensionType.IsKnown(type) && !IsAllowed(message, type)) + { + alert = HandshakeAlert.IllegalParameter; + return false; + } + } + + return true; + } + + internal static bool IsAllowed(HandshakeMessageKind message, ushort type) + { + return message switch + { + HandshakeMessageKind.ClientHello => type is + ExtensionType.ServerName or + ExtensionType.MaxFragmentLength or + ExtensionType.StatusRequest or + ExtensionType.SupportedGroups or + ExtensionType.EcPointFormats or + ExtensionType.SignatureAlgorithms or + ExtensionType.UseSrtp or + ExtensionType.Heartbeat or + ExtensionType.ApplicationLayerProtocolNegotiation or + ExtensionType.SignedCertificateTimestamp or + ExtensionType.ClientCertificateType or + ExtensionType.ServerCertificateType or + ExtensionType.Padding or + ExtensionType.ExtendedMasterSecret or + ExtensionType.CompressCertificate or + ExtensionType.SessionTicket or + ExtensionType.PreSharedKey or + ExtensionType.EarlyData or + ExtensionType.SupportedVersions or + ExtensionType.Cookie or + ExtensionType.PskKeyExchangeModes or + ExtensionType.CertificateAuthorities or + ExtensionType.PostHandshakeAuth or + ExtensionType.SignatureAlgorithmsCert or + ExtensionType.KeyShare or + ExtensionType.QuicTransportParameters or + ExtensionType.ApplicationSettingsLegacy or + ExtensionType.ApplicationSettings or + ExtensionType.EncryptedClientHello or + ExtensionType.RenegotiationInfo, + HandshakeMessageKind.ServerHello => type is ExtensionType.PreSharedKey or ExtensionType.SupportedVersions or ExtensionType.KeyShare, + HandshakeMessageKind.HelloRetryRequest => type is ExtensionType.SupportedVersions or ExtensionType.Cookie or ExtensionType.KeyShare, + HandshakeMessageKind.EncryptedExtensions => type is + ExtensionType.ServerName or + ExtensionType.MaxFragmentLength or + ExtensionType.SupportedGroups or + ExtensionType.UseSrtp or + ExtensionType.Heartbeat or + ExtensionType.ApplicationLayerProtocolNegotiation or + ExtensionType.ServerCertificateType or + ExtensionType.EarlyData or + ExtensionType.QuicTransportParameters or + ExtensionType.ApplicationSettingsLegacy or + ExtensionType.ApplicationSettings, + HandshakeMessageKind.Certificate => type is ExtensionType.StatusRequest or ExtensionType.SignedCertificateTimestamp, + HandshakeMessageKind.CertificateRequest => type is + ExtensionType.StatusRequest or + ExtensionType.SignatureAlgorithms or + ExtensionType.SignedCertificateTimestamp or + ExtensionType.CertificateAuthorities or + ExtensionType.OidFilters or + ExtensionType.SignatureAlgorithmsCert or + ExtensionType.CompressCertificate, + HandshakeMessageKind.NewSessionTicket => type == ExtensionType.EarlyData, + _ => false, + }; + } +} diff --git a/src/Titanium.Tls/Internal/HandshakeFraming.cs b/src/Titanium.Tls/Internal/HandshakeFraming.cs new file mode 100644 index 000000000..c37ccf8a4 --- /dev/null +++ b/src/Titanium.Tls/Internal/HandshakeFraming.cs @@ -0,0 +1,233 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// Handshake header (type + 24-bit length) and a reassembler for messages split across records +/// or packed into one record. The default cap is 128 KiB. Nothing larger than 1 MiB is accepted. +/// +internal static class HandshakeFraming +{ + internal const int DefaultMaxMessageBytes = 131072; + internal const int HardMaxMessageBytes = 1 << 20; + internal const int HeaderLength = 4; + + internal static bool TryReadHeader(ReadOnlySpan message, out HandshakeType type, out int bodyLength) + { + type = default; + bodyLength = 0; + if (message.Length < HeaderLength) + { + return false; + } + + type = (HandshakeType)message[0]; + bodyLength = (message[1] << 16) | (message[2] << 8) | message[3]; + return true; + } + + internal static bool TrySplitMessage(ReadOnlySpan message, out HandshakeType type, out ReadOnlySpan body, out HandshakeAlert alert) + { + type = default; + body = default; + alert = default; + if (!TryReadHeader(message, out type, out int bodyLength)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (bodyLength > HardMaxMessageBytes || message.Length != HeaderLength + bodyLength) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + body = message.Slice(HeaderLength, bodyLength); + return true; + } + + internal static bool TryUnwrapHandshakeRecord(ReadOnlySpan record, out ReadOnlySpan payload, out bool incomplete, out HandshakeAlert alert) + { + payload = default; + incomplete = false; + alert = default; + if (record.Length < TlsRecordProtector.HeaderLength) + { + incomplete = record.Length > 0 && record[0] == 22; + alert = incomplete ? default : HandshakeAlert.DecodeError; + return false; + } + + if (record[0] != 22 || record[1] != 3 || (record[2] != 1 && record[2] != 3)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + int length = (record[3] << 8) | record[4]; + if (length == 0 || length > TlsRecordProtector.MaxCiphertext) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (record.Length < TlsRecordProtector.HeaderLength + length) + { + incomplete = true; + return false; + } + + payload = record.Slice(TlsRecordProtector.HeaderLength, length); + return true; + } +} + +internal sealed class HandshakeReassembler +{ + private byte[] _buffer; + private readonly int _maxMessage; + private int _length; + + internal HandshakeReassembler(int maxMessageBytes = HandshakeFraming.DefaultMaxMessageBytes) + { + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(maxMessageBytes); + ArgumentOutOfRangeException.ThrowIfGreaterThan(maxMessageBytes, HandshakeFraming.HardMaxMessageBytes); + _maxMessage = maxMessageBytes; + int initial = Math.Min(4096, maxMessageBytes + HandshakeFraming.HeaderLength); + _buffer = new byte[initial]; + } + + internal int Pending => _length; + + internal int DeclaredBodyLength() + { + if (_length < HandshakeFraming.HeaderLength) + { + return -1; + } + + return (_buffer[1] << 16) | (_buffer[2] << 8) | _buffer[3]; + } + + internal void Return() + { + if (_buffer.Length == 0) + { + return; + } + + CryptographicOperations.ZeroMemory(_buffer); + _buffer = []; + _length = 0; + } + + internal bool TryAppend(ReadOnlySpan fragment, out HandshakeAlert alert) + { + alert = default; + if (fragment.IsEmpty) + { + return true; + } + + int need = _length + fragment.Length; + int cap = _maxMessage + HandshakeFraming.HeaderLength; + if (need > cap) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (need > _buffer.Length) + { + Grow(need); + } + + fragment.CopyTo(_buffer.AsSpan(_length)); + _length += fragment.Length; + if (_length >= HandshakeFraming.HeaderLength) + { + int bodyLength = (_buffer[1] << 16) | (_buffer[2] << 8) | _buffer[3]; + if (bodyLength > _maxMessage) + { + alert = HandshakeAlert.DecodeError; + return false; + } + } + + return true; + } + + internal bool TryTake(Span bodyDestination, out HandshakeType type, out int bodyLength, out bool needMore, out HandshakeAlert alert) + { + type = default; + bodyLength = 0; + needMore = false; + alert = default; + if (_length < HandshakeFraming.HeaderLength) + { + needMore = true; + return true; + } + + int declared = (_buffer[1] << 16) | (_buffer[2] << 8) | _buffer[3]; + if (declared > _maxMessage) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (_length < HandshakeFraming.HeaderLength + declared) + { + needMore = true; + return true; + } + + if (bodyDestination.Length < declared) + { + throw new TlsProtocolViolation("The destination is shorter than the handshake body."); + } + + type = (HandshakeType)_buffer[0]; + _buffer.AsSpan(HandshakeFraming.HeaderLength, declared).CopyTo(bodyDestination); + int total = HandshakeFraming.HeaderLength + declared; + int tail = _length - total; + if (tail > 0) + { + Buffer.BlockCopy(_buffer, total, _buffer, 0, tail); + } + + _length = tail; + bodyLength = declared; + return true; + } + + private void Grow(int need) + { + int size = _buffer.Length == 0 ? 4096 : _buffer.Length; + while (size < need) + { + size *= 2; + } + + int cap = _maxMessage + HandshakeFraming.HeaderLength; + if (size > cap) + { + size = cap; + } + + byte[] next = new byte[size]; + if (_length > 0) + { + _buffer.AsSpan(0, _length).CopyTo(next); + } + + if (_buffer.Length > 0) + { + CryptographicOperations.ZeroMemory(_buffer); + } + + _buffer = next; + } +} diff --git a/src/Titanium.Tls/Internal/HandshakeMessages.cs b/src/Titanium.Tls/Internal/HandshakeMessages.cs new file mode 100644 index 000000000..70f502f7d --- /dev/null +++ b/src/Titanium.Tls/Internal/HandshakeMessages.cs @@ -0,0 +1,560 @@ +using System; + +namespace Titanium.Tls; + +internal readonly ref struct ClientHelloView +{ + internal ClientHelloView( + ushort legacyVersion, + ReadOnlySpan random, + ReadOnlySpan sessionId, + ReadOnlySpan cipherSuites, + ReadOnlySpan compressionMethods, + ReadOnlySpan extensions, + bool hasExtensions) + { + LegacyVersion = legacyVersion; + Random = random; + SessionId = sessionId; + CipherSuites = cipherSuites; + CompressionMethods = compressionMethods; + Extensions = extensions; + HasExtensions = hasExtensions; + } + + internal ushort LegacyVersion { get; } + + internal ReadOnlySpan Random { get; } + + internal ReadOnlySpan SessionId { get; } + + internal ReadOnlySpan CipherSuites { get; } + + internal ReadOnlySpan CompressionMethods { get; } + + internal ReadOnlySpan Extensions { get; } + + internal bool HasExtensions { get; } + + internal bool TryWrite(Span destination, out int written) + { + written = 0; + TlsWriter writer = TlsWriter.Over(destination); + if (!writer.TryWriteUInt8((byte)HandshakeType.ClientHello) || !writer.TryReserveLength(3, out int lengthAt)) + { + return false; + } + + if (!writer.TryWriteUInt16(LegacyVersion) || + !writer.TryWrite(Random) || + !writer.TryWriteVector8(SessionId) || + !writer.TryWriteVector16(CipherSuites) || + !writer.TryWriteVector8(CompressionMethods) || + (HasExtensions && !writer.TryWriteVector16(Extensions)) || + !writer.TryPatchLength(lengthAt, 3)) + { + return false; + } + + written = writer.Written; + return true; + } +} + +internal readonly ref struct ServerHelloView +{ + internal ServerHelloView( + ushort legacyVersion, + ReadOnlySpan random, + ReadOnlySpan sessionId, + ushort cipherSuite, + byte compressionMethod, + ReadOnlySpan extensions, + bool helloRetryRequest) + { + LegacyVersion = legacyVersion; + Random = random; + SessionId = sessionId; + CipherSuite = cipherSuite; + CompressionMethod = compressionMethod; + Extensions = extensions; + IsHelloRetryRequest = helloRetryRequest; + } + + internal ushort LegacyVersion { get; } + + internal ReadOnlySpan Random { get; } + + internal ReadOnlySpan SessionId { get; } + + internal ushort CipherSuite { get; } + + internal byte CompressionMethod { get; } + + internal ReadOnlySpan Extensions { get; } + + internal bool IsHelloRetryRequest { get; } + + internal bool TryWrite(Span destination, out int written) + { + written = 0; + TlsWriter writer = TlsWriter.Over(destination); + if (!writer.TryWriteUInt8((byte)HandshakeType.ServerHello) || !writer.TryReserveLength(3, out int lengthAt)) + { + return false; + } + + if (!writer.TryWriteUInt16(LegacyVersion) || + !writer.TryWrite(Random) || + !writer.TryWriteVector8(SessionId) || + !writer.TryWriteUInt16(CipherSuite) || + !writer.TryWriteUInt8(CompressionMethod) || + !writer.TryWriteVector16(Extensions) || + !writer.TryPatchLength(lengthAt, 3)) + { + return false; + } + + written = writer.Written; + return true; + } +} + +internal readonly ref struct CertificateView +{ + internal CertificateView(ReadOnlySpan requestContext, ReadOnlySpan certificateList) + { + RequestContext = requestContext; + CertificateList = certificateList; + } + + internal ReadOnlySpan RequestContext { get; } + + internal ReadOnlySpan CertificateList { get; } + + internal bool TryWrite(Span destination, out int written) + { + return WriteFramed(destination, HandshakeType.Certificate, RequestContext, CertificateList, out written); + } + + internal static bool WriteFramed(Span destination, HandshakeType type, ReadOnlySpan context, ReadOnlySpan list, out int written) + { + written = 0; + TlsWriter writer = TlsWriter.Over(destination); + if (!writer.TryWriteUInt8((byte)type) || !writer.TryReserveLength(3, out int lengthAt)) + { + return false; + } + + if (!writer.TryWriteVector8(context) || !writer.TryWriteVector24(list) || !writer.TryPatchLength(lengthAt, 3)) + { + return false; + } + + written = writer.Written; + return true; + } +} + +internal static class HandshakeMessages +{ + /// One hundred entries still parse. The boundary test locks that. The next entry is decode_error. + internal const int MaxCertificateEntries = 100; + private static ReadOnlySpan HelloRetryRequestRandom => + [ + 0xCF, 0x21, 0xAD, 0x74, 0xE5, 0x9A, 0x61, 0x11, 0xBE, 0x1D, 0x8C, 0x02, 0x1E, 0x65, 0xB8, 0x91, + 0xC2, 0xA2, 0x11, 0x16, 0x7A, 0xBB, 0x8C, 0x5E, 0x07, 0x9E, 0x09, 0xE2, 0xC8, 0xA8, 0x33, 0x9C, + ]; + + internal static bool TryReadClientHello(ReadOnlySpan message, out ClientHelloView view, out HandshakeAlert alert) + { + view = default; + if (!TryBody(message, HandshakeType.ClientHello, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt16(out ushort version) || + !reader.TryReadBytes(32, out ReadOnlySpan random) || + !reader.TryReadVector8(out ReadOnlySpan sessionId) || + !reader.TryReadVector16(out ReadOnlySpan ciphers) || + !reader.TryReadVector8(out ReadOnlySpan compression)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (sessionId.Length > 32 || ciphers.Length < 2 || (ciphers.Length & 1) != 0 || compression.IsEmpty) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + ReadOnlySpan extensions = default; + bool hasExtensions = reader.Remaining > 0; + if (hasExtensions) + { + if (!reader.TryReadVector16(out extensions) || reader.Remaining != 0) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (!ExtensionRules.TryValidate(HandshakeMessageKind.ClientHello, extensions, out alert)) + { + return false; + } + } + + view = new ClientHelloView(version, random, sessionId, ciphers, compression, extensions, hasExtensions); + return true; + } + + internal static bool TryReadServerHello(ReadOnlySpan message, out ServerHelloView view, out HandshakeAlert alert) + { + view = default; + if (!TryBody(message, HandshakeType.ServerHello, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt16(out ushort version) || + !reader.TryReadBytes(32, out ReadOnlySpan random) || + !reader.TryReadVector8(out ReadOnlySpan sessionId) || + !reader.TryReadUInt16(out ushort cipher) || + !reader.TryReadUInt8(out byte compression) || + !reader.TryReadVector16(out ReadOnlySpan extensions) || + reader.Remaining != 0) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (sessionId.Length > 32 || compression != 0) + { + alert = HandshakeAlert.IllegalParameter; + return false; + } + + bool helloRetry = random.SequenceEqual(HelloRetryRequestRandom); + HandshakeMessageKind kind = helloRetry ? HandshakeMessageKind.HelloRetryRequest : HandshakeMessageKind.ServerHello; + if (!ExtensionRules.TryValidate(kind, extensions, out alert)) + { + return false; + } + + view = new ServerHelloView(version, random, sessionId, cipher, compression, extensions, helloRetry); + return true; + } + + internal static bool TryReadEncryptedExtensions(ReadOnlySpan message, out ReadOnlySpan extensions, out HandshakeAlert alert) + { + extensions = default; + if (!TryBody(message, HandshakeType.EncryptedExtensions, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out extensions) || reader.Remaining != 0) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return ExtensionRules.TryValidate(HandshakeMessageKind.EncryptedExtensions, extensions, out alert); + } + + internal static bool TryWriteEncryptedExtensions(Span destination, ReadOnlySpan extensions, out int written) + { + written = 0; + TlsWriter writer = TlsWriter.Over(destination); + if (!writer.TryWriteUInt8((byte)HandshakeType.EncryptedExtensions) || !writer.TryReserveLength(3, out int lengthAt)) + { + return false; + } + + if (!writer.TryWriteVector16(extensions) || !writer.TryPatchLength(lengthAt, 3)) + { + return false; + } + + written = writer.Written; + return true; + } + + internal static bool TryReadCertificate(ReadOnlySpan message, out CertificateView view, out HandshakeAlert alert) + { + view = default; + if (!TryBody(message, HandshakeType.Certificate, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector8(out ReadOnlySpan context) || !reader.TryReadVector24(out ReadOnlySpan list) || reader.Remaining != 0) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (!TryValidateCertificateList(list, out alert)) + { + return false; + } + + view = new CertificateView(context, list); + return true; + } + + internal static bool TryReadCertificateRequest(ReadOnlySpan message, out ReadOnlySpan context, out ReadOnlySpan extensions, out HandshakeAlert alert) + { + context = default; + extensions = default; + if (!TryBody(message, HandshakeType.CertificateRequest, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector8(out context) || !reader.TryReadVector16(out extensions) || reader.Remaining != 0 || extensions.Length < 2) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return ExtensionRules.TryValidate(HandshakeMessageKind.CertificateRequest, extensions, out alert); + } + + internal static bool TryReadCertificateVerify(ReadOnlySpan message, out ushort scheme, out ReadOnlySpan signature, out HandshakeAlert alert) + { + scheme = 0; + signature = default; + if (!TryBody(message, HandshakeType.CertificateVerify, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt16(out scheme) || !reader.TryReadVector16(out signature) || reader.Remaining != 0) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return true; + } + + internal static bool TryReadFinished(ReadOnlySpan message, out ReadOnlySpan verifyData, out HandshakeAlert alert) + { + verifyData = default; + if (!TryBody(message, HandshakeType.Finished, out ReadOnlySpan body, out alert)) + { + return false; + } + + if (body.Length is not (32 or 48)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + verifyData = body; + return true; + } + + internal static bool TryReadNewSessionTicket( + ReadOnlySpan message, + out uint lifetime, + out uint ageAdd, + out ReadOnlySpan nonce, + out ReadOnlySpan ticket, + out ReadOnlySpan extensions, + out HandshakeAlert alert) + { + lifetime = 0; + ageAdd = 0; + nonce = default; + ticket = default; + extensions = default; + if (!TryBody(message, HandshakeType.NewSessionTicket, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt32(out lifetime) || + !reader.TryReadUInt32(out ageAdd) || + !reader.TryReadVector8(out nonce) || + !reader.TryReadVector16(out ticket) || + !reader.TryReadVector16(out extensions) || + reader.Remaining != 0 || + ticket.IsEmpty) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return ExtensionRules.TryValidate(HandshakeMessageKind.NewSessionTicket, extensions, out alert); + } + + internal static bool TryReadKeyUpdate(ReadOnlySpan message, out byte request, out HandshakeAlert alert) + { + request = 0; + if (!TryBody(message, HandshakeType.KeyUpdate, out ReadOnlySpan body, out alert)) + { + return false; + } + + if (body.Length != 1 || body[0] > 1) + { + alert = HandshakeAlert.IllegalParameter; + return false; + } + + request = body[0]; + return true; + } + + internal static bool TryReadEndOfEarlyData(ReadOnlySpan message, out HandshakeAlert alert) + { + if (!TryBody(message, HandshakeType.EndOfEarlyData, out ReadOnlySpan body, out alert)) + { + return false; + } + + if (!body.IsEmpty) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return true; + } + + internal static bool TryReadCompressedCertificate( + ReadOnlySpan message, + out ushort algorithm, + out int uncompressedLength, + out ReadOnlySpan compressed, + out HandshakeAlert alert) + { + algorithm = 0; + uncompressedLength = 0; + compressed = default; + if (!TryBody(message, HandshakeType.CompressedCertificate, out ReadOnlySpan body, out alert)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt16(out algorithm) || + !reader.TryReadUInt24(out uncompressedLength) || + !reader.TryReadVector24(out compressed) || + reader.Remaining != 0 || + uncompressedLength == 0 || + compressed.IsEmpty) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return true; + } + + internal static bool TryReadMessageHash(ReadOnlySpan message, out ReadOnlySpan hash, out HandshakeAlert alert) + { + hash = default; + if (!TryBody(message, HandshakeType.MessageHash, out ReadOnlySpan body, out alert)) + { + return false; + } + + if (body.Length is not (32 or 48)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + hash = body; + return true; + } + + internal static bool TryReadHostName(ReadOnlySpan serverNameExtension, out ReadOnlySpan host) + { + host = default; + TlsReader reader = new(serverNameExtension); + if (!reader.TryReadVector16(out ReadOnlySpan list) || reader.Remaining != 0) + { + return false; + } + + TlsReader names = new(list); + if (!names.TryReadUInt8(out byte nameType) || nameType != 0 || !names.TryReadVector16(out host) || names.Remaining != 0 || host.IsEmpty) + { + host = default; + return false; + } + + return true; + } + + private static bool TryValidateCertificateList(ReadOnlySpan list, out HandshakeAlert alert) + { + alert = default; + TlsReader reader = new(list); + if (reader.Remaining == 0) + { + return true; + } + + int count = 0; + while (reader.Remaining > 0) + { + count++; + if (count > MaxCertificateEntries) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (!reader.TryReadVector24(out ReadOnlySpan certificate) || certificate.IsEmpty || !reader.TryReadVector16(out ReadOnlySpan extensions)) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + if (!ExtensionRules.TryValidate(HandshakeMessageKind.Certificate, extensions, out alert)) + { + return false; + } + } + + return true; + } + + private static bool TryBody(ReadOnlySpan message, HandshakeType expected, out ReadOnlySpan body, out HandshakeAlert alert) + { + body = default; + if (!HandshakeFraming.TrySplitMessage(message, out HandshakeType type, out body, out alert)) + { + return false; + } + + if (type != expected) + { + alert = HandshakeAlert.UnexpectedMessage; + return false; + } + + if (body.Length > HandshakeFraming.HardMaxMessageBytes) + { + alert = HandshakeAlert.DecodeError; + return false; + } + + return true; + } +} diff --git a/src/Titanium.Tls/Internal/HandshakeTypes.cs b/src/Titanium.Tls/Internal/HandshakeTypes.cs new file mode 100644 index 000000000..7fac21272 --- /dev/null +++ b/src/Titanium.Tls/Internal/HandshakeTypes.cs @@ -0,0 +1,115 @@ +using System; + +namespace Titanium.Tls; + +internal enum HandshakeType : byte +{ + ClientHello = 1, + ServerHello = 2, + NewSessionTicket = 4, + EndOfEarlyData = 5, + EncryptedExtensions = 8, + Certificate = 11, + CertificateRequest = 13, + CertificateVerify = 15, + Finished = 20, + KeyUpdate = 24, + CompressedCertificate = 25, + MessageHash = 254, +} + +internal enum HandshakeAlert +{ + UnexpectedMessage = 10, + IllegalParameter = 47, + DecodeError = 50, + UnsupportedExtension = 110, +} + +internal enum HandshakeMessageKind +{ + ClientHello, + ServerHello, + HelloRetryRequest, + EncryptedExtensions, + Certificate, + CertificateRequest, + NewSessionTicket, +} + +/// Extension code points this stack recognizes. Unlisted values are retained and ignored. +internal static class ExtensionType +{ + internal const ushort ServerName = 0; + internal const ushort MaxFragmentLength = 1; + internal const ushort StatusRequest = 5; + internal const ushort SupportedGroups = 10; + internal const ushort EcPointFormats = 11; + internal const ushort SignatureAlgorithms = 13; + internal const ushort UseSrtp = 14; + internal const ushort Heartbeat = 15; + internal const ushort ApplicationLayerProtocolNegotiation = 16; + internal const ushort SignedCertificateTimestamp = 18; + internal const ushort ClientCertificateType = 19; + internal const ushort ServerCertificateType = 20; + internal const ushort Padding = 21; + internal const ushort ExtendedMasterSecret = 23; + internal const ushort CompressCertificate = 27; + internal const ushort SessionTicket = 35; + internal const ushort PreSharedKey = 41; + internal const ushort EarlyData = 42; + internal const ushort SupportedVersions = 43; + internal const ushort Cookie = 44; + internal const ushort PskKeyExchangeModes = 45; + internal const ushort CertificateAuthorities = 47; + internal const ushort OidFilters = 48; + internal const ushort PostHandshakeAuth = 49; + internal const ushort SignatureAlgorithmsCert = 50; + internal const ushort KeyShare = 51; + internal const ushort QuicTransportParameters = 57; + internal const ushort ApplicationSettingsLegacy = 17513; + internal const ushort ApplicationSettings = 17613; + internal const ushort EncryptedClientHello = 0xFE0D; + internal const ushort RenegotiationInfo = 0xFF01; + + // BinarySearch requires this list to stay in ascending numeric order. + private static readonly ushort[] Known = + [ + ServerName, + MaxFragmentLength, + StatusRequest, + SupportedGroups, + EcPointFormats, + SignatureAlgorithms, + UseSrtp, + Heartbeat, + ApplicationLayerProtocolNegotiation, + SignedCertificateTimestamp, + ClientCertificateType, + ServerCertificateType, + Padding, + ExtendedMasterSecret, + CompressCertificate, + SessionTicket, + PreSharedKey, + EarlyData, + SupportedVersions, + Cookie, + PskKeyExchangeModes, + CertificateAuthorities, + OidFilters, + PostHandshakeAuth, + SignatureAlgorithmsCert, + KeyShare, + QuicTransportParameters, + ApplicationSettingsLegacy, + ApplicationSettings, + EncryptedClientHello, + RenegotiationInfo, + ]; + + internal static bool IsKnown(ushort type) + { + return Array.BinarySearch(Known, type) >= 0; + } +} diff --git a/src/Titanium.Tls/Internal/HybridKeyExchange.cs b/src/Titanium.Tls/Internal/HybridKeyExchange.cs new file mode 100644 index 000000000..c862150fe --- /dev/null +++ b/src/Titanium.Tls/Internal/HybridKeyExchange.cs @@ -0,0 +1,155 @@ +using System; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// X25519MLKEM768. The share is the ML-KEM-768 encapsulation key or ciphertext followed by the X25519 +/// public key. Captured ClientHellos and OpenSSL 3.5.9 both use that order, and the X25519 half is a separate key +/// from a standalone X25519 share. +/// +internal sealed class HybridKeyExchange : IKeyExchangeGroup +{ + internal const int EncapsulationKeyLength = 1184; + internal const int CiphertextLength = 1088; + internal const int KemSecretLength = 32; + internal const int ClientShareLength = EncapsulationKeyLength + 32; + internal const int ServerShareLength = CiphertextLength + 32; + internal const int SharedLength = KemSecretLength + 32; + + private readonly IMlKem768 _kem; + + public HybridKeyExchange(bool forceManaged = false) + { + _kem = MlKem768.Create(forceManaged); + } + + public NamedGroup Group => NamedGroup.X25519MlKem768; + + public int PublicKeyLength => ClientShareLength; + + public int SharedSecretLength => SharedLength; + + public IPrivateKeyShare GenerateKeyShare(IEntropySource entropy) + { + ArgumentNullException.ThrowIfNull(entropy); + return new HybridPrivateShare(_kem, entropy); + } + + public bool TryEncapsulate(ReadOnlySpan clientShare, IEntropySource entropy, Span serverShare, Span secret, out int serverWritten, out int secretWritten) + { + ArgumentNullException.ThrowIfNull(entropy); + serverWritten = 0; + secretWritten = 0; + if (clientShare.Length != ClientShareLength || serverShare.Length < ServerShareLength || secret.Length < SharedLength) + { + return false; + } + + Span scalar = stackalloc byte[32]; + entropy.Fill(scalar); + try + { + if (!_kem.TryEncapsulate(clientShare[..EncapsulationKeyLength], serverShare[..CiphertextLength], secret[..KemSecretLength])) + { + return false; + } + + X25519.PublicKey(scalar, serverShare.Slice(CiphertextLength, 32)); + if (!X25519.TryAgree(scalar, clientShare.Slice(EncapsulationKeyLength, 32), secret.Slice(KemSecretLength, 32))) + { + CryptographicOperations.ZeroMemory(secret[..SharedLength]); + CryptographicOperations.ZeroMemory(serverShare[..ServerShareLength]); + return false; + } + } + finally + { + CryptographicOperations.ZeroMemory(scalar); + } + + serverWritten = ServerShareLength; + secretWritten = SharedLength; + return true; + } + + private sealed class HybridPrivateShare : IPrivateKeyShare + { + private readonly IMlKem768 _kem; + private readonly SecretBuffer _scalar = new(32); + private readonly byte[] _public = new byte[ClientShareLength]; + private readonly byte[] _decapsulation = new byte[ManagedMlKem768.DecapsulationKeyLength]; + private readonly GCHandle _decapsulationPin; + private bool _disposed; + + internal HybridPrivateShare(IMlKem768 kem, IEntropySource entropy) + { + _kem = kem; + _decapsulationPin = GCHandle.Alloc(_decapsulation, GCHandleType.Pinned); + _kem.GenerateKeyPair(_public.AsSpan(0, EncapsulationKeyLength), _decapsulation); + entropy.Fill(_scalar.Span); + X25519.PublicKey(_scalar.Span, _public.AsSpan(EncapsulationKeyLength, 32)); + } + + public void WritePublicKey(Span destination) + { + ObjectDisposedException.ThrowIf(_disposed, this); + _public.CopyTo(destination); + } + + public bool TryComputeSharedSecret(ReadOnlySpan peerShare, Span secret, out int written) + { + ObjectDisposedException.ThrowIf(_disposed, this); + written = 0; + if (peerShare.Length != ServerShareLength || secret.Length < SharedLength) + { + return false; + } + + Span scalar = stackalloc byte[32]; + _scalar.Span.CopyTo(scalar); + try + { + if (!_kem.TryDecapsulate(_decapsulation, peerShare[..CiphertextLength], secret[..KemSecretLength])) + { + return false; + } + if (!X25519.TryAgree(scalar, peerShare.Slice(CiphertextLength, 32), secret.Slice(KemSecretLength, 32))) + { + CryptographicOperations.ZeroMemory(secret[..SharedLength]); + return false; + } + } + catch (CryptographicException) + { + CryptographicOperations.ZeroMemory(secret[..SharedLength]); + return false; + } + finally + { + CryptographicOperations.ZeroMemory(scalar); + } + + written = SharedLength; + return true; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _scalar.Dispose(); + CryptographicOperations.ZeroMemory(_decapsulation); + CryptographicOperations.ZeroMemory(_public); + if (_decapsulationPin.IsAllocated) + { + _decapsulationPin.Free(); + } + } + } +} diff --git a/src/Titanium.Tls/Internal/IEntropySource.cs b/src/Titanium.Tls/Internal/IEntropySource.cs new file mode 100644 index 000000000..f434e52fe --- /dev/null +++ b/src/Titanium.Tls/Internal/IEntropySource.cs @@ -0,0 +1,17 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal interface IEntropySource +{ + void Fill(Span destination); +} + +internal sealed class SystemEntropy : IEntropySource +{ + public void Fill(Span destination) + { + RandomNumberGenerator.Fill(destination); + } +} diff --git a/src/Titanium.Tls/Internal/IKeyExchangeGroup.cs b/src/Titanium.Tls/Internal/IKeyExchangeGroup.cs new file mode 100644 index 000000000..138a479b9 --- /dev/null +++ b/src/Titanium.Tls/Internal/IKeyExchangeGroup.cs @@ -0,0 +1,44 @@ +using System; + +namespace Titanium.Tls; + +internal interface IKeyExchangeGroup +{ + NamedGroup Group { get; } + + int PublicKeyLength { get; } + + int SharedSecretLength { get; } + + IPrivateKeyShare GenerateKeyShare(IEntropySource entropy); + + bool TryEncapsulate(ReadOnlySpan clientShare, IEntropySource entropy, Span serverShare, Span secret, out int serverWritten, out int secretWritten); +} + +internal interface IPrivateKeyShare : IDisposable +{ + void WritePublicKey(Span destination); + + bool TryComputeSharedSecret(ReadOnlySpan peerShare, Span secret, out int written); +} + +internal static class KeyExchangeGroups +{ + internal static IKeyExchangeGroup Create(NamedGroup group) + { + return group switch + { + NamedGroup.X25519 => new X25519KeyExchange(), + NamedGroup.Secp256r1 => new NistKeyExchange(group, ECCurveNamed.P256), + NamedGroup.Secp384r1 => new NistKeyExchange(group, ECCurveNamed.P384), + NamedGroup.X25519MlKem768 => new HybridKeyExchange(), + _ => throw new ArgumentOutOfRangeException(nameof(group)), + }; + } +} + +internal enum ECCurveNamed +{ + P256, + P384, +} diff --git a/src/Titanium.Tls/Internal/InboundBufferPool.cs b/src/Titanium.Tls/Internal/InboundBufferPool.cs new file mode 100644 index 000000000..49ae29260 --- /dev/null +++ b/src/Titanium.Tls/Internal/InboundBufferPool.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; + +namespace Titanium.Tls; + +/// +/// Receive buffers for . A socket keeps a reference to the last buffer a read +/// used, so a buffer allocated per connection stays reachable for as long as the socket lives even after +/// the stream lets go of it. Sharing a few exact-size buffers keeps that reference from costing +/// one record per idle connection. The buffers hold ciphertext and handshake plaintext that is not secret. +/// +internal static class InboundBufferPool +{ + internal const int BufferLength = TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxCiphertext; + + private const int MaxPooled = 64; + + private static readonly Stack Free = new(); + private static readonly object Gate = new(); + + internal static byte[] Rent() + { + lock (Gate) + { + if (Free.Count > 0) + { + return Free.Pop(); + } + } + + return new byte[BufferLength]; + } + + internal static void Return(byte[] buffer) + { + if (buffer.Length != BufferLength) + { + return; + } + + lock (Gate) + { + if (Free.Count < MaxPooled) + { + Free.Push(buffer); + } + } + } +} diff --git a/src/Titanium.Tls/Internal/Keccak.cs b/src/Titanium.Tls/Internal/Keccak.cs new file mode 100644 index 000000000..5f8589fec --- /dev/null +++ b/src/Titanium.Tls/Internal/Keccak.cs @@ -0,0 +1,293 @@ +using System; +using System.Buffers.Binary; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// SHA-3 and SHAKE. The platform implementation is used when it exists. Otherwise the permutation +/// is the Keccak-f[1600] function from FIPS 202, including the round constants generated by its LFSR. +/// +internal interface IKeccak +{ + void Sha3_256(ReadOnlySpan input, Span output); + + void Sha3_512(ReadOnlySpan input, Span output); + + void Shake128(ReadOnlySpan input, Span output); + + void Shake256(ReadOnlySpan input, Span output); +} + +internal static class Keccak +{ + internal static IKeccak Create(bool forceManaged = false) + { + if (!forceManaged && SHA3_256.IsSupported && SHA3_512.IsSupported && Shake128.IsSupported && Shake256.IsSupported) + { + return BclKeccak.Instance; + } + + return ManagedKeccak.Instance; + } +} + +internal sealed class BclKeccak : IKeccak +{ + internal static readonly BclKeccak Instance = new(); + + public void Sha3_256(ReadOnlySpan input, Span output) + { + SHA3_256.HashData(input, output); + } + + public void Sha3_512(ReadOnlySpan input, Span output) + { + SHA3_512.HashData(input, output); + } + + public void Shake128(ReadOnlySpan input, Span output) + { + System.Security.Cryptography.Shake128.HashData(input, output); + } + + public void Shake256(ReadOnlySpan input, Span output) + { + System.Security.Cryptography.Shake256.HashData(input, output); + } +} + +internal sealed class ManagedKeccak : IKeccak +{ + internal static readonly ManagedKeccak Instance = new(); + + private const int LaneCount = 25; + + private static readonly ulong[] RoundConstants = BuildRoundConstants(); + + public void Sha3_256(ReadOnlySpan input, Span output) + { + if (output.Length != 32) + { + throw new ArgumentException("SHA3-256 writes 32 bytes."); + } + + Sponge(input, output, rate: 136, domain: 0x06); + } + + public void Sha3_512(ReadOnlySpan input, Span output) + { + if (output.Length != 64) + { + throw new ArgumentException("SHA3-512 writes 64 bytes."); + } + + Sponge(input, output, rate: 72, domain: 0x06); + } + + public void Shake128(ReadOnlySpan input, Span output) + { + Sponge(input, output, rate: 168, domain: 0x1F); + } + + public void Shake256(ReadOnlySpan input, Span output) + { + Sponge(input, output, rate: 136, domain: 0x1F); + } + + private static void Sponge(ReadOnlySpan input, Span output, int rate, byte domain) + { + Span state = stackalloc ulong[LaneCount]; + Span tail = stackalloc byte[168]; + try + { + int offset = 0; + while (input.Length - offset >= rate) + { + XorLaneBytes(state, input.Slice(offset, rate)); + Permute(state); + offset += rate; + } + + tail.Clear(); + input[offset..].CopyTo(tail); + tail[input.Length - offset] ^= domain; + tail[rate - 1] ^= 0x80; + XorLaneBytes(state, tail[..rate]); + Permute(state); + int produced = 0; + while (produced < output.Length) + { + int take = Math.Min(rate, output.Length - produced); + StoreLaneBytes(state, output.Slice(produced, take)); + produced += take; + if (produced < output.Length) + { + Permute(state); + } + } + } + finally + { + CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(state)); + CryptographicOperations.ZeroMemory(tail); + } + } + + private static void XorLaneBytes(Span state, ReadOnlySpan block) + { + int lane = 0; + int offset = 0; + while (offset + 8 <= block.Length) + { + state[lane++] ^= BinaryPrimitives.ReadUInt64LittleEndian(block.Slice(offset, 8)); + offset += 8; + } + + if (offset < block.Length) + { + ulong partial = 0; + for (int i = 0; offset + i < block.Length; i++) + { + partial |= (ulong)block[offset + i] << (8 * i); + } + + state[lane] ^= partial; + } + } + + private static void StoreLaneBytes(ReadOnlySpan state, Span destination) + { + int lane = 0; + int offset = 0; + while (offset + 8 <= destination.Length) + { + BinaryPrimitives.WriteUInt64LittleEndian(destination.Slice(offset, 8), state[lane++]); + offset += 8; + } + + if (offset < destination.Length) + { + ulong value = state[lane]; + for (int i = 0; offset + i < destination.Length; i++) + { + destination[offset + i] = (byte)(value >> (8 * i)); + } + } + } + + private static void Permute(Span a) + { + Span b = stackalloc ulong[LaneCount]; + Span c = stackalloc ulong[5]; + try + { + for (int round = 0; round < 24; round++) + { + c.Clear(); + for (int x = 0; x < 5; x++) + { + c[x] = a[x] ^ a[x + 5] ^ a[x + 10] ^ a[x + 15] ^ a[x + 20]; + } + + for (int x = 0; x < 5; x++) + { + ulong d = c[(x + 4) % 5] ^ RotateLeft(c[(x + 1) % 5], 1); + for (int y = 0; y < 5; y++) + { + a[x + (5 * y)] ^= d; + } + } + + b.Clear(); + b[0] = a[0]; + int px = 1; + int py = 0; + for (int t = 0; t < 24; t++) + { + int rotation = ((t + 1) * (t + 2) / 2) % 64; + int nx = py; + int ny = ((2 * px) + (3 * py)) % 5; + b[nx + (5 * ny)] = RotateLeft(a[px + (5 * py)], rotation); + px = nx; + py = ny; + } + + for (int y = 0; y < 5; y++) + { + for (int x = 0; x < 5; x++) + { + a[x + (5 * y)] = b[x + (5 * y)] ^ ((~b[((x + 1) % 5) + (5 * y)]) & b[((x + 2) % 5) + (5 * y)]); + } + } + + a[0] ^= RoundConstants[round]; + } + } + finally + { + CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(b)); + CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(c)); + } + } + + private static ulong RotateLeft(ulong value, int bits) + { + if (bits == 0) + { + return value; + } + + return (value << bits) | (value >> (64 - bits)); + } + + private static ulong[] BuildRoundConstants() + { + ulong[] constants = new ulong[24]; + for (int round = 0; round < 24; round++) + { + ulong lane = 0; + for (int j = 0; j < 7; j++) + { + int bit = Rc((j + (7 * round)) % 255); + lane |= (ulong)bit << ((1 << j) - 1); + } + + constants[round] = lane; + } + + return constants; + } + + private static int Rc(int t) + { + if (t == 0) + { + return 1; + } + + Span r = stackalloc int[8]; + Span next = stackalloc int[9]; + r[0] = 1; + for (int i = 1; i <= t; i++) + { + next.Clear(); + for (int bit = 0; bit < 8; bit++) + { + next[bit + 1] = r[bit]; + } + + next[0] ^= next[8]; + next[4] ^= next[8]; + next[5] ^= next[8]; + next[6] ^= next[8]; + for (int bit = 0; bit < 8; bit++) + { + r[bit] = next[bit]; + } + } + + return r[0]; + } +} diff --git a/src/Titanium.Tls/Internal/ManagedMlKem768.cs b/src/Titanium.Tls/Internal/ManagedMlKem768.cs new file mode 100644 index 000000000..94493e2e0 --- /dev/null +++ b/src/Titanium.Tls/Internal/ManagedMlKem768.cs @@ -0,0 +1,625 @@ +using System; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// ML-KEM-768 from FIPS 203. Zeta powers are 17 raised to the bit-reversed exponent, which is the +/// table in Appendix A. Arithmetic stays in the integers; there is no floating-point rounding. +/// +internal sealed class ManagedMlKem768 : IMlKem768 +{ + internal const int Q = 3329; + internal const int N = 256; + internal const int K = 3; + internal const int EncapsulationKeyLength = 1184; + internal const int DecapsulationKeyLength = 2400; + internal const int CiphertextLength = 1088; + internal const int SharedSecretLength = 32; + + private const int Eta = 2; + private const int Du = 10; + private const int Dv = 4; + private const int Inv128 = 3303; + private const int PolyBytes12 = 384; + private const int EncodedU = 320; + + internal static readonly ManagedMlKem768 Instance = new(); + + private static readonly short[] Zetas = BuildZetas(); + private static readonly short[] Gammas = BuildGammas(); + + private readonly ManagedKeccak _keccak = ManagedKeccak.Instance; + + public void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey) + { + Span d = stackalloc byte[32]; + Span z = stackalloc byte[32]; + RandomNumberGenerator.Fill(d); + RandomNumberGenerator.Fill(z); + try + { + GenerateKeyPair(encapsulationKey, decapsulationKey, d, z); + } + finally + { + CryptographicOperations.ZeroMemory(d); + CryptographicOperations.ZeroMemory(z); + } + } + + public void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey, ReadOnlySpan seedD, ReadOnlySpan seedZ) + { + if (encapsulationKey.Length != EncapsulationKeyLength || decapsulationKey.Length != DecapsulationKeyLength || seedD.Length != 32 || seedZ.Length != 32) + { + throw new ArgumentException("ML-KEM-768 key generation lengths are fixed."); + } + + PkeKeyGen(seedD, encapsulationKey, decapsulationKey[..(K * PolyBytes12)]); + encapsulationKey.CopyTo(decapsulationKey.Slice(K * PolyBytes12, EncapsulationKeyLength)); + _keccak.Sha3_256(encapsulationKey, decapsulationKey.Slice((K * PolyBytes12) + EncapsulationKeyLength, 32)); + seedZ.CopyTo(decapsulationKey[^32..]); + } + + public bool TryEncapsulate(ReadOnlySpan encapsulationKey, Span ciphertext, Span sharedSecret) + { + Span message = stackalloc byte[32]; + RandomNumberGenerator.Fill(message); + try + { + return TryEncapsulate(encapsulationKey, message, ciphertext, sharedSecret); + } + finally + { + CryptographicOperations.ZeroMemory(message); + } + } + + public bool TryEncapsulate(ReadOnlySpan encapsulationKey, ReadOnlySpan message, Span ciphertext, Span sharedSecret) + { + if (encapsulationKey.Length != EncapsulationKeyLength || message.Length != 32 || ciphertext.Length != CiphertextLength || sharedSecret.Length != SharedSecretLength) + { + return false; + } + + if (!ModulusCheck(encapsulationKey)) + { + return false; + } + + Span hash = stackalloc byte[32]; + Span coins = stackalloc byte[64]; + Span preimage = stackalloc byte[64]; + try + { + _keccak.Sha3_256(encapsulationKey, hash); + message.CopyTo(preimage); + hash.CopyTo(preimage[32..]); + _keccak.Sha3_512(preimage, coins); + coins[..32].CopyTo(sharedSecret); + PkeEncrypt(encapsulationKey, message, coins[32..], ciphertext); + return true; + } + finally + { + CryptographicOperations.ZeroMemory(hash); + CryptographicOperations.ZeroMemory(coins); + CryptographicOperations.ZeroMemory(preimage); + } + } + + public bool TryDecapsulate(ReadOnlySpan decapsulationKey, ReadOnlySpan ciphertext, Span sharedSecret) + { + if (decapsulationKey.Length != DecapsulationKeyLength || ciphertext.Length != CiphertextLength || sharedSecret.Length != SharedSecretLength) + { + return false; + } + + ReadOnlySpan encryptionKey = decapsulationKey.Slice(K * PolyBytes12, EncapsulationKeyLength); + ReadOnlySpan expectedHash = decapsulationKey.Slice((K * PolyBytes12) + EncapsulationKeyLength, 32); + Span hash = stackalloc byte[32]; + _keccak.Sha3_256(encryptionKey, hash); + if (!hash.SequenceEqual(expectedHash) || !ModulusCheck(encryptionKey)) + { + CryptographicOperations.ZeroMemory(hash); + return false; + } + + Span message = stackalloc byte[32]; + Span coins = stackalloc byte[64]; + Span preimage = stackalloc byte[64]; + Span candidate = stackalloc byte[CiphertextLength]; + Span rejection = stackalloc byte[32]; + Span rejectionInput = stackalloc byte[32 + CiphertextLength]; + try + { + PkeDecrypt(decapsulationKey[..(K * PolyBytes12)], ciphertext, message); + message.CopyTo(preimage); + hash.CopyTo(preimage[32..]); + _keccak.Sha3_512(preimage, coins); + PkeEncrypt(encryptionKey, message, coins[32..], candidate); + decapsulationKey[^32..].CopyTo(rejectionInput); + ciphertext.CopyTo(rejectionInput[32..]); + _keccak.Shake256(rejectionInput, rejection); + uint different = 0; + for (int i = 0; i < CiphertextLength; i++) + { + different |= (uint)(ciphertext[i] ^ candidate[i]); + } + + uint mask = (uint)((int)-different >> 31); + for (int i = 0; i < 32; i++) + { + sharedSecret[i] = (byte)(coins[i] ^ ((coins[i] ^ rejection[i]) & mask)); + } + + return true; + } + finally + { + CryptographicOperations.ZeroMemory(hash); + CryptographicOperations.ZeroMemory(message); + CryptographicOperations.ZeroMemory(coins); + CryptographicOperations.ZeroMemory(preimage); + CryptographicOperations.ZeroMemory(candidate); + CryptographicOperations.ZeroMemory(rejection); + CryptographicOperations.ZeroMemory(rejectionInput); + } + } + + private void PkeKeyGen(ReadOnlySpan seedD, Span encryptionKey, Span decryptionKey) + { + Span expanded = stackalloc byte[64]; + Span domain = stackalloc byte[33]; + seedD.CopyTo(domain); + domain[32] = K; + _keccak.Sha3_512(domain, expanded); + ReadOnlySpan rho = expanded[..32]; + ReadOnlySpan sigma = expanded[32..]; + Span matrix = stackalloc short[K * K * N]; + Span secret = stackalloc short[K * N]; + Span noise = stackalloc short[K * N]; + try + { + ExpandMatrix(rho, matrix); + byte nonce = 0; + for (int i = 0; i < K; i++) + { + SamplePolyCbd(sigma, nonce++, secret.Slice(i * N, N)); + Ntt(secret.Slice(i * N, N)); + } + + for (int i = 0; i < K; i++) + { + SamplePolyCbd(sigma, nonce++, noise.Slice(i * N, N)); + Ntt(noise.Slice(i * N, N)); + } + + Span product = stackalloc short[N]; + for (int i = 0; i < K; i++) + { + product.Clear(); + for (int j = 0; j < K; j++) + { + Accumulate(matrix.Slice(((i * K) + j) * N, N), secret.Slice(j * N, N), product); + } + + Add(product, noise.Slice(i * N, N)); + ByteEncode(product, 12, encryptionKey.Slice(i * PolyBytes12, PolyBytes12)); + ByteEncode(secret.Slice(i * N, N), 12, decryptionKey.Slice(i * PolyBytes12, PolyBytes12)); + } + + rho.CopyTo(encryptionKey[^32..]); + } + finally + { + Zero(secret); + Zero(noise); + CryptographicOperations.ZeroMemory(expanded); + CryptographicOperations.ZeroMemory(domain); + } + } + + private void PkeEncrypt(ReadOnlySpan encryptionKey, ReadOnlySpan message, ReadOnlySpan randomness, Span ciphertext) + { + Span target = stackalloc short[K * N]; + Span matrix = stackalloc short[K * K * N]; + Span vector = stackalloc short[K * N]; + Span error = stackalloc short[K * N]; + Span extra = stackalloc short[N]; + ReadOnlySpan rho = encryptionKey[^32..]; + ExpandMatrix(rho, matrix); + byte nonce = 0; + for (int i = 0; i < K; i++) + { + ByteDecode(encryptionKey.Slice(i * PolyBytes12, PolyBytes12), 12, target.Slice(i * N, N)); + SamplePolyCbd(randomness, nonce++, vector.Slice(i * N, N)); + Ntt(vector.Slice(i * N, N)); + } + + for (int i = 0; i < K; i++) + { + SamplePolyCbd(randomness, nonce++, error.Slice(i * N, N)); + } + + SamplePolyCbd(randomness, nonce, extra); + Span accumulated = stackalloc short[N]; + for (int i = 0; i < K; i++) + { + accumulated.Clear(); + for (int j = 0; j < K; j++) + { + Accumulate(matrix.Slice(((j * K) + i) * N, N), vector.Slice(j * N, N), accumulated); + } + + InverseNtt(accumulated); + Add(accumulated, error.Slice(i * N, N)); + CompressEncode(accumulated, Du, ciphertext.Slice(i * EncodedU, EncodedU)); + } + + accumulated.Clear(); + for (int j = 0; j < K; j++) + { + Accumulate(target.Slice(j * N, N), vector.Slice(j * N, N), accumulated); + } + + InverseNtt(accumulated); + Add(accumulated, extra); + AddMessage(accumulated, message); + CompressEncode(accumulated, Dv, ciphertext[(K * EncodedU)..]); + Zero(vector); + Zero(error); + Zero(extra); + Zero(accumulated); + } + + private void PkeDecrypt(ReadOnlySpan decryptionKey, ReadOnlySpan ciphertext, Span message) + { + Span secret = stackalloc short[K * N]; + Span u = stackalloc short[K * N]; + Span v = stackalloc short[N]; + for (int i = 0; i < K; i++) + { + ByteDecode(decryptionKey.Slice(i * PolyBytes12, PolyBytes12), 12, secret.Slice(i * N, N)); + DecompressDecode(ciphertext.Slice(i * EncodedU, EncodedU), Du, u.Slice(i * N, N)); + Ntt(u.Slice(i * N, N)); + } + + DecompressDecode(ciphertext[(K * EncodedU)..], Dv, v); + Span accumulated = stackalloc short[N]; + for (int j = 0; j < K; j++) + { + Accumulate(secret.Slice(j * N, N), u.Slice(j * N, N), accumulated); + } + + InverseNtt(accumulated); + Sub(v, accumulated); + CompressEncodeMessage(v, message); + Zero(secret); + Zero(u); + Zero(v); + Zero(accumulated); + } + + private void ExpandMatrix(ReadOnlySpan rho, Span matrix) + { + Span seed = stackalloc byte[34]; + Span stream = stackalloc byte[1008]; + rho.CopyTo(seed); + for (int i = 0; i < K; i++) + { + for (int j = 0; j < K; j++) + { + seed[32] = (byte)j; + seed[33] = (byte)i; + _keccak.Shake128(seed, stream); + SampleNtt(stream, matrix.Slice(((i * K) + j) * N, N)); + } + } + } + + private void SamplePolyCbd(ReadOnlySpan sigma, byte nonce, Span polynomial) + { + Span input = stackalloc byte[33]; + Span block = stackalloc byte[64 * Eta]; + sigma.CopyTo(input); + input[32] = nonce; + try + { + _keccak.Shake256(input, block); + for (int i = 0; i < N; i++) + { + int x = 0; + int y = 0; + for (int bit = 0; bit < Eta; bit++) + { + x += ReadBit(block, (2 * Eta * i) + bit); + y += ReadBit(block, (2 * Eta * i) + Eta + bit); + } + + polynomial[i] = (short)Mod(x - y); + } + } + finally + { + CryptographicOperations.ZeroMemory(input); + CryptographicOperations.ZeroMemory(block); + } + } + + private static void SampleNtt(ReadOnlySpan stream, Span polynomial) + { + int filled = 0; + int offset = 0; + while (filled < N) + { + if (offset + 3 > stream.Length) + { + throw new CryptographicException("SampleNTT exceeded its XOF bound."); + } + + int d1 = stream[offset] + (256 * (stream[offset + 1] & 0x0F)); + int d2 = (stream[offset + 1] >> 4) + (16 * stream[offset + 2]); + offset += 3; + if (d1 < Q) + { + polynomial[filled++] = (short)d1; + } + + if (d2 < Q && filled < N) + { + polynomial[filled++] = (short)d2; + } + } + } + + private static void Ntt(Span polynomial) + { + int k = 1; + for (int length = 128; length >= 2; length >>= 1) + { + for (int start = 0; start < N; start += 2 * length) + { + short zeta = Zetas[k++]; + for (int j = start; j < start + length; j++) + { + int t = Mul(zeta, polynomial[j + length]); + polynomial[j + length] = (short)Mod(polynomial[j] - t); + polynomial[j] = (short)Mod(polynomial[j] + t); + } + } + } + } + + private static void InverseNtt(Span polynomial) + { + int k = 127; + for (int length = 2; length <= 128; length <<= 1) + { + for (int start = 0; start < N; start += 2 * length) + { + short zeta = Zetas[k--]; + for (int j = start; j < start + length; j++) + { + int t = polynomial[j]; + polynomial[j] = (short)Mod(t + polynomial[j + length]); + polynomial[j + length] = (short)Mul(zeta, Mod(polynomial[j + length] - t)); + } + } + } + + for (int i = 0; i < N; i++) + { + polynomial[i] = (short)Mul(polynomial[i], Inv128); + } + } + + private static void Accumulate(ReadOnlySpan left, ReadOnlySpan right, Span destination) + { + for (int i = 0; i < 128; i++) + { + int gamma = Gammas[i]; + int a0 = left[2 * i]; + int a1 = left[(2 * i) + 1]; + int b0 = right[2 * i]; + int b1 = right[(2 * i) + 1]; + int r0 = Mod(((long)a0 * b0) + ((long)Mul(a1, b1) * gamma)); + int r1 = Mod(((long)a0 * b1) + ((long)a1 * b0)); + destination[2 * i] = (short)Mod(destination[2 * i] + r0); + destination[(2 * i) + 1] = (short)Mod(destination[(2 * i) + 1] + r1); + } + } + + private static void Add(Span left, ReadOnlySpan right) + { + for (int i = 0; i < N; i++) + { + left[i] = (short)Mod(left[i] + right[i]); + } + } + + private static void Sub(Span left, ReadOnlySpan right) + { + for (int i = 0; i < N; i++) + { + left[i] = (short)Mod(left[i] - right[i]); + } + } + + private static void AddMessage(Span polynomial, ReadOnlySpan message) + { + for (int i = 0; i < N; i++) + { + int mask = -ReadBit(message, i); + polynomial[i] = (short)Mod(polynomial[i] + (mask & ((Q + 1) / 2))); + } + } + + private bool ModulusCheck(ReadOnlySpan encapsulationKey) + { + Span polynomial = stackalloc short[N]; + Span encoded = stackalloc byte[PolyBytes12]; + for (int i = 0; i < K; i++) + { + ReadOnlySpan slice = encapsulationKey.Slice(i * PolyBytes12, PolyBytes12); + ByteDecode(slice, 12, polynomial); + ByteEncode(polynomial, 12, encoded); + if (!encoded.SequenceEqual(slice)) + { + return false; + } + } + + return true; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void CompressEncode(ReadOnlySpan polynomial, int bits, Span destination) + { + Span compressed = stackalloc short[N]; + for (int i = 0; i < N; i++) + { + compressed[i] = (short)((((long)polynomial[i] << (bits + 1)) + Q) / (2 * Q) & ((1 << bits) - 1)); + } + + ByteEncode(compressed, bits, destination); + } + + private static void DecompressDecode(ReadOnlySpan source, int bits, Span polynomial) + { + ByteDecode(source, bits, polynomial); + int half = 1 << (bits - 1); + for (int i = 0; i < N; i++) + { + polynomial[i] = (short)((((long)polynomial[i] * Q) + half) >> bits); + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void CompressEncodeMessage(ReadOnlySpan polynomial, Span message) + { + message.Clear(); + for (int i = 0; i < N; i++) + { + int bit = (int)((((long)polynomial[i] << 2) + Q) / (2 * Q) & 1); + message[i >> 3] |= (byte)(bit << (i & 7)); + } + } + + private static void ByteEncode(ReadOnlySpan polynomial, int bits, Span destination) + { + destination.Clear(); + int acc = 0; + int filled = 0; + int position = 0; + for (int i = 0; i < N; i++) + { + acc |= polynomial[i] << filled; + filled += bits; + while (filled >= 8) + { + destination[position++] = (byte)acc; + acc >>= 8; + filled -= 8; + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void ByteDecode(ReadOnlySpan source, int bits, Span polynomial) + { + int acc = 0; + int filled = 0; + int position = 0; + int mask = (1 << bits) - 1; + for (int i = 0; i < N; i++) + { + while (filled < bits) + { + acc |= source[position++] << filled; + filled += 8; + } + + int value = acc & mask; + polynomial[i] = (short)(bits == 12 ? value % Q : value); + acc >>= bits; + filled -= bits; + } + } + + private static void Zero(Span values) + { + CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(values)); + } + + private static int ReadBit(ReadOnlySpan bytes, int index) + { + return (bytes[index >> 3] >> (index & 7)) & 1; + } + + private static int Mul(int left, int right) + { + return Mod((long)left * right); + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static int Mod(long value) + { + int reduced = (int)(value % Q); + return reduced + ((reduced >> 31) & Q); + } + + private static short[] BuildZetas() + { + short[] zetas = new short[128]; + for (int i = 0; i < 128; i++) + { + zetas[i] = (short)ModPow(17, BitRev7(i)); + } + + return zetas; + } + + private static short[] BuildGammas() + { + short[] gammas = new short[128]; + for (int i = 0; i < 128; i++) + { + gammas[i] = (short)ModPow(17, (2 * BitRev7(i)) + 1); + } + + return gammas; + } + + private static int BitRev7(int value) + { + int reversed = 0; + for (int bit = 0; bit < 7; bit++) + { + reversed = (reversed << 1) | (value & 1); + value >>= 1; + } + + return reversed; + } + + private static int ModPow(int value, int exponent) + { + int result = 1; + int baseValue = value; + while (exponent > 0) + { + if ((exponent & 1) == 1) + { + result = (int)((long)result * baseValue % Q); + } + + baseValue = (int)((long)baseValue * baseValue % Q); + exponent >>= 1; + } + + return result; + } +} diff --git a/src/Titanium.Tls/Internal/MlKem768.cs b/src/Titanium.Tls/Internal/MlKem768.cs new file mode 100644 index 000000000..c20d19bae --- /dev/null +++ b/src/Titanium.Tls/Internal/MlKem768.cs @@ -0,0 +1,88 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal interface IMlKem768 +{ + void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey); + + void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey, ReadOnlySpan seedD, ReadOnlySpan seedZ); + + bool TryEncapsulate(ReadOnlySpan encapsulationKey, Span ciphertext, Span sharedSecret); + + bool TryEncapsulate(ReadOnlySpan encapsulationKey, ReadOnlySpan message, Span ciphertext, Span sharedSecret); + + bool TryDecapsulate(ReadOnlySpan decapsulationKey, ReadOnlySpan ciphertext, Span sharedSecret); +} + +internal static class MlKem768 +{ + internal static IMlKem768 Create(bool forceManaged = false) + { + if (!forceManaged && MLKem.IsSupported) + { + return BclMlKem768.Instance; + } + + return ManagedMlKem768.Instance; + } +} + +internal sealed class BclMlKem768 : IMlKem768 +{ + internal static readonly BclMlKem768 Instance = new(); + + public void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey) + { + using MLKem kem = MLKem.GenerateKey(MLKemAlgorithm.MLKem768); + kem.ExportEncapsulationKey(encapsulationKey); + kem.ExportDecapsulationKey(decapsulationKey); + } + + public void GenerateKeyPair(Span encapsulationKey, Span decapsulationKey, ReadOnlySpan seedD, ReadOnlySpan seedZ) + { + _ = encapsulationKey; + _ = decapsulationKey; + _ = seedD; + _ = seedZ; + throw new NotSupportedException("The platform ML-KEM key generator does not accept external seeds."); + } + + public bool TryEncapsulate(ReadOnlySpan encapsulationKey, Span ciphertext, Span sharedSecret) + { + try + { + using MLKem kem = MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, encapsulationKey); + kem.Encapsulate(ciphertext, sharedSecret); + return true; + } + catch (CryptographicException) + { + return false; + } + } + + public bool TryEncapsulate(ReadOnlySpan encapsulationKey, ReadOnlySpan message, Span ciphertext, Span sharedSecret) + { + _ = encapsulationKey; + _ = message; + _ = ciphertext; + _ = sharedSecret; + throw new NotSupportedException("The platform ML-KEM encapsulation does not accept an external message."); + } + + public bool TryDecapsulate(ReadOnlySpan decapsulationKey, ReadOnlySpan ciphertext, Span sharedSecret) + { + try + { + using MLKem kem = MLKem.ImportDecapsulationKey(MLKemAlgorithm.MLKem768, decapsulationKey); + kem.Decapsulate(ciphertext, sharedSecret); + return true; + } + catch (CryptographicException) + { + return false; + } + } +} diff --git a/src/Titanium.Tls/Internal/NamedGroup.cs b/src/Titanium.Tls/Internal/NamedGroup.cs new file mode 100644 index 000000000..2ed249f11 --- /dev/null +++ b/src/Titanium.Tls/Internal/NamedGroup.cs @@ -0,0 +1,10 @@ +namespace Titanium.Tls; + +/// TLS 1.3 supported-group code points this stack knows. +internal enum NamedGroup : ushort +{ + Secp256r1 = 0x0017, + Secp384r1 = 0x0018, + X25519 = 0x001D, + X25519MlKem768 = 0x11EC, +} diff --git a/src/Titanium.Tls/Internal/NistKeyExchange.cs b/src/Titanium.Tls/Internal/NistKeyExchange.cs new file mode 100644 index 000000000..1fe8310e9 --- /dev/null +++ b/src/Titanium.Tls/Internal/NistKeyExchange.cs @@ -0,0 +1,171 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// NIST ECDHE. The platform generates the scalar because has no hook for +/// . X25519 is the group that consumes the entropy source. +/// +internal sealed class NistKeyExchange : IKeyExchangeGroup +{ + private readonly ECCurveNamed _curve; + + internal NistKeyExchange(NamedGroup group, ECCurveNamed curve) + { + Group = group; + _curve = curve; + } + + public NamedGroup Group { get; } + + public int PublicKeyLength => FieldSize * 2 + 1; + + public int SharedSecretLength => FieldSize; + + private int FieldSize => _curve == ECCurveNamed.P256 ? 32 : 48; + + public IPrivateKeyShare GenerateKeyShare(IEntropySource entropy) + { + ArgumentNullException.ThrowIfNull(entropy); + return new NistPrivateShare(Curve(), FieldSize); + } + + public bool TryEncapsulate(ReadOnlySpan clientShare, IEntropySource entropy, Span serverShare, Span secret, out int serverWritten, out int secretWritten) + { + _ = clientShare; + _ = entropy; + _ = serverShare; + _ = secret; + serverWritten = 0; + secretWritten = 0; + return false; + } + + internal IPrivateKeyShare Import(ReadOnlySpan scalar, ReadOnlySpan uncompressedPublic) + { + return new NistPrivateShare(Curve(), FieldSize, scalar, uncompressedPublic); + } + + private ECCurve Curve() + { + return _curve == ECCurveNamed.P256 ? ECCurve.NamedCurves.nistP256 : ECCurve.NamedCurves.nistP384; + } + + private sealed class NistPrivateShare : IPrivateKeyShare + { + private readonly ECCurve _curve; + private readonly int _fieldSize; + private readonly byte[] _public; + private ECDiffieHellman? _key; + + internal NistPrivateShare(ECCurve curve, int fieldSize) + { + _curve = curve; + _fieldSize = fieldSize; + _key = ECDiffieHellman.Create(curve); + ECParameters parameters = _key.ExportParameters(includePrivateParameters: false); + _public = new byte[(fieldSize * 2) + 1]; + _public[0] = 0x04; + CopyCoordinate(parameters.Q.X, _public.AsSpan(1, fieldSize)); + CopyCoordinate(parameters.Q.Y, _public.AsSpan(1 + fieldSize, fieldSize)); + } + + internal NistPrivateShare(ECCurve curve, int fieldSize, ReadOnlySpan scalar, ReadOnlySpan uncompressedPublic) + { + if (uncompressedPublic.Length != (fieldSize * 2) + 1 || uncompressedPublic[0] != 0x04 || scalar.Length != fieldSize) + { + throw new ArgumentException("The NIST private key and public point have the wrong length."); + } + + _curve = curve; + _fieldSize = fieldSize; + _public = uncompressedPublic.ToArray(); + ECParameters parameters = new() + { + Curve = curve, + D = scalar.ToArray(), + Q = new ECPoint + { + X = uncompressedPublic.Slice(1, fieldSize).ToArray(), + Y = uncompressedPublic.Slice(1 + fieldSize, fieldSize).ToArray(), + }, + }; + _key = ECDiffieHellman.Create(parameters); + } + + public void WritePublicKey(Span destination) + { + ObjectDisposedException.ThrowIf(_key is null, this); + _public.CopyTo(destination); + } + + public bool TryComputeSharedSecret(ReadOnlySpan peerShare, Span secret, out int written) + { + ObjectDisposedException.ThrowIf(_key is null, this); + written = 0; + if (peerShare.Length != _public.Length || peerShare[0] != 0x04 || secret.Length < _fieldSize) + { + return false; + } + + byte[] x = peerShare.Slice(1, _fieldSize).ToArray(); + byte[] y = peerShare.Slice(1 + _fieldSize, _fieldSize).ToArray(); + try + { + ECParameters peer = new() + { + Curve = _curve, + Q = new ECPoint { X = x, Y = y }, + }; + using ECDiffieHellman peerKey = ECDiffieHellman.Create(peer); + byte[] agreed = _key.DeriveRawSecretAgreement(peerKey.PublicKey); + try + { + if (agreed.Length > _fieldSize) + { + return false; + } + + secret[.._fieldSize].Clear(); + agreed.CopyTo(secret[(_fieldSize - agreed.Length)..]); + written = _fieldSize; + return true; + } + finally + { + CryptographicOperations.ZeroMemory(agreed); + } + } + catch (Exception exception) when (exception is CryptographicException or ArgumentException or PlatformNotSupportedException) + { + secret[.._fieldSize].Clear(); + return false; + } + finally + { + CryptographicOperations.ZeroMemory(x); + CryptographicOperations.ZeroMemory(y); + } + } + + public void Dispose() + { + ECDiffieHellman? key = _key; + _key = null; + key?.Dispose(); + CryptographicOperations.ZeroMemory(_public); + } + + private static void CopyCoordinate(byte[]? source, Span destination) + { + destination.Clear(); + if (source is null || source.Length == 0) + { + return; + } + + source.AsSpan(^Math.Min(source.Length, destination.Length)).CopyTo(destination[^Math.Min(source.Length, destination.Length)..]); + } + } +} diff --git a/src/Titanium.Tls/Internal/PooledBufferWriter.cs b/src/Titanium.Tls/Internal/PooledBufferWriter.cs new file mode 100644 index 000000000..9e84c20e8 --- /dev/null +++ b/src/Titanium.Tls/Internal/PooledBufferWriter.cs @@ -0,0 +1,98 @@ +using System; +using System.Buffers; + +namespace Titanium.Tls; + +/// +/// A reusable over a pooled array. The engine keeps one per handshake flight +/// instead of allocating a growing writer for every ClientHello. wipes and returns the array. +/// +internal sealed class PooledBufferWriter : IBufferWriter +{ + private const int MinimumSize = 1024; + + private byte[] _buffer = []; + private int _written; + + internal ReadOnlySpan WrittenSpan => _buffer.AsSpan(0, _written); + + internal int WrittenCount => _written; + + internal void Clear() + { + if (_written > 0) + { + _buffer.AsSpan(0, _written).Clear(); + _written = 0; + } + } + + internal void Write(ReadOnlySpan value) + { + value.CopyTo(GetSpan(value.Length)); + Advance(value.Length); + } + + internal void Release() + { + if (_buffer.Length > 0) + { + ArrayPool.Shared.Return(_buffer, clearArray: true); + _buffer = []; + } + + _written = 0; + } + + public void Advance(int count) + { + ArgumentOutOfRangeException.ThrowIfNegative(count); + if (count > _buffer.Length - _written) + { + throw new InvalidOperationException("Advanced past the end of the buffer."); + } + + _written += count; + } + + public Memory GetMemory(int sizeHint = 0) + { + Grow(sizeHint); + return _buffer.AsMemory(_written); + } + + public Span GetSpan(int sizeHint = 0) + { + Grow(sizeHint); + return _buffer.AsSpan(_written); + } + + private void Grow(int sizeHint) + { + ArgumentOutOfRangeException.ThrowIfNegative(sizeHint); + int need = sizeHint == 0 ? 1 : sizeHint; + if (_buffer.Length - _written >= need) + { + return; + } + + int size = _buffer.Length == 0 ? MinimumSize : _buffer.Length; + while (size - _written < need) + { + size *= 2; + } + + byte[] next = ArrayPool.Shared.Rent(size); + if (_written > 0) + { + _buffer.AsSpan(0, _written).CopyTo(next); + } + + if (_buffer.Length > 0) + { + ArrayPool.Shared.Return(_buffer, clearArray: true); + } + + _buffer = next; + } +} diff --git a/src/Titanium.Tls/Internal/SecretBuffer.cs b/src/Titanium.Tls/Internal/SecretBuffer.cs new file mode 100644 index 000000000..0e1d0a1dd --- /dev/null +++ b/src/Titanium.Tls/Internal/SecretBuffer.cs @@ -0,0 +1,64 @@ +using System; + +namespace Titanium.Tls; + +/// Pinned secret bytes that are wiped on dispose. +internal sealed class SecretBuffer : IDisposable +{ + private byte[] _bytes; + private bool _disposed; + + private readonly int _length; + + internal SecretBuffer(int length) + { + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(length); + ArgumentOutOfRangeException.ThrowIfGreaterThan(length, SecretBufferPool.SlabLength); + + _bytes = SecretBufferPool.Rent(); + _length = length; + } + + internal int Length => _length; + + internal Span Span + { + get + { + ObjectDisposedException.ThrowIf(_disposed, this); + return _bytes.AsSpan(0, _length); + } + } + + internal bool IsZeroed + { + get + { + for (int i = 0; i < _length; i++) + { + if (_bytes[i] != 0) + { + return false; + } + } + + return true; + } + } + + internal void CopyTo(Span destination) + { + Span.CopyTo(destination); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + SecretBufferPool.Return(_bytes); + } +} diff --git a/src/Titanium.Tls/Internal/SecretBufferPool.cs b/src/Titanium.Tls/Internal/SecretBufferPool.cs new file mode 100644 index 000000000..222f332ff --- /dev/null +++ b/src/Titanium.Tls/Internal/SecretBufferPool.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// Fixed 48-byte pinned slabs for TLS secrets. A returned slab is wiped. +internal static class SecretBufferPool +{ + internal const int SlabLength = 48; + + private static readonly Stack Free = new(); + private static readonly object Gate = new(); + + internal static byte[] Rent() + { + lock (Gate) + { + if (Free.Count > 0) + { + return Free.Pop(); + } + } + + return GC.AllocateArray(SlabLength, pinned: true); + } + + internal static void Return(byte[] slab) + { + CryptographicOperations.ZeroMemory(slab); + lock (Gate) + { + Free.Push(slab); + } + } +} diff --git a/src/Titanium.Tls/Internal/SignatureScheme.cs b/src/Titanium.Tls/Internal/SignatureScheme.cs new file mode 100644 index 000000000..2a352666f --- /dev/null +++ b/src/Titanium.Tls/Internal/SignatureScheme.cs @@ -0,0 +1,9 @@ +namespace Titanium.Tls; + +/// +/// TLS 1.3 signature schemes this stack verifies. Ed25519 is 0x0807. +/// +internal enum SignatureScheme : ushort +{ + Ed25519 = 0x0807, +} diff --git a/src/Titanium.Tls/Internal/TlsAlgorithmPolicy.cs b/src/Titanium.Tls/Internal/TlsAlgorithmPolicy.cs new file mode 100644 index 000000000..a070aec12 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsAlgorithmPolicy.cs @@ -0,0 +1,11 @@ +namespace Titanium.Tls; + +/// Which algorithms a handshake may offer or select. +public enum TlsAlgorithmPolicy +{ + /// The stack's ordinary TLS 1.3 set. + Default = 0, + + /// AES-GCM, NIST P-256 and P-384, and the approved ECDSA and RSA-PSS schemes. Ed25519 is rejected. + FipsApprovedOnly = 1, +} diff --git a/src/Titanium.Tls/Internal/TlsAlgorithmSet.cs b/src/Titanium.Tls/Internal/TlsAlgorithmSet.cs new file mode 100644 index 000000000..76cc4189a --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsAlgorithmSet.cs @@ -0,0 +1,46 @@ +namespace Titanium.Tls; + +internal static class TlsAlgorithmSet +{ + internal static bool AllowsCipher(TlsAlgorithmPolicy policy, ushort cipher) + { + if (policy != TlsAlgorithmPolicy.FipsApprovedOnly) + { + return true; + } + + return cipher is 0x1301 or 0x1302; + } + + internal static bool AllowsGroup(TlsAlgorithmPolicy policy, ushort group) + { + if (policy != TlsAlgorithmPolicy.FipsApprovedOnly) + { + return true; + } + + return group is 0x0017 or 0x0018; + } + + internal static bool AllowsSignature(TlsAlgorithmPolicy policy, ushort scheme) + { + if (policy != TlsAlgorithmPolicy.FipsApprovedOnly) + { + return true; + } + + return scheme is 0x0403 or 0x0503 or 0x0804 or 0x0805 or 0x0806 or 0x0809 or 0x080A or 0x080B; + } + + internal static bool AllowsRsa(TlsAlgorithmPolicy policy, int bits) + { + return policy != TlsAlgorithmPolicy.FipsApprovedOnly || bits >= 2048; + } + + internal static bool IsApprovedOffer(ushort value) + { + return AllowsCipher(TlsAlgorithmPolicy.FipsApprovedOnly, value) || + AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, value) || + AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, value); + } +} diff --git a/src/Titanium.Tls/Internal/TlsCertificateDecision.cs b/src/Titanium.Tls/Internal/TlsCertificateDecision.cs new file mode 100644 index 000000000..9107e68bb --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsCertificateDecision.cs @@ -0,0 +1,61 @@ +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Text; + +namespace Titanium.Tls; + +/// +/// Applies the way SslStream does, then disposes the chain. +/// +internal static class TlsCertificateDecision +{ + internal const string RemoteCertificateInvalid = "The remote certificate is invalid according to the validation procedure."; + + internal const string RemoteCertificateRejected = "The remote certificate was rejected by the provided RemoteCertificateValidationCallback."; + + internal static void ThrowIfRejected(SslPolicyErrors errors, RemoteCertificateValidationCallback? callback, object? sender, X509Certificate? certificate, X509Chain? chain) + { + try + { + bool accepted = errors == SslPolicyErrors.None; + if (callback is not null) + { + accepted = callback(sender!, certificate, chain, errors); + } + + if (!accepted) + { + string message = callback is not null + ? RemoteCertificateRejected + : ChainErrorMessage(chain); + throw new AuthenticationException(message); + } + } + finally + { + chain?.Dispose(); + } + } + + private static string ChainErrorMessage(X509Chain? chain) + { + if (chain is null || chain.ChainStatus.Length == 0) + { + return RemoteCertificateInvalid; + } + + var text = new StringBuilder("The remote certificate is invalid because of errors in the certificate chain: "); + for (int i = 0; i < chain.ChainStatus.Length; i++) + { + if (i > 0) + { + text.Append(", "); + } + + text.Append(chain.ChainStatus[i].Status); + } + + return text.ToString(); + } +} diff --git a/src/Titanium.Tls/Internal/TlsCertificateVerifier.cs b/src/Titanium.Tls/Internal/TlsCertificateVerifier.cs new file mode 100644 index 000000000..22755aecf --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsCertificateVerifier.cs @@ -0,0 +1,68 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +/// +/// Checks a TLS 1.3 CertificateVerify signature. SHA-1 and PKCS#1 v1.5 schemes are rejected. +/// +internal static class TlsCertificateVerifier +{ + private const int MinimumRsaBits = 2048; + private const string P256 = "1.2.840.10045.3.1.7"; + private const string P384 = "1.3.132.0.34"; + private const string RsaPss = "1.2.840.113549.1.1.10"; + + internal static bool Verify(X509Certificate2 certificate, ushort scheme, ReadOnlySpan content, ReadOnlySpan signature) + { + ArgumentNullException.ThrowIfNull(certificate); + try + { + return scheme switch + { + 0x0403 => VerifyEcdsa(certificate, content, signature, HashAlgorithmName.SHA256, P256), + 0x0503 => VerifyEcdsa(certificate, content, signature, HashAlgorithmName.SHA384, P384), + 0x0804 => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA256, rsaPssKey: false), + 0x0805 => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA384, rsaPssKey: false), + 0x0806 => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA512, rsaPssKey: false), + 0x0809 => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA256, rsaPssKey: true), + 0x080A => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA384, rsaPssKey: true), + 0x080B => VerifyRsaPss(certificate, content, signature, HashAlgorithmName.SHA512, rsaPssKey: true), + _ => false, + }; + } + catch (CryptographicException) + { + return false; + } + } + + private static bool VerifyEcdsa(X509Certificate2 certificate, ReadOnlySpan content, ReadOnlySpan signature, HashAlgorithmName hash, string curveOid) + { + using ECDsa? key = certificate.GetECDsaPublicKey(); + if (key is null || !string.Equals(key.ExportParameters(false).Curve.Oid.Value, curveOid, StringComparison.Ordinal)) + { + return false; + } + + return key.VerifyData(content, signature, hash, DSASignatureFormat.Rfc3279DerSequence); + } + + private static bool VerifyRsaPss(X509Certificate2 certificate, ReadOnlySpan content, ReadOnlySpan signature, HashAlgorithmName hash, bool rsaPssKey) + { + bool pssKey = string.Equals(certificate.PublicKey.Oid.Value, RsaPss, StringComparison.Ordinal); + if (pssKey != rsaPssKey) + { + return false; + } + + using RSA? key = certificate.GetRSAPublicKey(); + if (key is null || key.KeySize < MinimumRsaBits) + { + return false; + } + + return key.VerifyData(content, signature, hash, RSASignaturePadding.Pss); + } +} diff --git a/src/Titanium.Tls/Internal/TlsChainValidator.cs b/src/Titanium.Tls/Internal/TlsChainValidator.cs new file mode 100644 index 000000000..cb0aba04c --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsChainValidator.cs @@ -0,0 +1,163 @@ +using System; +using System.Collections.Generic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +/// +/// Chain and hostname result for one Certificate message. The stapled OCSP response and the timestamps are copied out and are not checked. +/// +internal sealed class TlsCertificateCheck : IDisposable +{ + private readonly X509Certificate2[] _certificates; + + internal TlsCertificateCheck(SslPolicyErrors errors, X509Certificate2[] certificates, X509Chain? chain, byte[]? stapledStatus, byte[]? signedTimestamps) + { + Errors = errors; + _certificates = certificates; + Chain = chain; + StapledStatus = stapledStatus; + SignedCertificateTimestamps = signedTimestamps; + } + + internal SslPolicyErrors Errors { get; } + + internal X509Chain? Chain { get; } + + internal byte[]? StapledStatus { get; } + + internal byte[]? SignedCertificateTimestamps { get; } + + public void Dispose() + { + Chain?.Dispose(); + foreach (X509Certificate2 certificate in _certificates) + { + certificate.Dispose(); + } + } +} + +/// +/// Builds an the way SslStream does and reports . +/// A stapled status is not passed to the chain. cannot consume one. +/// +internal static class TlsChainValidator +{ + private const string ServerAuth = "1.3.6.1.5.5.7.3.1"; + private const string ClientAuth = "1.3.6.1.5.5.7.3.2"; + + internal static TlsCertificateCheck Evaluate(ReadOnlySpan certificateList, string? targetHost, X509Certificate2Collection? trustAnchors, bool serverCertificate) + { + if (!TryReadCertificates(certificateList, out X509Certificate2[] certificates, out byte[]? stapled, out byte[]? timestamps)) + { + return new TlsCertificateCheck(SslPolicyErrors.RemoteCertificateChainErrors, certificates, null, stapled, timestamps); + } + + if (certificates.Length == 0) + { + return new TlsCertificateCheck(SslPolicyErrors.RemoteCertificateNotAvailable, certificates, null, stapled, timestamps); + } + + var chain = new X509Chain(); + chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; + chain.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag; + chain.ChainPolicy.ApplicationPolicy.Add(new Oid(serverCertificate ? ServerAuth : ClientAuth)); + if (trustAnchors is not null) + { + chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust; + chain.ChainPolicy.CustomTrustStore.AddRange(trustAnchors); + } + + for (int i = 1; i < certificates.Length; i++) + { + chain.ChainPolicy.ExtraStore.Add(certificates[i]); + } + + bool built = false; + CryptoExecutionPolicy.Run(CryptoExecutionPolicy.Revocation(false), () => built = chain.Build(certificates[0])); + SslPolicyErrors errors = built ? SslPolicyErrors.None : SslPolicyErrors.RemoteCertificateChainErrors; + if (!HostMatches(certificates[0], targetHost)) + { + errors |= SslPolicyErrors.RemoteCertificateNameMismatch; + } + + return new TlsCertificateCheck(errors, certificates, chain, stapled, timestamps); + } + + private static bool HostMatches(X509Certificate2 certificate, string? targetHost) + { + if (string.IsNullOrEmpty(targetHost)) + { + return true; + } + + return certificate.MatchesHostname(targetHost, allowWildcards: true, allowCommonName: true); + } + + private static bool TryReadCertificates(ReadOnlySpan list, out X509Certificate2[] certificates, out byte[]? stapledStatus, out byte[]? signedTimestamps) + { + var loaded = new List(); + stapledStatus = null; + signedTimestamps = null; + TlsReader reader = new(list); + bool first = true; + int count = 0; + while (reader.Remaining > 0) + { + count++; + if (count > HandshakeMessages.MaxCertificateEntries) + { + certificates = loaded.ToArray(); + return false; + } + + if (!reader.TryReadVector24(out ReadOnlySpan encoded) || encoded.IsEmpty || !reader.TryReadVector16(out ReadOnlySpan extensions)) + { + certificates = loaded.ToArray(); + return false; + } + + try + { + loaded.Add(X509CertificateLoader.LoadCertificate(encoded)); + } + catch (CryptographicException) + { + certificates = loaded.ToArray(); + return false; + } + + if (first) + { + stapledStatus = CopyExtension(extensions, ExtensionType.StatusRequest); + signedTimestamps = CopyExtension(extensions, ExtensionType.SignedCertificateTimestamp); + first = false; + } + } + + certificates = loaded.ToArray(); + return true; + } + + private static byte[]? CopyExtension(ReadOnlySpan extensions, ushort type) + { + TlsReader reader = new(extensions); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort found) || !reader.TryReadVector16(out ReadOnlySpan body)) + { + return null; + } + + if (found == type) + { + return body.ToArray(); + } + } + + return null; + } +} diff --git a/src/Titanium.Tls/Internal/TlsEngine.Client.cs b/src/Titanium.Tls/Internal/TlsEngine.Client.cs new file mode 100644 index 000000000..4d600b3b9 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsEngine.Client.cs @@ -0,0 +1,1628 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +internal sealed partial class TlsEngine +{ + private const ushort CipherAes128GcmSha256 = 0x1301; + private const byte AlertUnexpectedMessage = 10; + private const byte AlertIllegalParameter = 47; + private const byte AlertDecryptError = 51; + private const byte AlertMissingExtension = 109; + private const int MaxTicketsStored = 8; + private const int MaxStoredTicketBytes = 2048; + + private static readonly byte[] EmptyCertificate = [11, 0, 0, 4, 0, 0, 0, 0]; + private const string ProfileName = "tls"; + + private static ReadOnlySpan DowngradeTls12 => [0x44, 0x4F, 0x57, 0x4E, 0x47, 0x52, 0x44, 0x01]; + + private static ReadOnlySpan DowngradeTls11 => [0x44, 0x4F, 0x57, 0x4E, 0x47, 0x52, 0x44, 0x00]; + + private readonly ushort[] _offered = new ushort[32]; + private int _offeredCount; + private byte[]? _profileRetry; + private IPrivateKeyShare? _extraShare; + private ushort _extraGroup; + private bool _certificateAllowsP256; + private IPrivateKeyShare? _share; + private readonly byte[] _clientRandom = new byte[32]; + private readonly byte[] _legacySessionId = new byte[32]; + private TlsRecordProtector? _read; + private TlsRecordProtector? _write; + private SecretBuffer? _clientHandshakeSecret; + private SecretBuffer? _serverHandshakeSecret; + private SecretBuffer? _resumptionMaster; + private byte[]? _leaf; + private PooledBufferWriter? _flightWriter; + private PooledBufferWriter? _joinWriter; + + internal X509Certificate2Collection? TrustAnchors { get; set; } + + internal X509Certificate2? LocalCertificate { get; set; } + + internal Func? ChooseLocalCertificate { get; set; } + + private string[]? _acceptableIssuers; + + internal string[]? ApplicationProtocols { get; set; } + + internal TlsFingerprintProfile? FingerprintProfile { get; set; } + + internal bool OfferStatusRequest { get; set; } + + internal SslPolicyErrors ServerCertificateErrors { get; private set; } + + internal byte[]? StapledOcspResponse { get; private set; } + + internal byte[]? SignedCertificateTimestamps { get; private set; } + private byte[]? _cookie; + private byte[]? _psk; + private byte[]? _ticketIdentity; + private int _ticketsStored; + private uint _ticketAgeAdd; + private uint _ticketLifetime; + private long _ticketIssued; + private ushort _shareGroup = (ushort)NamedGroup.X25519; + private ushort _generatedGroup; + private int _publicLength = 32; + private ushort _selectedCipher; + private ushort[] _offeredCiphers = [0x1301]; + private HashAlgorithmName _hash = HashAlgorithmName.SHA256; + private TlsAeadSuite _aead = TlsAeadSuite.Aes128Gcm; + private int _keyLength = 16; + private bool _hrrSeen; + private bool _certificateRequested; + private bool _pskSelected; + private bool _randomReady; + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + ReleaseFlightWriters(); + _share?.Dispose(); + _extraShare?.Dispose(); + _read?.Dispose(); + _write?.Dispose(); + _clientHandshakeSecret?.Dispose(); + _serverHandshakeSecret?.Dispose(); + _clientApplication?.Dispose(); + _serverApplication?.Dispose(); + _exporter?.Dispose(); + _serverCheck?.Dispose(); + _remoteCertificate?.Dispose(); + if (_plaintext is not null) + { + System.Buffers.ArrayPool.Shared.Return(_plaintext, clearArray: true); + _plaintext = null; + } + + ReturnHandshakeBuffers(); + _resumptionMaster?.Dispose(); + _transcript?.Dispose(); + _schedule?.Dispose(); + if (_psk is not null) + { + CryptographicOperations.ZeroMemory(_psk); + } + } + + private void WriteClientHello(TlsOutput output, bool helloRetry) + { + if (_schedule!.Stage == KeyScheduleStage.None) + { + LoadTicket(); + _schedule.InitializeEarly(_psk ?? ReadOnlySpan.Empty); + } + + if (!_randomReady) + { + _entropy.Fill(_clientRandom); + if (!DatagramTransport) + { + _entropy.Fill(_legacySessionId); + } + + _randomReady = true; + } + + EnsureShare(); + if (FingerprintProfile is not null && !DatagramTransport) + { + WriteProfileHello(output); + return; + } + + byte[]? hello = BuildClientHello(); + if (hello is null && _psk is not null) + { + CryptographicOperations.ZeroMemory(_psk); + _psk = null; + _ticketIdentity = null; + _cache?.Forget(_serverName ?? string.Empty, ProfileName); + hello = BuildClientHello(); + } + + if (hello is null) + { + Fail(output, AlertInternalError); + return; + } + + if (_psk is not null) + { + PatchBinder(hello); + } + + _offeredCiphers = [CipherAes128GcmSha256]; + _transcript!.Append(hello); + if (DatagramTransport) + { + output.AddDatagram(0, hello); + } + else + { + WritePlaintextHandshake(output, hello); + } + } + + private void HandleClient(HandshakeType type, int bodyLength, TlsOutput output) + { + if (type == HandshakeType.ServerHello) + { + OnServerHello(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.EncryptedExtensions) + { + OnEncryptedExtensions(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.CertificateRequest) + { + OnCertificateRequest(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.Certificate) + { + OnCertificate(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.CertificateVerify) + { + OnCertificateVerify(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.Finished) + { + OnFinished(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.NewSessionTicket) + { + OnTicket(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.KeyUpdate) + { + OnKeyUpdate(bodyLength, output); + } + } + + private void OnServerHello(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.ServerHello, bodyLength); + if (!HandshakeMessages.TryReadServerHello(message, out ServerHelloView hello, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (hello.LegacyVersion != 0x0303 || hello.CompressionMethod != 0) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!ResponseExtensionsAreOffered(hello.Extensions, hello.IsHelloRetryRequest, out byte extensionAlert)) + { + Fail(output, extensionAlert); + return; + } + + ReadOnlySpan expectedSession = DatagramTransport ? ReadOnlySpan.Empty : _legacySessionId; + if (!hello.SessionId.SequenceEqual(expectedSession)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (hello.IsHelloRetryRequest) + { + OnHelloRetry(hello, message, output); + return; + } + + if (!TryServerVersion(hello, out byte versionAlert, out bool legacyServer)) + { + if (legacyServer) + { + State = TlsEngineState.Closed; + throw new TlsVersionNotSupportedException(); + } + + Fail(output, versionAlert); + return; + } + + if (!OfferedCipher(hello.CipherSuite) + || !Suite(hello.CipherSuite, out HashAlgorithmName negotiatedHash, out TlsAeadSuite negotiatedAead, out int negotiatedKey) + || (_hrrSeen && hello.CipherSuite != _selectedCipher)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!TrySharedSecret(hello.Extensions, out byte[]? secret)) + { + Fail(output, secret is null ? AlertMissingExtension : AlertIllegalParameter); + return; + } + + if (!TrySelectedPreSharedKey(hello.Extensions, out bool selectedPreSharedKey, out byte pskAlert)) + { + CryptographicOperations.ZeroMemory(secret); + Fail(output, pskAlert); + return; + } + + _pskSelected = selectedPreSharedKey; + if (!selectedPreSharedKey && _psk is not null) + { + _schedule!.AbandonPreSharedKey(); + CryptographicOperations.ZeroMemory(_psk); + _psk = null; + } + + _hash = negotiatedHash; + _aead = negotiatedAead; + _keyLength = negotiatedKey; + if (negotiatedHash != HashAlgorithmName.SHA256) + { + _transcript!.Retarget(negotiatedHash); + _schedule!.Dispose(); + _schedule = new TlsKeySchedule(negotiatedHash); + _schedule.InitializeEarly(_psk ?? ReadOnlySpan.Empty); + } + + _selectedCipher = hello.CipherSuite; + _transcript!.Append(message); + Span hash = stackalloc byte[48]; + _transcript.CurrentHash(hash); + _schedule!.AdvanceToHandshake(secret); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(secret); + InstallHandshakeKeys(hash); + State = TlsEngineState.WaitEncryptedExtensions; + _endOfRecord = true; + } + + private void InstallHandshakeKeys(ReadOnlySpan transcriptHash) + { + _clientHandshakeSecret?.Dispose(); + _serverHandshakeSecret?.Dispose(); + int hashLength = HashLength; + _clientHandshakeSecret = new SecretBuffer(hashLength); + _serverHandshakeSecret = new SecretBuffer(hashLength); + _schedule!.HandshakeTrafficSecret(true, transcriptHash[..hashLength], _clientHandshakeSecret.Span); + _schedule.HandshakeTrafficSecret(false, transcriptHash[..hashLength], _serverHandshakeSecret.Span); + if (DatagramTransport) + { + _alertsEncrypted = true; + return; + } + + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(_hash, _serverHandshakeSecret.Span, key[.._keyLength], iv); + _read?.Dispose(); + _read = new TlsRecordProtector(_aead, key[.._keyLength], iv); + TlsKeySchedule.DeriveTrafficKeys(_hash, _clientHandshakeSecret.Span, key[.._keyLength], iv); + _write?.Dispose(); + _write = new TlsRecordProtector(_aead, key[.._keyLength], iv); + _alertsEncrypted = true; + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(key); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(iv); + } + + private void OnHelloRetry(ServerHelloView hello, byte[] message, TlsOutput output) + { + if (_hrrSeen) + { + Fail(output, AlertUnexpectedMessage); + return; + } + + bool tls13 = TryServerVersion(hello, out byte versionAlert, out _); + if (!tls13) + { + Fail(output, versionAlert == 0 ? AlertIllegalParameter : versionAlert); + return; + } + + // RFC 8446 section 4.1.4: the retry names the suite the server picked, and it must be one the hello offered. + if (!OfferedCipher(hello.CipherSuite) + || !Suite(hello.CipherSuite, out HashAlgorithmName retryHash, out _, out _) + || (_psk is not null && hello.CipherSuite != CipherAes128GcmSha256)) + { + Fail(output, AlertIllegalParameter); + return; + } + + bool hasGroup = TryHelloRetryGroup(hello.Extensions, out ushort group); + bool hasCookie = TryExtension(hello.Extensions, ExtensionType.Cookie, out ReadOnlySpan cookie); + if (!hasGroup && !hasCookie) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (hasGroup && !ClientOfferedGroup(group)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (hasGroup && group == _shareGroup) + { + Fail(output, AlertIllegalParameter); + return; + } + + _hrrSeen = true; + _selectedCipher = hello.CipherSuite; + if (hasGroup) + { + _shareGroup = group; + } + + _cookie = hasCookie ? cookie.ToArray() : null; + // RFC 8446 section 4.4.1: the message_hash entry uses the hash of the suite the retry selected. + _transcript!.Retarget(retryHash); + _transcript.ReplaceWithMessageHash(); + _transcript.Append(message); + WriteClientHello(output, helloRetry: true); + if (State == TlsEngineState.Closed) + { + return; + } + + State = TlsEngineState.WaitServerHelloOrHrr; + } + + private void OnCertificate(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.Certificate, bodyLength); + if (!HandshakeMessages.TryReadCertificate(message, out CertificateView certificate, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (!certificate.RequestContext.IsEmpty) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (certificate.CertificateList.IsEmpty) + { + Fail(output, (byte)HandshakeAlert.DecodeError); + return; + } + + if (!CertificateEntriesAreOffered(certificate.CertificateList, out byte entryAlert)) + { + Fail(output, entryAlert); + return; + } + + if (!TryCopyLeaf(certificate.CertificateList)) + { + Fail(output, (byte)HandshakeAlert.DecodeError); + return; + } + + _transcript!.Append(message); + _serverCheck?.Dispose(); + _serverCheck = TlsChainValidator.Evaluate(certificate.CertificateList, _serverName, TrustAnchors, serverCertificate: true); + ServerCertificateErrors = _serverCheck.Errors; + StapledOcspResponse = _serverCheck.StapledStatus; + SignedCertificateTimestamps = _serverCheck.SignedCertificateTimestamps; + + State = TlsEngineState.WaitCertificateDecision; + _paused = true; + output.AddEvent(TlsEventKind.ServerCertificateReceived); + } + + private void OnCertificateVerify(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.CertificateVerify, bodyLength); + if (!HandshakeMessages.TryReadCertificateVerify(message, out ushort scheme, out ReadOnlySpan signature, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (_leaf is null || !ClientAcceptsScheme(scheme)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!VerifyServerSignature(scheme, signature)) + { + Fail(output, AlertDecryptError); + return; + } + + _transcript!.Append(message); + State = TlsEngineState.WaitFinished; + } + + private void OnFinished(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.Finished, bodyLength); + if (!HandshakeMessages.TryReadFinished(message, out ReadOnlySpan verifyData, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + int hashLength = HashLength; + Span hash = stackalloc byte[48]; + Span expected = stackalloc byte[48]; + Span finishedKey = stackalloc byte[48]; + _transcript!.CurrentHash(hash); + TlsKeySchedule.FinishedKey(_hash, _serverHandshakeSecret!.Span, finishedKey[..hashLength]); + Mac(_hash, finishedKey[..hashLength], hash[..hashLength], expected[..hashLength]); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + if (!CryptographicOperations.FixedTimeEquals(expected[..hashLength], verifyData)) + { + Fail(output, AlertDecryptError); + return; + } + + _transcript.Append(message); + _transcript.CurrentHash(hash); + _schedule!.AdvanceToMaster(); + Span clientApp = stackalloc byte[48]; + Span serverApp = stackalloc byte[48]; + Span exporter = stackalloc byte[48]; + _schedule.ApplicationTrafficSecret(true, hash[..hashLength], clientApp[..hashLength]); + _schedule.ApplicationTrafficSecret(false, hash[..hashLength], serverApp[..hashLength]); + _schedule.ExporterMaster(hash[..hashLength], exporter[..hashLength]); + RememberTrafficSecrets(clientApp[..hashLength], serverApp[..hashLength], exporter[..hashLength]); + ReadOnlySpan clientCertificate = default; + ReadOnlySpan clientVerify = default; + byte[]? certificateMessage = null; + byte[]? verifyMessage = null; + if (_certificateRequested) + { + if (ChooseLocalCertificate is not null) + { + LocalCertificate = ChooseLocalCertificate(_acceptableIssuers); + } + + if (LocalCertificate is not null && _certificateAllowsP256 && CanSignP256(LocalCertificate)) + { + certificateMessage = CertificateMessage(LocalCertificate.RawData); + _transcript.Append(certificateMessage); + _transcript.CurrentHash(hash); + verifyMessage = SignClientCertificate(hash[..hashLength]); + _transcript.Append(verifyMessage); + clientCertificate = certificateMessage; + clientVerify = verifyMessage; + _sentClientCertificate = true; + } + else + { + _transcript.Append(EmptyCertificate); + clientCertificate = EmptyCertificate; + } + + _transcript.CurrentHash(hash); + } + + TlsKeySchedule.FinishedKey(_hash, _clientHandshakeSecret!.Span, finishedKey[..hashLength]); + Mac(_hash, finishedKey[..hashLength], hash[..hashLength], expected[..hashLength]); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + SendClientFinished(output, expected[..hashLength], clientApp[..hashLength], serverApp[..hashLength], clientCertificate, clientVerify); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(clientApp); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(serverApp); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(exporter); + _transcript.CurrentHash(hash); + _resumptionMaster = new SecretBuffer(hashLength); + _schedule.ResumptionMaster(hash[..hashLength], _resumptionMaster.Span); + State = TlsEngineState.Connected; + _endOfRecord = true; + output.AddEvent(TlsEventKind.HandshakeCompleted); + } + + private void OnTicket(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.NewSessionTicket, bodyLength); + if (!HandshakeMessages.TryReadNewSessionTicket(message, out uint lifetime, out uint ageAdd, out ReadOnlySpan nonce, out ReadOnlySpan ticket, out _, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (lifetime > 7 * 24 * 60 * 60) + { + Fail(output, AlertIllegalParameter); + return; + } + + output.AddEvent(TlsEventKind.TicketReceived); + if (_cache is null || _resumptionMaster is null || lifetime == 0 || ticket.Length > MaxStoredTicketBytes || _ticketsStored >= MaxTicketsStored) + { + return; + } + + _ticketsStored++; + var psk = new byte[HashLength]; + TlsKeySchedule.ResumptionPsk(_hash, _resumptionMaster.Span, nonce, psk); + _cache.Store(_serverName ?? string.Empty, ProfileName, new TlsResumptionTicket(ticket.ToArray(), lifetime, ageAdd, nonce.ToArray(), psk, _selectedCipher, Now())); + } + + private void OnSimple(HandshakeType type, int bodyLength, TlsOutput output, Func validate, TlsEngineState next) + { + byte[] message = Message(type, bodyLength); + HandshakeAlert? alert = validate(message); + if (alert is HandshakeAlert value && value != default) + { + Fail(output, (byte)value); + return; + } + + _transcript!.Append(message); + State = next; + } + + private byte[] SignClientCertificate(ReadOnlySpan hash) + { + ECDsa key = CertificateKeys.Ecdsa(LocalCertificate!)!; + Span content = stackalloc byte[64 + 33 + 1 + hash.Length]; + content[..64].Fill(0x20); + "TLS 1.3, client CertificateVerify"u8.CopyTo(content[64..]); + content[64 + 33] = 0; + hash.CopyTo(content[(64 + 33 + 1)..]); + byte[] signature = key.SignData(content, HashAlgorithmName.SHA256, DSASignatureFormat.Rfc3279DerSequence); + return CertificateVerifyMessage(0x0403, signature); + } + + private static bool CanSignP256(X509Certificate2 certificate) + { + ECDsa? key = CertificateKeys.Ecdsa(certificate); + return key is not null && key.ExportParameters(false).Curve.Oid.Value == "1.2.840.10045.3.1.7"; + } + + private void SendClientFinished(TlsOutput output, ReadOnlySpan verifyData, ReadOnlySpan clientApp, ReadOnlySpan serverApp, ReadOnlySpan clientCertificate, ReadOnlySpan clientVerify) + { + Span finished = stackalloc byte[4 + 48]; + finished[0] = (byte)HandshakeType.Finished; + finished[1] = (byte)(verifyData.Length >> 16); + finished[2] = (byte)(verifyData.Length >> 8); + finished[3] = (byte)verifyData.Length; + verifyData.CopyTo(finished[4..]); + _transcript!.Append(finished[..(4 + verifyData.Length)]); + if (DatagramTransport) + { + if (!clientCertificate.IsEmpty) + { + output.AddDatagram(2, clientCertificate); + } + + if (!clientVerify.IsEmpty) + { + output.AddDatagram(2, clientVerify); + } + + output.AddDatagram(2, finished[..(4 + verifyData.Length)]); + return; + } + + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(_hash, _clientHandshakeSecret!.Span, key[.._keyLength], iv); + _write?.Dispose(); + _write = new TlsRecordProtector(_aead, key[.._keyLength], iv); + output.AddBytes([20, 3, 3, 0, 1, 1]); + if (!clientCertificate.IsEmpty) + { + ProtectHandshakeRecord(output, clientCertificate); + } + + if (!clientVerify.IsEmpty) + { + ProtectHandshakeRecord(output, clientVerify); + } + + ProtectHandshakeRecord(output, finished[..(4 + verifyData.Length)]); + _write.Dispose(); + _read?.Dispose(); + TlsKeySchedule.DeriveTrafficKeys(_hash, serverApp, key[.._keyLength], iv); + _read = new TlsRecordProtector(_aead, key[.._keyLength], iv); + TlsKeySchedule.DeriveTrafficKeys(_hash, clientApp, key[.._keyLength], iv); + _write = new TlsRecordProtector(_aead, key[.._keyLength], iv); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(key); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(iv); + } + + private void ProtectHandshakeRecord(TlsOutput output, ReadOnlySpan plaintext) + { + var encrypted = new byte[plaintext.Length + 64]; + int written = _write!.Protect(22, plaintext, encrypted); + output.AddBytes(encrypted.AsSpan(0, written)); + } + + private void WriteProfileHello(TlsOutput output) + { + TlsFingerprintProfile profile = FingerprintProfile!; + var shares = new Dictionary(); + AddProfileShares(shares, profile.Fidelity); + var context = new ClientHelloContext + { + ServerName = _serverName, + ApplicationProtocols = ApplicationProtocols, + KeyShares = shares, + HelloRetryState = _profileRetry, + AnswersHelloRetry = _hrrSeen, + }; + PooledBufferWriter flight = _flightWriter ??= new PooledBufferWriter(); + flight.Clear(); + try + { + profile.BuildClientHello(context, flight); + } + catch (InvalidOperationException) + { + Fail(output, AlertInternalError); + return; + } + catch (TlsProtocolViolation) + { + Fail(output, AlertInternalError); + return; + } + + _profileRetry = context.HelloRetryState; + if (!TryJoinHandshake(flight.WrittenSpan, out byte[] handshake) || !RememberProfileHello(handshake)) + { + Fail(output, AlertInternalError); + return; + } + + _transcript!.Append(handshake); + output.AddBytes(flight.WrittenSpan); + } + + private void AddProfileShares(Dictionary shares, TlsFingerprintFidelity fidelity) + { + if (fidelity == TlsFingerprintFidelity.ReducedFipsPolicy) + { + EnsureShare(); + return; + } + + if (_hrrSeen) + { + // The server named the group it wants. The retry carries that one share and nothing else. + EnsureShare(); + byte[] requested = new byte[_publicLength]; + _share!.WritePublicKey(requested); + shares[_shareGroup] = requested; + return; + } + + if (_shareGroup != (ushort)NamedGroup.X25519) + { + _shareGroup = (ushort)NamedGroup.X25519; + } + + EnsureShare(); + byte[] x25519 = new byte[_publicLength]; + _share!.WritePublicKey(x25519); + shares[(ushort)NamedGroup.X25519] = x25519; + if (fidelity != TlsFingerprintFidelity.Full) + { + return; + } + + if (_extraShare is null || _extraGroup != (ushort)NamedGroup.X25519MlKem768) + { + _extraShare?.Dispose(); + IKeyExchangeGroup hybrid = KeyExchangeGroups.Create(NamedGroup.X25519MlKem768); + _extraShare = hybrid.GenerateKeyShare(_entropy); + _extraGroup = (ushort)NamedGroup.X25519MlKem768; + } + + byte[] hybridPublic = new byte[HybridKeyExchange.ClientShareLength]; + _extraShare.WritePublicKey(hybridPublic); + shares[_extraGroup] = hybridPublic; + } + + private bool TryJoinHandshake(ReadOnlySpan flight, out byte[] handshake) + { + handshake = []; + PooledBufferWriter joined = _joinWriter ??= new PooledBufferWriter(); + joined.Clear(); + int offset = 0; + if (flight.IsEmpty) + { + return false; + } + + while (offset < flight.Length) + { + if (flight.Length - offset < 5 || flight[offset] != 22) + { + return false; + } + + int length = (flight[offset + 3] << 8) | flight[offset + 4]; + if (length <= 0 || flight.Length - offset < 5 + length) + { + return false; + } + + joined.Write(flight.Slice(offset + 5, length)); + offset += 5 + length; + } + + handshake = joined.WrittenSpan.ToArray(); + return handshake.Length > 0; + } + + private bool RememberProfileHello(ReadOnlySpan handshake) + { + if (handshake.Length < 44 || handshake[0] != (byte)HandshakeType.ClientHello) + { + return false; + } + + handshake.Slice(6, 32).CopyTo(_clientRandom); + int sessionLength = handshake[38]; + if (sessionLength != _legacySessionId.Length || handshake.Length < 39 + sessionLength + 2) + { + return false; + } + + handshake.Slice(39, sessionLength).CopyTo(_legacySessionId); + int pos = 39 + sessionLength; + if (!TryReadU16(handshake, pos, out int cipherBytes) + || cipherBytes < 2 + || (cipherBytes & 1) != 0 + || handshake.Length < pos + 2 + cipherBytes) + { + return false; + } + + var ciphers = new ushort[cipherBytes / 2]; + int cipherAt = pos + 2; + for (int i = 0; i < ciphers.Length; i++) + { + ciphers[i] = (ushort)((handshake[cipherAt] << 8) | handshake[cipherAt + 1]); + cipherAt += 2; + } + + _offeredCiphers = ciphers; + pos += 2 + cipherBytes; + if ((uint)pos >= (uint)handshake.Length) + { + return false; + } + + int compression = handshake[pos]; + pos += 1 + compression; + if (!TryReadU16(handshake, pos, out int extensionBytes)) + { + return false; + } + + pos += 2; + int end = pos + extensionBytes; + if (end != handshake.Length) + { + return false; + } + + _offeredCount = 0; + while (pos < end) + { + if (!TryReadU16(handshake, pos, out int type) || !TryReadU16(handshake, pos + 2, out int body)) + { + return false; + } + + if (_offeredCount == _offered.Length) + { + return false; + } + + _offered[_offeredCount++] = (ushort)type; + pos += 4 + body; + } + + return pos == end; + } + + private int HashLength => _hash == HashAlgorithmName.SHA384 ? 48 : 32; + + private static bool TryReadU16(ReadOnlySpan bytes, int offset, out int value) + { + value = 0; + if (offset < 0 || bytes.Length - offset < 2) + { + return false; + } + + value = (bytes[offset] << 8) | bytes[offset + 1]; + return true; + } + + private byte[]? BuildClientHello() + { + _offeredCount = 0; + Span share = stackalloc byte[128]; + _share!.WritePublicKey(share[.._publicLength]); + int variable = _publicLength + (_cookie?.Length ?? 0) + (_serverName?.Length ?? 0) + (_ticketIdentity?.Length ?? 0); + if (DatagramTransport) + { + variable += (LocalTransportParameters?.Length ?? 0) + 4; + } + if (ApplicationProtocols is { Length: > 0 } protocols) + { + foreach (string protocol in protocols) + { + variable += protocol.Length + 1; + } + } + + int capacity = 768 + variable; + if (capacity > 16000) + { + return null; + } + + var buffer = new byte[capacity]; + TlsWriter writer = TlsWriter.Over(buffer); + if (!writer.TryWriteUInt8((byte)HandshakeType.ClientHello) || !writer.TryReserveLength(3, out int lengthAt)) + { + return null; + } + + ReadOnlySpan sessionId = DatagramTransport ? ReadOnlySpan.Empty : _legacySessionId; + if (!writer.TryWriteUInt16(0x0303) + || !writer.TryWrite(_clientRandom) + || !writer.TryWriteVector8(sessionId) + || !writer.TryWriteVector16([0x13, 0x01]) + || !writer.TryWriteVector8([0]) + || !writer.TryReserveLength(2, out int extensionsLengthAt)) + { + return null; + } + + ReadOnlySpan groups = _algorithmPolicy == TlsAlgorithmPolicy.FipsApprovedOnly + ? [0x00, 0x04, 0x00, 0x17, 0x00, 0x18] + : [0x00, 0x04, 0x00, 0x1D, 0x00, 0x17]; + ReadOnlySpan signatures = _algorithmPolicy == TlsAlgorithmPolicy.FipsApprovedOnly + ? [0x00, 0x0A, 0x04, 0x03, 0x05, 0x03, 0x08, 0x04, 0x08, 0x05, 0x08, 0x06] + : [0x00, 0x08, 0x04, 0x03, 0x05, 0x03, 0x08, 0x04, 0x08, 0x05]; + if (!WriteOffered(ref writer, ExtensionType.SupportedGroups, groups) + || !WriteOffered(ref writer, ExtensionType.SignatureAlgorithms, signatures) + || !WriteOffered(ref writer, ExtensionType.SupportedVersions, [0x02, 0x03, 0x04])) + { + return null; + } + + byte[] shareBytes = share[.._publicLength].ToArray(); + if (!WriteKeyShare(ref writer, shareBytes)) + { + return null; + } + + if (_cookie is not null && !WriteOffered(ref writer, ExtensionType.Cookie, _cookie)) + { + return null; + } + + if (_serverName is not null && !WriteServerName(ref writer, _serverName)) + { + return null; + } + + if (ApplicationProtocols is { Length: > 0 } offered && !WriteAlpn(ref writer, offered)) + { + return null; + } + + if (DatagramTransport + && (LocalTransportParameters is null + || !WriteOffered(ref writer, ExtensionType.QuicTransportParameters, LocalTransportParameters))) + { + return null; + } + + if (OfferStatusRequest + && (!WriteOffered(ref writer, ExtensionType.StatusRequest, [1, 0, 0, 0, 0]) + || !WriteOffered(ref writer, ExtensionType.SignedCertificateTimestamp, []))) + { + return null; + } + + if (_psk is not null + && (!WriteOffered(ref writer, ExtensionType.PskKeyExchangeModes, [0x01, 0x01]) || !WritePreSharedKey(ref writer))) + { + return null; + } + + if (!writer.TryPatchLength(extensionsLengthAt, 2) || !writer.TryPatchLength(lengthAt, 3)) + { + return null; + } + + var hello = new byte[writer.Written]; + buffer.AsSpan(0, writer.Written).CopyTo(hello); + return hello; + } + + private bool WriteKeyShare(ref TlsWriter writer, ReadOnlySpan share) + { + var body = new byte[2 + 2 + 2 + share.Length]; + body[0] = (byte)((2 + 2 + share.Length) >> 8); + body[1] = (byte)(2 + 2 + share.Length); + body[2] = (byte)(_shareGroup >> 8); + body[3] = (byte)_shareGroup; + body[4] = (byte)(share.Length >> 8); + body[5] = (byte)share.Length; + share.CopyTo(body.AsSpan(6)); + return WriteOffered(ref writer, ExtensionType.KeyShare, body); + } + + private bool WritePreSharedKey(ref TlsWriter writer) + { + uint age = ObfuscatedAge(); + int identities = 2 + _ticketIdentity!.Length + 4; + int binders = 1 + 32; + var body = new byte[2 + identities + 2 + binders]; + int offset = 0; + body[offset++] = (byte)(identities >> 8); + body[offset++] = (byte)identities; + body[offset++] = (byte)(_ticketIdentity.Length >> 8); + body[offset++] = (byte)_ticketIdentity.Length; + _ticketIdentity.CopyTo(body.AsSpan(offset)); + offset += _ticketIdentity.Length; + body[offset++] = (byte)(age >> 24); + body[offset++] = (byte)(age >> 16); + body[offset++] = (byte)(age >> 8); + body[offset++] = (byte)age; + body[offset++] = 0; + body[offset++] = (byte)(1 + 32); + body[offset++] = 32; + return WriteOffered(ref writer, ExtensionType.PreSharedKey, body); + } + + private void PatchBinder(byte[] hello) + { + const int binderTail = 2 + 1 + 32; + Span hash = stackalloc byte[32]; + _transcript!.HashWith(hello.AsSpan(0, hello.Length - binderTail), hash); + Span empty = stackalloc byte[32]; + SHA256.HashData(ReadOnlySpan.Empty, empty); + Span binderKey = stackalloc byte[32]; + Span finishedKey = stackalloc byte[32]; + _schedule!.DeriveEarly("res binder"u8, empty, binderKey); + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, binderKey, finishedKey); + HMACSHA256.HashData(finishedKey, hash, hello.AsSpan(hello.Length - 32)); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(binderKey); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + } + + private void EnsureShare() + { + if (_share is not null && _generatedGroup == _shareGroup) + { + return; + } + + _share?.Dispose(); + IKeyExchangeGroup group = KeyExchangeGroups.Create((NamedGroup)_shareGroup); + _publicLength = group.PublicKeyLength; + _share = group.GenerateKeyShare(_entropy); + _generatedGroup = _shareGroup; + } + + private void LoadTicket() + { + if (_cache is null || !_cache.TryGet(_serverName ?? string.Empty, ProfileName, Now(), out TlsResumptionTicket ticket)) + { + return; + } + + if (ticket.CipherSuite != CipherAes128GcmSha256 || ticket.Ticket.Length > MaxStoredTicketBytes) + { + if (ticket.Ticket.Length > MaxStoredTicketBytes) + { + _cache.Forget(_serverName ?? string.Empty, ProfileName); + } + + return; + } + + _psk = (byte[])ticket.Psk.Clone(); + _ticketIdentity = (byte[])ticket.Ticket.Clone(); + _ticketAgeAdd = ticket.AgeAdd; + _ticketLifetime = ticket.LifetimeSeconds; + _ticketIssued = ticket.IssuedUnixSeconds; + } + + private bool TrySelectedPreSharedKey(ReadOnlySpan extensions, out bool selected, out byte alert) + { + selected = false; + alert = 0; + if (!TryExtension(extensions, ExtensionType.PreSharedKey, out ReadOnlySpan body)) + { + return true; + } + + if (_psk is null || body.Length != 2 || ((body[0] << 8) | body[1]) != 0) + { + alert = AlertIllegalParameter; + return false; + } + + selected = true; + return true; + } + + private bool TrySharedSecret(ReadOnlySpan extensions, out byte[]? secret) + { + secret = null; + if (!TryExtension(extensions, ExtensionType.KeyShare, out ReadOnlySpan body)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadUInt16(out ushort group) || !reader.TryReadVector16(out ReadOnlySpan key) || reader.Remaining != 0) + { + secret = []; + return false; + } + + if (group == _extraGroup && _extraShare is not null && group != _shareGroup) + { + _share?.Dispose(); + _share = _extraShare; + _extraShare = null; + _shareGroup = group; + _generatedGroup = group; + } + + if (group != _shareGroup) + { + secret = []; + return false; + } + + secret = new byte[KeyExchangeGroups.Create((NamedGroup)_shareGroup).SharedSecretLength]; + if (!_share!.TryComputeSharedSecret(key, secret, out int written) || written != secret.Length) + { + CryptographicOperations.ZeroMemory(secret); + secret = []; + return false; + } + + return true; + } + + private bool VerifyServerSignature(ushort scheme, ReadOnlySpan signature) + { + using X509Certificate2 certificate = X509CertificateLoader.LoadCertificate(_leaf!); + int hashLength = HashLength; + Span hash = stackalloc byte[48]; + _transcript!.CurrentHash(hash); + Span content = stackalloc byte[64 + 33 + 1 + 48]; + content[..64].Fill(0x20); + "TLS 1.3, server CertificateVerify"u8.CopyTo(content[64..]); + hash[..hashLength].CopyTo(content[(64 + 33 + 1)..]); + return TlsCertificateVerifier.Verify(certificate, scheme, content[..(64 + 33 + 1 + hashLength)], signature); + } + + private bool ClientOfferedGroup(ushort group) + { + if (_algorithmPolicy == TlsAlgorithmPolicy.FipsApprovedOnly) + { + return group is (ushort)NamedGroup.Secp256r1 or (ushort)NamedGroup.Secp384r1; + } + + if (FingerprintProfile is not null && !DatagramTransport) + { + // A profile advertises P-384 as well, so a server may name it in a HelloRetryRequest. + return group is (ushort)NamedGroup.X25519 or (ushort)NamedGroup.Secp256r1 or (ushort)NamedGroup.Secp384r1; + } + + return group is (ushort)NamedGroup.X25519 or (ushort)NamedGroup.Secp256r1; + } + + private bool OfferedCipher(ushort suite) + { + ushort[] offered = _offeredCiphers; + for (int i = 0; i < offered.Length; i++) + { + if (offered[i] == suite) + { + return true; + } + } + + return false; + } + + private bool ClientAcceptsScheme(ushort scheme) + { + if (_algorithmPolicy == TlsAlgorithmPolicy.FipsApprovedOnly) + { + return TlsAlgorithmSet.AllowsSignature(_algorithmPolicy, scheme); + } + + return scheme is 0x0403 or 0x0503 or 0x0804 or 0x0805; + } + + private bool TryCopyLeaf(ReadOnlySpan list) + { + TlsReader reader = new(list); + if (!reader.TryReadVector24(out ReadOnlySpan certificate) || certificate.IsEmpty) + { + return false; + } + + _leaf = certificate.ToArray(); + return true; + } + + private static bool TryServerVersion(ServerHelloView hello, out byte alert, out bool legacyServer) + { + alert = 0; + legacyServer = false; + bool sentinel = hello.Random[^8..].SequenceEqual(DowngradeTls12) || hello.Random[^8..].SequenceEqual(DowngradeTls11); + if (!TryExtension(hello.Extensions, ExtensionType.SupportedVersions, out ReadOnlySpan version)) + { + if (sentinel) + { + alert = AlertIllegalParameter; + return false; + } + + legacyServer = true; + return false; + } + + if (version.Length != 2) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + if (version[0] != 3 || version[1] != 4 || sentinel) + { + alert = AlertIllegalParameter; + return false; + } + + return true; + } + + private void OnEncryptedExtensions(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.EncryptedExtensions, bodyLength); + if (!HandshakeMessages.TryReadEncryptedExtensions(message, out ReadOnlySpan extensions, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (!ResponseExtensionsAreOffered(extensions, false, out byte extensionAlert)) + { + Fail(output, extensionAlert); + return; + } + + if (!TryRememberSelectedProtocol(extensions, out byte protocolAlert)) + { + Fail(output, protocolAlert); + return; + } + + if (TryExtension(extensions, ExtensionType.QuicTransportParameters, out ReadOnlySpan transportParameters)) + { + PeerTransportParameters = transportParameters.ToArray(); + } + else if (DatagramTransport) + { + Fail(output, AlertMissingExtension); + return; + } + + _transcript!.Append(message); + State = _pskSelected ? TlsEngineState.WaitFinished : TlsEngineState.WaitCertificateRequestOrCertificate; + } + + private void OnCertificateRequest(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.CertificateRequest, bodyLength); + if (!HandshakeMessages.TryReadCertificateRequest(message, out ReadOnlySpan context, out ReadOnlySpan extensions, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (!context.IsEmpty) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!TryExtension(extensions, ExtensionType.SignatureAlgorithms, out ReadOnlySpan schemes)) + { + Fail(output, AlertMissingExtension); + return; + } + + if (!CertificateRequestExtensionsAreAcceptable(extensions, out byte extensionAlert)) + { + Fail(output, extensionAlert); + return; + } + + if (!TryListedScheme(schemes, 0x0403, out bool listed)) + { + Fail(output, (byte)HandshakeAlert.DecodeError); + return; + } + + _certificateRequested = true; + _certificateAllowsP256 = listed; + _acceptableIssuers = ReadCertificateAuthorities(extensions); + _transcript!.Append(message); + State = TlsEngineState.WaitCertificate; + } + + private bool CertificateRequestExtensionsAreAcceptable(ReadOnlySpan extensions, out byte alert) + { + alert = 0; + TlsReader reader = new(extensions); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort type) || !reader.TryReadVector16(out _)) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + // These are the server's request, not a response to the ClientHello. + // compress_certificate is legal on this message. OpenSSL 3.5.5 sends it + // when the ClientHello did not, and an uncompressed certificate still satisfies it. + if (type is ExtensionType.SignatureAlgorithms + or ExtensionType.SignatureAlgorithmsCert + or ExtensionType.CertificateAuthorities + or ExtensionType.OidFilters + or ExtensionType.CompressCertificate) + { + continue; + } + + if (!Offered(type)) + { + alert = (byte)HandshakeAlert.UnsupportedExtension; + return false; + } + } + + return true; + } + + private bool ResponseExtensionsAreOffered(ReadOnlySpan extensions, bool allowCookie, out byte alert) + { + alert = 0; + TlsReader reader = new(extensions); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort type) || !reader.TryReadVector16(out _)) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + if (allowCookie && type == ExtensionType.Cookie) + { + continue; + } + + if (!Offered(type)) + { + alert = (byte)HandshakeAlert.UnsupportedExtension; + return false; + } + } + + return true; + } + + private bool CertificateEntriesAreOffered(ReadOnlySpan list, out byte alert) + { + alert = 0; + TlsReader reader = new(list); + while (reader.Remaining > 0) + { + if (!reader.TryReadVector24(out _) || !reader.TryReadVector16(out ReadOnlySpan extensions)) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + if (!ResponseExtensionsAreOffered(extensions, false, out alert)) + { + return false; + } + } + + return true; + } + + private bool Offered(ushort type) + { + for (int i = 0; i < _offeredCount; i++) + { + if (_offered[i] == type) + { + return true; + } + } + + return false; + } + + private static bool TryListedScheme(ReadOnlySpan body, ushort scheme, out bool listed) + { + listed = false; + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan list) || reader.Remaining != 0 || (list.Length & 1) != 0) + { + return false; + } + + for (int i = 0; i + 1 < list.Length; i += 2) + { + if (((list[i] << 8) | list[i + 1]) == scheme) + { + listed = true; + } + } + + return true; + } + + private static bool TryHelloRetryGroup(ReadOnlySpan extensions, out ushort group) + { + group = 0; + if (!TryExtension(extensions, ExtensionType.KeyShare, out ReadOnlySpan body) || body.Length != 2) + { + return false; + } + + group = (ushort)((body[0] << 8) | body[1]); + return true; + } + + internal static string[]? ReadCertificateAuthorities(ReadOnlySpan extensions) + { + if (!TryExtension(extensions, ExtensionType.CertificateAuthorities, out ReadOnlySpan body)) + { + return null; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan list) || reader.Remaining != 0) + { + return null; + } + + int count = 0; + TlsReader counter = new(list); + while (counter.Remaining > 0) + { + if (!counter.TryReadVector16(out ReadOnlySpan distinguishedName) || distinguishedName.IsEmpty) + { + return null; + } + + count++; + } + + var names = new string[count]; + int index = 0; + TlsReader items = new(list); + while (items.Remaining > 0) + { + if (!items.TryReadVector16(out ReadOnlySpan distinguishedName)) + { + return null; + } + + try + { + names[index] = new X500DistinguishedName(distinguishedName.ToArray()).Name; + } + catch (CryptographicException) + { + return null; + } + + index++; + } + + return names; + } + + private static bool TryExtension(ReadOnlySpan extensions, ushort wanted, out ReadOnlySpan body) + { + body = default; + TlsReader reader = new(extensions); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort type) || !reader.TryReadVector16(out ReadOnlySpan value)) + { + return false; + } + + if (type == wanted) + { + body = value; + return true; + } + } + + return false; + } + + private byte[] Message(HandshakeType type, int bodyLength) + { + EnsureBuffers(); + var message = new byte[4 + bodyLength]; + message[0] = (byte)type; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[1] = (byte)(bodyLength >> 16); + message[2] = (byte)(bodyLength >> 8); + message[3] = (byte)bodyLength; + _body.AsSpan(0, bodyLength).CopyTo(message.AsSpan(4)); + return message; + } + + private static void WritePlaintextHandshake(TlsOutput output, ReadOnlySpan handshake) + { + var record = new byte[5 + handshake.Length]; + record[0] = 22; + record[1] = 3; + record[2] = 1; + record[3] = (byte)(handshake.Length >> 8); + record[4] = (byte)handshake.Length; + handshake.CopyTo(record.AsSpan(5)); + output.AddBytes(record); + } + + private bool WriteOffered(ref TlsWriter writer, ushort type, ReadOnlySpan body) + { + if (_offeredCount == _offered.Length) + { + throw new TlsProtocolViolation("The ClientHello offers more extensions than the engine records."); + } + + if (!WriteExtension(ref writer, type, body)) + { + return false; + } + + _offered[_offeredCount++] = type; + return true; + } + + private static bool WriteExtension(ref TlsWriter writer, ushort type, ReadOnlySpan body) + { + return writer.TryWriteUInt16(type) && writer.TryWriteVector16(body); + } + + private bool WriteAlpn(ref TlsWriter writer, string[] protocols) + { + int list = 0; + foreach (string protocol in protocols) + { + list += 1 + System.Text.Encoding.ASCII.GetByteCount(protocol); + } + + var body = new byte[2 + list]; + body[0] = (byte)(list >> 8); + body[1] = (byte)list; + int at = 2; + foreach (string protocol in protocols) + { + byte[] name = System.Text.Encoding.ASCII.GetBytes(protocol); + body[at++] = (byte)name.Length; + name.CopyTo(body.AsSpan(at)); + at += name.Length; + } + + return WriteOffered(ref writer, ExtensionType.ApplicationLayerProtocolNegotiation, body); + } + + private bool WriteServerName(ref TlsWriter writer, string name) + { + byte[] ascii = System.Text.Encoding.ASCII.GetBytes(name); + var body = new byte[2 + 1 + 2 + ascii.Length]; + int list = 1 + 2 + ascii.Length; + body[0] = (byte)(list >> 8); + body[1] = (byte)list; + body[3] = (byte)(ascii.Length >> 8); + body[4] = (byte)ascii.Length; + ascii.CopyTo(body.AsSpan(5)); + return WriteOffered(ref writer, ExtensionType.ServerName, body); + } + + private uint ObfuscatedAge() + { + long milliseconds = Math.Max(0, Now() - _ticketIssued) * 1000L; + return (uint)(milliseconds + _ticketAgeAdd); + } + + private long Now() + { + return UnixTimeSeconds > 0 ? UnixTimeSeconds : DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + } +} diff --git a/src/Titanium.Tls/Internal/TlsEngine.Server.cs b/src/Titanium.Tls/Internal/TlsEngine.Server.cs new file mode 100644 index 000000000..cf6b48dbd --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsEngine.Server.cs @@ -0,0 +1,1688 @@ +using System; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +internal sealed partial class TlsEngine +{ + private const byte AlertHandshakeFailure = 40; + private const byte AlertProtocolVersion = 70; + private const byte AlertInternalError = 80; + private const byte AlertNoApplicationProtocol = 120; + private const int DefaultTicketLifetime = 6 * 60 * 60; + private const int MaxTicketLifetime = 7 * 24 * 60 * 60; + + private static readonly ushort[] DefaultCiphers = [0x1301, 0x1303, 0x1302]; + private static readonly NamedGroup[] DefaultGroups = + [ + NamedGroup.X25519MlKem768, + NamedGroup.X25519, + NamedGroup.Secp256r1, + NamedGroup.Secp384r1, + ]; + + private static ReadOnlySpan HelloRetryRandom => + [ + 0xCF, 0x21, 0xAD, 0x74, 0xE5, 0x9A, 0x61, 0x11, 0xBE, 0x1D, 0x8C, 0x02, 0x1E, 0x65, 0xB8, 0x91, + 0xC2, 0xA2, 0x11, 0x16, 0x7A, 0xBB, 0x8C, 0x5E, 0x07, 0x9E, 0x09, 0xE2, 0xC8, 0xA8, 0x33, 0x9C, + ]; + + private TlsServerSelection? _selection; + private TlsClientHelloInfo? _clientHelloInfo; + private byte[]? _firstHello; + private byte[]? _sessionId; + private ushort _requestedGroup; + private bool _resumed; + + internal bool AcceptedResumption => _resumed; + private byte[]? _clientLeaf; + private TlsCertificateCheck? _clientCheck; + + internal SslPolicyErrors ClientCertificateErrors => _clientCheck?.Errors ?? SslPolicyErrors.None; + + internal X509Chain? ClientChain => _clientCheck?.Chain; + + internal void ReleaseClientCheck() + { + _clientCheck?.Dispose(); + _clientCheck = null; + } + + private string? _selectedAlpn; + private SecretBuffer? _clientApplication; + private SecretBuffer? _serverApplication; + + internal TlsClientHelloInfo? ClientHello => _clientHelloInfo; + + internal string? SelectedApplicationProtocol => _selectedAlpn; + + internal bool IsResumption => _resumed; + + internal void Resume(Func callback, TlsOutput output) + { + ArgumentNullException.ThrowIfNull(callback); + ArgumentNullException.ThrowIfNull(output); + if (!_paused || _clientHelloInfo is null) + { + throw new InvalidOperationException("The engine is not waiting for a decision."); + } + + try + { + _selection = callback(_clientHelloInfo); + } + catch (Exception) + { + output.Clear(); + Fail(output, AlertInternalError); + return; + } + + Resume(true, output); + } + + private void HandleServer(HandshakeType type, int bodyLength, TlsOutput output) + { + if (type == HandshakeType.ClientHello) + { + OnClientHello(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.Certificate) + { + OnClientCertificate(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.CertificateVerify) + { + OnClientCertificateVerify(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.Finished) + { + OnClientFinished(bodyLength, output); + // Stryker disable once statement: the following handshake type does not match + return; + } + + if (type == HandshakeType.KeyUpdate) + { + OnKeyUpdate(bodyLength, output); + } + } + + private void OnClientHello(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.ClientHello, bodyLength); + if (!HandshakeMessages.TryReadClientHello(message, out ClientHelloView hello, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + _loggedRandom = hello.Random.ToArray(); + _ignoreEarlyData = TryExtension(hello.Extensions, ExtensionType.EarlyData, out _); + if (_hrrSeen) + { + ContinueAfterRetry(message, hello, output); + if (State != TlsEngineState.Closed) + { + _endOfRecord = true; + } + + return; + } + + if (!OffersVersion(hello.Extensions, 0x0304)) + { + Fail(output, AlertProtocolVersion); + return; + } + + if (!OffersCompressionNull(hello.CompressionMethods)) + { + Fail(output, AlertIllegalParameter); + return; + } + + _firstHello = message; + _sessionId = hello.SessionId.ToArray(); + if (TryExtension(hello.Extensions, ExtensionType.QuicTransportParameters, out ReadOnlySpan transportParameters)) + { + PeerTransportParameters = transportParameters.ToArray(); + } + else if (DatagramTransport) + { + Fail(output, AlertMissingExtension); + return; + } + + _clientHelloInfo = new TlsClientHelloInfo(ReadServerName(hello.Extensions), message); + State = TlsEngineState.WaitClientHelloDecision; + _paused = true; + _endOfRecord = true; + output.AddEvent(TlsEventKind.ClientHelloReceived); + } + + private void SendServerFlight(TlsOutput output) + { + if (_selection is null || _firstHello is null || _sessionId is null) + { + Fail(output, AlertInternalError); + return; + } + + if (!HandshakeMessages.TryReadClientHello(_firstHello, out ClientHelloView hello, out _)) + { + Fail(output, AlertInternalError); + return; + } + + if (!RequireGroups(hello.Extensions, output)) + { + return; + } + + if (!TrySelectCipher(hello.CipherSuites, out ushort cipher, out HashAlgorithmName hash, out TlsAeadSuite aead, out int keyLength)) + { + Fail(output, AlertHandshakeFailure); + return; + } + + _selectedCipher = cipher; + _transcript = new TranscriptStore(hash); + _schedule = new TlsKeySchedule(hash); + if (!TrySelectShare(hello, out ushort group, out byte[]? share)) + { + Fail(output, AlertHandshakeFailure); + return; + } + + if (!TrySelectAlpn(hello.Extensions, out byte alpnAlert)) + { + Fail(output, alpnAlert); + return; + } + + if (share is null) + { + _transcript.Append(_firstHello); + SendHelloRetry(group, output); + return; + } + + if (!TryAcceptTicket(hello, _firstHello, out byte[]? psk, out byte pskAlert)) + { + if (pskAlert != 0) + { + Fail(output, pskAlert); + return; + } + + psk = null; + } + + _schedule.InitializeEarly(psk ?? ReadOnlySpan.Empty); + if (psk is not null) + { + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(psk); + } + + _transcript.Append(_firstHello); + EmitFlight(group, share, hash, aead, keyLength, output); + } + + private void ContinueAfterRetry(byte[] message, ClientHelloView hello, TlsOutput output) + { + if (_schedule is null || _transcript is null || _selection is null || _firstHello is null) + { + Fail(output, AlertInternalError); + return; + } + + if (!OffersVersion(hello.Extensions, 0x0304)) + { + Fail(output, AlertProtocolVersion); + return; + } + + if (!OffersCompressionNull(hello.CompressionMethods)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!HandshakeMessages.TryReadClientHello(_firstHello, out ClientHelloView first, out _) || !RetryHelloMatches(first, hello)) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (!RequireGroups(hello.Extensions, output)) + { + return; + } + + if (!TryKeyShare(hello.Extensions, _requestedGroup, out byte[]? share) || share is null) + { + Fail(output, AlertIllegalParameter); + return; + } + + Suite(_selectedCipher, out HashAlgorithmName hash, out TlsAeadSuite aead, out int keyLength); + if (!TryAcceptTicket(hello, message, out byte[]? psk, out byte pskAlert)) + { + if (pskAlert != 0) + { + Fail(output, pskAlert); + return; + } + + psk = null; + } + + _schedule.InitializeEarly(psk ?? ReadOnlySpan.Empty); + if (psk is not null) + { + CryptographicOperations.ZeroMemory(psk); + } + + _transcript.Append(message); + EmitFlight(_requestedGroup, share, hash, aead, keyLength, output); + } + + private void SendHelloRetry(ushort group, TlsOutput output) + { + var random = new byte[32]; + HelloRetryRandom.CopyTo(random); + byte[] message = ServerHelloMessage(random, _sessionId!, _selectedCipher, VersionExtension(), GroupOnly(group), psk: false); + _transcript!.ReplaceWithMessageHash(); + _transcript.Append(message); + EmitRecord(output, 0, message); + _hrrSeen = true; + _requestedGroup = group; + State = TlsEngineState.WaitClientHello; + } + + private void EmitFlight(ushort group, byte[] clientShare, HashAlgorithmName hash, TlsAeadSuite aead, int keyLength, TlsOutput output) + { + Span serverShare = stackalloc byte[1216]; + Span secret = stackalloc byte[64]; + if (!TryAgree(group, clientShare, serverShare, secret, out int serverWritten, out int secretWritten)) + { + Fail(output, AlertIllegalParameter); + return; + } + + var random = new byte[32]; + _entropy.Fill(random); + byte[] serverHello = ServerHelloMessage(random, _sessionId!, _selectedCipher, VersionExtension(), KeyShareEntry(group, serverShare[..serverWritten]), _resumed); + _transcript!.Append(serverHello); + int hashLength = TlsHkdf.HashLength(hash); + Span transcriptHash = stackalloc byte[48]; + _transcript.CurrentHash(transcriptHash); + _schedule!.AdvanceToHandshake(secret[..secretWritten]); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(secret[..secretWritten]); + InstallServerHandshakeKeys(hash, aead, keyLength, hashLength, transcriptHash); + byte[] ee = EncryptedExtensionsMessage(_selectedAlpn, DatagramTransport ? LocalTransportParameters : null); + _transcript.Append(ee); + var flight = new System.Collections.Generic.List(ee.Length + 2048); + flight.AddRange(ee); + if (!_resumed && _selection!.RequestClientCertificate) + { + byte[] request = CertificateRequestMessage(); + _transcript.Append(request); + flight.AddRange(request); + _certificateRequested = true; + } + + if (!_resumed) + { + byte[] certificate = CertificateMessage(_selection!.Certificate.RawData); + _transcript.Append(certificate); + _transcript.CurrentHash(transcriptHash); + if (!TrySign(_selection.Certificate, hash, transcriptHash, out ushort scheme, out byte[] signature, out byte signAlert)) + { + Fail(output, signAlert); + return; + } + + byte[] verify = CertificateVerifyMessage(scheme, signature); + _transcript.Append(verify); + flight.AddRange(certificate); + flight.AddRange(verify); + } + + _transcript.CurrentHash(transcriptHash); + Span finishedKey = stackalloc byte[48]; + Span verifyData = stackalloc byte[48]; + TlsKeySchedule.FinishedKey(hash, _serverHandshakeSecret!.Span, finishedKey[..hashLength]); + Mac(hash, finishedKey[..hashLength], transcriptHash[..hashLength], verifyData[..hashLength]); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + var finished = new byte[4 + hashLength]; + finished[0] = (byte)HandshakeType.Finished; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + finished[1] = (byte)(hashLength >> 16); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + finished[2] = (byte)(hashLength >> 8); + finished[3] = (byte)hashLength; + verifyData[..hashLength].CopyTo(finished.AsSpan(4)); + _transcript.Append(finished); + flight.AddRange(finished); + _transcript.CurrentHash(transcriptHash); + _schedule.AdvanceToMaster(); + _clientApplication = new SecretBuffer(hashLength); + _serverApplication = new SecretBuffer(hashLength); + _exporter?.Dispose(); + _exporter = new SecretBuffer(hashLength); + _schedule.ApplicationTrafficSecret(true, transcriptHash[..hashLength], _clientApplication.Span); + _schedule.ApplicationTrafficSecret(false, transcriptHash[..hashLength], _serverApplication.Span); + _schedule.ExporterMaster(transcriptHash[..hashLength], _exporter.Span); + EmitRecord(output, 0, serverHello); + if (_sessionId!.Length > 0) + { + output.AddBytes([20, 3, 3, 0, 1, 1]); + } + + EmitRecord(output, 2, System.Runtime.InteropServices.CollectionsMarshal.AsSpan(flight)); + _alertsEncrypted = true; + State = _certificateRequested ? TlsEngineState.WaitClientCertificate : TlsEngineState.WaitFinished; + } + + private void OnClientCertificate(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.Certificate, bodyLength); + if (!HandshakeMessages.TryReadCertificate(message, out CertificateView certificate, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (!certificate.RequestContext.IsEmpty) + { + Fail(output, AlertIllegalParameter); + return; + } + + if (certificate.CertificateList.IsEmpty) + { + if (_selection?.RequireClientCertificate == true) + { + Fail(output, 116); + return; + } + + _transcript!.Append(message); + State = TlsEngineState.WaitFinished; + return; + } + + TlsCertificateCheck check = TlsChainValidator.Evaluate(certificate.CertificateList, targetHost: null, _selection?.ClientTrustAnchors, serverCertificate: false); + if (!TryCopyClientLeaf(certificate.CertificateList)) + { + check.Dispose(); + Fail(output, 42); + return; + } + + _transcript!.Append(message); + if (_selection?.ClientCertificateCallback is not null) + { + _clientCheck = check; + _paused = true; + State = TlsEngineState.WaitClientCertificateDecision; + output.AddEvent(TlsEventKind.ClientCertificateReceived); + return; + } + + if (check.Errors != SslPolicyErrors.None) + { + check.Dispose(); + Fail(output, 42); + return; + } + + check.Dispose(); + State = TlsEngineState.WaitClientCertificateVerify; + } + + private void OnClientCertificateVerify(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.CertificateVerify, bodyLength); + if (!HandshakeMessages.TryReadCertificateVerify(message, out ushort scheme, out ReadOnlySpan signature, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (scheme != 0x0403 || _clientLeaf is null) + { + Fail(output, 47); + return; + } + + HashAlgorithmName hash = HashOf(_selectedCipher); + int hashLength = TlsHkdf.HashLength(hash); + Span transcriptHash = stackalloc byte[48]; + _transcript!.CurrentHash(transcriptHash); + Span content = stackalloc byte[64 + 34 + 48]; + content[..64].Fill(0x20); + "TLS 1.3, client CertificateVerify"u8.CopyTo(content[64..]); + content[64 + 33] = 0; + transcriptHash[..hashLength].CopyTo(content[(64 + 34)..]); + using X509Certificate2 certificate = X509CertificateLoader.LoadCertificate(_clientLeaf); + if (!TlsCertificateVerifier.Verify(certificate, scheme, content[..(64 + 34 + hashLength)], signature)) + { + Fail(output, AlertDecryptError); + return; + } + + _transcript.Append(message); + _clientAuthenticated = true; + State = TlsEngineState.WaitFinished; + } + + private bool TryCopyClientLeaf(ReadOnlySpan list) + { + TlsReader reader = new(list); + if (!reader.TryReadVector24(out ReadOnlySpan encoded) || encoded.IsEmpty) + { + return false; + } + + _clientLeaf = encoded.ToArray(); + return true; + } + + private void OnClientFinished(int bodyLength, TlsOutput output) + { + byte[] message = Message(HandshakeType.Finished, bodyLength); + if (!HandshakeMessages.TryReadFinished(message, out ReadOnlySpan verifyData, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + HashAlgorithmName hash = HashOf(_selectedCipher); + int hashLength = TlsHkdf.HashLength(hash); + Span transcriptHash = stackalloc byte[48]; + Span finishedKey = stackalloc byte[48]; + Span expected = stackalloc byte[48]; + _transcript!.CurrentHash(transcriptHash); + TlsKeySchedule.FinishedKey(hash, _clientHandshakeSecret!.Span, finishedKey[..hashLength]); + Mac(hash, finishedKey[..hashLength], transcriptHash[..hashLength], expected[..hashLength]); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + if (!CryptographicOperations.FixedTimeEquals(expected[..hashLength], verifyData)) + { + Fail(output, AlertDecryptError); + return; + } + + _transcript.Append(message); + _transcript.CurrentHash(transcriptHash); + _resumptionMaster = new SecretBuffer(hashLength); + _schedule!.ResumptionMaster(transcriptHash[..hashLength], _resumptionMaster.Span); + InstallApplicationKeys(); + if (_selection?.Tickets is not null) + { + SendTicket(hash, output); + } + + State = TlsEngineState.Connected; + _endOfRecord = true; + output.AddEvent(TlsEventKind.HandshakeCompleted); + } + + private void InstallServerHandshakeKeys(HashAlgorithmName hash, TlsAeadSuite aead, int keyLength, int hashLength, ReadOnlySpan transcriptHash) + { + _clientHandshakeSecret?.Dispose(); + _serverHandshakeSecret?.Dispose(); + _clientHandshakeSecret = new SecretBuffer(hashLength); + _serverHandshakeSecret = new SecretBuffer(hashLength); + _schedule!.HandshakeTrafficSecret(true, transcriptHash[..hashLength], _clientHandshakeSecret.Span); + _schedule.HandshakeTrafficSecret(false, transcriptHash[..hashLength], _serverHandshakeSecret.Span); + if (DatagramTransport) + { + return; + } + + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(hash, _clientHandshakeSecret.Span, key[..keyLength], iv); + _read?.Dispose(); + _read = new TlsRecordProtector(aead, key[..keyLength], iv); + TlsKeySchedule.DeriveTrafficKeys(hash, _serverHandshakeSecret.Span, key[..keyLength], iv); + _write?.Dispose(); + _write = new TlsRecordProtector(aead, key[..keyLength], iv); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(key); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(iv); + } + + private void InstallApplicationKeys() + { + if (DatagramTransport) + { + return; + } + + HashAlgorithmName hash = HashOf(_selectedCipher); + Suite(_selectedCipher, out _, out TlsAeadSuite aead, out int keyLength); + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(hash, _clientApplication!.Span, key[..keyLength], iv); + _read?.Dispose(); + _read = new TlsRecordProtector(aead, key[..keyLength], iv); + TlsKeySchedule.DeriveTrafficKeys(hash, _serverApplication!.Span, key[..keyLength], iv); + _write?.Dispose(); + _write = new TlsRecordProtector(aead, key[..keyLength], iv); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(key); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(iv); + } + + private void EmitRecord(TlsOutput output, int level, ReadOnlySpan handshake) + { + if (DatagramTransport) + { + output.AddDatagram(level, handshake); + return; + } + + if (level == 0) + { + WriteServerRecord(output, handshake); + return; + } + + ProtectHandshake(output, handshake); + } + + private void ProtectHandshake(TlsOutput output, ReadOnlySpan handshake) + { + if (DatagramTransport) + { + output.AddDatagram(State == TlsEngineState.Connected ? 3 : 2, handshake); + return; + } + + var encrypted = new byte[handshake.Length + 64]; + int written = _write!.Protect(22, handshake, encrypted); + output.AddBytes(encrypted.AsSpan(0, written)); + } + + private bool TrySign(X509Certificate2 leaf, HashAlgorithmName transcriptHash, ReadOnlySpan hash, out ushort scheme, out byte[] signature, out byte alert) + { + scheme = 0; + signature = []; + alert = AlertHandshakeFailure; + if (!TryOfferedSchemes(_firstHello!, out ushort[] offered, out alert)) + { + return false; + } + + int hashLength = TlsHkdf.HashLength(transcriptHash); + Span content = stackalloc byte[64 + 34 + 48]; + content[..64].Fill(0x20); + "TLS 1.3, server CertificateVerify"u8.CopyTo(content[64..]); + hash[..hashLength].CopyTo(content[(64 + 34)..]); + ReadOnlySpan signedContent = content[..(64 + 34 + hashLength)]; + ECDsa? ecdsa = CertificateKeys.Ecdsa(leaf); + if (ecdsa is not null) + { + ECParameters parameters = ecdsa.ExportParameters(false); + string? oid = parameters.Curve.Oid.Value; + if (oid == "1.2.840.10045.3.1.7") + { + scheme = 0x0403; + } + else if (oid == "1.3.132.0.34") + { + scheme = 0x0503; + } + + if (scheme == 0 || !Contains(offered, scheme) || !TlsAlgorithmSet.AllowsSignature(_algorithmPolicy, scheme)) + { + alert = AlertHandshakeFailure; + return false; + } + + signature = ecdsa.SignData(signedContent, scheme == 0x0403 ? HashAlgorithmName.SHA256 : HashAlgorithmName.SHA384, DSASignatureFormat.Rfc3279DerSequence); + alert = 0; + return true; + } + + RSA? rsa = CertificateKeys.Rsa(leaf); + if (rsa is null || rsa.KeySize < 2048 || !TlsAlgorithmSet.AllowsRsa(_algorithmPolicy, rsa.KeySize) || !Contains(offered, 0x0804)) + { + alert = AlertHandshakeFailure; + return false; + } + + scheme = 0x0804; + signature = rsa.SignData(signedContent, HashAlgorithmName.SHA256, RSASignaturePadding.Pss); + alert = 0; + return true; + } + + private bool TryAcceptTicket(ClientHelloView hello, byte[] message, out byte[]? psk, out byte alert) + { + psk = null; + alert = 0; + _resumed = false; + // A requested client certificate is not stored in the ticket. Resuming would skip CertificateRequest. + if (_selection?.RequestClientCertificate == true) + { + return false; + } + + if (_selection?.Tickets is null || !TryExtension(hello.Extensions, ExtensionType.PreSharedKey, out ReadOnlySpan body)) + { + return false; + } + + if (!TryPskKeyExchange(hello.Extensions, out bool dhe, out alert) || + !TryReadFirstTicket(body, out ReadOnlySpan identity, out ReadOnlySpan binder, out int binderTail, out alert)) + { + return false; + } + + if (!dhe) + { + return false; + } + + Span plain = stackalloc byte[1024]; + if (!_selection.Tickets.TryUnprotect(identity, plain, out int plainLength) || !TryReadTicket(plain[..plainLength], out TicketView ticket)) + { + return false; + } + + long now = Now(); + bool acceptable = ticket.Cipher == _selectedCipher && + ticket.Lifetime is > 0 and <= MaxTicketLifetime && + now <= ticket.Issued + ticket.Lifetime && + NamesMatch(ticket.ServerName, _clientHelloInfo?.ServerName) && + string.Equals(ticket.Alpn, _selectedAlpn, StringComparison.Ordinal) && + ticket.LeafHash.SequenceEqual(SHA256.HashData(_selection.Certificate.RawData)); + Span expected = stackalloc byte[48]; + int hashLength = binder.Length; + if (hashLength != TlsHkdf.HashLength(HashOf(_selectedCipher))) + { + CryptographicOperations.ZeroMemory(ticket.Psk); + alert = AlertIllegalParameter; + return false; + } + + Span transcriptHash = stackalloc byte[48]; + _transcript!.HashWith(message.AsSpan(0, message.Length - binderTail), transcriptHash); + using var early = new TlsKeySchedule(HashOf(_selectedCipher)); + early.InitializeEarly(ticket.Psk); + Span empty = stackalloc byte[48]; + empty[..hashLength].Clear(); + if (HashOf(_selectedCipher) == HashAlgorithmName.SHA256) + { + SHA256.HashData(ReadOnlySpan.Empty, empty[..hashLength]); + } + else + { + SHA384.HashData(ReadOnlySpan.Empty, empty[..hashLength]); + } + + Span binderKey = stackalloc byte[48]; + Span finishedKey = stackalloc byte[48]; + early.DeriveEarly("res binder"u8, empty[..hashLength], binderKey[..hashLength]); + TlsKeySchedule.FinishedKey(HashOf(_selectedCipher), binderKey[..hashLength], finishedKey[..hashLength]); + Mac(HashOf(_selectedCipher), finishedKey[..hashLength], transcriptHash[..hashLength], expected); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(binderKey); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(finishedKey); + bool binderMatches = CryptographicOperations.FixedTimeEquals(expected[..hashLength], binder); + if (!acceptable) + { + CryptographicOperations.ZeroMemory(ticket.Psk); + return false; + } + + if (!binderMatches) + { + CryptographicOperations.ZeroMemory(ticket.Psk); + alert = AlertDecryptError; + return false; + } + + psk = ticket.Psk; + _resumed = true; + return true; + } + + private void SendTicket(HashAlgorithmName hash, TlsOutput output) + { + var nonce = new byte[8]; + _entropy.Fill(nonce); + var psk = new byte[TlsHkdf.HashLength(hash)]; + TlsKeySchedule.ResumptionPsk(hash, _resumptionMaster!.Span, nonce, psk); + byte[] plain = WriteTicket(_selectedCipher, psk, _clientHelloInfo?.ServerName, _selectedAlpn, Now(), DefaultTicketLifetime, SHA256.HashData(_selection!.Certificate.RawData)); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(psk); + byte[] identity = _selection.Tickets!.Protect(plain); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(plain); + var age = new byte[4]; + _entropy.Fill(age); + byte[] message = NewSessionTicketMessage(DefaultTicketLifetime, age, nonce, identity); + ProtectHandshake(output, message); + } + + // QUIC packet protection in this library is AES-128-GCM. A datagram server selects only TLS_AES_128_GCM_SHA256. + private bool DatagramCipher(ushort cipher) => !DatagramTransport || cipher == 0x1301; + + private bool TrySelectCipher(ReadOnlySpan offered, out ushort cipher, out HashAlgorithmName hash, out TlsAeadSuite aead, out int keyLength) + { + cipher = 0; + hash = default; + aead = default; + keyLength = 0; + ushort[] supported = _selection!.CipherSuites ?? DefaultCiphers; + if (_selection.PreferServerCipherOrder) + { + foreach (ushort candidate in supported) + { + if (ContainsCipher(offered, candidate) && DatagramCipher(candidate) && TlsAlgorithmSet.AllowsCipher(_algorithmPolicy, candidate) && Suite(candidate, out hash, out aead, out keyLength)) + { + cipher = candidate; + return true; + } + } + + return false; + } + + for (int i = 0; i + 1 < offered.Length; i += 2) + { + ushort candidate = (ushort)((offered[i] << 8) | offered[i + 1]); + if (Contains(supported, candidate) && DatagramCipher(candidate) && TlsAlgorithmSet.AllowsCipher(_algorithmPolicy, candidate) && Suite(candidate, out hash, out aead, out keyLength)) + { + cipher = candidate; + return true; + } + } + + return false; + } + + private bool TrySelectShare(ClientHelloView hello, out ushort group, out byte[]? share) + { + group = 0; + share = null; + NamedGroup[] preference = _selection!.Groups ?? DefaultGroups; + foreach (NamedGroup candidate in preference) + { + if (!TlsAlgorithmSet.AllowsGroup(_algorithmPolicy, (ushort)candidate)) + { + continue; + } + + if (TryKeyShare(hello.Extensions, (ushort)candidate, out byte[]? found) && found is not null && Advertised(hello.Extensions, (ushort)candidate)) + { + group = (ushort)candidate; + share = found; + return true; + } + } + + if (_hrrSeen) + { + return false; + } + + foreach (NamedGroup candidate in preference) + { + if (!TlsAlgorithmSet.AllowsGroup(_algorithmPolicy, (ushort)candidate)) + { + continue; + } + + if (Advertised(hello.Extensions, (ushort)candidate)) + { + group = (ushort)candidate; + return true; + } + } + + return false; + } + + private bool TrySelectAlpn(ReadOnlySpan extensions, out byte alert) + { + alert = 0; + _selectedAlpn = null; + if (!TryExtension(extensions, ExtensionType.ApplicationLayerProtocolNegotiation, out ReadOnlySpan body)) + { + return true; + } + + string[]? ours = _selection!.ApplicationProtocols; + if (!TryReadAlpn(body, out string[] theirs) || theirs.Length == 0) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + if (ours is not null) + { + foreach (string protocol in ours) + { + foreach (string offered in theirs) + { + if (string.Equals(protocol, offered, StringComparison.Ordinal)) + { + _selectedAlpn = protocol; + return true; + } + } + } + } + + if (_selection.RequireApplicationProtocol) + { + alert = AlertNoApplicationProtocol; + return false; + } + + return true; + } + + private bool TryAgree(ushort group, ReadOnlySpan clientShare, Span serverShare, Span secret, out int serverWritten, out int secretWritten) + { + serverWritten = 0; + secretWritten = 0; + IKeyExchangeGroup exchange = KeyExchangeGroups.Create((NamedGroup)group); + if (group == (ushort)NamedGroup.X25519MlKem768) + { + return exchange.TryEncapsulate(clientShare, _entropy, serverShare, secret, out serverWritten, out secretWritten); + } + + using IPrivateKeyShare mine = exchange.GenerateKeyShare(_entropy); + serverWritten = exchange.PublicKeyLength; + mine.WritePublicKey(serverShare[..serverWritten]); + return mine.TryComputeSharedSecret(clientShare, secret, out secretWritten); + } + + private static bool Suite(ushort cipher, out HashAlgorithmName hash, out TlsAeadSuite aead, out int keyLength) + { + switch (cipher) + { + case 0x1301: + hash = HashAlgorithmName.SHA256; + aead = TlsAeadSuite.Aes128Gcm; + keyLength = 16; + return true; + case 0x1302: + hash = HashAlgorithmName.SHA384; + aead = TlsAeadSuite.Aes256Gcm; + keyLength = 32; + return true; + case 0x1303: + hash = HashAlgorithmName.SHA256; + aead = TlsAeadSuite.ChaCha20Poly1305; + keyLength = 32; + return true; + default: + hash = default; + aead = default; + keyLength = 0; + return false; + } + } + + private static HashAlgorithmName HashOf(ushort cipher) + { + Suite(cipher, out HashAlgorithmName hash, out _, out _); + return hash; + } + + private static void Mac(HashAlgorithmName hash, ReadOnlySpan key, ReadOnlySpan data, Span destination) + { + if (hash == HashAlgorithmName.SHA256) + { + HMACSHA256.HashData(key, data, destination); + return; + } + + HMACSHA384.HashData(key, data, destination); + } + + private static bool OffersVersion(ReadOnlySpan extensions, ushort version) + { + if (!TryExtension(extensions, ExtensionType.SupportedVersions, out ReadOnlySpan body) || body.IsEmpty) + { + return false; + } + + int length = body[0]; + if ((length & 1) != 0 || body.Length != 1 + length) + { + return false; + } + + for (int i = 0; i < length; i += 2) + { + if (((body[1 + i] << 8) | body[2 + i]) == version) + { + return true; + } + } + + return false; + } + + private static bool OffersCompressionNull(ReadOnlySpan methods) + { + return methods.Length == 1 && methods[0] == 0; + } + + private bool RequireGroups(ReadOnlySpan extensions, TlsOutput output) + { + if (!TryExtension(extensions, ExtensionType.SupportedGroups, out ReadOnlySpan body)) + { + Fail(output, AlertMissingExtension); + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan groups) || reader.Remaining != 0 || groups.Length == 0 || (groups.Length & 1) != 0) + { + Fail(output, (byte)HandshakeAlert.DecodeError); + return false; + } + + return true; + } + + private static bool Advertised(ReadOnlySpan extensions, ushort group) + { + if (!TryExtension(extensions, ExtensionType.SupportedGroups, out ReadOnlySpan body)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan groups)) + { + return false; + } + + for (int i = 0; i + 1 < groups.Length; i += 2) + { + if (((groups[i] << 8) | groups[i + 1]) == group) + { + return true; + } + } + + return false; + } + + private static bool TryKeyShare(ReadOnlySpan extensions, ushort group, out byte[]? share) + { + share = null; + if (!TryExtension(extensions, ExtensionType.KeyShare, out ReadOnlySpan body)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan entries)) + { + return false; + } + + TlsReader entriesReader = new(entries); + while (entriesReader.Remaining > 0) + { + if (!entriesReader.TryReadUInt16(out ushort found) || !entriesReader.TryReadVector16(out ReadOnlySpan key)) + { + return false; + } + + if (found == group) + { + share = key.ToArray(); + return true; + } + } + + return false; + } + + private static string? ReadServerName(ReadOnlySpan extensions) + { + if (!TryExtension(extensions, ExtensionType.ServerName, out ReadOnlySpan body)) + { + return null; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan list)) + { + return null; + } + + TlsReader names = new(list); + if (!names.TryReadUInt8(out byte kind) || kind != 0 || !names.TryReadVector16(out ReadOnlySpan host)) + { + return null; + } + + return System.Text.Encoding.ASCII.GetString(host); + } + + private static bool TryPskKeyExchange(ReadOnlySpan extensions, out bool dhe, out byte alert) + { + dhe = false; + alert = 0; + if (!TryExtension(extensions, ExtensionType.PskKeyExchangeModes, out ReadOnlySpan body)) + { + alert = AlertMissingExtension; + return false; + } + + if (body.IsEmpty) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + int count = body[0]; + if (body.Length != 1 + count) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + for (int i = 0; i < count; i++) + { + if (body[1 + i] == 1) + { + dhe = true; + } + } + + return true; + } + + private static bool TryReadFirstTicket(ReadOnlySpan body, out ReadOnlySpan identity, out ReadOnlySpan binder, out int binderTail, out byte alert) + { + identity = default; + binder = default; + binderTail = 0; + alert = (byte)HandshakeAlert.DecodeError; + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan identities) || !reader.TryReadVector16(out ReadOnlySpan binders) || reader.Remaining != 0) + { + return false; + } + + if (!CountVectors(identities, 4, out int identityCount) || !CountBinders(binders, out int binderCount)) + { + return false; + } + + if (identityCount != binderCount || identityCount == 0) + { + alert = AlertIllegalParameter; + return false; + } + + TlsReader idReader = new(identities); + if (!idReader.TryReadVector16(out identity) || identity.IsEmpty || !idReader.TryReadUInt32(out _)) + { + return false; + } + + TlsReader binderReader = new(binders); + if (!binderReader.TryReadVector8(out binder) || binder.Length is not (32 or 48)) + { + return false; + } + + binderTail = 2 + binders.Length; + alert = 0; + return true; + } + + private static bool CountBinders(ReadOnlySpan body, out int count) + { + count = 0; + TlsReader reader = new(body); + while (reader.Remaining > 0) + { + if (!reader.TryReadVector8(out ReadOnlySpan value) || value.IsEmpty) + { + return false; + } + + count++; + } + + return true; + } + + private static bool CountVectors(ReadOnlySpan body, int trailing, out int count) + { + count = 0; + TlsReader reader = new(body); + while (reader.Remaining > 0) + { + if (!reader.TryReadVector16(out ReadOnlySpan value) || value.IsEmpty) + { + return false; + } + + if (trailing > 0 && !reader.TryReadBytes(trailing, out _)) + { + return false; + } + + count++; + } + + return true; + } + + private static bool TryOfferedSchemes(byte[] hello, out ushort[] schemes, out byte alert) + { + schemes = []; + alert = AlertMissingExtension; + if (!HandshakeMessages.TryReadClientHello(hello, out ClientHelloView view, out _)) + { + alert = AlertInternalError; + return false; + } + + if (!TryExtension(view.Extensions, ExtensionType.SignatureAlgorithms, out ReadOnlySpan body)) + { + return false; + } + + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan list) || reader.Remaining != 0 || (list.Length & 1) != 0 || list.Length == 0) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + schemes = new ushort[list.Length / 2]; + for (int i = 0; i < schemes.Length; i++) + { + schemes[i] = (ushort)((list[i * 2] << 8) | list[(i * 2) + 1]); + } + + alert = 0; + return true; + } + + private static bool RetryHelloMatches(ClientHelloView first, ClientHelloView second) + { + if (first.LegacyVersion != second.LegacyVersion || + !first.Random.SequenceEqual(second.Random) || + !first.SessionId.SequenceEqual(second.SessionId) || + !first.CipherSuites.SequenceEqual(second.CipherSuites) || + !first.CompressionMethods.SequenceEqual(second.CompressionMethods)) + { + return false; + } + + return ExtensionsKept(first.Extensions, second.Extensions, fromFirst: true) && + ExtensionsKept(second.Extensions, first.Extensions, fromFirst: false); + } + + private static bool ExtensionsKept(ReadOnlySpan source, ReadOnlySpan other, bool fromFirst) + { + TlsReader reader = new(source); + while (reader.Remaining > 0) + { + if (!reader.TryReadUInt16(out ushort type) || !reader.TryReadVector16(out ReadOnlySpan body)) + { + return false; + } + + if (type is ExtensionType.KeyShare or ExtensionType.Cookie or ExtensionType.Padding) + { + continue; + } + + if (type == ExtensionType.EarlyData) + { + if (fromFirst || TryExtension(other, type, out _)) + { + continue; + } + + return false; + } + + if (type == ExtensionType.PreSharedKey) + { + if (!TryExtension(other, type, out ReadOnlySpan otherBody) || !SamePskIdentities(body, otherBody)) + { + return false; + } + + continue; + } + + if (!TryExtension(other, type, out ReadOnlySpan match) || !body.SequenceEqual(match)) + { + return false; + } + } + + return true; + } + + private static bool SamePskIdentities(ReadOnlySpan left, ReadOnlySpan right) + { + if (left.Length < 2 || right.Length < 2) + { + return false; + } + + int leftLength = (left[0] << 8) | left[1]; + int rightLength = (right[0] << 8) | right[1]; + return leftLength == rightLength && + left.Length >= 2 + leftLength && + right.Length >= 2 + rightLength && + left[..(2 + leftLength)].SequenceEqual(right[..(2 + rightLength)]); + } + + private static bool TryReadAlpn(ReadOnlySpan body, out string[] protocols) + { + protocols = []; + TlsReader reader = new(body); + if (!reader.TryReadVector16(out ReadOnlySpan list)) + { + return false; + } + + var found = new System.Collections.Generic.List(); + TlsReader items = new(list); + while (items.Remaining > 0) + { + if (!items.TryReadVector8(out ReadOnlySpan protocol) || protocol.IsEmpty) + { + return false; + } + + found.Add(System.Text.Encoding.ASCII.GetString(protocol)); + } + + protocols = found.ToArray(); + return true; + } + + private static bool ContainsCipher(ReadOnlySpan offered, ushort cipher) + { + for (int i = 0; i + 1 < offered.Length; i += 2) + { + if (((offered[i] << 8) | offered[i + 1]) == cipher) + { + return true; + } + } + + return false; + } + + private static bool Contains(ReadOnlySpan values, ushort wanted) + { + foreach (ushort value in values) + { + if (value == wanted) + { + return true; + } + } + + return false; + } + + private static bool NamesMatch(string? left, string? right) + { + return string.Equals(left ?? string.Empty, right ?? string.Empty, StringComparison.Ordinal); + } + + private static byte[] VersionExtension() => [0x03, 0x04]; + + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + private static byte[] GroupOnly(ushort group) => [(byte)(group >> 8), (byte)group]; + + private static byte[] KeyShareEntry(ushort group, ReadOnlySpan share) + { + var body = new byte[4 + share.Length]; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + body[0] = (byte)(group >> 8); + body[1] = (byte)group; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + body[2] = (byte)(share.Length >> 8); + body[3] = (byte)share.Length; + share.CopyTo(body.AsSpan(4)); + return body; + } + + private static byte[] ServerHelloMessage(byte[] random, byte[] session, ushort cipher, byte[] version, byte[] keyShare, bool psk) + { + var extensions = new System.Collections.Generic.List(); + AddExtension(extensions, ExtensionType.SupportedVersions, version); + AddExtension(extensions, ExtensionType.KeyShare, keyShare); + if (psk) + { + AddExtension(extensions, ExtensionType.PreSharedKey, [0, 0]); + } + + var body = new System.Collections.Generic.List { 2, 0, 0, 0, 3, 3 }; + body.AddRange(random); + body.Add((byte)session.Length); + body.AddRange(session); + body.Add((byte)(cipher >> 8)); + body.Add((byte)cipher); + body.Add(0); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + body.Add((byte)(extensions.Count >> 8)); + body.Add((byte)extensions.Count); + body.AddRange(extensions); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + body[1] = (byte)((body.Count - 4) >> 16); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + body[2] = (byte)((body.Count - 4) >> 8); + body[3] = (byte)(body.Count - 4); + return body.ToArray(); + } + + private static byte[] EncryptedExtensionsMessage(string? alpn, byte[]? transportParameters) + { + var extensions = new System.Collections.Generic.List(); + if (alpn is not null) + { + byte[] name = System.Text.Encoding.ASCII.GetBytes(alpn); + var body = new byte[2 + 1 + name.Length]; + body[1] = (byte)(1 + name.Length); + body[2] = (byte)name.Length; + name.CopyTo(body.AsSpan(3)); + AddExtension(extensions, ExtensionType.ApplicationLayerProtocolNegotiation, body); + } + + if (transportParameters is not null) + { + AddExtension(extensions, ExtensionType.QuicTransportParameters, transportParameters); + } + + if (extensions.Count == 0) + { + return [8, 0, 0, 2, 0, 0]; + } + + var message = new System.Collections.Generic.List { 8, 0, 0, 0 }; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message.Add((byte)(extensions.Count >> 8)); + message.Add((byte)extensions.Count); + message.AddRange(extensions); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[1] = (byte)((message.Count - 4) >> 16); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[2] = (byte)((message.Count - 4) >> 8); + message[3] = (byte)(message.Count - 4); + return message.ToArray(); + } + + private static byte[] CertificateRequestMessage() + { + return + [ + 13, 0, 0, 11, + 0, + 0, 8, + 0, 13, 0, 4, 0, 2, 4, 3, + ]; + } + + private static byte[] CertificateMessage(byte[] der) + { + var entry = new byte[3 + der.Length + 2]; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + entry[0] = (byte)(der.Length >> 16); + entry[1] = (byte)(der.Length >> 8); + entry[2] = (byte)der.Length; + der.CopyTo(entry, 3); + var message = new byte[8 + entry.Length]; + message[0] = 11; + int body = 4 + entry.Length; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[1] = (byte)(body >> 16); + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[5] = (byte)(entry.Length >> 16); + message[6] = (byte)(entry.Length >> 8); + message[7] = (byte)entry.Length; + entry.CopyTo(message, 8); + return message; + } + + private static byte[] CertificateVerifyMessage(ushort scheme, byte[] signature) + { + var message = new byte[8 + signature.Length]; + message[0] = 15; + int body = 4 + signature.Length; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + message[4] = (byte)(scheme >> 8); + message[5] = (byte)scheme; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[6] = (byte)(signature.Length >> 8); + message[7] = (byte)signature.Length; + signature.CopyTo(message.AsSpan(8)); + return message; + } + + private static byte[] NewSessionTicketMessage(uint lifetime, byte[] ageAdd, byte[] nonce, byte[] ticket) + { + int body = 4 + 4 + 1 + nonce.Length + 2 + ticket.Length + 2; + var message = new byte[4 + body]; + message[0] = 4; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[1] = (byte)(body >> 16); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + WriteUint(message, 4, lifetime); + ageAdd.CopyTo(message.AsSpan(8)); + message[12] = (byte)nonce.Length; + nonce.CopyTo(message.AsSpan(13)); + int at = 13 + nonce.Length; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + message[at] = (byte)(ticket.Length >> 8); + message[at + 1] = (byte)ticket.Length; + ticket.CopyTo(message.AsSpan(at + 2)); + return message; + } + + private static byte[] WriteTicket(ushort cipher, byte[] psk, string? serverName, string? alpn, long issued, uint lifetime, byte[] leafHash) + { + byte[] name = System.Text.Encoding.ASCII.GetBytes(serverName ?? string.Empty); + byte[] protocol = System.Text.Encoding.ASCII.GetBytes(alpn ?? string.Empty); + var plain = new byte[2 + 1 + psk.Length + 2 + name.Length + 1 + protocol.Length + 8 + 4 + 32]; + int at = 0; + plain[at++] = (byte)(cipher >> 8); + plain[at++] = (byte)cipher; + plain[at++] = (byte)psk.Length; + psk.CopyTo(plain.AsSpan(at)); + at += psk.Length; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + plain[at++] = (byte)(name.Length >> 8); + plain[at++] = (byte)name.Length; + name.CopyTo(plain.AsSpan(at)); + at += name.Length; + plain[at++] = (byte)protocol.Length; + protocol.CopyTo(plain.AsSpan(at)); + at += protocol.Length; + for (int i = 7; i >= 0; i--) + { + plain[at++] = (byte)(issued >> (8 * i)); + } + + WriteUint(plain, at, lifetime); + at += 4; + leafHash.CopyTo(plain.AsSpan(at)); + return plain; + } + + private static bool TryReadTicket(ReadOnlySpan plain, out TicketView ticket) + { + ticket = default; + TlsReader reader = new(plain); + if (!reader.TryReadUInt16(out ushort cipher) || !reader.TryReadVector8(out ReadOnlySpan psk) || psk.IsEmpty) + { + return false; + } + + if (!reader.TryReadVector16(out ReadOnlySpan name) || !reader.TryReadVector8(out ReadOnlySpan alpn)) + { + return false; + } + + if (!reader.TryReadBytes(8, out ReadOnlySpan issuedBytes) || !reader.TryReadUInt32(out uint lifetime) || !reader.TryReadBytes(32, out ReadOnlySpan leaf) || reader.Remaining != 0) + { + return false; + } + + long issued = 0; + foreach (byte part in issuedBytes) + { + issued = (issued << 8) | part; + } + + ticket = new TicketView(cipher, psk.ToArray(), name.IsEmpty ? null : System.Text.Encoding.ASCII.GetString(name), alpn.IsEmpty ? null : System.Text.Encoding.ASCII.GetString(alpn), issued, lifetime, leaf.ToArray()); + return true; + } + + private static void WriteServerRecord(TlsOutput output, ReadOnlySpan handshake) + { + var record = new byte[5 + handshake.Length]; + record[0] = 22; + record[1] = 3; + record[2] = 3; + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + record[3] = (byte)(handshake.Length >> 8); + record[4] = (byte)handshake.Length; + handshake.CopyTo(record.AsSpan(5)); + output.AddBytes(record); + } + + private static void AddExtension(System.Collections.Generic.List destination, ushort type, byte[] body) + { + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + destination.Add((byte)(type >> 8)); + destination.Add((byte)type); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + destination.Add((byte)(body.Length >> 8)); + destination.Add((byte)body.Length); + destination.AddRange(body); + } + + private static void WriteUint(byte[] destination, int at, uint value) + { + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + destination[at] = (byte)(value >> 24); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + destination[at + 1] = (byte)(value >> 16); + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + destination[at + 2] = (byte)(value >> 8); + destination[at + 3] = (byte)value; + } + + private readonly struct TicketView + { + internal TicketView(ushort cipher, byte[] psk, string? serverName, string? alpn, long issued, uint lifetime, byte[] leafHash) + { + Cipher = cipher; + Psk = psk; + ServerName = serverName; + Alpn = alpn; + Issued = issued; + Lifetime = lifetime; + LeafHash = leafHash; + } + + internal ushort Cipher { get; } + + internal byte[] Psk { get; } + + internal string? ServerName { get; } + + internal string? Alpn { get; } + + internal long Issued { get; } + + internal uint Lifetime { get; } + + internal byte[] LeafHash { get; } + } +} + +internal static class CertificateKeys +{ + private static readonly System.Runtime.CompilerServices.ConditionalWeakTable EcdsaKeys = new(); + private static readonly System.Runtime.CompilerServices.ConditionalWeakTable RsaKeys = new(); + + internal static ECDsa? Ecdsa(X509Certificate2 certificate) + { + if (EcdsaKeys.TryGetValue(certificate, out ECDsa? cached)) + { + return cached; + } + + ECDsa? key = certificate.GetECDsaPrivateKey(); + if (key is null) + { + return null; + } + + EcdsaKeys.Add(certificate, key); + return key; + } + + internal static RSA? Rsa(X509Certificate2 certificate) + { + if (RsaKeys.TryGetValue(certificate, out RSA? cached)) + { + return cached; + } + + RSA? key = certificate.GetRSAPrivateKey(); + if (key is null) + { + return null; + } + + RsaKeys.Add(certificate, key); + return key; + } +} diff --git a/src/Titanium.Tls/Internal/TlsEngine.Traffic.cs b/src/Titanium.Tls/Internal/TlsEngine.Traffic.cs new file mode 100644 index 000000000..8267c86b4 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsEngine.Traffic.cs @@ -0,0 +1,292 @@ +using System; +using System.Buffers; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +internal sealed partial class TlsEngine +{ + internal int PlaintextAvailable => _plaintextLength - _plaintextOffset; + + internal ushort SelectedCipher => _selectedCipher; + + internal bool IsMutuallyAuthenticated => _sentClientCertificate || _clientAuthenticated; + + internal X509Certificate2? RemoteCertificate + { + get + { + byte[]? encoded = _role == TlsRole.Server ? _clientLeaf : _leaf; + if (_remoteCertificate is null && encoded is not null) + { + _remoteCertificate = X509CertificateLoader.LoadCertificate(encoded); + } + + return _remoteCertificate; + } + } + + internal X509Chain? ServerChain => _serverCheck?.Chain; + + internal void ReleaseServerCheck() + { + _serverCheck?.Dispose(); + _serverCheck = null; + } + + internal int ReadPlaintext(Span destination) + { + int available = PlaintextAvailable; + int count = available < destination.Length ? available : destination.Length; + if (count == 0 || _plaintext is null) + { + return 0; + } + + _plaintext.AsSpan(_plaintextOffset, count).CopyTo(destination); + _plaintextOffset += count; + if (_plaintextOffset == _plaintextLength) + { + CryptographicOperations.ZeroMemory(_plaintext.AsSpan(0, _plaintextLength)); + _plaintextLength = 0; + _plaintextOffset = 0; + } + + return count; + } + + internal int ProtectApplication(ReadOnlySpan plaintext, Span destination) + { + if (State != TlsEngineState.Connected || _write is null) + { + throw new InvalidOperationException("The handshake is not complete."); + } + + if (plaintext.Length > TlsRecordProtector.MaxPlaintext) + { + throw new TlsRecordException(TlsRecordAlert.RecordOverflow); + } + + return _write.Protect(23, plaintext, destination); + } + + internal int ProtectAlert(byte level, byte description, Span destination) + { + if (_write is null) + { + Span alert = stackalloc byte[7]; + alert[0] = 21; + alert[1] = 3; + alert[2] = 3; + alert[3] = 0; + alert[4] = 2; + alert[5] = level; + alert[6] = description; + alert.CopyTo(destination); + return alert.Length; + } + + Span plain = stackalloc byte[2]; + plain[0] = level; + plain[1] = description; + return _write.Protect(21, plain, destination); + } + + internal int ProtectKeyUpdate(byte request, Span destination) + { + Span message = stackalloc byte[5]; + message[0] = (byte)HandshakeType.KeyUpdate; + message[3] = 1; + message[4] = request; + int written = _write!.Protect(22, message, destination); + RotateTraffic(read: false); + KeyUpdateResponseNeeded = false; + return written; + } + + internal bool WriteKeyUpdateDue => _write is not null && _write.KeyUpdateDue; + + internal void WriteKeyLog(ITlsKeyLogSink sink) + { + ReadOnlySpan random = _role == TlsRole.Client ? _clientRandom : _loggedRandom; + if (random.IsEmpty || _clientApplication is null || _serverApplication is null || _exporter is null) + { + return; + } + + sink.Write("CLIENT_TRAFFIC_SECRET_0 " + ToHex(random) + " " + ToHex(_clientApplication.Span)); + sink.Write("SERVER_TRAFFIC_SECRET_0 " + ToHex(random) + " " + ToHex(_serverApplication.Span)); + sink.Write("EXPORTER_SECRET " + ToHex(random) + " " + ToHex(_exporter.Span)); + } + + internal void ExportKeyingMaterial(string label, ReadOnlySpan context, Span destination) + { + if (_exporter is null || State != TlsEngineState.Connected) + { + throw new InvalidOperationException("The handshake is not complete."); + } + + HashAlgorithmName hash = _selectedCipher == 0 ? HashAlgorithmName.SHA256 : HashOf(_selectedCipher); + TlsKeySchedule.ExportKeyingMaterial(hash, _exporter.Span, System.Text.Encoding.ASCII.GetBytes(label), context, destination); + } + + private void OnKeyUpdate(int bodyLength, TlsOutput output) + { + if (!HandshakeMessages.TryReadKeyUpdate(Message(HandshakeType.KeyUpdate, bodyLength), out byte request, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return; + } + + if (_keyUpdates >= MaxKeyUpdates) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + return; + } + + _keyUpdates++; + RotateTraffic(read: true); + if (request == 1) + { + KeyUpdateResponseNeeded = true; + } + + _endOfRecord = true; + output.AddEvent(TlsEventKind.KeyUpdateRequired, request); + } + + internal bool TryCopyTrafficSecret(bool application, bool client, Span destination) + { + SecretBuffer? source = application + ? client ? _clientApplication : _serverApplication + : client ? _clientHandshakeSecret : _serverHandshakeSecret; + if (source is null || destination.Length < source.Length) + { + return false; + } + + source.Span.CopyTo(destination[..source.Length]); + return true; + } + + private void RememberTrafficSecrets(ReadOnlySpan client, ReadOnlySpan server, ReadOnlySpan exporter) + { + _clientApplication?.Dispose(); + _serverApplication?.Dispose(); + _exporter?.Dispose(); + _clientApplication = new SecretBuffer(client.Length); + _serverApplication = new SecretBuffer(server.Length); + _exporter = new SecretBuffer(exporter.Length); + client.CopyTo(_clientApplication.Span); + server.CopyTo(_serverApplication.Span); + exporter.CopyTo(_exporter.Span); + } + + private bool TryRememberSelectedProtocol(ReadOnlySpan extensions, out byte alert) + { + alert = 0; + if (!TryExtension(extensions, ExtensionType.ApplicationLayerProtocolNegotiation, out ReadOnlySpan body)) + { + return true; + } + + // protocol_name_list is one uint16 length and exactly one name. A second name, or a name + // this client did not offer, is illegal_parameter (RFC 7301). + if (body.Length < 4) + { + alert = (byte)HandshakeAlert.DecodeError; + return false; + } + + int listLength = (body[0] << 8) | body[1]; + int nameLength = body[2]; + if (listLength != body.Length - 2 || nameLength == 0 || nameLength != listLength - 1) + { + alert = (byte)HandshakeAlert.IllegalParameter; + return false; + } + + string selected = System.Text.Encoding.ASCII.GetString(body.Slice(3, nameLength)); + if (ApplicationProtocols is not { Length: > 0 }) + { + alert = (byte)HandshakeAlert.UnsupportedExtension; + return false; + } + + foreach (string offered in ApplicationProtocols) + { + if (offered == selected) + { + _selectedAlpn = selected; + return true; + } + } + + alert = (byte)HandshakeAlert.IllegalParameter; + return false; + } + + private void AppendPlaintext(ReadOnlySpan plaintext) + { + if (plaintext.IsEmpty) + { + return; + } + + if (_plaintext is null || _plaintextLength + plaintext.Length > _plaintext.Length) + { + byte[] rented = ArrayPool.Shared.Rent(TlsRecordProtector.MaxPlaintext); + if (_plaintext is not null) + { + _plaintext.AsSpan(_plaintextOffset, PlaintextAvailable).CopyTo(rented); + _plaintextLength = PlaintextAvailable; + _plaintextOffset = 0; + ArrayPool.Shared.Return(_plaintext, clearArray: true); + } + + _plaintext = rented; + } + + plaintext.CopyTo(_plaintext.AsSpan(_plaintextLength)); + _plaintextLength += plaintext.Length; + } + + private void RotateTraffic(bool read) + { + SecretBuffer current = read + ? (_role == TlsRole.Client ? _serverApplication! : _clientApplication!) + : (_role == TlsRole.Client ? _clientApplication! : _serverApplication!); + HashAlgorithmName hash = _selectedCipher == 0 ? HashAlgorithmName.SHA256 : HashOf(_selectedCipher); + int hashLength = TlsHkdf.HashLength(hash); + Span next = stackalloc byte[48]; + TlsKeySchedule.NextTrafficSecret(hash, current.Span, next[..hashLength]); + next[..hashLength].CopyTo(current.Span); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(next); + Suite(_selectedCipher == 0 ? (ushort)0x1301 : _selectedCipher, out _, out TlsAeadSuite aead, out int keyLength); + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(hash, current.Span, key[..keyLength], iv); + if (read) + { + _read?.Dispose(); + _read = new TlsRecordProtector(aead, key[..keyLength], iv); + } + else + { + _write?.Dispose(); + _write = new TlsRecordProtector(aead, key[..keyLength], iv); + } + + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(key); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(iv); + } + + private static string ToHex(ReadOnlySpan value) + { + return Convert.ToHexString(value); + } +} diff --git a/src/Titanium.Tls/Internal/TlsEngine.cs b/src/Titanium.Tls/Internal/TlsEngine.cs new file mode 100644 index 000000000..e3d16da43 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsEngine.cs @@ -0,0 +1,944 @@ +using System; +using System.Buffers; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +internal enum TlsRole +{ + Client = 0, + Server = 1, +} + +internal enum TlsEngineState +{ + Start = 0, + WaitServerHelloOrHrr = 1, + WaitCertificateRequestOrCertificate = 11, + WaitEncryptedExtensions = 2, + WaitCertificate = 3, + WaitCertificateDecision = 4, + WaitCertificateVerify = 5, + WaitClientHello = 6, + WaitClientHelloDecision = 7, + WaitClientCertificate = 12, + WaitClientCertificateVerify = 13, + WaitClientCertificateDecision = 14, + WaitFinished = 8, + Connected = 9, + Closed = 10, +} + +internal enum TlsEventKind +{ + ClientHelloReceived = 1, + ServerCertificateReceived = 2, + HandshakeCompleted = 3, + PeerAlert = 4, + NeedMoreData = 5, + TicketReceived = 6, + KeyUpdateRequired = 7, + ClientCertificateReceived = 8, +} + +internal readonly struct TlsEvent +{ + internal TlsEventKind Kind { get; init; } + + internal byte Alert { get; init; } +} + +/// Bytes to write and events from one or Resume call. +internal sealed class TlsOutput +{ + private const int MaxBytes = 16384; + private byte[] _bytes = []; + private readonly TlsEvent[] _events = new TlsEvent[8]; + private readonly TlsSegment[] _segments = new TlsSegment[8]; + private int _length; + private int _eventCount; + private int _segmentCount; + + private struct TlsSegment + { + internal int Level; + + internal int Offset; + + internal int Length; + } + + internal ReadOnlySpan Bytes => _bytes.AsSpan(0, _length); + + internal ReadOnlyMemory WrittenMemory => _bytes.AsMemory(0, _length); + + internal int EventCount => _eventCount; + + internal TlsEvent Event(int index) => _events[index]; + + internal void Clear() + { + _length = 0; + _eventCount = 0; + _segmentCount = 0; + } + + internal void Release() + { + if (_bytes.Length > 0) + { + // A socket keeps a reference to the last buffer a write used. Returning the buffer to the + // shared pool means that reference costs an idle connection nothing. + ArrayPool.Shared.Return(_bytes, clearArray: true); + _bytes = []; + } + + Clear(); + } + + internal int SegmentCount => _segmentCount; + + internal (int Level, int Offset, int Length) Segment(int index) + { + TlsSegment segment = _segments[index]; + return (segment.Level, segment.Offset, segment.Length); + } + + internal void AddDatagram(int level, ReadOnlySpan bytes) + { + int start = _length; + AddBytes(bytes); + if (_segmentCount > 0) + { + TlsSegment previous = _segments[_segmentCount - 1]; + if (previous.Level == level && previous.Offset + previous.Length == start) + { + previous.Length += bytes.Length; + _segments[_segmentCount - 1] = previous; + return; + } + } + + if (_segmentCount == _segments.Length) + { + throw new TlsProtocolViolation("The engine produced more datagram segments than the stub buffer holds."); + } + + _segments[_segmentCount++] = new TlsSegment { Level = level, Offset = start, Length = bytes.Length }; + } + + internal void AddBytes(ReadOnlySpan bytes) + { + Ensure(_length + bytes.Length); + bytes.CopyTo(_bytes.AsSpan(_length)); + _length += bytes.Length; + } + + private void Ensure(int length) + { + if (length > MaxBytes) + { + throw new TlsProtocolViolation("The engine produced more output than the stub buffer holds."); + } + + if (_bytes.Length >= length) + { + return; + } + + int size = _bytes.Length == 0 ? 256 : _bytes.Length; + while (size < length) + { + size *= 2; + } + + byte[] next = ArrayPool.Shared.Rent(size); + if (_length > 0) + { + _bytes.AsSpan(0, _length).CopyTo(next); + } + + if (_bytes.Length > 0) + { + ArrayPool.Shared.Return(_bytes, clearArray: true); + } + + _bytes = next; + } + + internal void AddEvent(TlsEventKind kind, byte alert = 0) + { + if (_eventCount == _events.Length) + { + throw new TlsProtocolViolation("The engine produced more events than the stub buffer holds."); + } + + _events[_eventCount++] = new TlsEvent { Kind = kind, Alert = alert }; + } +} + +/// +/// Sans-IO handshake driver. The client completes a TLS 1.3 handshake. The server answers one after +/// . +/// +internal sealed partial class TlsEngine : IDisposable +{ + internal const int MaxEmptyRecords = 32; + + internal const int MaxKeyUpdates = 32; + internal const int DefaultMaxBufferedBytes = HandshakeFraming.DefaultMaxMessageBytes + TlsRecordProtector.HeaderLength; + + private readonly TlsRole _role; + private readonly int _maxBufferedBytes; + private readonly int _maxHandshakeMessage; + private byte[] _stash = []; + private byte[] _body = []; + private HandshakeReassembler _handshake = null!; + private bool _buffersReady; + private bool _keepRecordBuffer; + private int _stashLength; + private int _pendingHandshake; + private int _emptyRecords; + + private int _keyUpdates; + private int _acceptedChangeCipherSpec; + private bool _paused; + private bool _endOfRecord; + private bool _alertsEncrypted; + private bool _ignoreEarlyData; + private int _earlyDataSkipped; + private const int MaxIgnoredEarlyData = 16384; + private byte[]? _plaintext; + private int _plaintextLength; + private int _plaintextOffset; + private SecretBuffer? _exporter; + private TlsCertificateCheck? _serverCheck; + private X509Certificate2? _remoteCertificate; + private bool _sentClientCertificate; + private bool _clientAuthenticated; + private byte[]? _loggedRandom; + internal bool KeyUpdateResponseNeeded; + + internal bool SendKeyUpdate; + + internal byte LastLocalAlert { get; private set; } + + /// QUIC carries handshake bytes without TLS records. Packet protection is outside this engine. + internal bool DatagramTransport { get; set; } + + internal byte[]? LocalTransportParameters { get; set; } + + internal byte[]? PeerTransportParameters { get; private set; } + + /// When set, a protected alert is recorded and writes it under the write lock. + internal bool DeferSealedAlerts { get; set; } + + internal bool HasDeferredAlert { get; private set; } + + internal void ClearDeferredAlert() => HasDeferredAlert = false; + + private TlsAlgorithmPolicy _algorithmPolicy; + + internal TlsAlgorithmPolicy AlgorithmPolicy + { + get => _algorithmPolicy; + set + { + _algorithmPolicy = value; + if (value == TlsAlgorithmPolicy.FipsApprovedOnly && _shareGroup == (ushort)NamedGroup.X25519) + { + _shareGroup = (ushort)NamedGroup.Secp256r1; + } + } + } + private readonly IEntropySource _entropy; + private readonly string? _serverName; + private readonly ITlsSessionCache? _cache; + private TranscriptStore? _transcript; + private TlsKeySchedule? _schedule; + private bool _disposed; + + internal TlsEngine( + TlsRole role, + int maxHandshakeMessage = HandshakeFraming.DefaultMaxMessageBytes, + int maxBufferedBytes = DefaultMaxBufferedBytes, + IEntropySource? entropy = null, + string? serverName = null, + ITlsSessionCache? cache = null) + { + ArgumentOutOfRangeException.ThrowIfNegativeOrZero(maxBufferedBytes); + _role = role; + _maxBufferedBytes = maxBufferedBytes; + _maxHandshakeMessage = maxHandshakeMessage; + _entropy = entropy ?? new SystemEntropy(); + _serverName = serverName; + _cache = cache; + if (role == TlsRole.Client) + { + _transcript = new TranscriptStore(System.Security.Cryptography.HashAlgorithmName.SHA256); + _schedule = new TlsKeySchedule(System.Security.Cryptography.HashAlgorithmName.SHA256); + State = TlsEngineState.Start; + } + else + { + State = TlsEngineState.WaitClientHello; + } + } + + internal long UnixTimeSeconds { get; set; } + + internal TlsEngineState State { get; private set; } + + internal void Advance(ReadOnlySpan input, out int consumed, TlsOutput output) + { + ArgumentNullException.ThrowIfNull(output); + output.Clear(); + consumed = 0; + if (State == TlsEngineState.Closed) + { + return; + } + + if (_paused) + { + return; + } + + if (_role == TlsRole.Client && State == TlsEngineState.Start) + { + WriteClientHello(output, helloRetry: false); + if (State == TlsEngineState.Closed) + { + return; + } + + State = TlsEngineState.WaitServerHelloOrHrr; + } + + bool needMore = false; + int offset = 0; + while (State != TlsEngineState.Closed) + { + if (!TryFillRecord(input, ref offset, out int recordLength, out bool incomplete, out byte alert)) + { + Fail(output, alert); + break; + } + + if (incomplete) + { + needMore = _stashLength > 0 || offset < input.Length; + break; + } + + byte contentType = _stash[0]; + if (recordLength == 0) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + if (contentType == 20) + { + bool beforeHello = _role == TlsRole.Server && _firstHello is null; + bool accepted = !beforeHello && + _pendingHandshake == 0 && + State != TlsEngineState.Connected && + TlsPlaintextRecord.TryAcceptChangeCipherSpec(_stash.AsSpan(0, TlsRecordProtector.HeaderLength + recordLength), ref _acceptedChangeCipherSpec); + Consume(recordLength); + if (!accepted) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + continue; + } + + if (contentType == 21) + { + if (_read != null) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + byte description = recordLength == 2 ? _stash[6] : (byte)0; + Consume(recordLength); + if (recordLength != 2) + { + Fail(output, (byte)HandshakeAlert.DecodeError); + break; + } + + output.AddEvent(TlsEventKind.PeerAlert, description); + State = TlsEngineState.Closed; + break; + } + + if (contentType == 22) + { + if (_read != null) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + bool ok = AppendHandshake(_stash.AsSpan(TlsRecordProtector.HeaderLength, recordLength), output) && DrainHandshake(output); + Consume(recordLength); + if (!ok || _paused || State == TlsEngineState.Closed) + { + break; + } + + continue; + } + + if (contentType == 23) + { + if (_read == null) + { + Consume(recordLength); + if (State != TlsEngineState.Connected) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + } + + continue; + } + + RecordResult result = _read.TryUnprotect(_stash.AsSpan(0, TlsRecordProtector.HeaderLength + recordLength)); + if (!result.Success) + { + if (result.Alert == TlsRecordAlert.BadRecordMac && + _ignoreEarlyData && + State != TlsEngineState.Connected && + _earlyDataSkipped + recordLength <= MaxIgnoredEarlyData) + { + _earlyDataSkipped += recordLength; + _emptyRecords = 0; + Consume(recordLength); + continue; + } + + Consume(recordLength); + Fail(output, (byte)result.Alert); + break; + } + + _ignoreEarlyData = false; + if (result.ContentLength == 0 && result.ContentType is 20 or 21 or 22) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + if (result.ContentType == 23 && result.ContentLength == 0) + { + if (State != TlsEngineState.Connected) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + _emptyRecords++; + Consume(recordLength); + if (_emptyRecords > MaxEmptyRecords) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + continue; + } + + _emptyRecords = 0; + + if (result.ContentType == 21) + { + if (result.ContentLength != 2) + { + Consume(recordLength); + Fail(output, (byte)HandshakeAlert.DecodeError); + break; + } + + byte description = _stash[TlsRecordProtector.HeaderLength + 1]; + Consume(recordLength); + output.AddEvent(TlsEventKind.PeerAlert, description); + State = TlsEngineState.Closed; + _paused = false; + break; + } + + if (result.ContentType == 22) + { + bool ok = AppendHandshake(_stash.AsSpan(TlsRecordProtector.HeaderLength, result.ContentLength), output) && DrainHandshake(output); + Consume(recordLength); + if (!ok || _paused || State == TlsEngineState.Closed) + { + break; + } + + continue; + } + + if (result.ContentType != 23 || State != TlsEngineState.Connected) + { + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + break; + } + + AppendPlaintext(_stash.AsSpan(TlsRecordProtector.HeaderLength, result.ContentLength)); + _keepRecordBuffer = true; + Consume(recordLength); + if (result.ContentLength > 0) + { + break; + } + + continue; + } + + Consume(recordLength); + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + } + + if (needMore && State != TlsEngineState.Closed && !_paused) + { + output.AddEvent(TlsEventKind.NeedMoreData); + } + + // Handshake scratch goes away once the handshake is idle. The record buffer stays + // after the first application record so the next record does not allocate it again. + if (!_keepRecordBuffer) + { + ReleaseHandshakeBuffers(); + } + + consumed = offset; + } + + internal void Resume(bool accepted, TlsOutput output) + { + ArgumentNullException.ThrowIfNull(output); + output.Clear(); + if (!_paused) + { + throw new InvalidOperationException("The engine is not waiting for a decision."); + } + + _paused = false; + if (!accepted) + { + byte alert = State == TlsEngineState.WaitClientHelloDecision ? (byte)40 : (byte)42; + Fail(output, alert); + return; + } + + if (State == TlsEngineState.WaitClientHelloDecision) + { + if (_selection is null) + { + Fail(output, 80); + return; + } + + SendServerFlight(output); + return; + } + + if (State == TlsEngineState.WaitClientCertificateDecision) + { + State = TlsEngineState.WaitClientCertificateVerify; + DrainHandshake(output); + return; + } + + State = TlsEngineState.WaitCertificateVerify; + DrainHandshake(output); + } + + private void EnsureBuffers() + { + if (_buffersReady) + { + return; + } + + // One record fits in the stash. The body and the reassembler start small and double + // up to the existing caps. Idle connections return all three. + _stash = new byte[TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxCiphertext]; + _body = new byte[4096]; + _handshake = new HandshakeReassembler(_maxHandshakeMessage); + _buffersReady = true; + } + + private void EnsureBody(int length) + { + if (length <= _body.Length) + { + return; + } + + int size = _body.Length == 0 ? 4096 : _body.Length; + while (size < length) + { + size *= 2; + } + + if (size > _maxHandshakeMessage) + { + size = _maxHandshakeMessage; + } + + byte[] next = new byte[size]; + CryptographicOperations.ZeroMemory(_body); + _body = next; + } + + internal void ReleaseIdleBuffers() + { + if (State == TlsEngineState.Connected && !DatagramTransport) + { + ReleaseHandshakeState(); + } + + ReleaseHandshakeBuffers(); + } + + // After the handshake only the application secrets, the exporter, the resumption master and the record + // protectors are needed. The key shares, the handshake traffic secrets, the key schedule and the + // transcript hash (a native handle plus its buffered bytes) are dead weight for every idle connection. + // A datagram transport keeps them because QUIC copies the handshake secrets out later. + private void ReleaseHandshakeState() + { + ReleaseFlightWriters(); + _share?.Dispose(); + _share = null; + _extraShare?.Dispose(); + _extraShare = null; + _clientHandshakeSecret?.Dispose(); + _clientHandshakeSecret = null; + _serverHandshakeSecret?.Dispose(); + _serverHandshakeSecret = null; + _schedule?.Dispose(); + _schedule = null; + _transcript?.Dispose(); + _transcript = null; + } + + private void ReleaseFlightWriters() + { + _flightWriter?.Release(); + _flightWriter = null; + _joinWriter?.Release(); + _joinWriter = null; + } + + private void ReleaseHandshakeBuffers() + { + // The record buffer is the receive path for every application record. Dropping it + // here allocated a fresh 16 KiB stash on the next record. + if (_keepRecordBuffer || !_buffersReady || _pendingHandshake != 0 || _stashLength != 0 || _handshake.Pending != 0) + { + return; + } + + ReturnHandshakeBuffers(); + if (State == TlsEngineState.Connected) + { + _transcript?.DropRawBytes(); + } + } + + private void ReturnHandshakeBuffers() + { + if (_stash.Length > 0) + { + CryptographicOperations.ZeroMemory(_stash); + _stash = []; + } + + if (_body.Length > 0) + { + CryptographicOperations.ZeroMemory(_body); + _body = []; + } + + _handshake?.Return(); + _handshake = null!; + _buffersReady = false; + _stashLength = 0; + } + + private bool TryFillRecord(ReadOnlySpan input, ref int offset, out int recordLength, out bool incomplete, out byte alert) + { + recordLength = 0; + incomplete = false; + alert = 0; + if (!Pull(input, ref offset, TlsRecordProtector.HeaderLength)) + { + incomplete = true; + return true; + } + + int maxLength = _read is null ? TlsRecordProtector.MaxPlaintext : TlsRecordProtector.MaxCiphertext; + if (!TlsPlaintextRecord.TryReadHeader(_stash, out _, out _, out recordLength, out TlsRecordAlert headerAlert, maxLength)) + { + alert = (byte)headerAlert; + return false; + } + + int total = TlsRecordProtector.HeaderLength + recordLength; + if (total > _maxBufferedBytes) + { + alert = (byte)TlsRecordAlert.RecordOverflow; + return false; + } + + if (!Pull(input, ref offset, total)) + { + incomplete = true; + return true; + } + + return true; + } + + private bool Pull(ReadOnlySpan input, ref int offset, int total) + { + if (_stash.Length < total) + { + // An idle connection has no handshake bytes yet. Allocate when the peer sends some. + if (!_buffersReady && input.Length == offset && _stashLength == 0) + { + return false; + } + + EnsureBuffers(); + } + + if (total > _stash.Length) + { + return false; + } + + int need = total - _stashLength; + if (need <= 0) + { + return true; + } + + int available = input.Length - offset; + int take = need < available ? need : available; + if (take > 0) + { + input.Slice(offset, take).CopyTo(_stash.AsSpan(_stashLength)); + _stashLength += take; + offset += take; + } + + return _stashLength >= total; + } + + private bool AppendHandshake(ReadOnlySpan payload, TlsOutput output) + { + EnsureBuffers(); + if (_pendingHandshake + payload.Length > _maxBufferedBytes) + { + Fail(output, (byte)TlsRecordAlert.RecordOverflow); + return false; + } + + if (!_handshake.TryAppend(payload, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return false; + } + + _pendingHandshake += payload.Length; + return true; + } + + private bool DrainHandshake(TlsOutput output) + { + EnsureBuffers(); + while (State != TlsEngineState.Closed && !_paused) + { + int declared = _handshake.DeclaredBodyLength(); + if (declared > _body.Length && declared <= _maxHandshakeMessage) + { + EnsureBody(declared); + } + + if (!_handshake.TryTake(_body, out HandshakeType type, out int bodyLength, out bool needMore, out HandshakeAlert alert)) + { + Fail(output, (byte)alert); + return false; + } + + if (needMore) + { + return true; + } + + _pendingHandshake -= HandshakeFraming.HeaderLength + bodyLength; + if (_pendingHandshake < 0) + { + _pendingHandshake = 0; + } + + if (!Accepts(type)) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + return false; + } + + Enter(type, bodyLength, output); + if (_endOfRecord) + { + _endOfRecord = false; + if (State != TlsEngineState.Closed && _handshake.Pending > 0) + { + Fail(output, (byte)TlsRecordAlert.UnexpectedMessage); + return false; + } + } + + if (State == TlsEngineState.Closed || _paused) + { + return State != TlsEngineState.Closed; + } + } + + return State != TlsEngineState.Closed; + } + + private bool Accepts(HandshakeType type) + { + if (_role == TlsRole.Client) + { + return State switch + { + TlsEngineState.WaitServerHelloOrHrr => type == HandshakeType.ServerHello, + TlsEngineState.WaitEncryptedExtensions => type == HandshakeType.EncryptedExtensions, + TlsEngineState.WaitCertificateRequestOrCertificate => type is HandshakeType.CertificateRequest or HandshakeType.Certificate, + TlsEngineState.WaitCertificate => type == HandshakeType.Certificate, + TlsEngineState.WaitCertificateVerify => type == HandshakeType.CertificateVerify, + TlsEngineState.WaitFinished => type == HandshakeType.Finished, + TlsEngineState.Connected => type is HandshakeType.NewSessionTicket or HandshakeType.KeyUpdate, + _ => false, + }; + } + + return State switch + { + TlsEngineState.WaitClientHello => type == HandshakeType.ClientHello, + TlsEngineState.WaitClientCertificate => type == HandshakeType.Certificate, + TlsEngineState.WaitClientCertificateVerify => type == HandshakeType.CertificateVerify, + TlsEngineState.WaitFinished => type == HandshakeType.Finished, + TlsEngineState.Connected => type == HandshakeType.KeyUpdate, + _ => false, + }; + } + + private void Enter(HandshakeType type, int bodyLength, TlsOutput output) + { + if (_role == TlsRole.Client) + { + HandleClient(type, bodyLength, output); + return; + } + + HandleServer(type, bodyLength, output); + } + + internal void AdvanceDatagram(ReadOnlySpan handshake, TlsOutput output) + { + ArgumentNullException.ThrowIfNull(output); + output.Clear(); + if (State == TlsEngineState.Closed || _paused) + { + return; + } + + if (_role == TlsRole.Client && State == TlsEngineState.Start) + { + WriteClientHello(output, helloRetry: false); + if (State == TlsEngineState.Closed) + { + return; + } + + State = TlsEngineState.WaitServerHelloOrHrr; + } + + if (handshake.IsEmpty || !AppendHandshake(handshake, output)) + { + return; + } + + DrainHandshake(output); + } + + private void Fail(TlsOutput output, byte description) + { + State = TlsEngineState.Closed; + _paused = false; + LastLocalAlert = description; + if (DatagramTransport) + { + return; + } + + if (_alertsEncrypted && _write != null) + { + if (DeferSealedAlerts) + { + HasDeferredAlert = true; + return; + } + + Span plain = stackalloc byte[2]; + plain[0] = 2; + plain[1] = description; + Span encrypted = stackalloc byte[32]; + int written = _write.Protect(21, plain, encrypted); + output.AddBytes(encrypted[..written]); + return; + } + + Span alert = stackalloc byte[7]; + alert[0] = 21; + alert[1] = 3; + alert[2] = 3; + alert[3] = 0; + alert[4] = 2; + alert[5] = 2; + alert[6] = description; + output.AddBytes(alert); + } + + private void Consume(int recordLength) + { + int total = TlsRecordProtector.HeaderLength + recordLength; + int tail = _stashLength - total; + if (tail > 0) + { + Buffer.BlockCopy(_stash, total, _stash, 0, tail); + _stashLength = tail; + return; + } + + _stashLength = 0; + ReleaseHandshakeBuffers(); + } +} diff --git a/src/Titanium.Tls/Internal/TlsFingerprintFidelity.cs b/src/Titanium.Tls/Internal/TlsFingerprintFidelity.cs new file mode 100644 index 000000000..4f8fcffba --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsFingerprintFidelity.cs @@ -0,0 +1,22 @@ +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// How closely a ClientHello can follow a captured browser when a primitive is missing. +public enum TlsFingerprintFidelity +{ + /// The profile can offer the post-quantum hybrid group. + Full, + + /// The profile omits the post-quantum hybrid group. + ReducedNoPostQuantum = 1, + + /// The profile keeps AES-GCM, P-256, P-384, and the approved signature schemes. + ReducedFipsPolicy = 2, +} + +internal static class TlsFingerprint +{ + internal static TlsFingerprintFidelity Current => + MLKem.IsSupported ? TlsFingerprintFidelity.Full : TlsFingerprintFidelity.ReducedNoPostQuantum; +} diff --git a/src/Titanium.Tls/Internal/TlsHkdf.cs b/src/Titanium.Tls/Internal/TlsHkdf.cs new file mode 100644 index 000000000..2a996ac8b --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsHkdf.cs @@ -0,0 +1,124 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// TLS 1.3 HKDF-Expand-Label and Derive-Secret (RFC 8446 section 7.1). +/// Calls are synchronous. The label is the short label, without the "tls13 " prefix. +/// +internal static class TlsHkdf +{ + private static ReadOnlySpan LabelPrefix => "tls13 "u8; + + internal static int HashLength(HashAlgorithmName hash) + { + if (hash == HashAlgorithmName.SHA256) + { + return 32; + } + + if (hash == HashAlgorithmName.SHA384) + { + return 48; + } + + throw new ArgumentException("TLS 1.3 uses SHA-256 or SHA-384.", nameof(hash)); + } + + internal static void Extract(HashAlgorithmName hash, ReadOnlySpan ikm, ReadOnlySpan salt, Span prk) + { + HKDF.Extract(hash, ikm, salt, prk); + } + + internal static void ExpandLabel( + HashAlgorithmName hash, + ReadOnlySpan secret, + ReadOnlySpan label, + ReadOnlySpan context, + Span output) + { + if (label.Length > 249) + { + throw new ArgumentException("TLS 1.3 labels are at most 249 bytes.", nameof(label)); + } + + if (context.Length > 255) + { + throw new ArgumentException("HKDF label context is at most 255 bytes.", nameof(context)); + } + + if (output.Length > ushort.MaxValue) + { + throw new ArgumentException("HKDF output is at most 65535 bytes.", nameof(output)); + } + + int infoLength = 2 + 1 + LabelPrefix.Length + label.Length + 1 + context.Length; + if (output.Length <= HashLength(hash)) + { + // HKDF-Expand of at most one block is HMAC(secret, info || 0x01). + Span message = stackalloc byte[infoLength + 1]; + WriteInfo(message[..infoLength], output.Length, label, context); + message[infoLength] = 1; + Span block = stackalloc byte[HashLength(hash)]; + if (hash == HashAlgorithmName.SHA256) + { + HMACSHA256.HashData(secret, message, block); + } + else + { + HMACSHA384.HashData(secret, message, block); + } + + block[..output.Length].CopyTo(output); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(block); + return; + } + + Span info = infoLength <= 512 ? stackalloc byte[infoLength] : new byte[infoLength]; + WriteInfo(info, output.Length, label, context); + HKDF.Expand(hash, secret, output, info); + } + + internal static void Hash(HashAlgorithmName hash, ReadOnlySpan data, Span destination) + { + int hashLength = HashLength(hash); + if (destination.Length < hashLength) + { + throw new ArgumentException("Destination is shorter than the hash.", nameof(destination)); + } + + if (hash == HashAlgorithmName.SHA256) + { + SHA256.HashData(data, destination[..hashLength]); + return; + } + + SHA384.HashData(data, destination[..hashLength]); + } + + internal static void DeriveSecret( + HashAlgorithmName hash, + ReadOnlySpan secret, + ReadOnlySpan label, + ReadOnlySpan transcriptHash, + Span output) + { + ExpandLabel(hash, secret, label, transcriptHash, output); + } + + private static void WriteInfo(Span info, int length, ReadOnlySpan label, ReadOnlySpan context) + { + // Stryker disable once bitwise: this byte matches for a non-negative value under the shift width + info[0] = (byte)(length >> 8); + info[1] = (byte)length; + int labelLength = LabelPrefix.Length + label.Length; + info[2] = (byte)labelLength; + LabelPrefix.CopyTo(info.Slice(3)); + label.CopyTo(info.Slice(3 + LabelPrefix.Length)); + int contextAt = 3 + labelLength; + info[contextAt] = (byte)context.Length; + context.CopyTo(info.Slice(contextAt + 1)); + } +} diff --git a/src/Titanium.Tls/Internal/TlsKeySchedule.cs b/src/Titanium.Tls/Internal/TlsKeySchedule.cs new file mode 100644 index 000000000..33ae1c3a2 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsKeySchedule.cs @@ -0,0 +1,277 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal enum KeyScheduleStage +{ + None = 0, + Early = 1, + Handshake = 2, + Master = 3, +} + +/// +/// RFC 8446 section 7 key schedule. Each transition consumes the previous secret and zeroes it. +/// +internal sealed class TlsKeySchedule : IDisposable +{ + private readonly HashAlgorithmName _hash; + private readonly int _hashLength; + private readonly SecretBuffer _early; + private readonly SecretBuffer _handshake; + private readonly SecretBuffer _master; + private KeyScheduleStage _stage; + private bool _clientApplication; + private bool _serverApplication; + private bool _exporter; + private bool _resumption; + private bool _completed; + private bool _disposed; + + internal TlsKeySchedule(HashAlgorithmName hash) + { + _hashLength = TlsHkdf.HashLength(hash); + _hash = hash; + _early = new SecretBuffer(_hashLength); + _handshake = new SecretBuffer(_hashLength); + _master = new SecretBuffer(_hashLength); + } + + internal KeyScheduleStage Stage => _stage; + + internal void InitializeEarly(ReadOnlySpan psk) + { + EnsureStage(KeyScheduleStage.None); + Span salt = stackalloc byte[_hashLength]; + salt.Clear(); + if (psk.IsEmpty) + { + Span zeros = stackalloc byte[_hashLength]; + zeros.Clear(); + TlsHkdf.Extract(_hash, zeros, salt, _early.Span); + } + else + { + if (psk.Length != _hashLength) + { + throw new ArgumentException("PSK must be one hash length.", nameof(psk)); + } + + TlsHkdf.Extract(_hash, psk, salt, _early.Span); + } + + _stage = KeyScheduleStage.Early; + } + + /// + /// The binder used the offered PSK. A ServerHello that does not select it continues with the all-zero early secret. + /// + internal void AbandonPreSharedKey() + { + EnsureStage(KeyScheduleStage.Early); + Span salt = stackalloc byte[_hashLength]; + Span zeros = stackalloc byte[_hashLength]; + salt.Clear(); + // Stryker disable once statement: the temporary is not read after the bytes are copied + zeros.Clear(); + TlsHkdf.Extract(_hash, zeros, salt, _early.Span); + } + + internal void AdvanceToHandshake(ReadOnlySpan sharedSecret) + { + EnsureStage(KeyScheduleStage.Early); + Span derived = stackalloc byte[_hashLength]; + Span emptyHash = stackalloc byte[_hashLength]; + HashEmpty(emptyHash); + TlsHkdf.DeriveSecret(_hash, _early.Span, "derived"u8, emptyHash, derived); + CryptographicOperations.ZeroMemory(_early.Span); + if (sharedSecret.IsEmpty) + { + Span zeros = stackalloc byte[_hashLength]; + zeros.Clear(); + TlsHkdf.Extract(_hash, zeros, derived, _handshake.Span); + } + else + { + TlsHkdf.Extract(_hash, sharedSecret, derived, _handshake.Span); + } + + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(derived); + _stage = KeyScheduleStage.Handshake; + } + + internal void AdvanceToMaster() + { + EnsureStage(KeyScheduleStage.Handshake); + Span derived = stackalloc byte[_hashLength]; + Span emptyHash = stackalloc byte[_hashLength]; + Span zeros = stackalloc byte[_hashLength]; + // Stryker disable once statement: the temporary is not read after the bytes are copied + zeros.Clear(); + HashEmpty(emptyHash); + TlsHkdf.DeriveSecret(_hash, _handshake.Span, "derived"u8, emptyHash, derived); + CryptographicOperations.ZeroMemory(_handshake.Span); + TlsHkdf.Extract(_hash, zeros, derived, _master.Span); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(derived); + _stage = KeyScheduleStage.Master; + } + + internal void HandshakeTrafficSecret(bool client, ReadOnlySpan transcriptHash, Span destination) + { + EnsureStage(KeyScheduleStage.Handshake); + ReadOnlySpan label = client ? "c hs traffic"u8 : "s hs traffic"u8; + TlsHkdf.DeriveSecret(_hash, _handshake.Span, label, transcriptHash, destination); + } + + internal void DeriveEarly(ReadOnlySpan label, ReadOnlySpan transcriptHash, Span destination) + { + EnsureStage(KeyScheduleStage.Early); + TlsHkdf.DeriveSecret(_hash, _early.Span, label, transcriptHash, destination); + } + + internal void ApplicationTrafficSecret(bool client, ReadOnlySpan transcriptHash, Span destination) + { + EnsureStage(KeyScheduleStage.Master); + ReadOnlySpan label = client ? "c ap traffic"u8 : "s ap traffic"u8; + TlsHkdf.DeriveSecret(_hash, _master.Span, label, transcriptHash, destination); + if (client) + { + _clientApplication = true; + } + else + { + _serverApplication = true; + } + + MaybeComplete(); + } + + internal void ExporterMaster(ReadOnlySpan transcriptHash, Span destination) + { + EnsureStage(KeyScheduleStage.Master); + TlsHkdf.DeriveSecret(_hash, _master.Span, "exp master"u8, transcriptHash, destination); + _exporter = true; + MaybeComplete(); + } + + internal void ResumptionMaster(ReadOnlySpan transcriptHash, Span destination) + { + EnsureStage(KeyScheduleStage.Master); + TlsHkdf.DeriveSecret(_hash, _master.Span, "res master"u8, transcriptHash, destination); + _resumption = true; + MaybeComplete(); + } + + private void MaybeComplete() + { + if (_completed || !_clientApplication || !_serverApplication || !_exporter || !_resumption) + { + return; + } + + _completed = true; + CryptographicOperations.ZeroMemory(_master.Span); + } + + internal static void DeriveTrafficKeys(HashAlgorithmName hash, ReadOnlySpan secret, Span key, Span iv) + { + if (iv.Length != 12) + { + throw new ArgumentException("TLS 1.3 traffic IVs are 12 bytes.", nameof(iv)); + } + + TlsHkdf.ExpandLabel(hash, secret, "key"u8, ReadOnlySpan.Empty, key); + TlsHkdf.ExpandLabel(hash, secret, "iv"u8, ReadOnlySpan.Empty, iv); + } + + internal static void FinishedKey(HashAlgorithmName hash, ReadOnlySpan secret, Span destination) + { + TlsHkdf.ExpandLabel(hash, secret, "finished"u8, ReadOnlySpan.Empty, destination); + } + + internal static void NextTrafficSecret(HashAlgorithmName hash, ReadOnlySpan secret, Span destination) + { + TlsHkdf.ExpandLabel(hash, secret, "traffic upd"u8, ReadOnlySpan.Empty, destination); + } + + internal static void ResumptionPsk(HashAlgorithmName hash, ReadOnlySpan resumptionMaster, ReadOnlySpan ticketNonce, Span destination) + { + TlsHkdf.ExpandLabel(hash, resumptionMaster, "resumption"u8, ticketNonce, destination); + } + + internal static void ExportKeyingMaterial( + HashAlgorithmName hash, + ReadOnlySpan exporterMaster, + ReadOnlySpan label, + ReadOnlySpan context, + Span output) + { + int hashLength = TlsHkdf.HashLength(hash); + Span emptyHash = stackalloc byte[hashLength]; + Span derived = stackalloc byte[hashLength]; + Span contextHash = stackalloc byte[hashLength]; + TlsHkdf.Hash(hash, ReadOnlySpan.Empty, emptyHash); + TlsHkdf.DeriveSecret(hash, exporterMaster, label, emptyHash, derived); + TlsHkdf.Hash(hash, context, contextHash); + TlsHkdf.ExpandLabel(hash, derived, "exporter"u8, contextHash, output); + // Stryker disable once statement: the temporary is not read after the bytes are copied + CryptographicOperations.ZeroMemory(derived); + } + + internal bool IsStageZeroed(KeyScheduleStage stage) + { + return StageBuffer(stage).IsZeroed; + } + + internal void CopyStageSecret(KeyScheduleStage stage, Span destination) + { + ReadOnlySpan source = StageBuffer(stage).Span; + if (destination.Length < _hashLength) + { + throw new ArgumentException("Destination is shorter than the hash.", nameof(destination)); + } + + source.CopyTo(destination[.._hashLength]); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _early.Dispose(); + _handshake.Dispose(); + _master.Dispose(); + } + + private SecretBuffer StageBuffer(KeyScheduleStage stage) + { + return stage switch + { + KeyScheduleStage.Early => _early, + KeyScheduleStage.Handshake => _handshake, + KeyScheduleStage.Master => _master, + _ => throw new ArgumentOutOfRangeException(nameof(stage)), + }; + } + + private void EnsureStage(KeyScheduleStage expected) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (_stage != expected) + { + throw new InvalidOperationException("Key schedule stage is " + _stage + "."); + } + } + + private void HashEmpty(Span destination) + { + TlsHkdf.Hash(_hash, ReadOnlySpan.Empty, destination); + } +} diff --git a/src/Titanium.Tls/Internal/TlsPlaintextRecord.cs b/src/Titanium.Tls/Internal/TlsPlaintextRecord.cs new file mode 100644 index 000000000..b2d1dae7f --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsPlaintextRecord.cs @@ -0,0 +1,62 @@ +using System; + +namespace Titanium.Tls; + +/// Unprotected TLS records used before the handshake keys exist. +internal static class TlsPlaintextRecord +{ + internal static bool TryReadHeader(ReadOnlySpan input, out byte contentType, out int version, out int length, out TlsRecordAlert alert, int maxLength = TlsRecordProtector.MaxPlaintext) + { + contentType = 0; + version = 0; + length = 0; + alert = TlsRecordAlert.UnexpectedMessage; + if (input.Length < TlsRecordProtector.HeaderLength) + { + return false; + } + + contentType = input[0]; + version = (input[1] << 8) | input[2]; + length = (input[3] << 8) | input[4]; + if (version != 0x0301 && version != 0x0303) + { + return false; + } + + if (length > maxLength) + { + alert = TlsRecordAlert.RecordOverflow; + return false; + } + + if (contentType != 20 && contentType != 21 && contentType != 22 && contentType != 23) + { + return false; + } + + alert = default; + return true; + } + + internal static bool TryAcceptChangeCipherSpec(ReadOnlySpan record, ref int accepted) + { + if (!TryReadHeader(record, out byte contentType, out _, out int length, out _)) + { + return false; + } + + if (contentType != 20 || length != 1 || record.Length < TlsRecordProtector.HeaderLength + 1 || record[5] != 1) + { + return false; + } + + if (accepted != 0) + { + return false; + } + + accepted = 1; + return true; + } +} diff --git a/src/Titanium.Tls/Internal/TlsReader.cs b/src/Titanium.Tls/Internal/TlsReader.cs new file mode 100644 index 000000000..2f900d866 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsReader.cs @@ -0,0 +1,133 @@ +using System; + +namespace Titanium.Tls; + +/// +/// Reads TLS vectors from a span. A short buffer returns false and does not throw. +/// +internal ref struct TlsReader +{ + private ReadOnlySpan _rest; + + internal TlsReader(ReadOnlySpan span) + { + _rest = span; + } + + internal int Remaining => _rest.Length; + + internal ReadOnlySpan Unread => _rest; + + internal bool TryReadUInt8(out byte value) + { + if (_rest.IsEmpty) + { + value = 0; + return false; + } + + value = _rest[0]; + _rest = _rest[1..]; + return true; + } + + internal bool TryReadUInt16(out ushort value) + { + if (_rest.Length < 2) + { + value = 0; + return false; + } + + value = (ushort)((_rest[0] << 8) | _rest[1]); + _rest = _rest[2..]; + return true; + } + + internal bool TryReadUInt24(out int value) + { + if (_rest.Length < 3) + { + value = 0; + return false; + } + + value = (_rest[0] << 16) | (_rest[1] << 8) | _rest[2]; + _rest = _rest[3..]; + return true; + } + + internal bool TryReadUInt32(out uint value) + { + if (_rest.Length < 4) + { + value = 0; + return false; + } + + value = ((uint)_rest[0] << 24) | ((uint)_rest[1] << 16) | ((uint)_rest[2] << 8) | _rest[3]; + _rest = _rest[4..]; + return true; + } + + internal bool TryReadBytes(int count, out ReadOnlySpan value) + { + if (count < 0 || _rest.Length < count) + { + value = default; + return false; + } + + value = _rest[..count]; + _rest = _rest[count..]; + return true; + } + + internal bool TryReadVector8(out ReadOnlySpan value) + { + return TryReadVector(1, out value); + } + + internal bool TryReadVector16(out ReadOnlySpan value) + { + return TryReadVector(2, out value); + } + + internal bool TryReadVector24(out ReadOnlySpan value) + { + return TryReadVector(3, out value); + } + + internal bool Skip(int count) + { + return TryReadBytes(count, out _); + } + + private bool TryReadVector(int width, out ReadOnlySpan value) + { + bool ok; + int length; + if (width == 1) + { + ok = TryReadUInt8(out byte small); + length = small; + } + else if (width == 2) + { + ok = TryReadUInt16(out ushort medium); + length = medium; + } + else + { + ok = TryReadUInt24(out length); + } + + if (!ok) + { + value = default; + return false; + } + + return TryReadBytes(length, out value); + } +} diff --git a/src/Titanium.Tls/Internal/TlsRecordProtector.cs b/src/Titanium.Tls/Internal/TlsRecordProtector.cs new file mode 100644 index 000000000..a8a34471c --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsRecordProtector.cs @@ -0,0 +1,301 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal enum TlsAeadSuite +{ + Aes128Gcm = 0, + Aes256Gcm = 1, + ChaCha20Poly1305 = 2, +} + +internal enum TlsRecordAlert +{ + UnexpectedMessage = 10, + BadRecordMac = 20, + RecordOverflow = 22, +} + +internal readonly struct RecordResult +{ + internal bool Success { get; init; } + + internal byte ContentType { get; init; } + + internal int ContentLength { get; init; } + + internal TlsRecordAlert Alert { get; init; } +} + +internal sealed class TlsRecordException : Exception +{ + internal TlsRecordException(TlsRecordAlert alert) + : base(alert.ToString()) + { + Alert = alert; + } + + internal TlsRecordAlert Alert { get; } +} + +/// +/// TLS 1.3 record protection (RFC 8446 section 5). One direction, one key generation. +/// +internal sealed class TlsRecordProtector : IDisposable +{ + internal const int MaxPlaintext = 1 << 14; + internal const int MaxCiphertext = MaxPlaintext + 256; + internal const int HeaderLength = 5; + internal const int TagLength = 16; + + private readonly AesGcm? _aes; + private readonly ChaCha20Poly1305? _chacha; + private readonly byte[] _iv; + private readonly ulong _keyUpdateAfter; + private ulong _sequence; + private bool _disposed; + + internal TlsRecordProtector(TlsAeadSuite suite, ReadOnlySpan key, ReadOnlySpan iv, ulong keyUpdateAfter = 1UL << 23) + { + if (iv.Length != 12) + { + throw new ArgumentException("TLS 1.3 nonces start from a 12-byte IV.", nameof(iv)); + } + + int expected = suite == TlsAeadSuite.Aes128Gcm ? 16 : 32; + if (key.Length != expected) + { + throw new ArgumentException("AEAD key length does not match the suite.", nameof(key)); + } + + _iv = new byte[12]; + iv.CopyTo(_iv); + _keyUpdateAfter = keyUpdateAfter; + if (suite == TlsAeadSuite.ChaCha20Poly1305) + { + _chacha = new ChaCha20Poly1305(key); + } + else + { + _aes = new AesGcm(key, TagLength); + } + } + + internal ulong Sequence => _sequence; + + internal void SetSequence(ulong sequence) => _sequence = sequence; + + internal bool KeyUpdateDue => _sequence >= _keyUpdateAfter; + + internal bool IvIsZeroed + { + get + { + foreach (byte value in _iv) + { + if (value != 0) + { + return false; + } + } + + return true; + } + } + + internal int Protect(byte contentType, ReadOnlySpan plaintext, Span destination, int padding = 0) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (padding < 0) + { + throw new TlsRecordException(TlsRecordAlert.RecordOverflow); + } + + // RFC 8446 section 5.4: content plus padding stay within 2^14, and the inner plaintext adds the type byte. + long innerLengthLong = (long)plaintext.Length + padding + 1; + if (plaintext.Length + padding > MaxPlaintext || innerLengthLong > MaxPlaintext + 1) + { + throw new TlsRecordException(TlsRecordAlert.RecordOverflow); + } + + int innerLength = (int)innerLengthLong; + int cipherLength = innerLength + TagLength; + if (cipherLength > MaxCiphertext) + { + throw new TlsRecordException(TlsRecordAlert.RecordOverflow); + } + + if (destination.Length < HeaderLength + cipherLength) + { + throw new ArgumentException("Destination is shorter than the record.", nameof(destination)); + } + + EnsureSequence(); + plaintext.CopyTo(destination.Slice(HeaderLength, plaintext.Length)); + destination[HeaderLength + plaintext.Length] = contentType; + destination.Slice(HeaderLength + plaintext.Length + 1, padding).Clear(); + + Span nonce = stackalloc byte[12]; + Span aad = stackalloc byte[HeaderLength]; + WriteNonce(nonce); + WriteAad(aad, cipherLength); + Span inner = destination.Slice(HeaderLength, innerLength); + Span tag = destination.Slice(HeaderLength + innerLength, TagLength); + Encrypt(nonce, inner, inner, tag, aad); + destination[0] = 23; + destination[1] = 3; + destination[2] = 3; + destination[3] = (byte)(cipherLength >> 8); + destination[4] = (byte)cipherLength; + _sequence++; + return HeaderLength + cipherLength; + } + + internal byte Unprotect(Span record, out int contentLength) + { + RecordResult result = TryUnprotect(record); + if (!result.Success) + { + throw new TlsRecordException(result.Alert); + } + + contentLength = result.ContentLength; + return result.ContentType; + } + + internal RecordResult TryUnprotect(Span record) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (record.Length < HeaderLength || record[0] != 23 || record[1] != 3 || record[2] != 3) + { + return Fail(TlsRecordAlert.UnexpectedMessage); + } + + int cipherLength = (record[3] << 8) | record[4]; + if (cipherLength > MaxCiphertext) + { + return Fail(TlsRecordAlert.RecordOverflow); + } + + if (cipherLength < TagLength + 1 || record.Length < HeaderLength + cipherLength || _sequence == ulong.MaxValue) + { + return Fail(_sequence == ulong.MaxValue ? TlsRecordAlert.RecordOverflow : TlsRecordAlert.UnexpectedMessage); + } + + int innerLength = cipherLength - TagLength; + if (innerLength > MaxPlaintext + 1) + { + return Fail(TlsRecordAlert.RecordOverflow); + } + Span nonce = stackalloc byte[12]; + Span aad = stackalloc byte[HeaderLength]; + WriteNonce(nonce); + WriteAad(aad, cipherLength); + Span inner = record.Slice(HeaderLength, innerLength); + Span tag = record.Slice(HeaderLength + innerLength, TagLength); + try + { + Decrypt(nonce, inner, tag, aad, inner); + } + catch (AuthenticationTagMismatchException) + { + return Fail(TlsRecordAlert.BadRecordMac); + } + + if (!TryReadInner(inner, out byte contentType, out int contentLength) || contentLength > MaxPlaintext) + { + return Fail(contentLength > MaxPlaintext ? TlsRecordAlert.RecordOverflow : TlsRecordAlert.UnexpectedMessage); + } + + _sequence++; + return new RecordResult { Success = true, ContentType = contentType, ContentLength = contentLength }; + } + + private static RecordResult Fail(TlsRecordAlert alert) + { + return new RecordResult { Success = false, Alert = alert }; + } + + internal static bool TryReadInner(ReadOnlySpan inner, out byte contentType, out int contentLength) + { + for (int i = inner.Length - 1; i >= 0; i--) + { + if (inner[i] == 0) + { + continue; + } + + contentType = inner[i]; + contentLength = i; + return true; + } + + contentType = 0; + contentLength = 0; + return false; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _aes?.Dispose(); + _chacha?.Dispose(); + CryptographicOperations.ZeroMemory(_iv); + } + + private void EnsureSequence() + { + if (_sequence == ulong.MaxValue) + { + throw new TlsRecordException(TlsRecordAlert.RecordOverflow); + } + } + + private void WriteNonce(Span nonce) + { + _iv.CopyTo(nonce); + ulong sequence = _sequence; + for (int i = 11; i >= 4; i--) + { + nonce[i] ^= (byte)sequence; + sequence >>= 8; + } + } + + private static void WriteAad(Span aad, int cipherLength) + { + aad[0] = 23; + aad[1] = 3; + aad[2] = 3; + aad[3] = (byte)(cipherLength >> 8); + aad[4] = (byte)cipherLength; + } + + private void Encrypt(ReadOnlySpan nonce, ReadOnlySpan plaintext, Span ciphertext, Span tag, ReadOnlySpan aad) + { + if (_aes != null) + { + _aes.Encrypt(nonce, plaintext, ciphertext, tag, aad); + return; + } + + _chacha!.Encrypt(nonce, plaintext, ciphertext, tag, aad); + } + + private void Decrypt(ReadOnlySpan nonce, ReadOnlySpan ciphertext, ReadOnlySpan tag, ReadOnlySpan aad, Span plaintext) + { + if (_aes != null) + { + _aes.Decrypt(nonce, ciphertext, tag, plaintext, aad); + return; + } + + _chacha!.Decrypt(nonce, ciphertext, tag, plaintext, aad); + } +} diff --git a/src/Titanium.Tls/Internal/TlsServerSelection.cs b/src/Titanium.Tls/Internal/TlsServerSelection.cs new file mode 100644 index 000000000..61b5cd0b2 --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsServerSelection.cs @@ -0,0 +1,148 @@ +using System; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +/// What the server callback returns after it has seen the ClientHello. +internal sealed class TlsServerSelection +{ + internal required X509Certificate2 Certificate { get; init; } + + internal string[]? ApplicationProtocols { get; init; } + + internal bool RequireApplicationProtocol { get; init; } + + internal bool RequestClientCertificate { get; init; } + + /// An empty client Certificate is certificate_required (116). Resumption is refused while a certificate is requested. + internal bool RequireClientCertificate { get; init; } + + internal RemoteCertificateValidationCallback? ClientCertificateCallback { get; init; } + + internal X509Certificate2Collection? ClientTrustAnchors { get; init; } + + internal NamedGroup[]? Groups { get; init; } + + internal ushort[]? CipherSuites { get; init; } + + internal bool PreferServerCipherOrder { get; init; } + + internal ITicketProtector? Tickets { get; init; } +} + +/// The ClientHello the server callback is allowed to inspect. +internal sealed class TlsClientHelloInfo +{ + internal TlsClientHelloInfo(string? serverName, byte[] rawHello) + { + ServerName = serverName; + RawHello = rawHello; + } + + internal string? ServerName { get; } + + internal byte[] RawHello { get; } +} + +/// Encrypts a session ticket. The default implementation rotates a key every 24 hours and still accepts the previous one. +internal interface ITicketProtector +{ + byte[] Protect(ReadOnlySpan plaintext); + + bool TryUnprotect(ReadOnlySpan ticket, Span destination, out int written); +} + +/// In-memory AES-256-GCM tickets. Two keys are live: the current one and the one it replaced. +internal sealed class MemoryTicketProtector : ITicketProtector, IDisposable +{ + private readonly byte[][] _keys = [new byte[32], new byte[32]]; + private int _current; + private long _born; + private bool _disposed; + + internal MemoryTicketProtector() + { + RandomNumberGenerator.Fill(_keys[0]); + RandomNumberGenerator.Fill(_keys[1]); + _born = DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + } + + internal long UnixTimeSeconds { get; set; } + + internal void ForceRotate() + { + ObjectDisposedException.ThrowIf(_disposed, this); + _current = 1 - _current; + RandomNumberGenerator.Fill(_keys[_current]); + _born = Now(); + } + + public byte[] Protect(ReadOnlySpan plaintext) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (Now() - _born >= 24 * 60 * 60) + { + ForceRotate(); + } + + var ticket = new byte[1 + 12 + plaintext.Length + 16]; + ticket[0] = (byte)_current; + RandomNumberGenerator.Fill(ticket.AsSpan(1, 12)); + using var aes = new AesGcm(_keys[_current], 16); + aes.Encrypt(ticket.AsSpan(1, 12), plaintext, ticket.AsSpan(13, plaintext.Length), ticket.AsSpan(ticket.Length - 16)); + return ticket; + } + + public bool TryUnprotect(ReadOnlySpan ticket, Span destination, out int written) + { + written = 0; + if (_disposed || ticket.Length < 1 + 12 + 16) + { + return false; + } + + int id = ticket[0]; + if (id > 1) + { + return false; + } + + int plaintext = ticket.Length - 1 - 12 - 16; + if (destination.Length < plaintext) + { + return false; + } + + try + { + using var aes = new AesGcm(_keys[id], 16); + aes.Decrypt(ticket.Slice(1, 12), ticket.Slice(13, plaintext), ticket.Slice(ticket.Length - 16), destination[..plaintext]); + } + catch (CryptographicException) + { + return false; + } + + written = plaintext; + return true; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + CryptographicOperations.ZeroMemory(_keys[0]); + CryptographicOperations.ZeroMemory(_keys[1]); + } + + private long Now() + { + return UnixTimeSeconds > 0 ? UnixTimeSeconds : DateTimeOffset.UtcNow.ToUnixTimeSeconds(); + } +} diff --git a/src/Titanium.Tls/Internal/TlsSessionCache.cs b/src/Titanium.Tls/Internal/TlsSessionCache.cs new file mode 100644 index 000000000..4b59a633f --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsSessionCache.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal sealed class TlsResumptionTicket +{ + internal TlsResumptionTicket(byte[] ticket, uint lifetimeSeconds, uint ageAdd, byte[] nonce, byte[] psk, ushort cipherSuite, long issuedUnixSeconds) + { + Ticket = ticket; + LifetimeSeconds = lifetimeSeconds; + AgeAdd = ageAdd; + Nonce = nonce; + Psk = psk; + CipherSuite = cipherSuite; + IssuedUnixSeconds = issuedUnixSeconds; + } + + internal byte[] Ticket { get; } + + internal uint LifetimeSeconds { get; } + + internal uint AgeAdd { get; } + + internal byte[] Nonce { get; } + + internal byte[] Psk { get; } + + internal ushort CipherSuite { get; } + + internal long IssuedUnixSeconds { get; } + + internal void Clear() + { + CryptographicOperations.ZeroMemory(Psk); + } +} + +internal interface ITlsSessionCache +{ + bool TryGet(string serverName, string profileName, long nowUnixSeconds, out TlsResumptionTicket ticket); + + void Store(string serverName, string profileName, TlsResumptionTicket ticket); + + void Forget(string serverName, string profileName); +} + +/// Bounded in-memory tickets, keyed by server name and profile name. +internal sealed class MemoryTlsSessionCache : ITlsSessionCache +{ + internal const int Capacity = 32; + + internal int QueuedKeys + { + get + { + lock (_gate) return _order.Count; + } + } + + private readonly Dictionary _items = new(StringComparer.Ordinal); + private readonly Queue _order = new(); + private readonly object _gate = new(); + + public bool TryGet(string serverName, string profileName, long nowUnixSeconds, out TlsResumptionTicket ticket) + { + string key = Key(serverName, profileName); + lock (_gate) + { + if (!_items.TryGetValue(key, out ticket!)) + { + return false; + } + + if (ticket.LifetimeSeconds == 0 || nowUnixSeconds > ticket.IssuedUnixSeconds + ticket.LifetimeSeconds) + { + ticket.Clear(); + _items.Remove(key); + return false; + } + + return true; + } + } + + public void Store(string serverName, string profileName, TlsResumptionTicket ticket) + { + string key = Key(serverName, profileName); + lock (_gate) + { + if (_items.TryGetValue(key, out TlsResumptionTicket? previous)) + { + previous.Clear(); + } + else + { + _order.Enqueue(key); + } + + _items[key] = ticket; + while (_items.Count > Capacity && _order.TryDequeue(out string? old)) + { + if (_items.Remove(old, out TlsResumptionTicket? evicted)) + { + evicted.Clear(); + } + } + } + } + + public void Forget(string serverName, string profileName) + { + string key = Key(serverName, profileName); + lock (_gate) + { + if (_items.Remove(key, out TlsResumptionTicket? evicted)) + { + evicted.Clear(); + } + } + } + + private static string Key(string serverName, string profileName) + { + return serverName + "\n" + profileName; + } +} diff --git a/src/Titanium.Tls/Internal/TlsWriter.cs b/src/Titanium.Tls/Internal/TlsWriter.cs new file mode 100644 index 000000000..94a798cda --- /dev/null +++ b/src/Titanium.Tls/Internal/TlsWriter.cs @@ -0,0 +1,189 @@ +using System; +using System.Buffers; + +namespace Titanium.Tls; + +/// A programmer error in the codec, not a malformed peer message. +internal sealed class TlsProtocolViolation : Exception +{ + internal TlsProtocolViolation(string message) + : base(message) + { + } +} + +/// +/// Writes TLS vectors into a caller span and back-patches length prefixes. +/// copies the finished bytes into an . +/// +internal ref struct TlsWriter +{ + private readonly Span _buffer; + private int _written; + + private TlsWriter(Span buffer) + { + _buffer = buffer; + _written = 0; + } + + internal int Written => _written; + + internal ReadOnlySpan WrittenBytes => _buffer[.._written]; + + internal static TlsWriter Over(Span buffer) + { + return new TlsWriter(buffer); + } + + internal bool TryWriteUInt8(byte value) + { + if (_buffer.Length - _written < 1) + { + return false; + } + + _buffer[_written++] = value; + return true; + } + + internal bool TryWriteUInt16(ushort value) + { + if (_buffer.Length - _written < 2) + { + return false; + } + + _buffer[_written++] = (byte)(value >> 8); + _buffer[_written++] = (byte)value; + return true; + } + + internal bool TryWriteUInt24(int value) + { + if (value < 0 || value > 0xFFFFFF || _buffer.Length - _written < 3) + { + return false; + } + + _buffer[_written++] = (byte)(value >> 16); + _buffer[_written++] = (byte)(value >> 8); + _buffer[_written++] = (byte)value; + return true; + } + + internal bool TryWriteUInt32(uint value) + { + if (_buffer.Length - _written < 4) + { + return false; + } + + _buffer[_written++] = (byte)(value >> 24); + _buffer[_written++] = (byte)(value >> 16); + _buffer[_written++] = (byte)(value >> 8); + _buffer[_written++] = (byte)value; + return true; + } + + internal bool TryWrite(ReadOnlySpan value) + { + if (_buffer.Length - _written < value.Length) + { + return false; + } + + value.CopyTo(_buffer[_written..]); + _written += value.Length; + return true; + } + + internal bool TryWriteVector8(ReadOnlySpan value) + { + return value.Length <= byte.MaxValue && TryWriteUInt8((byte)value.Length) && TryWrite(value); + } + + internal bool TryWriteVector16(ReadOnlySpan value) + { + return value.Length <= ushort.MaxValue && TryWriteUInt16((ushort)value.Length) && TryWrite(value); + } + + internal bool TryWriteVector24(ReadOnlySpan value) + { + return value.Length <= 0xFFFFFF && TryWriteUInt24(value.Length) && TryWrite(value); + } + + internal bool TryReserveLength(int width, out int position) + { + if (width is not (1 or 2 or 3)) + { + throw new TlsProtocolViolation("A TLS length prefix is 1, 2, or 3 bytes."); + } + + position = _written; + if (_buffer.Length - _written < width) + { + return false; + } + + _buffer.Slice(_written, width).Clear(); + _written += width; + return true; + } + + internal bool TryPatchLength(int position, int width) + { + if (width is not (1 or 2 or 3)) + { + throw new TlsProtocolViolation("A TLS length prefix is 1, 2, or 3 bytes."); + } + + int length = _written - position - width; + if (length < 0 || position < 0 || position + width > _buffer.Length) + { + throw new TlsProtocolViolation("The length prefix is outside the bytes already written."); + } + + if ((width == 1 && length > byte.MaxValue) || (width == 2 && length > ushort.MaxValue) || length > 0xFFFFFF) + { + return false; + } + + if (width == 1) + { + _buffer[position] = (byte)length; + } + else if (width == 2) + { + _buffer[position] = (byte)(length >> 8); + _buffer[position + 1] = (byte)length; + } + else + { + _buffer[position] = (byte)(length >> 16); + _buffer[position + 1] = (byte)(length >> 8); + _buffer[position + 2] = (byte)length; + } + + return true; + } + + internal bool TryFlush(IBufferWriter writer) + { + ArgumentNullException.ThrowIfNull(writer); + if (_written == 0) + { + return true; + } + + Span span = writer.GetSpan(_written); + if (span.Length < _written) + { + return false; + } + + WrittenBytes.CopyTo(span); + writer.Advance(_written); + return true; + } +} diff --git a/src/Titanium.Tls/Internal/TranscriptStore.cs b/src/Titanium.Tls/Internal/TranscriptStore.cs new file mode 100644 index 000000000..f7cbf6b93 --- /dev/null +++ b/src/Titanium.Tls/Internal/TranscriptStore.cs @@ -0,0 +1,196 @@ +using System; +using System.Buffers; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// Handshake transcript (RFC 8446 section 4.4.1). The running hash is incremental. +/// After HelloRetryRequest, substitutes the first ClientHello. +/// +internal sealed class TranscriptStore : IDisposable +{ + internal const int MaxTranscriptBytes = 256 * 1024; + + private HashAlgorithmName _hash; + private int _hashLength; + private byte[] _buffer; + private int _length; + private IncrementalHash _running; + private bool _disposed; + + internal TranscriptStore(HashAlgorithmName hash) + { + _hashLength = TlsHkdf.HashLength(hash); + _hash = hash; + _buffer = ArrayPool.Shared.Rent(256); + _running = IncrementalHash.CreateHash(hash); + } + + internal int Length => _length; + + internal void Retarget(HashAlgorithmName hash) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (_hash == hash) + { + return; + } + + _hash = hash; + _hashLength = TlsHkdf.HashLength(hash); + _running.Dispose(); + _running = IncrementalHash.CreateHash(hash); + if (_length > 0) + { + _running.AppendData(_buffer.AsSpan(0, _length)); + } + } + + internal void Append(ReadOnlySpan message) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (message.Length == 0) + { + return; + } + + if ((long)_length + message.Length > MaxTranscriptBytes) + { + throw new InvalidOperationException("Handshake transcript exceeded 256 KiB."); + } + + Ensure(_length + message.Length); + message.CopyTo(_buffer.AsSpan(_length)); + _length += message.Length; + _running.AppendData(message); + } + + internal void CurrentHash(Span destination) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if (destination.Length < _hashLength) + { + throw new ArgumentException("Destination is shorter than the hash.", nameof(destination)); + } + + _running.GetCurrentHash(destination[.._hashLength]); + } + + internal void HashWith(ReadOnlySpan extra, Span destination) + { + ObjectDisposedException.ThrowIf(_disposed, this); + if ((long)_length + extra.Length > MaxTranscriptBytes) + { + throw new InvalidOperationException("Handshake transcript exceeded 256 KiB."); + } + + byte[] rented = ArrayPool.Shared.Rent(_length + extra.Length); + try + { + _buffer.AsSpan(0, _length).CopyTo(rented); + extra.CopyTo(rented.AsSpan(_length)); + Hash(rented.AsSpan(0, _length + extra.Length), destination); + } + finally + { + CryptographicOperations.ZeroMemory(rented.AsSpan(0, _length + extra.Length)); + ArrayPool.Shared.Return(rented, clearArray: true); + } + } + + internal void ReplaceWithMessageHash() + { + ObjectDisposedException.ThrowIf(_disposed, this); + Span hash = stackalloc byte[48]; + CurrentHash(hash[.._hashLength]); + Ensure(4 + _hashLength); + _buffer[0] = 254; + _buffer[1] = 0; + _buffer[2] = 0; + _buffer[3] = (byte)_hashLength; + hash[.._hashLength].CopyTo(_buffer.AsSpan(4)); + CryptographicOperations.ZeroMemory(_buffer.AsSpan(4 + _hashLength, _buffer.Length - (4 + _hashLength))); + _length = 4 + _hashLength; + _running.Dispose(); + _running = IncrementalHash.CreateHash(_hash); + _running.AppendData(_buffer.AsSpan(0, _length)); + } + + internal ReadOnlySpan Bytes => _buffer.AsSpan(0, _length); + + internal void DropRawBytes() + { + if (_buffer.Length == 0) + { + return; + } + + CryptographicOperations.ZeroMemory(_buffer.AsSpan(0, _length)); + _buffer = []; + _length = 0; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + if (_buffer.Length > 0) + { + CryptographicOperations.ZeroMemory(_buffer.AsSpan(0, _length)); + ArrayPool.Shared.Return(_buffer, clearArray: true); + } + + _running.Dispose(); + _buffer = []; + _length = 0; + } + + private void Ensure(int size) + { + if (_buffer.Length >= size) + { + return; + } + + int next = _buffer.Length == 0 ? 256 : _buffer.Length; + while (next < size) + { + next = Math.Min(next * 2, MaxTranscriptBytes); + } + + byte[] grown = ArrayPool.Shared.Rent(next); + if (_length > 0) + { + _buffer.AsSpan(0, _length).CopyTo(grown); + } + + if (_buffer.Length > 0) + { + CryptographicOperations.ZeroMemory(_buffer.AsSpan(0, _length)); + ArrayPool.Shared.Return(_buffer, clearArray: true); + } + + _buffer = grown; + } + + private void Hash(ReadOnlySpan data, Span destination) + { + if (destination.Length < _hashLength) + { + throw new ArgumentException("Destination is shorter than the hash.", nameof(destination)); + } + + if (_hash == HashAlgorithmName.SHA256) + { + SHA256.HashData(data, destination[.._hashLength]); + return; + } + + SHA384.HashData(data, destination[.._hashLength]); + } +} diff --git a/src/Titanium.Tls/Internal/X25519.cs b/src/Titanium.Tls/Internal/X25519.cs new file mode 100644 index 000000000..77794d5f2 --- /dev/null +++ b/src/Titanium.Tls/Internal/X25519.cs @@ -0,0 +1,113 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// RFC 7748 X25519. Field elements are five 51-bit limbs. The ladder does not branch on the scalar. +/// +internal static class X25519 +{ + private const ulong A24 = 121665; + internal static void PublicKey(ReadOnlySpan scalar, Span publicKey) + { + X25519FixedBase.PublicKey(scalar, publicKey); + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveOptimization)] + internal static void ScalarMult(ReadOnlySpan scalar, ReadOnlySpan uCoordinate, Span result) + { + if (scalar.Length != 32 || uCoordinate.Length != 32 || result.Length < 32) + { + throw new ArgumentException("X25519 inputs and the output are 32 bytes."); + } + + Span clamped = stackalloc byte[32]; + scalar.CopyTo(clamped); + clamped[0] &= 248; + clamped[31] &= 127; + clamped[31] |= 64; + + Span uBytes = stackalloc byte[32]; + uCoordinate.CopyTo(uBytes); + uBytes[31] &= 127; + + Curve25519Field x1 = Curve25519Field.FromBytes(uBytes); + Curve25519Field x2 = Curve25519Field.One; + Curve25519Field z2 = default; + Curve25519Field x3 = x1; + Curve25519Field z3 = Curve25519Field.One; + uint swap = 0; + Curve25519Field a = default; + Curve25519Field aa = default; + Curve25519Field b = default; + Curve25519Field bb = default; + Curve25519Field e = default; + Curve25519Field c = default; + Curve25519Field d = default; + Curve25519Field da = default; + Curve25519Field cb = default; + Curve25519Field sum = default; + Curve25519Field difference = default; + Curve25519Field scaled = default; + Curve25519Field combined = default; + for (int bit = 254; bit >= 0; bit--) + { + uint current = (uint)((clamped[bit >> 3] >> (bit & 7)) & 1); + swap ^= current; + Curve25519Field.ConditionalSwap(ref x2, ref x3, swap); + Curve25519Field.ConditionalSwap(ref z2, ref z3, swap); + swap = current; + + Curve25519Field.Add(ref a, in x2, in z2); + Curve25519Field.Square(ref aa, in a); + Curve25519Field.Sub(ref b, in x2, in z2); + Curve25519Field.Square(ref bb, in b); + Curve25519Field.Sub(ref e, in aa, in bb); + Curve25519Field.Add(ref c, in x3, in z3); + Curve25519Field.Sub(ref d, in x3, in z3); + Curve25519Field.Mul(ref da, in d, in a); + Curve25519Field.Mul(ref cb, in c, in b); + Curve25519Field.Add(ref sum, in da, in cb); + Curve25519Field.Sub(ref difference, in da, in cb); + Curve25519Field.Square(ref x3, in sum); + Curve25519Field.Square(ref difference, in difference); + Curve25519Field.Mul(ref z3, in x1, in difference); + Curve25519Field.Mul(ref x2, in aa, in bb); + Curve25519Field.MulSmall(ref scaled, in e, A24); + Curve25519Field.Add(ref combined, in aa, in scaled); + Curve25519Field.Mul(ref z2, in e, in combined); + } + + Curve25519Field.ConditionalSwap(ref x2, ref x3, swap); + Curve25519Field.ConditionalSwap(ref z2, ref z3, swap); + Curve25519Field output = x2 * z2.Invert(); + output.ToBytes(result); + CryptographicOperations.ZeroMemory(clamped); + } + + internal static bool TryAgree(ReadOnlySpan scalar, ReadOnlySpan peerPublic, Span shared) + { + ScalarMult(scalar, peerPublic, shared); + byte accumulated = 0; + for (int i = 0; i < 32; i++) + { + accumulated |= shared[i]; + } + + if (ConstantTimeEqualsZero(accumulated) != 0) + { + CryptographicOperations.ZeroMemory(shared[..32]); + return false; + } + + return true; + } + + private static uint ConstantTimeEqualsZero(byte value) + { + uint widened = value; + return (~(widened | (0u - widened))) >> 31; + } +} + diff --git a/src/Titanium.Tls/Internal/X25519FixedBase.cs b/src/Titanium.Tls/Internal/X25519FixedBase.cs new file mode 100644 index 000000000..a0d6536e6 --- /dev/null +++ b/src/Titanium.Tls/Internal/X25519FixedBase.cs @@ -0,0 +1,266 @@ +using System; +using System.Globalization; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +/// +/// The X25519 public key for a secret scalar: the Montgomery coordinate of [scalar]B, found as a fixed-base +/// multiplication on the birationally equivalent twisted Edwards curve. The scalar is split into 64 signed +/// radix-16 digits. Thirty-two tables of the multiples 1 to 8 of 256^i times the base point are built on first +/// use, so a key costs 64 mixed additions, four doublings and one inversion instead of a 255-step ladder. +/// Every digit scans all eight table entries under a mask, negation is a masked swap, and no branch or index +/// depends on the scalar. +/// +internal static class X25519FixedBase +{ + private const int Positions = 32; + private const int Multiples = 8; + + private static readonly Niels[] Table = BuildTable(); + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + internal static void PublicKey(ReadOnlySpan scalar, Span publicKey) + { + if (scalar.Length != 32 || publicKey.Length < 32) + { + throw new ArgumentException("X25519 inputs and the output are 32 bytes."); + } + + Span clamped = stackalloc byte[32]; + Span digits = stackalloc int[64]; + try + { + scalar.CopyTo(clamped); + clamped[0] &= 248; + clamped[31] &= 127; + clamped[31] |= 64; + Recode(clamped, digits); + + Point h = Point.Identity; + Niels selected = default; + for (int i = 1; i < 64; i += 2) + { + Select(ref selected, i >> 1, digits[i]); + MixedAdd(ref h, in selected); + } + + for (int i = 0; i < 4; i++) + { + Double(ref h); + } + + for (int i = 0; i < 64; i += 2) + { + Select(ref selected, i >> 1, digits[i]); + MixedAdd(ref h, in selected); + } + + Curve25519Field numerator = h.Z + h.Y; + Curve25519Field denominator = h.Z - h.Y; + Curve25519Field u = numerator * denominator.Invert(); + u.ToBytes(publicKey); + } + finally + { + CryptographicOperations.ZeroMemory(clamped); + CryptographicOperations.ZeroMemory(MemoryMarshal.AsBytes(digits)); + } + } + + /// Signed radix-16 digits in [-8, 8]. The clamped scalar is below 2^255, so the last carry never leaves the top digit. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Recode(ReadOnlySpan scalar, Span digits) + { + for (int i = 0; i < 32; i++) + { + digits[2 * i] = scalar[i] & 15; + digits[(2 * i) + 1] = (scalar[i] >> 4) & 15; + } + + int carry = 0; + for (int i = 0; i < 63; i++) + { + digits[i] += carry; + carry = (digits[i] + 8) >> 4; + digits[i] -= carry << 4; + } + + digits[63] += carry; + } + + /// Loads the table entry for digit times 256^position times the base point, or the neutral entry for zero. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Select(ref Niels result, int position, int digit) + { + int negative = digit >> 31; + int magnitude = (digit ^ negative) - negative; + result.YPlusX = Curve25519Field.One; + result.YMinusX = Curve25519Field.One; + result.XY2D = Curve25519Field.Zero; + int start = position * Multiples; + for (int j = 0; j < Multiples; j++) + { + ulong mask = 0UL - Equal(magnitude, j + 1); + ref readonly Niels entry = ref Table[start + j]; + Curve25519Field.ConditionalMove(ref result.YPlusX, in entry.YPlusX, mask); + Curve25519Field.ConditionalMove(ref result.YMinusX, in entry.YMinusX, mask); + Curve25519Field.ConditionalMove(ref result.XY2D, in entry.XY2D, mask); + } + + uint swap = (uint)negative & 1u; + Curve25519Field.ConditionalSwap(ref result.YPlusX, ref result.YMinusX, swap); + Curve25519Field negated = default; + Curve25519Field.Sub(ref negated, Curve25519Field.Zero, in result.XY2D); + Curve25519Field.ConditionalMove(ref result.XY2D, in negated, 0UL - swap); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static uint Equal(int left, int right) + { + uint difference = (uint)(left ^ right); + return (difference - 1) >> 31; + } + + /// Adds an affine table entry to an extended point. The a = -1 formulas are complete, so the neutral entry needs no branch. + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void MixedAdd(ref Point point, in Niels entry) + { + Curve25519Field sum = point.Y + point.X; + Curve25519Field difference = point.Y - point.X; + Curve25519Field a = sum * entry.YPlusX; + Curve25519Field b = difference * entry.YMinusX; + Curve25519Field c = entry.XY2D * point.T; + Curve25519Field d = point.Z + point.Z; + Curve25519Field e = a - b; + Curve25519Field f = d - c; + Curve25519Field g = d + c; + Curve25519Field h = a + b; + point.X = e * f; + point.Y = g * h; + point.Z = f * g; + point.T = e * h; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static void Double(ref Point point) + { + Curve25519Field a = point.X.Square(); + Curve25519Field b = point.Y.Square(); + Curve25519Field c = point.Z.Square(); + c += c; + Curve25519Field h = a + b; + Curve25519Field e = h - (point.X + point.Y).Square(); + Curve25519Field g = a - b; + Curve25519Field f = c + g; + point.X = e * f; + point.Y = g * h; + point.Z = f * g; + point.T = e * h; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static Point Add(in Point left, in Point right, in Curve25519Field twoD) + { + Curve25519Field a = (left.Y - left.X) * (right.Y - right.X); + Curve25519Field b = (left.Y + left.X) * (right.Y + right.X); + Curve25519Field c = (left.T * right.T) * twoD; + Curve25519Field d = left.Z * right.Z; + d += d; + Curve25519Field e = b - a; + Curve25519Field f = d - c; + Curve25519Field g = d + c; + Curve25519Field h = b + a; + return new Point { X = e * f, Y = g * h, Z = f * g, T = e * h }; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static Niels[] BuildTable() + { + Curve25519Field d = Curve25519Field.Zero - (Curve25519Field.FromUInt64(121665) * Curve25519Field.FromUInt64(121666).Invert()); + Curve25519Field twoD = d + d; + Curve25519Field baseX = FromBigEndianHex("216936D3CD6E53FEC0A4E231FDD6DC5C692CC7609525A7B2C9562D608F25D51A"); + Curve25519Field baseY = FromBigEndianHex("6666666666666666666666666666666666666666666666666666666666666658"); + Point position = new() { X = baseX, Y = baseY, Z = Curve25519Field.One, T = baseX * baseY }; + + var points = new Point[Positions * Multiples]; + for (int i = 0; i < Positions; i++) + { + Point multiple = position; + for (int j = 0; j < Multiples; j++) + { + points[(i * Multiples) + j] = multiple; + multiple = Add(in multiple, in position, in twoD); + } + + for (int j = 0; j < 8; j++) + { + Double(ref position); + } + } + + // Montgomery's trick: one inversion for all 256 affine conversions. + var running = new Curve25519Field[points.Length]; + Curve25519Field product = Curve25519Field.One; + for (int i = 0; i < points.Length; i++) + { + running[i] = product; + product *= points[i].Z; + } + + Curve25519Field inverse = product.Invert(); + var table = new Niels[points.Length]; + for (int i = points.Length - 1; i >= 0; i--) + { + Curve25519Field zInverse = inverse * running[i]; + inverse *= points[i].Z; + Curve25519Field x = points[i].X * zInverse; + Curve25519Field y = points[i].Y * zInverse; + table[i] = new Niels + { + YPlusX = Canonical(y + x), + YMinusX = Canonical(y - x), + XY2D = Canonical((x * y) * twoD), + }; + } + + return table; + } + + [MethodImpl(MethodImplOptions.AggressiveOptimization)] + private static Curve25519Field Canonical(Curve25519Field value) + { + Span bytes = stackalloc byte[32]; + value.ToBytes(bytes); + return Curve25519Field.FromBytes(bytes); + } + + private static Curve25519Field FromBigEndianHex(string hex) + { + var value = BigInteger.Parse("0" + hex, NumberStyles.HexNumber, CultureInfo.InvariantCulture); + Span bytes = stackalloc byte[32]; + bytes.Clear(); + value.TryWriteBytes(bytes, out _, isUnsigned: true, isBigEndian: false); + return Curve25519Field.FromBytes(bytes); + } + + private struct Point + { + internal Curve25519Field X; + internal Curve25519Field Y; + internal Curve25519Field Z; + internal Curve25519Field T; + + internal static Point Identity => new() { X = Curve25519Field.Zero, Y = Curve25519Field.One, Z = Curve25519Field.One, T = Curve25519Field.Zero }; + } + + private struct Niels + { + internal Curve25519Field YPlusX; + internal Curve25519Field YMinusX; + internal Curve25519Field XY2D; + } +} diff --git a/src/Titanium.Tls/Internal/X25519KeyExchange.cs b/src/Titanium.Tls/Internal/X25519KeyExchange.cs new file mode 100644 index 000000000..e3b30517f --- /dev/null +++ b/src/Titanium.Tls/Internal/X25519KeyExchange.cs @@ -0,0 +1,88 @@ +using System; +using System.Security.Cryptography; + +namespace Titanium.Tls; + +internal sealed class X25519KeyExchange : IKeyExchangeGroup +{ + public NamedGroup Group => NamedGroup.X25519; + + public int PublicKeyLength => 32; + + public int SharedSecretLength => 32; + + public IPrivateKeyShare GenerateKeyShare(IEntropySource entropy) + { + ArgumentNullException.ThrowIfNull(entropy); + return new X25519PrivateShare(entropy); + } + + public bool TryEncapsulate(ReadOnlySpan clientShare, IEntropySource entropy, Span serverShare, Span secret, out int serverWritten, out int secretWritten) + { + _ = clientShare; + _ = entropy; + _ = serverShare; + _ = secret; + serverWritten = 0; + secretWritten = 0; + return false; + } + + private sealed class X25519PrivateShare : IPrivateKeyShare + { + private readonly SecretBuffer _scalar = new(32); + private readonly byte[] _public = new byte[32]; + private bool _disposed; + + internal X25519PrivateShare(IEntropySource entropy) + { + entropy.Fill(_scalar.Span); + X25519.PublicKey(_scalar.Span, _public); + } + + public void WritePublicKey(Span destination) + { + ObjectDisposedException.ThrowIf(_disposed, this); + _public.CopyTo(destination); + } + + public bool TryComputeSharedSecret(ReadOnlySpan peerShare, Span secret, out int written) + { + ObjectDisposedException.ThrowIf(_disposed, this); + written = 0; + if (peerShare.Length != 32 || secret.Length < 32) + { + return false; + } + + Span scalar = stackalloc byte[32]; + _scalar.Span.CopyTo(scalar); + try + { + if (!X25519.TryAgree(scalar, peerShare, secret)) + { + return false; + } + } + finally + { + CryptographicOperations.ZeroMemory(scalar); + } + + written = 32; + return true; + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _scalar.Dispose(); + CryptographicOperations.ZeroMemory(_public); + } + } +} diff --git a/src/Titanium.Tls/LICENSE b/src/Titanium.Tls/LICENSE new file mode 100644 index 000000000..786bcaca4 --- /dev/null +++ b/src/Titanium.Tls/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jehonathan Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/src/Titanium.Tls/PublicAPI.Shipped.txt b/src/Titanium.Tls/PublicAPI.Shipped.txt new file mode 100644 index 000000000..7dc5c5811 --- /dev/null +++ b/src/Titanium.Tls/PublicAPI.Shipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Titanium.Tls/PublicAPI.Unshipped.txt b/src/Titanium.Tls/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..ad44b1d42 --- /dev/null +++ b/src/Titanium.Tls/PublicAPI.Unshipped.txt @@ -0,0 +1,104 @@ +#nullable enable +abstract Titanium.Tls.TlsFingerprintProfile.BuildClientHello(Titanium.Tls.ClientHelloContext! context, System.Buffers.IBufferWriter! destination) -> void +abstract Titanium.Tls.TlsFingerprintProfile.Fidelity.get -> Titanium.Tls.TlsFingerprintFidelity +abstract Titanium.Tls.TlsFingerprintProfile.Name.get -> string! +abstract Titanium.Tls.TlsFingerprintProfile.Version.get -> string! +override Titanium.Tls.ChromeFingerprintProfile.BuildClientHello(Titanium.Tls.ClientHelloContext! context, System.Buffers.IBufferWriter! destination) -> void +override Titanium.Tls.ChromeFingerprintProfile.Fidelity.get -> Titanium.Tls.TlsFingerprintFidelity +override Titanium.Tls.ChromeFingerprintProfile.Name.get -> string! +override Titanium.Tls.ChromeFingerprintProfile.Version.get -> string! +static Titanium.Tls.TlsFingerprintProfiles.Chrome.get -> Titanium.Tls.ChromeFingerprintProfile! +Titanium.Tls.ChromeFingerprintProfile +Titanium.Tls.ChromeFingerprintProfile.ChromeFingerprintProfile() -> void +Titanium.Tls.ClientHelloContext +Titanium.Tls.ClientHelloContext.ApplicationProtocols.get -> System.Collections.Generic.IReadOnlyList? +Titanium.Tls.ClientHelloContext.ApplicationProtocols.set -> void +Titanium.Tls.ClientHelloContext.ClientHelloContext() -> void +Titanium.Tls.ClientHelloContext.HelloRetryState.get -> byte[]? +Titanium.Tls.ClientHelloContext.HelloRetryState.set -> void +Titanium.Tls.ClientHelloContext.KeyShares.get -> System.Collections.Generic.IReadOnlyDictionary? +Titanium.Tls.ClientHelloContext.KeyShares.set -> void +Titanium.Tls.ClientHelloContext.PskBinder.get -> byte[]? +Titanium.Tls.ClientHelloContext.PskBinder.set -> void +Titanium.Tls.ClientHelloContext.ServerName.get -> string? +Titanium.Tls.ClientHelloContext.ServerName.set -> void +Titanium.Tls.ClientHelloContext.SessionTicket.get -> byte[]? +Titanium.Tls.ClientHelloContext.SessionTicket.set -> void +Titanium.Tls.TlsFingerprintFidelity +Titanium.Tls.TlsFingerprintFidelity.Full = 0 -> Titanium.Tls.TlsFingerprintFidelity +Titanium.Tls.TlsFingerprintFidelity.ReducedFipsPolicy = 2 -> Titanium.Tls.TlsFingerprintFidelity +Titanium.Tls.TlsFingerprintFidelity.ReducedNoPostQuantum = 1 -> Titanium.Tls.TlsFingerprintFidelity +Titanium.Tls.TlsAlgorithmPolicy +Titanium.Tls.TlsAlgorithmPolicy.Default = 0 -> Titanium.Tls.TlsAlgorithmPolicy +Titanium.Tls.TlsAlgorithmPolicy.FipsApprovedOnly = 1 -> Titanium.Tls.TlsAlgorithmPolicy +static Titanium.Tls.FipsEnvironment.IsEnabled() -> bool +static Titanium.Tls.FipsEnvironment.ManagedStackRefusal(bool managedRequested, bool configOverride) -> string? +Titanium.Tls.FipsEnvironment +Titanium.Tls.TlsStreamOptions.AlgorithmPolicy.get -> Titanium.Tls.TlsAlgorithmPolicy +Titanium.Tls.TlsStreamOptions.AlgorithmPolicy.set -> void +Titanium.Tls.TlsStreamOptions.AllowManagedStackUnderFips.get -> bool +Titanium.Tls.TlsStreamOptions.AllowManagedStackUnderFips.set -> void +Titanium.Tls.TlsFingerprintProfile +Titanium.Tls.TlsFingerprintProfile.TlsFingerprintProfile() -> void +Titanium.Tls.TlsFingerprintProfiles +Titanium.Tls.TlsVersionNotSupportedException +Titanium.Tls.TlsVersionNotSupportedException.TlsVersionNotSupportedException() -> void +Titanium.Tls.ITlsKeyLogSink +Titanium.Tls.ITlsKeyLogSink.Write(string! line) -> void +Titanium.Tls.TlsAlertException +Titanium.Tls.TlsAlertException.Description.get -> byte +Titanium.Tls.TlsAlertException.TlsAlertException(byte description, bool sent) -> void +Titanium.Tls.TlsAlertException.WasSent.get -> bool +Titanium.Tls.TlsServerOptionsSelectionCallback +virtual Titanium.Tls.TlsServerOptionsSelectionCallback.Invoke(Titanium.Tls.TlsStream! stream, System.Net.Security.SslClientHelloInfo hello, object? state, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.ValueTask +Titanium.Tls.TlsStream +Titanium.Tls.TlsStream.AuthenticateAsClient(System.Net.Security.SslClientAuthenticationOptions! options) -> void +Titanium.Tls.TlsStream.AuthenticateAsClientAsync(System.Net.Security.SslClientAuthenticationOptions! options, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.AuthenticateAsServer(System.Net.Security.SslServerAuthenticationOptions! options) -> void +Titanium.Tls.TlsStream.AuthenticateAsServerAsync(System.Net.Security.SslServerAuthenticationOptions! options) -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.AuthenticateAsServerAsync(System.Net.Security.SslServerAuthenticationOptions! options, System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.AuthenticateAsServerAsync(Titanium.Tls.TlsServerOptionsSelectionCallback! callback, object? state, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.ExportKeyingMaterial(System.Span destination, string! label, System.ReadOnlySpan context) -> void +Titanium.Tls.TlsStream.FingerprintFidelity.get -> Titanium.Tls.TlsFingerprintFidelity +Titanium.Tls.TlsStream.IsAuthenticated.get -> bool +Titanium.Tls.TlsStream.IsEncrypted.get -> bool +Titanium.Tls.TlsStream.IsMutuallyAuthenticated.get -> bool +Titanium.Tls.TlsStream.IsServer.get -> bool +Titanium.Tls.TlsStream.IsSigned.get -> bool +Titanium.Tls.TlsStream.LocalCertificate.get -> System.Security.Cryptography.X509Certificates.X509Certificate? +Titanium.Tls.TlsStream.NegotiateClientCertificateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.NegotiatedApplicationProtocol.get -> System.Net.Security.SslApplicationProtocol +Titanium.Tls.TlsStream.NegotiatedCipherSuite.get -> System.Net.Security.TlsCipherSuite +Titanium.Tls.TlsStream.RemoteCertificate.get -> System.Security.Cryptography.X509Certificates.X509Certificate? +Titanium.Tls.TlsStream.ShutdownAsync() -> System.Threading.Tasks.Task! +Titanium.Tls.TlsStream.SslProtocol.get -> System.Security.Authentication.SslProtocols +Titanium.Tls.TlsStream.TargetHostName.get -> string! +Titanium.Tls.TlsStream.TlsStream(System.IO.Stream! inner) -> void +Titanium.Tls.TlsStream.TlsStream(System.IO.Stream! inner, bool leaveInnerStreamOpen) -> void +Titanium.Tls.TlsStream.TlsStream(System.IO.Stream! inner, bool leaveInnerStreamOpen, Titanium.Tls.TlsStreamOptions? options) -> void +Titanium.Tls.TlsStream.TlsStream(System.IO.Stream! inner, Titanium.Tls.TlsStreamOptions? options) -> void +override Titanium.Tls.TlsStream.CanRead.get -> bool +override Titanium.Tls.TlsStream.CanSeek.get -> bool +override Titanium.Tls.TlsStream.CanWrite.get -> bool +override Titanium.Tls.TlsStream.DisposeAsync() -> System.Threading.Tasks.ValueTask +override Titanium.Tls.TlsStream.Flush() -> void +override Titanium.Tls.TlsStream.FlushAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task! +override Titanium.Tls.TlsStream.Length.get -> long +override Titanium.Tls.TlsStream.Position.get -> long +override Titanium.Tls.TlsStream.Position.set -> void +override Titanium.Tls.TlsStream.Read(byte[]! buffer, int offset, int count) -> int +override Titanium.Tls.TlsStream.Read(System.Span buffer) -> int +override Titanium.Tls.TlsStream.ReadAsync(System.Memory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +override Titanium.Tls.TlsStream.Seek(long offset, System.IO.SeekOrigin origin) -> long +override Titanium.Tls.TlsStream.SetLength(long value) -> void +override Titanium.Tls.TlsStream.Write(byte[]! buffer, int offset, int count) -> void +override Titanium.Tls.TlsStream.Write(System.ReadOnlySpan buffer) -> void +override Titanium.Tls.TlsStream.WriteAsync(System.ReadOnlyMemory buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask +Titanium.Tls.TlsStreamOptions +Titanium.Tls.TlsStreamOptions.FingerprintProfile.get -> Titanium.Tls.TlsFingerprintProfile? +Titanium.Tls.TlsStreamOptions.FingerprintProfile.set -> void +Titanium.Tls.TlsStreamOptions.KeyLog.get -> Titanium.Tls.ITlsKeyLogSink? +Titanium.Tls.TlsStreamOptions.KeyLog.set -> void +Titanium.Tls.TlsStreamOptions.StrictCloseNotify.get -> bool +Titanium.Tls.TlsStreamOptions.StrictCloseNotify.set -> void +Titanium.Tls.TlsStreamOptions.TlsStreamOptions() -> void diff --git a/src/Titanium.Tls/README.md b/src/Titanium.Tls/README.md new file mode 100644 index 000000000..e33e1cb4c --- /dev/null +++ b/src/Titanium.Tls/README.md @@ -0,0 +1,25 @@ +# Titanium.Tls + +Managed TLS 1.3 for .NET. The protocol state machine is C#. Record protection, signatures, and the NIST curves use `System.Security.Cryptography`. X25519 is a managed ladder. + +The proxy calls this stack when `UseManagedTlsStack` is on. The library default is off. + +```csharp +var options = new TlsStreamOptions { AllowManagedStackUnderFips = true }; +await using var stream = new TlsStream(tcp, options); +await stream.AuthenticateAsClientAsync(new SslClientAuthenticationOptions +{ + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, +}); +await stream.WriteAsync(payload); +``` + +## Limits + +The client hello offers `TLS_AES_128_GCM_SHA256`. A fingerprint profile is stored and reported. It is not the hello on the wire. TLS 1.2 is rejected. Online revocation stays `NoCheck`. Stapled OCSP and certificate timestamps are copied and not checked. Post-handshake client authentication is not implemented. + +This package is experimental. It is not a FIPS-validated module. While FIPS mode is on, authentication throws unless `AllowManagedStackUnderFips` is set or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. + +`samples/TlsStreamEcho` opens a loopback client and server and echoes two bytes. diff --git a/src/Titanium.Tls/StrongNameKey.snk b/src/Titanium.Tls/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/src/Titanium.Tls/StrongNameKey.snk differ diff --git a/src/Titanium.Tls/Titanium.Tls.csproj b/src/Titanium.Tls/Titanium.Tls.csproj new file mode 100644 index 000000000..729f9f2eb --- /dev/null +++ b/src/Titanium.Tls/Titanium.Tls.csproj @@ -0,0 +1,29 @@ + + + + Titanium.Tls + Managed TLS 1.3 for .NET. + Titanium.Tls + tls;tls13;managed + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + diff --git a/src/Titanium.Tls/TlsAlertException.cs b/src/Titanium.Tls/TlsAlertException.cs new file mode 100644 index 000000000..9de40c6f8 --- /dev/null +++ b/src/Titanium.Tls/TlsAlertException.cs @@ -0,0 +1,25 @@ +using System.Security.Authentication; + +namespace Titanium.Tls; + +/// A fatal TLS alert ended the connection. +public sealed class TlsAlertException : AuthenticationException +{ + /// Creates the exception for an alert this stack sent or received. + /// The alert description. + /// True when this stack sent the alert. + public TlsAlertException(byte description, bool sent) + : base(sent + ? "Authentication failed because the local side sent TLS alert " + description + "." + : "Authentication failed because the remote party sent TLS alert " + description + ".") + { + Description = description; + WasSent = sent; + } + + /// The alert description. + public byte Description { get; } + + /// True when this stack sent the alert. + public bool WasSent { get; } +} diff --git a/src/Titanium.Tls/TlsStream.cs b/src/Titanium.Tls/TlsStream.cs new file mode 100644 index 000000000..382fd39ff --- /dev/null +++ b/src/Titanium.Tls/TlsStream.cs @@ -0,0 +1,1723 @@ +using System; +using System.Buffers; +using System.IO; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace Titanium.Tls; + +/// A TLS 1.3 stream with the same shape as . +public sealed class TlsStream : Stream +{ + private const string AuthenticatedContext = "This operation is only allowed using a successfully authenticated context."; + private const string ShutdownWrite = "Write operations are not allowed after the channel was shutdown."; + + private readonly Stream _inner; + private readonly bool _batchWrites; + private readonly bool _leaveInnerOpen; + private readonly TlsStreamOptions _options; + private readonly SemaphoreSlim _readLock = new(1, 1); + private readonly SemaphoreSlim _writeLock = new(1, 1); + private byte[]? _encryptStorage; + private byte[] _encrypt => _encryptStorage ??= new byte[TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxPlaintext + 1 + TlsRecordProtector.TagLength]; + private const int MaxRecordLength = TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxPlaintext + 1 + TlsRecordProtector.TagLength; + private const int RecordsPerTransportWrite = 4; + private const int BatchCapacity = RecordsPerTransportWrite * MaxRecordLength; + private readonly TlsOutput _pull = new(); + private TlsOutput? _resume; + private TlsEngine? _engine; + private SslClientAuthenticationOptions? _clientOptions; + private SslServerAuthenticationOptions? _serverOptions; + private byte[]? _inboundStorage; + private byte[] _inbound => _inboundStorage ??= InboundBufferPool.Rent(); + private int _inboundCount; + private int _inboundUsed; + private bool _authenticated; + private bool _server; + private bool _shutdown; + private bool _readClosed; + private bool _disposed; + private bool _broken; + private int _disposeStarted; + + /// Creates a stream that closes on dispose. + /// The transport. + public TlsStream(Stream inner) + : this(inner, false, null) + { + } + + /// Creates a stream and chooses whether dispose closes . + /// The transport. + /// True to leave open. + public TlsStream(Stream inner, bool leaveInnerStreamOpen) + : this(inner, leaveInnerStreamOpen, null) + { + } + + /// Creates a stream that closes on dispose. + /// The transport. + /// Extra options. Null uses the defaults. + public TlsStream(Stream inner, TlsStreamOptions? options) + : this(inner, false, options) + { + } + + /// Creates a stream. + /// The transport. + /// True to leave open. + /// Extra options. Null uses the defaults. + public TlsStream(Stream inner, bool leaveInnerStreamOpen, TlsStreamOptions? options) + { + ArgumentNullException.ThrowIfNull(inner); + _inner = inner; + _batchWrites = inner is NetworkStream; + _leaveInnerOpen = leaveInnerStreamOpen; + _options = options ?? new TlsStreamOptions(); + } + + /// True after a finished handshake. + public bool IsAuthenticated => _authenticated && !_disposed; + + /// True after a finished handshake. The record layer is always encrypted. + public bool IsEncrypted => IsAuthenticated; + + /// True after a finished handshake. TLS 1.3 authenticates the transcript. + public bool IsSigned => IsAuthenticated; + + /// True when this side authenticated as the server. + public bool IsServer => _server; + + /// True when a client certificate was authenticated. + public bool IsMutuallyAuthenticated => _engine?.IsMutuallyAuthenticated == true; + + /// The negotiated protocol. This stack speaks TLS 1.3 only. + public SslProtocols SslProtocol => _authenticated ? SslProtocols.Tls13 : SslProtocols.None; + + /// The negotiated cipher suite. + public TlsCipherSuite NegotiatedCipherSuite => _authenticated ? (TlsCipherSuite)_engine!.SelectedCipher : TlsCipherSuite.TLS_AES_128_GCM_SHA256; + + /// The negotiated application protocol, or the empty protocol. + public SslApplicationProtocol NegotiatedApplicationProtocol + { + get + { + string? protocol = _engine?.SelectedApplicationProtocol; + return string.IsNullOrEmpty(protocol) ? default : new SslApplicationProtocol(protocol); + } + } + + /// The peer leaf, or null before the handshake produces one. + public X509Certificate? RemoteCertificate => _engine?.RemoteCertificate; + + /// The local leaf used for authentication, or null. + public X509Certificate? LocalCertificate => _engine?.LocalCertificate; + + /// The name passed to client authentication, or the server name from the ClientHello. + public string TargetHostName => _clientOptions?.TargetHost ?? _engine?.ClientHello?.ServerName ?? string.Empty; + + /// The fingerprint profile's fidelity, or the built-in hello's fidelity when no profile is set. FIPS policy reports . + public TlsFingerprintFidelity FingerprintFidelity => + EffectivePolicy == TlsAlgorithmPolicy.FipsApprovedOnly + ? TlsFingerprintFidelity.ReducedFipsPolicy + : _options.FingerprintProfile?.Fidelity ?? TlsFingerprintFidelity.ReducedNoPostQuantum; + + internal bool AcceptedResumption => _engine?.AcceptedResumption == true; + + /// + public override bool CanRead => !_disposed && _inner.CanRead; + + /// + public override bool CanWrite => !_disposed && !_shutdown && _inner.CanWrite; + + /// + public override bool CanSeek => false; + + /// + public override long Length => throw new NotSupportedException(); + + /// + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + /// Authenticates as the client. + /// The client authentication options. + public void AuthenticateAsClient(SslClientAuthenticationOptions options) + { + ArgumentNullException.ThrowIfNull(options); + LockBoth(); + try + { + PrepareClient(options); + DriveSync(); + } + finally + { + UnlockBoth(); + } + } + + /// Authenticates as the client. + /// The client authentication options. + /// Cancels the transport reads and writes. + /// A task that completes when the handshake finishes. + public Task AuthenticateAsClientAsync(SslClientAuthenticationOptions options, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(options); + return AuthenticateClientAsync(options, cancellationToken); + } + + /// Authenticates as the server with one set of options. + /// The server authentication options. + public void AuthenticateAsServer(SslServerAuthenticationOptions options) + { + ArgumentNullException.ThrowIfNull(options); + LockBoth(); + try + { + PrepareServer(options); + DriveSync(); + } + finally + { + UnlockBoth(); + } + } + + /// Authenticates as the server with one set of options. + /// The server authentication options. + /// A task that completes when the handshake finishes. + public Task AuthenticateAsServerAsync(SslServerAuthenticationOptions options) + { + return AuthenticateAsServerAsync(options, default); + } + + /// Authenticates as the server with one set of options. + /// The server authentication options. + /// Cancels the transport reads and writes. + /// A task that completes when the handshake finishes. + public Task AuthenticateAsServerAsync(SslServerAuthenticationOptions options, CancellationToken cancellationToken) + { + ArgumentNullException.ThrowIfNull(options); + return AuthenticateServerAsync(options, null, null, cancellationToken); + } + + /// Authenticates as the server and selects options after the ClientHello. + /// The selection callback. + /// State passed to . + /// Cancels the transport reads and writes. + /// A task that completes when the handshake finishes. + public Task AuthenticateAsServerAsync(TlsServerOptionsSelectionCallback callback, object? state, CancellationToken cancellationToken = default) + { + ArgumentNullException.ThrowIfNull(callback); + return AuthenticateServerAsync(null, callback, state, cancellationToken); + } + + /// Sends close_notify and refuses further writes. + /// A task that completes when the alert has been written. + public async Task ShutdownAsync() + { + ObjectDisposedException.ThrowIf(_disposed, this); + await _writeLock.WaitAsync().ConfigureAwait(false); + try + { + EnsureAuthenticated(); + if (_shutdown) + { + return; + } + + int written = _engine!.ProtectAlert(1, 0, _encrypt); + await _inner.WriteAsync(_encrypt.AsMemory(0, written)).ConfigureAwait(false); + _shutdown = true; + } + finally + { + _writeLock.Release(); + } + } + + /// Post-handshake client authentication is not supported. + /// Unused. + /// This method does not return. + public Task NegotiateClientCertificateAsync(CancellationToken cancellationToken = default) + { + throw new NotSupportedException("Post-handshake client authentication is not supported."); + } + + /// Exports keying material from the TLS 1.3 exporter master secret. + /// The buffer that receives the material. + /// The exporter label. + /// The exporter context. Empty is allowed. + public void ExportKeyingMaterial(Span destination, string label, ReadOnlySpan context) + { + ObjectDisposedException.ThrowIf(_disposed, this); + ArgumentNullException.ThrowIfNull(label); + EnsureAuthenticated(); + _engine!.ExportKeyingMaterial(label, context, destination); + } + + /// + public override int Read(byte[] buffer, int offset, int count) + { + ArgumentNullException.ThrowIfNull(buffer); + return Read(buffer.AsSpan(offset, count)); + } + + /// + public override int Read(Span buffer) + { + ObjectDisposedException.ThrowIf(_disposed, this); + _readLock.Wait(); + try + { + EnsureAuthenticated(); + if (buffer.Length == 0) + { + WaitForRecordSync(); + return 0; + } + + while (_engine!.PlaintextAvailable == 0) + { + if (_readClosed) + { + return 0; + } + + PullSync(); + } + + return _engine.ReadPlaintext(buffer); + } + finally + { + _readLock.Release(); + } + } + + /// + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + if (cancellationToken.IsCancellationRequested) + { + return ValueTask.FromCanceled(cancellationToken); + } + + if (buffer.Length > 0 && _authenticated && !_disposed && !_broken && _readLock.Wait(0, CancellationToken.None)) + { + try + { + if (_engine!.PlaintextAvailable > 0) + { + return new ValueTask(_engine.ReadPlaintext(buffer.Span)); + } + } + finally + { + _readLock.Release(); + } + } + + return ReadAsyncSlow(buffer, cancellationToken); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private async ValueTask ReadAsyncSlow(Memory buffer, CancellationToken cancellationToken) + { + ObjectDisposedException.ThrowIf(_disposed, this); + await _readLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + EnsureAuthenticated(); + ThrowIfBroken(); + while (_engine!.PlaintextAvailable == 0 && !_readClosed && _engine.State != TlsEngineState.Closed) + { + if (_inboundUsed >= _inboundCount) + { + int read; + try + { + read = await BeginSocketRead(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + + NoteSocketRead(read); + } + + _pull.Clear(); + _engine.Advance(Unconsumed(), out int consumed, _pull); + _inboundUsed += consumed; + if (_pull.Bytes.Length > 0) + { + await _inner.WriteAsync(_pull.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + if (_engine.HasDeferredAlert) + { + await SealDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + } + + NoteReadEvents(_pull); + if (_engine.KeyUpdateResponseNeeded) + { + await TrySendKeyUpdateFromReaderAsync(cancellationToken).ConfigureAwait(false); + } + + if (consumed == 0 && _engine.PlaintextAvailable == 0 && !_readClosed) + { + int read; + try + { + read = await BeginSocketRead(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + + NoteSocketRead(read); + } + } + + if (buffer.Length == 0 || _engine!.PlaintextAvailable == 0) + { + return 0; + } + + return _engine.ReadPlaintext(buffer.Span); + } + finally + { + _readLock.Release(); + } + } + + private ValueTask BeginSocketRead(CancellationToken cancellationToken) + { + CompactInbound(); + if (_inboundCount == _inbound.Length) + { + throw new IOException("The TLS record is larger than the receive buffer."); + } + + return _inner.ReadAsync(_inbound.AsMemory(_inboundCount), cancellationToken); + } + + private void NoteSocketRead(int read) + { + if (read == 0) + { + throw EndWithoutNotify(); + } + + _inboundCount += read; + } + + /// + public override void Write(byte[] buffer, int offset, int count) + { + ArgumentNullException.ThrowIfNull(buffer); + Write(buffer.AsSpan(offset, count)); + } + + /// + public override void Write(ReadOnlySpan buffer) + { + ObjectDisposedException.ThrowIf(_disposed, this); + _writeLock.Wait(); + try + { + WriteLocked(buffer); + } + finally + { + _writeLock.Release(); + } + } + + /// + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + if (cancellationToken.IsCancellationRequested) + { + return ValueTask.FromCanceled(cancellationToken); + } + + if (buffer.Length == 0 && !_disposed && _authenticated && !_shutdown && !_broken) + { + return default; + } + + if (buffer.Length is > 0 and <= TlsRecordProtector.MaxPlaintext + && _authenticated + && !_disposed + && !_broken + && !_shutdown + && _writeLock.Wait(0, CancellationToken.None)) + { + try + { + WriteLocked(buffer.Span); + return default; + } + finally + { + _writeLock.Release(); + } + } + + return WriteAsyncSlow(buffer, cancellationToken); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private async ValueTask WriteAsyncSlow(ReadOnlyMemory buffer, CancellationToken cancellationToken) + { + ObjectDisposedException.ThrowIf(_disposed, this); + await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + EnsureAuthenticated(); + if (_shutdown) + { + throw new InvalidOperationException(ShutdownWrite); + } + + if (buffer.Length == 0) + { + return; + } + + if (_batchWrites && buffer.Length > TlsRecordProtector.MaxPlaintext) + { + await WriteBatchedAsync(buffer, cancellationToken).ConfigureAwait(false); + return; + } + + ReadOnlyMemory rest = buffer; + while (rest.Length > 0) + { + await SendPendingKeyUpdateAsync(cancellationToken).ConfigureAwait(false); + int count = rest.Length < TlsRecordProtector.MaxPlaintext ? rest.Length : TlsRecordProtector.MaxPlaintext; + int written = _engine!.ProtectApplication(rest.Span[..count], _encrypt); + try + { + await _inner.WriteAsync(_encrypt.AsMemory(0, written), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + + rest = rest[count..]; + } + } + finally + { + _writeLock.Release(); + } + } + + private async Task WriteBatchedAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken) + { + byte[] batch = ArrayPool.Shared.Rent(BatchCapacity); + int used = 0; + try + { + ReadOnlyMemory rest = buffer; + while (rest.Length > 0) + { + if (KeyUpdatePending()) + { + used = await FlushBatchAsync(batch, used, cancellationToken).ConfigureAwait(false); + await SendPendingKeyUpdateAsync(cancellationToken).ConfigureAwait(false); + } + + int count = rest.Length < TlsRecordProtector.MaxPlaintext ? rest.Length : TlsRecordProtector.MaxPlaintext; + if (used + MaxRecordLength > BatchCapacity) + { + used = await FlushBatchAsync(batch, used, cancellationToken).ConfigureAwait(false); + } + + used += _engine!.ProtectApplication(rest.Span[..count], batch.AsSpan(used)); + rest = rest[count..]; + } + + await FlushBatchAsync(batch, used, cancellationToken).ConfigureAwait(false); + } + finally + { + ArrayPool.Shared.Return(batch); + } + } + + private async ValueTask FlushBatchAsync(byte[] batch, int used, CancellationToken cancellationToken) + { + if (used > 0) + { + try + { + await _inner.WriteAsync(batch.AsMemory(0, used), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + } + + return 0; + } + /// + public override void Flush() + { + ObjectDisposedException.ThrowIf(_disposed, this); + _inner.Flush(); + } + + /// + public override Task FlushAsync(CancellationToken cancellationToken) + { + ObjectDisposedException.ThrowIf(_disposed, this); + return _inner.FlushAsync(cancellationToken); + } + + /// + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + /// + public override void SetLength(long value) => throw new NotSupportedException(); + + /// + public override async ValueTask DisposeAsync() + { + if (Interlocked.Exchange(ref _disposeStarted, 1) == 0) + { + _disposed = true; + if (!_leaveInnerOpen) + { + await _inner.DisposeAsync().ConfigureAwait(false); + } + + await _readLock.WaitAsync().ConfigureAwait(false); + await _writeLock.WaitAsync().ConfigureAwait(false); + _engine?.Dispose(); + ReleaseInbound(); + _readLock.Release(); + _writeLock.Release(); + _readLock.Dispose(); + _writeLock.Dispose(); + } + + await base.DisposeAsync().ConfigureAwait(false); + } + + /// + protected override void Dispose(bool disposing) + { + if (disposing && Interlocked.Exchange(ref _disposeStarted, 1) == 0) + { + _disposed = true; + if (!_leaveInnerOpen) + { + _inner.Dispose(); + } + + _readLock.Wait(); + _writeLock.Wait(); + _engine?.Dispose(); + ReleaseInbound(); + _readLock.Release(); + _writeLock.Release(); + _readLock.Dispose(); + _writeLock.Dispose(); + } + + base.Dispose(disposing); + } + + internal void UpdateKeys() + { + if (_engine is not null) + { + _engine.SendKeyUpdate = true; + } + } + + private async Task AuthenticateClientAsync(SslClientAuthenticationOptions options, CancellationToken cancellationToken) + { + await LockBothAsync(cancellationToken).ConfigureAwait(false); + try + { + PrepareClient(options); + await DriveAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + UnlockBoth(); + } + } + + private async Task AuthenticateServerAsync(SslServerAuthenticationOptions? options, TlsServerOptionsSelectionCallback? callback, object? state, CancellationToken cancellationToken) + { + await LockBothAsync(cancellationToken).ConfigureAwait(false); + try + { + PrepareServer(options ?? new SslServerAuthenticationOptions()); + _selectionCallback = callback; + _selectionState = state; + await DriveAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + _selectionCallback = null; + UnlockBoth(); + } + } + + private TlsServerOptionsSelectionCallback? _selectionCallback; + private object? _selectionState; + + private void PrepareClient(SslClientAuthenticationOptions options) + { + if (_engine is not null) + { + throw new InvalidOperationException("The stream is already authenticated."); + } + + TlsAlgorithmPolicy policy = RequirePolicy(); + RequireTls13(options.EnabledSslProtocols); + if (options.CipherSuitesPolicy is not null && !AllowsAes128(options.CipherSuitesPolicy)) + { + throw new AuthenticationException("The cipher suite policy does not include TLS_AES_128_GCM_SHA256."); + } + + _clientOptions = options; + _engine = new TlsEngine(TlsRole.Client, serverName: options.TargetHost, entropy: _options.Entropy, cache: _options.SessionCache) + { + TrustAnchors = _options.TrustAnchors, + LocalCertificate = FirstCertificate(options.ClientCertificates), + ApplicationProtocols = ProtocolNames(options.ApplicationProtocols), + OfferStatusRequest = true, + AlgorithmPolicy = policy, + DeferSealedAlerts = true, + FingerprintProfile = _options.FingerprintProfile, + }; + if (options.LocalCertificateSelectionCallback is { } select) + { + TlsEngine engine = _engine; + X509CertificateCollection localCertificates = options.ClientCertificates ?? new X509CertificateCollection(); + string targetHost = options.TargetHost ?? string.Empty; + engine.ChooseLocalCertificate = issuers => + { + X509Certificate? chosen = select(this, targetHost, localCertificates, engine.RemoteCertificate, issuers ?? []); + return chosen as X509Certificate2; + }; + } + } + + private void PrepareServer(SslServerAuthenticationOptions options) + { + if (_engine is not null) + { + throw new InvalidOperationException("The stream is already authenticated."); + } + + TlsAlgorithmPolicy policy = RequirePolicy(); + RequireTls13(options.EnabledSslProtocols); + _serverOptions = options; + _server = true; + _engine = new TlsEngine(TlsRole.Server, entropy: _options.Entropy, cache: _options.SessionCache) + { + AlgorithmPolicy = policy, + DeferSealedAlerts = true, + }; + } + + private TlsAlgorithmPolicy EffectivePolicy => + FipsEnvironment.IsEnabled() || _options.AlgorithmPolicy == TlsAlgorithmPolicy.FipsApprovedOnly + ? TlsAlgorithmPolicy.FipsApprovedOnly + : TlsAlgorithmPolicy.Default; + + private TlsAlgorithmPolicy RequirePolicy() + { + if (FipsEnvironment.IsEnabled() && !_options.AllowManagedStackUnderFips && !FipsEnvironment.OverrideIsSet()) + { + throw new NotSupportedException( + "The managed TLS stack is disabled while FIPS mode is on. Set TlsStreamOptions.AllowManagedStackUnderFips or TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1."); + } + + return EffectivePolicy; + } + + private void DriveSync() + { + while (_engine!.State != TlsEngineState.Connected) + { + int consumed = Pump(WriteSync); + if (_engine.State == TlsEngineState.Connected) + { + return; + } + + if (consumed == 0 || _inboundUsed >= _inboundCount) + { + FillSync(); + } + } + } + + private async Task DriveAsync(CancellationToken cancellationToken) + { + while (_engine!.State != TlsEngineState.Connected) + { + int consumed = await PumpAsync(cancellationToken).ConfigureAwait(false); + if (_engine.State == TlsEngineState.Connected) + { + return; + } + + if (consumed == 0 || _inboundUsed >= _inboundCount) + { + await FillAsync(cancellationToken).ConfigureAwait(false); + } + } + } + + private int Pump(Action> write) + { + TlsOutput output = _pull; + _engine!.Advance(Unconsumed(), out int consumed, output); + _inboundUsed += consumed; + if (output.Bytes.Length > 0) + { + write(output.Bytes); + } + + WriteDeferredAlert(); + Apply(output, write); + WriteDeferredAlert(); + FinishDrive(); + return consumed; + } + + private async Task PumpAsync(CancellationToken cancellationToken) + { + TlsOutput output = _pull; + _engine!.Advance(Unconsumed(), out int consumed, output); + _inboundUsed += consumed; + if (output.Bytes.Length > 0) + { + await _inner.WriteAsync(output.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + await ApplyAsync(output, cancellationToken).ConfigureAwait(false); + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + FinishDrive(); + return consumed; + } + + private bool _releasedAfterHandshake; + + // The output of a decision the handshake paused for. It is separate from the pump output because + // the pump events are still being walked while the engine resumes. Reused across decisions and + // dropped with the other handshake scratch. + private TlsOutput ResumeOutput() => _resume ??= new TlsOutput(); + + private void FinishDrive() + { + if (_engine!.State == TlsEngineState.Connected) + { + if (!_authenticated) + { + _authenticated = true; + if (_options.KeyLog is not null) + { + _engine.WriteKeyLog(_options.KeyLog); + } + } + + // Once, after the handshake record has been consumed. Later records keep + // the receive and encrypt buffers they rent on first use. + if (!_releasedAfterHandshake) + { + _releasedAfterHandshake = true; + _pull.Release(); + _resume?.Release(); + _resume = null; + _engine.ReleaseIdleBuffers(); + if (_inboundUsed >= _inboundCount) + { + ReleaseInbound(); + } + + _encryptStorage = null; + } + + return; + } + + if (_engine.State == TlsEngineState.Closed) + { + throw new TlsAlertException(_engine.LastLocalAlert, sent: true); + } + } + + private ReadOnlySpan Unconsumed() + { + if (_inboundStorage is null || _inboundUsed >= _inboundCount) + { + return ReadOnlySpan.Empty; + } + + return _inboundStorage.AsSpan(_inboundUsed, _inboundCount - _inboundUsed); + } + + private void FillSync() + { + CompactInbound(); + if (_inboundCount == _inbound.Length) + { + throw new IOException("The TLS record is larger than the receive buffer."); + } + + int read = _inner.Read(_inbound.AsSpan(_inboundCount)); + if (read == 0) + { + throw EndWithoutNotify(); + } + + _inboundCount += read; + } + + private async Task FillAsync(CancellationToken cancellationToken) + { + CompactInbound(); + if (_inboundCount == _inbound.Length) + { + throw new IOException("The TLS record is larger than the receive buffer."); + } + + int read; + try + { + read = await _inner.ReadAsync(_inbound.AsMemory(_inboundCount), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + if (read == 0) + { + throw EndWithoutNotify(); + } + + _inboundCount += read; + } + + private void ReleaseInbound() + { + byte[]? storage = _inboundStorage; + _inboundStorage = null; + if (storage is not null) + { + InboundBufferPool.Return(storage); + } + + _inboundCount = 0; + _inboundUsed = 0; + } + + private void CompactInbound() + { + if (_inboundUsed >= _inboundCount) + { + _inboundCount = 0; + _inboundUsed = 0; + return; + } + + if (_inboundUsed == 0) + { + return; + } + + int rest = _inboundCount - _inboundUsed; + if (rest > 0) + { + Buffer.BlockCopy(_inbound, _inboundUsed, _inbound, 0, rest); + } + + _inboundCount = rest; + _inboundUsed = 0; + } + + private void Apply(TlsOutput output, Action> write) + { + for (int i = 0; i < output.EventCount; i++) + { + TlsEvent ev = output.Event(i); + if (ev.Kind == TlsEventKind.ServerCertificateReceived) + { + TlsOutput resumed = ResumeOutput(); + try + { + TlsCertificateDecision.ThrowIfRejected(_engine!.ServerCertificateErrors, _clientOptions?.RemoteCertificateValidationCallback, this, _engine.RemoteCertificate, _engine.ServerChain); + _engine.Resume(true, resumed); + } + catch (AuthenticationException) + { + _engine!.Resume(false, resumed); + if (resumed.Bytes.Length > 0) + { + write(resumed.Bytes); + } + + WriteDeferredAlert(); + _engine.ReleaseServerCheck(); + throw; + } + + _engine.ReleaseServerCheck(); + if (resumed.Bytes.Length > 0) + { + write(resumed.Bytes); + } + + WriteDeferredAlert(); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.ClientCertificateReceived) + { + TlsOutput resumed = ResumeOutput(); + try + { + TlsCertificateDecision.ThrowIfRejected(_engine!.ClientCertificateErrors, _serverOptions?.RemoteCertificateValidationCallback, this, _engine.RemoteCertificate, _engine.ClientChain); + _engine.Resume(true, resumed); + } + catch (AuthenticationException) + { + _engine!.Resume(false, resumed); + if (resumed.Bytes.Length > 0) + { + write(resumed.Bytes); + } + + WriteDeferredAlert(); + _engine.ReleaseClientCheck(); + throw; + } + + _engine.ReleaseClientCheck(); + if (resumed.Bytes.Length > 0) + { + write(resumed.Bytes); + } + + WriteDeferredAlert(); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.ClientHelloReceived) + { + if (_selectionCallback is not null) + { + throw new InvalidOperationException("The selection callback requires AuthenticateAsServerAsync."); + } + + TlsOutput resumed = ResumeOutput(); + _engine!.Resume(_ => BuildSelection(_serverOptions!), resumed); + if (resumed.Bytes.Length > 0) + { + write(resumed.Bytes); + } + + WriteDeferredAlert(); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.PeerAlert) + { + throw new TlsAlertException(ev.Alert, sent: false); + } + } + } + + private async Task ApplyAsync(TlsOutput output, CancellationToken cancellationToken) + { + for (int i = 0; i < output.EventCount; i++) + { + TlsEvent ev = output.Event(i); + if (ev.Kind == TlsEventKind.ServerCertificateReceived) + { + TlsOutput resumed = ResumeOutput(); + try + { + TlsCertificateDecision.ThrowIfRejected(_engine!.ServerCertificateErrors, _clientOptions?.RemoteCertificateValidationCallback, this, _engine.RemoteCertificate, _engine.ServerChain); + _engine.Resume(true, resumed); + } + catch (AuthenticationException) + { + _engine!.Resume(false, resumed); + if (resumed.Bytes.Length > 0) + { + await _inner.WriteAsync(resumed.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + _engine.ReleaseServerCheck(); + throw; + } + + _engine.ReleaseServerCheck(); + if (resumed.Bytes.Length > 0) + { + await _inner.WriteAsync(resumed.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.ClientCertificateReceived) + { + TlsOutput resumed = ResumeOutput(); + try + { + TlsCertificateDecision.ThrowIfRejected(_engine!.ClientCertificateErrors, _serverOptions?.RemoteCertificateValidationCallback, this, _engine.RemoteCertificate, _engine.ClientChain); + _engine.Resume(true, resumed); + } + catch (AuthenticationException) + { + _engine!.Resume(false, resumed); + if (resumed.Bytes.Length > 0) + { + await _inner.WriteAsync(resumed.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + _engine.ReleaseClientCheck(); + throw; + } + + _engine.ReleaseClientCheck(); + if (resumed.Bytes.Length > 0) + { + await _inner.WriteAsync(resumed.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.ClientHelloReceived) + { + if (_selectionCallback is not null) + { + string name = _engine!.ClientHello?.ServerName ?? string.Empty; + SslServerAuthenticationOptions chosen = await _selectionCallback(this, new SslClientHelloInfo(name, SslProtocols.Tls13), _selectionState, cancellationToken).ConfigureAwait(false); + _serverOptions = chosen; + } + + TlsOutput resumed = ResumeOutput(); + _engine!.Resume(_ => BuildSelection(_serverOptions!), resumed); + if (resumed.Bytes.Length > 0) + { + await _inner.WriteAsync(resumed.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + NoteCompleted(resumed); + } + else if (ev.Kind == TlsEventKind.PeerAlert) + { + throw new TlsAlertException(ev.Alert, sent: false); + } + } + } + + private void SealDeferredAlertSync() + { + if (_engine is not { HasDeferredAlert: true }) + { + return; + } + + _writeLock.Wait(); + try + { + WriteDeferredAlert(); + } + finally + { + _writeLock.Release(); + } + } + + private async Task SealDeferredAlertAsync(CancellationToken cancellationToken) + { + if (_engine is not { HasDeferredAlert: true }) + { + return; + } + + await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + await WriteDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + } + finally + { + _writeLock.Release(); + } + } + + // The handshake already holds the write lock. Taking it again deadlocks, + // so the alert never reaches the socket. + private void WriteDeferredAlert() + { + if (_engine is not { HasDeferredAlert: true }) + { + return; + } + + int written = _engine.ProtectAlert(2, _engine.LastLocalAlert, _encrypt); + _engine.ClearDeferredAlert(); + _inner.Write(_encrypt.AsSpan(0, written)); + } + + private async Task WriteDeferredAlertAsync(CancellationToken cancellationToken) + { + if (_engine is not { HasDeferredAlert: true }) + { + return; + } + + int written = _engine.ProtectAlert(2, _engine.LastLocalAlert, _encrypt); + _engine.ClearDeferredAlert(); + try + { + await _inner.WriteAsync(_encrypt.AsMemory(0, written), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + } + + private void NoteCompleted(TlsOutput output) + { + for (int i = 0; i < output.EventCount; i++) + { + if (output.Event(i).Kind == TlsEventKind.HandshakeCompleted) + { + _authenticated = true; + if (_options.KeyLog is not null) + { + _engine!.WriteKeyLog(_options.KeyLog); + } + + _engine!.ReleaseIdleBuffers(); + } + } + } + + private void PullSync() + { + ThrowIfBroken(); + while (_engine!.PlaintextAvailable == 0 && !_readClosed && _engine.State != TlsEngineState.Closed) + { + if (_inboundUsed >= _inboundCount) + { + FillSync(); + } + + _pull.Clear(); + _engine.Advance(Unconsumed(), out int consumed, _pull); + _inboundUsed += consumed; + if (_pull.Bytes.Length > 0) + { + _inner.Write(_pull.Bytes); + } + + SealDeferredAlertSync(); + NoteReadEvents(_pull); + TrySendKeyUpdateFromReaderSync(); + if (consumed == 0 && _engine.PlaintextAvailable == 0 && !_readClosed) + { + FillSync(); + } + } + } + + private async Task PullAsync(CancellationToken cancellationToken) + { + ThrowIfBroken(); + while (_engine!.PlaintextAvailable == 0 && !_readClosed && _engine.State != TlsEngineState.Closed) + { + if (_inboundUsed >= _inboundCount) + { + await FillAsync(cancellationToken).ConfigureAwait(false); + } + + _pull.Clear(); + _engine.Advance(Unconsumed(), out int consumed, _pull); + _inboundUsed += consumed; + if (_pull.Bytes.Length > 0) + { + await _inner.WriteAsync(_pull.WrittenMemory, cancellationToken).ConfigureAwait(false); + } + + if (_engine.HasDeferredAlert) + { + await SealDeferredAlertAsync(cancellationToken).ConfigureAwait(false); + } + + NoteReadEvents(_pull); + if (_engine.KeyUpdateResponseNeeded) + { + await TrySendKeyUpdateFromReaderAsync(cancellationToken).ConfigureAwait(false); + } + + if (consumed == 0 && _engine.PlaintextAvailable == 0 && !_readClosed) + { + await FillAsync(cancellationToken).ConfigureAwait(false); + } + } + } + + private void WaitForRecordSync() + { + if (_engine!.PlaintextAvailable > 0 || _readClosed) + { + return; + } + + PullSync(); + } + + private async Task WaitForRecordAsync(CancellationToken cancellationToken) + { + if (_engine!.PlaintextAvailable > 0 || _readClosed) + { + return; + } + + await PullAsync(cancellationToken).ConfigureAwait(false); + } + + private void NoteReadEvents(TlsOutput output) + { + for (int i = 0; i < output.EventCount; i++) + { + TlsEvent ev = output.Event(i); + if (ev.Kind == TlsEventKind.PeerAlert) + { + if (ev.Alert == 0) + { + _readClosed = true; + return; + } + + throw new IOException("The remote party sent TLS alert " + ev.Alert + ".", new TlsAlertException(ev.Alert, sent: false)); + } + } + + if (_engine!.State == TlsEngineState.Closed && !_readClosed) + { + throw ClosedAlert(output); + } + } + + private void WriteLocked(ReadOnlySpan buffer) + { + EnsureAuthenticated(); + if (_shutdown) + { + throw new InvalidOperationException(ShutdownWrite); + } + + if (buffer.Length == 0) + { + return; + } + + if (_batchWrites && buffer.Length > TlsRecordProtector.MaxPlaintext) + { + WriteBatchedLocked(buffer); + return; + } + + ReadOnlySpan rest = buffer; + while (rest.Length > 0) + { + SendPendingKeyUpdateSync(); + int count = rest.Length < TlsRecordProtector.MaxPlaintext ? rest.Length : TlsRecordProtector.MaxPlaintext; + int written = _engine!.ProtectApplication(rest[..count], _encrypt); + _inner.Write(_encrypt.AsSpan(0, written)); + rest = rest[count..]; + } + } + + /// + /// A write that spans several records over a socket stream, where each transport write is a system call, seals up to of them into one rented buffer and hands that to the transport in one call. + /// A pending key update flushes the batch first, so the records leave in the order they were sealed. + /// + private void WriteBatchedLocked(ReadOnlySpan buffer) + { + byte[] batch = ArrayPool.Shared.Rent(BatchCapacity); + int used = 0; + try + { + ReadOnlySpan rest = buffer; + while (rest.Length > 0) + { + if (KeyUpdatePending()) + { + FlushBatchSync(batch, ref used); + SendPendingKeyUpdateSync(); + } + + int count = rest.Length < TlsRecordProtector.MaxPlaintext ? rest.Length : TlsRecordProtector.MaxPlaintext; + if (used + MaxRecordLength > BatchCapacity) + { + FlushBatchSync(batch, ref used); + } + + used += _engine!.ProtectApplication(rest[..count], batch.AsSpan(used)); + rest = rest[count..]; + } + + FlushBatchSync(batch, ref used); + } + finally + { + ArrayPool.Shared.Return(batch); + } + } + + private void FlushBatchSync(byte[] batch, ref int used) + { + if (used > 0) + { + int length = used; + used = 0; + _inner.Write(batch.AsSpan(0, length)); + } + } + + private bool KeyUpdatePending() => _engine!.KeyUpdateResponseNeeded || _engine.WriteKeyUpdateDue || _engine.SendKeyUpdate; + + private void SendPendingKeyUpdateSync() + { + if (_engine!.KeyUpdateResponseNeeded || _engine.WriteKeyUpdateDue || _engine.SendKeyUpdate) + { + byte request = _engine.KeyUpdateResponseNeeded ? (byte)0 : (byte)1; + int written = _engine.ProtectKeyUpdate(request, _encrypt); + _engine.SendKeyUpdate = false; + _inner.Write(_encrypt.AsSpan(0, written)); + } + } + + private async Task SendPendingKeyUpdateAsync(CancellationToken cancellationToken) + { + if (_engine!.KeyUpdateResponseNeeded || _engine.WriteKeyUpdateDue || _engine.SendKeyUpdate) + { + byte request = _engine.KeyUpdateResponseNeeded ? (byte)0 : (byte)1; + int written = _engine.ProtectKeyUpdate(request, _encrypt); + _engine.SendKeyUpdate = false; + try + { + await _inner.WriteAsync(_encrypt.AsMemory(0, written), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + } + } + + private void TrySendKeyUpdateFromReaderSync() + { + if (!_engine!.KeyUpdateResponseNeeded) + { + return; + } + + _writeLock.Wait(); + try + { + if (_shutdown || !_engine.KeyUpdateResponseNeeded) + { + return; + } + + int written = _engine.ProtectKeyUpdate(0, _encrypt); + _inner.Write(_encrypt.AsSpan(0, written)); + } + finally + { + _writeLock.Release(); + } + } + + private async Task TrySendKeyUpdateFromReaderAsync(CancellationToken cancellationToken) + { + if (!_engine!.KeyUpdateResponseNeeded) + { + return; + } + + await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + if (_shutdown || !_engine.KeyUpdateResponseNeeded) + { + return; + } + + int written = _engine.ProtectKeyUpdate(0, _encrypt); + try + { + await _inner.WriteAsync(_encrypt.AsMemory(0, written), cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + _broken = true; + throw; + } + } + finally + { + _writeLock.Release(); + } + } + + private void WriteSync(ReadOnlySpan bytes) + { + _inner.Write(bytes); + } + + private TlsServerSelection BuildSelection(SslServerAuthenticationOptions options) + { + X509Certificate2 certificate = CertificateOf(options) ?? throw new InvalidOperationException("A server certificate is required."); + string[]? protocols = ProtocolNames(options.ApplicationProtocols); + ushort[]? ciphers = _options.CipherSuites ?? CipherIds(options.CipherSuitesPolicy); + return new TlsServerSelection + { + Certificate = certificate, + ApplicationProtocols = protocols, + RequireApplicationProtocol = protocols is { Length: > 0 }, + RequestClientCertificate = options.ClientCertificateRequired || _options.RequestClientCertificate, + RequireClientCertificate = options.ClientCertificateRequired, + ClientCertificateCallback = options.RemoteCertificateValidationCallback, + ClientTrustAnchors = _options.ClientTrustAnchors, + Groups = _options.Groups, + CipherSuites = ciphers, + PreferServerCipherOrder = _options.CipherSuites is not null, + Tickets = _options.Tickets, + }; + } + + private static X509Certificate2? CertificateOf(SslServerAuthenticationOptions options) + { + if (options.ServerCertificate is X509Certificate2 certificate) + { + return certificate; + } + + return options.ServerCertificateContext?.TargetCertificate; + } + + private static X509Certificate2? FirstCertificate(X509CertificateCollection? certificates) + { + if (certificates is null) + { + return null; + } + + foreach (X509Certificate certificate in certificates) + { + if (certificate is X509Certificate2 current && current.HasPrivateKey) + { + return current; + } + } + + return null; + } + + private static string[]? ProtocolNames(System.Collections.Generic.List? protocols) + { + if (protocols is null || protocols.Count == 0) + { + return null; + } + + var names = new string[protocols.Count]; + for (int i = 0; i < protocols.Count; i++) + { + names[i] = System.Text.Encoding.ASCII.GetString(protocols[i].Protocol.Span); + } + + return names; + } + + private static ushort[]? CipherIds(CipherSuitesPolicy? policy) + { + if (policy is null) + { + return null; + } + + var ids = new System.Collections.Generic.List(); + try + { +#pragma warning disable CA1416 + foreach (TlsCipherSuite suite in policy.AllowedCipherSuites) + { + ushort id = (ushort)suite; + if (id is 0x1301 or 0x1302 or 0x1303) + { + ids.Add(id); + } + } +#pragma warning restore CA1416 + } + catch (PlatformNotSupportedException) + { + return null; + } + + return ids.ToArray(); + } + + private static bool AllowsAes128(CipherSuitesPolicy policy) + { + try + { +#pragma warning disable CA1416 + foreach (TlsCipherSuite suite in policy.AllowedCipherSuites) + { + if (suite == TlsCipherSuite.TLS_AES_128_GCM_SHA256) + { + return true; + } + } +#pragma warning restore CA1416 + } + catch (PlatformNotSupportedException) + { + return true; + } + + return false; + } + + private static void RequireTls13(SslProtocols protocols) + { + if (protocols != SslProtocols.None && (protocols & SslProtocols.Tls13) == 0) + { + throw new TlsVersionNotSupportedException(); + } + } + + private void EnsureAuthenticated() + { + ThrowIfBroken(); + if (!_authenticated || _engine is null) + { + throw new InvalidOperationException(AuthenticatedContext); + } + } + + private void ThrowIfBroken() + { + if (_broken) + { + throw new IOException("The stream can no longer be used after a cancelled operation."); + } + } + + private IOException EndWithoutNotify() + { + _broken = true; + return new IOException(_options.StrictCloseNotify + ? "The remote party closed the connection without a close_notify alert." + : "The remote party closed the connection without a close_notify alert."); + } + + private IOException ClosedAlert(TlsOutput output) + { + for (int i = 0; i < output.EventCount; i++) + { + TlsEvent ev = output.Event(i); + if (ev.Kind == TlsEventKind.PeerAlert) + { + if (ev.Alert == 0) + { + _readClosed = true; + return new IOException("The remote party closed the connection."); + } + + return new IOException("The remote party sent TLS alert " + ev.Alert + ".", new TlsAlertException(ev.Alert, sent: false)); + } + } + + if (_engine!.LastLocalAlert != 0) + { + return new IOException("The handshake failed.", new TlsAlertException(_engine.LastLocalAlert, sent: true)); + } + + return new IOException("The handshake failed."); + } + + private void LockBoth() + { + _readLock.Wait(); + try + { + _writeLock.Wait(); + } + catch + { + _readLock.Release(); + throw; + } + } + + private async Task LockBothAsync(CancellationToken cancellationToken) + { + await _readLock.WaitAsync(cancellationToken).ConfigureAwait(false); + try + { + await _writeLock.WaitAsync(cancellationToken).ConfigureAwait(false); + } + catch + { + _readLock.Release(); + throw; + } + } + + private void UnlockBoth() + { + _writeLock.Release(); + _readLock.Release(); + } +} diff --git a/src/Titanium.Tls/TlsStreamOptions.cs b/src/Titanium.Tls/TlsStreamOptions.cs new file mode 100644 index 000000000..662aa1d85 --- /dev/null +++ b/src/Titanium.Tls/TlsStreamOptions.cs @@ -0,0 +1,53 @@ +using System.Security.Cryptography.X509Certificates; + +namespace Titanium.Tls; + +/// Options the BCL authentication types do not carry. +public sealed class TlsStreamOptions +{ + /// The ClientHello profile. The engine hello does not use it yet; still reports it. + public TlsFingerprintProfile? FingerprintProfile { get; set; } + + /// When true, a transport end without close_notify throws. The default matches SslStream and also throws. + public bool StrictCloseNotify { get; set; } + + /// Optional NSS key log. Leave null except while debugging. + public ITlsKeyLogSink? KeyLog { get; set; } + + /// Algorithms the handshake may offer or select. keeps the ordinary set. + public TlsAlgorithmPolicy AlgorithmPolicy { get; set; } + + /// + /// Allows authentication while FIPS mode is on. Without it, and without TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1, + /// authentication throws . + /// + public bool AllowManagedStackUnderFips { get; set; } + + internal ITlsSessionCache? SessionCache { get; set; } + + internal IEntropySource? Entropy { get; set; } + + internal X509Certificate2Collection? TrustAnchors { get; set; } + + internal NamedGroup[]? Groups { get; set; } + + internal ushort[]? CipherSuites { get; set; } + + internal ITicketProtector? Tickets { get; set; } + + internal bool RequestClientCertificate { get; set; } + + internal X509Certificate2Collection? ClientTrustAnchors { get; set; } +} + +/// Selects server authentication options after the ClientHello arrives. +/// The stream that received the hello. +/// The server name and the protocols the stack offered. +/// The state passed to . +/// Cancels the selection. +/// The options used for the rest of the handshake. +public delegate System.Threading.Tasks.ValueTask TlsServerOptionsSelectionCallback( + TlsStream stream, + System.Net.Security.SslClientHelloInfo hello, + object? state, + System.Threading.CancellationToken cancellationToken); diff --git a/src/Titanium.Tls/TlsVersionNotSupportedException.cs b/src/Titanium.Tls/TlsVersionNotSupportedException.cs new file mode 100644 index 000000000..de378a5aa --- /dev/null +++ b/src/Titanium.Tls/TlsVersionNotSupportedException.cs @@ -0,0 +1,13 @@ +using System.Security.Authentication; + +namespace Titanium.Tls; + +/// The peer selected a TLS version below 1.3. +public sealed class TlsVersionNotSupportedException : AuthenticationException +{ + /// Creates the exception. + public TlsVersionNotSupportedException() + : base("The remote party selected a TLS version below 1.3.") + { + } +} diff --git a/src/Titanium.Tls/design/BUG-LEDGER.md b/src/Titanium.Tls/design/BUG-LEDGER.md new file mode 100644 index 000000000..c68d09c68 --- /dev/null +++ b/src/Titanium.Tls/design/BUG-LEDGER.md @@ -0,0 +1,32 @@ +One row per bug found by the Part K campaigns. A row stays until the fix commit and the regression test both exist. + +| Id | Date | Technique | Symptom | Root cause | Severity | Fix | Regression | +| --- | --- | --- | --- | --- | --- | --- | --- | +| BH1-1 | 2026-11-27 | Flipped application record | The exception named a ciphertext byte as the alert description | `ClosedAlert` read the last byte of the record it had just written | major | `91d5a39e` | `ChunkingChaosTests.CampaignSelfTestCatchesAFlippedRecord` | +| BH1-2 | 2026-11-27 | OpenSSL hello oracle | A zero-length application record before the handshake stayed open | The empty-record cap ran before the state check, so the first 32 were ignored | minor | this change | `EngineTests.EmptyApplicationRecordBeforeTheHandshakeIsRejected` | + +## What has run + +`SeededSampleAgreesWithOpenSsl` draws a seeded sample (`TITANIUM_FUZZ_SEED`, default 8446; `TITANIUM_FUZZ_HANDSHAKES`, default 500). The nightly budget of 10,000, seed 8446, agreed with OpenSSL 3.5.9 on every draw and took 1 hour 44 minutes. Managed-client draws stay inside what that client can complete: AES-128-GCM, X25519 or P-256, and an ECDSA P-256 certificate. Managed-server draws cover the cipher, group, certificate, ALPN, client authentication, and HelloRetryRequest choices. Each draw must carry 32 bytes both ways. + +`ChunkingChaosTests` reads and writes through one-byte and three-byte fragments, including a 16,384-byte record and an empty write. `RandomInputsDoNotThrow` feeds 200 buffers from seed 8446 to `TlsFuzzTarget` and requires that they do not throw. Those buffers are not compared with OpenSSL. + +`MutatedClientHelloAgreesWithOpenSsl` compares this server with OpenSSL 3.5.9 `s_server` on an intact ClientHello, a truncated hello, a zero-length application record, 33 of those records, a handshake type of 11, a supported_versions list that contains only TLS 1.2, a duplicated first extension, and an extension length of 0x7FFF. Both sides accept, both reject with the same alert, or both keep the connection open when the record is incomplete. `BoundaryLimitTests` parses certificate lists of 0, 1, and 100 entries. `SequenceNearOverflowRejectsTheNextRecord` rejects the record after `ulong.MaxValue - 1`. + +`ScalarMultTimingDoesNotSeparateFixedFromRandom` and the four allocation gates ran on this PC, linuxmini, and macmini. The numbers are in `PROGRESS.md`. Welch's t was 0.31, 0.20, and 0.86. + +Stryker 5.1.0, Standard, Debug, four workers, scored the thirteen handshake, codec, key schedule, and record files. The run excluded `Slow`, `TimingSideChannel`, `TlsInteropTests`, `HandshakeOracleTests`, and `ScalarMultStaysUnderTheRegressionCeiling`. It tested 2417 mutants. The score is 70.06 percent: 1880 killed, 109 timed out, 428 survived, and 422 with no coverage. Timeouts count as detected. No-coverage mutants stay in the denominator. + +One hundred mutants are ignored as equivalent. Fifty-six are a byte stored from a shift: an unsigned shift matches the arithmetic shift for a non-negative value, and a left shift cast to that byte is zero while the value stays under the shift width. Thirty-three wipe a temporary after its bytes have been copied and are not read again. Eleven are a `return` after a handshake-type test whose following conditions do not match that type. The comments naming those reasons sit on the statements. + +The assertions that killed the rest of the length mutants are `HandshakeCodecTests.MultiByteLengthsRoundTrip`, `HandshakeCodecTests.LengthAtTheCapIsDistinctFromOnePastIt`, `ClientHandshakeTests.HelloRetryForAnUnlistedGroupIsIllegal`, `ClientHandshakeTests.ClientHelloEncodesWideServerNameAndProtocolList`, and `ClientHandshakeTests.PreSharedKeyEncodesAWideIdentityAndAge`. + +The 428 survivors stay for the phase report. They fall into four groups. An unsigned shift of a non-negative length shares its statement with a killed left shift, so that statement stays in the score. Peer parsers for a group id, a selected PSK index, and a ticket timestamp still see a zero high byte in this suite. `Dispose` and the wipes of `_psk` and `ticket.Psk` have no assertion after they run. `TlsEngine.Traffic.cs` (42.34 percent), `TlsEngine.cs` (63.69 percent), and `TlsEngine.Server.cs` (65.34 percent) are the files under 70 percent; the thirteen files together are 70.06 percent. + +`SoakTests.ThirtyMinutesOfHandshakesStayBounded` ran for 30 minutes. Completed exchanges, a one-byte abort, a reset after the ClientHello, and a one-byte-per-second hello all finished without an escaped exception. In flight stayed at or under 200, which is the test's cap: the engine has no handshake limiter to enforce. `ArrayPool.Shared` does not publish a rent count, so the pool balance is not a number in this run. After a forced collection the managed heap was within 32 MiB of the baseline taken once four warm handshakes had completed. + +`RealPeerTests.ManagedClientHandshakesWellKnownHosts`, with `TITANIUM_REAL_PEERS=1`, handshook five hosts on port 443 and no other port. `www.cloudflare.com`, `www.google.com`, `github.com`, and `www.wikipedia.org` completed with `TLS_AES_128_GCM_SHA256` and `http/1.1`. `www.microsoft.com` sent alert 40. OpenSSL 3.5.9 with only `ecdsa_secp256r1_sha256`, X25519, P-256, and AES-128-GCM-SHA256 gets that same alert, and a normal OpenSSL client completes TLS 1.3 there. The failure is the client's existing signature offer, recorded in `PARITY-DIFFS.md`, not a new defect. + +The three-machine gate ran in Release with `TITANIUM_REQUIRE_ORACLE=1` and `TestCategory!=Slow`. This PC passed 202 and skipped 0, including the 900 µs ceiling test. macmini passed 190 and skipped 12 (five platform TLS 1.3 peers, seven ML-KEM tests). linuxmini passed 201 and failed one assertion; that test was corrected to catch `CryptographicException` and then passed on its own. No open blocker or major remains from the eight campaigns. + +The C7 review then found one blocker and seven majors in the library, after those campaigns. They are fixed and covered by `RequiredClientCertificateRejectsAnEmptyList`, `RequestedClientCertificateDoesNotResume`, `ClientCertificatePausesForTheCallback`, `SelectedProtocolMustBeOneOfferedName`, `WideTicketStillProducesAConsistentClientHello`, `OversizedTicketIsDroppedInsteadOfCorruptingTheHello`, `RepeatingOneTicketDoesNotGrowTheCacheQueue`, `NinthNewSessionTicketIsNotStored`, and `CertificateListPastOneHundredIsDecodeError`. A certificate list of 100 entries still parses. The handshake buffers wait for the first byte; that does not by itself meet the idle-memory gate. diff --git a/src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md b/src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md new file mode 100644 index 000000000..7ba7f915d --- /dev/null +++ b/src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md @@ -0,0 +1,12 @@ +One tlsfuzzer script, a TLS-Anvil feature scan, one state-machine template, one h3spec run, one QUIC handshake interop run, and one BoGo TLS 1.3 server slice have been completed. A missing run is not a pass. A suite stays advisory until it has been stable for a week and the user agrees to make it blocking. + +| Suite | State | Reason | +| --- | --- | --- | +| BoGo TLS 1.3 server slice | 49 passed, 248 failed, 7821 unimplemented | BoringSSL `a003590712db258f80de823b660ee788589c98cf`. The shim connects to loopback, writes the 8-byte shim id, authenticates as a TLS 1.3 server, and XOR-echoes application data. It exits 89 for a client role, DTLS, QUIC, resumption, or any other flag outside that slice. Of the 248 failures, 128 are unexpected errors (both sides failed, and the shim stderr is not the BoringSSL error string; `Alert` received alert 22, which is record overflow), 107 are unexpected failures (the exchange did not succeed; many are older-version server tests, and the shim sends alert 70 because it only implements TLS 1.3), and 13 are unexpected successes. Those 13 completed a handshake the runner expected the server to reject: `DuplicateCertCompressionExt-TLS13`, `DuplicateKeyShares-TLS13`, `ExtensionTrailingData-CertificateAuthorities-Server-TLS-TLS13`, `ExtensionTrailingData-ServerName-Server-TLS-TLS13`, `ExtensionTrailingData-TrustAnchors-ClientHello-Server-TLS-TLS13`, `PAKE-Extension-Duplicate`, `RejectEmptyCertificateAuthorities-Server-TLS-TLS13`, `ServerCertificateType-Server-RejectsDefaultOnly-TLS13`, `TrailingKeyShareData-TLS13`, `TrustAnchors-Empty-ClientHello`, `TrustAnchors-NonMinimalComponent-ClientHello`, `TrustAnchors-TooLong-ClientHello`, and `TrustAnchors-TruncatedComponent-ClientHello`. | +| tlsfuzzer `test-tls13-conversation.py` sanity | fail | The script sends a ClientHello in a record whose legacy version is `0x0300`. The probe rejects that record with alert 10 (`unexpected_message`) before ServerHello. Three sanity attempts failed the same way. OpenSSL 3.5.9 sends record version `0x0301` and completes TLS 1.3 with `TLS_AES_256_GCM_SHA384` against the same probe. | +| TLS-Anvil feature scan | recorded | Against the loopback probe, image `ghcr.io/tls-attacker/tlsanvil:latest` reported TLS 1.3, groups X25519, secp256r1, and secp384r1, and ciphers `TLS_AES_128_GCM_SHA256`, `TLS_AES_256_GCM_SHA384`, and `TLS_CHACHA20_POLY1305_SHA256`. The scan took about 4.5 minutes. A metadata tag and the test id both scheduled 0 templates. The package `both.tls13.rfc8446` scheduled 27 server templates at strength 1. That run was stopped during the first template, so those templates have no pass or fail result. | +| TLS-Anvil `sendEmptyRecordFinished` | scored succeeded | Package `both.tls13.statemachine` schedules this one server template. The first strength-1 run failed all 14 cases in 7 minutes 44 seconds: the handshake held the write lock and then waited on that same lock to flush the alert, so no alert arrived and the socket stayed open. After the handshake writes the alert without taking the lock again, a re-run scored the template `STRICTLY_SUCCEEDED` in under a second. The five cases still say the tool did not parse a fatal alert. The probe log for those connections shows local alert 10. The score is not a clean pass. | +| h3spec 0.1.15 | 77 failures, 5 pending | The loopback probe listens with the managed QUIC stack, offers `h3`, and answers a request with status 200 and body `ok`. The tool reported 86 examples, 77 failures, and 5 pending in 164 seconds. Four checks passed: a large stream offset, a stream id past the limit, a missing `initial_source_connection_id`, and an `original_destination_connection_id`. The pending cases are 0-RTT, which the probe does not offer, and four extra unidirectional streams, which the tool says the server does not allow beyond the three a client needs. The failures are the cases that require a specific connection error. The probe does not implement those errors. | +| QUIC interop handshake | passed | The server speaks HTTP/0.9 on ALPN `hq-interop` and reads files from a directory. It binds loopback only. The quic-go interop client, image `martenseemann/quic-go-interop` digest `sha256:ae4b763aa4f6684d661248e475027d55b7bd72b33320aeaaccbc3a9c9fef8472`, with `TESTCASE=handshake`, downloaded a 64-byte file and then that file plus a 1000-byte file. Both client runs exited 0. The SHA-256 of the 64-byte file matched. The full runner matrix, the network simulator, and the other test cases are not this job. | + +`mutation.yml` names only the configuration project. The managed projects were not added, and the mutation score was not re-run. diff --git a/src/Titanium.Tls/design/CONSULT-LOG.md b/src/Titanium.Tls/design/CONSULT-LOG.md new file mode 100644 index 000000000..e5c25878f --- /dev/null +++ b/src/Titanium.Tls/design/CONSULT-LOG.md @@ -0,0 +1,13 @@ +Earlier reviews are recorded in `SELF-REVIEW.md`. This log is the Phase 1 gate consult. + +## C7 + +One read-only whole-library review of `src/Titanium.Tls`, asked for blockers around the state machine, parsing, secret handling, timing, DoS caps, and resumption. + +One blocker: a required client certificate was not enforced, and resumption skipped the request. Seven majors: the server ignored `RemoteCertificateValidationCallback` and did not expose the client certificate; a peer-triggered alert was encrypted on the reader thread; the client accepted any server ALPN; a large ticket or cookie could truncate the next ClientHello and stay cached; repeating one cache key grew the eviction queue; a certificate list was uncapped before chain building; every engine allocated the maximum handshake buffers up front. + +Applied as described in `SELF-REVIEW.md`. The certificate-list cap is 100, not 10 to 16, because `CertificateListsOfZeroOneAndOneHundredParse` already treats 100 as legal. The idle-memory gate was not re-measured. No second consult. + +## P3.6 handler roadblock + +2026-11-28 | P3.6-h3-handshake | Why the managed HTTP/3 client finishes against loopback Kestrel and against a platform listener with ALPN `test`, and the same client fails against the proxy platform HTTP/3 listener before the handshake completes; whether the measured HTTP/1.1 gap versus `SocketsHttpHandler` is the plan gate | `QuicClientHandler.cs` 146-218 and 487-607, `ManagedQuicConnection.cs` 70-117, `Http3Client.cs` 26-147, `QuicInteropTests.cs` 77-150, `HandlerHttp3ProxyTests.cs` | approve with changes | Recorded the measurement and the handshake failure in `src/Titanium.Quic/design/PROGRESS.md`. The peer close was transport `0x128`, frame `0x0`, TLS alert 40. The short hello offered only `ecdsa_secp256r1_sha256` while the proxy leaf is RSA-2048. The hello now also offers `ecdsa_secp384r1_sha384`, `rsa_pss_rsae_sha256`, and `rsa_pss_rsae_sha384`, and it rejects a cipher it did not offer. The proxy HTTP/3 GET and POST then passed on linuxmini. | The zero-unidirectional-stream and zero-timeout hypotheses do not match the defaults: the client allows 16 inbound unidirectional streams, and the proxy endpoint uses a 30 second handshake timeout, a 60 second idle timeout, and at least 3 inbound unidirectional streams. The 90 percent HTTP/1.1 gate stays the handler against plain `SocketsHttpHandler`. The first small-GET sample was about 66 to 69 percent of the platform request rate and about 2.2 times the allocated bytes, and a 64 KiB body was about 68 to 85 percent of the request rate and about 1.02 times the bytes. Later samples are in `src/Titanium.Quic/design/PROGRESS.md`. The gate is still missed. The Windows early return stays, because that run must not open the platform listener. diff --git a/src/Titanium.Tls/design/DESIGN.md b/src/Titanium.Tls/design/DESIGN.md new file mode 100644 index 000000000..1f378d48f --- /dev/null +++ b/src/Titanium.Tls/design/DESIGN.md @@ -0,0 +1,41 @@ +The managed stack is a TLS 1.3 and QUIC v1 implementation that TWP and a standalone `HttpClient` can opt into. Crypto and protocol logic are synchronous and do not perform I/O. `TlsStream` and, later, the QUIC drivers are the only places that wait. + +## Names + +Public names follow the protocol and mirror the BCL type they stand in for. `TlsStream` stands in for `SslStream`. QUIC types keep a `Managed` prefix (`ManagedQuicConnection`, `ManagedQuicListener`, `ManagedQuicStream`) because `System.Net.Quic` already exports the plain names and TWP imports that namespace. A guard test fails if a public simple name collides with `System.Net.Security`, `System.Net.Quic`, `System.Net.Sockets`, or `System.Security.Authentication`. + +`SslClientHelloInfo` has a public constructor, so the managed stack can construct it. The QUIC listener callback cannot, because it takes a sealed `QuicConnection`. That callback is `ManagedQuicConnectionOptionsCallback`. + +## Ownership + +Handshake messages and extensions are span codecs. A known extension on the wrong message is `illegal_parameter`, an unknown extension is retained, and a duplicate of either is `illegal_parameter`. `TlsEngine` owns the role and the handshake state. The client owns one `TlsKeySchedule`, one `TranscriptStore`, and a read and a write record protector. It is sans-IO: `Advance` takes bytes and returns bytes to send plus events. Events that need the caller (`ClientHelloReceived`, `ServerCertificateReceived`) pause the engine. The caller does the async work and then calls `Resume`. The client checks ServerHello, HelloRetryRequest, the certificate chain and hostname, CertificateVerify, and Finished, then installs application keys. A stapled OCSP response is copied onto the certificate check and is not passed to `X509Chain`, which cannot consume one. The server pauses on ClientHello. The callback supplies the certificate and the selection, and Resume writes the flight. No cryptographic method returns a `Task` or `ValueTask`. + +`TlsStream` owns the inner `Stream`, the pooled receive buffer, and the engine. Read and write run on the caller's continuation. There is no pipe, no channel, and no extra thread per connection. + +Secrets live in `SecretBuffer` (pinned, zeroed on dispose). A stage transition in `TlsKeySchedule` zeroes the secret it consumes. Short-lived key material uses `stackalloc` and `CryptographicOperations.ZeroMemory`. Secrets are not stored in strings, lists, or async state machines. + +## Threading + +The engine is not thread-safe. `TlsStream` will serialize reads with one lock and writes with another, matching a full-duplex `SslStream`. Crypto runs on the caller. `CryptoExecutionPolicy` marks online revocation and a non-software private key for offload. The engine does not hop threads; certificate validation performs that hop. + +## Fingerprints + +A profile is data. `TlsFingerprintProfile` is the public abstract type. `ChromeFingerprintProfile` is the only profile this plan ships, and it is a thin subclass over an internal template. `ClientHelloTemplate` stays internal until a second browser lands. No code outside `Fingerprint/Profiles/Chrome*.cs` may mention Chrome. Adding another browser later is a template, captures, and tests. A template entry is either implemented or advertised-only. The engine aborts if a server selects an advertised-only item. + +Chrome 158 captures (see `SPIKES.md`) fix the cipher list, the group list, a 32-byte session id, GREASE in the first and last extension slots, and an X25519MLKEM768 key share whose X25519 half is independent of the separate X25519 share. Extension slots between the GREASE values permute. Fresh profiles have no padding and no `pre_shared_key`. + +## Record and transcript decisions already in the code + +`TlsHkdf.ExpandLabel` uses one HMAC when the output fits in one hash block, and `HKDF.Expand` otherwise. `HKDF.Expand` allocates about 288 bytes on this PC; the HMAC path allocates nothing in Release. + +`TranscriptStore` still rehashes the whole buffer. The next change replaces that with `IncrementalHash` and drops raw bytes once HelloRetryRequest is no longer possible and binders are done. + +`TlsRecordProtector` throws on a bad record today. The engine-facing API will return a status and an alert. Only `TlsStream` turns a fatal status into an exception, so a peer that sends garbage cannot force an exception per record. + +## Key exchange + +X25519 is a managed 51-bit-limb ladder. Each product column is one widening multiply after the 2^255 terms are reduced by 19, which is the radix-2^51 schedule for the RFC 7748 prime (2^255 ≡ 19). Inversion uses the fixed chain for z^(2^255 - 21): z^2, z^9, z^11, then the blocks 2^5-1 through 2^250-1, finishing with five squares and a multiply by z^11 (254 squares and 11 multiplies, no branch on the exponent). Windows can do `curve25519` through `ECDiffieHellman`; macOS and Linux cannot (`PlatformNotSupportedException` in S1). The managed ladder stays the portable implementation. `IKeyExchangeGroup` can call the platform later where it exists. X25519MLKEM768 is the ML-KEM-768 encapsulation key or ciphertext followed by a fresh X25519 public key, and the shared secret is the ML-KEM secret followed by the X25519 secret. ML-KEM and SHA-3 are present on Windows and Linux and absent on macOS. `MlKem768.Create` uses the platform when `MLKem.IsSupported` is true and `ManagedMlKem768` otherwise. The managed path always hashes with `ManagedKeccak`, so it does not depend on platform SHA-3. Ed25519 verification reuses this field and platform SHA-512. It is verify-only, scheme `0x0807`, and `TlsAlgorithmPolicy.FipsApprovedOnly` rejects it. The Chrome profile does not advertise it. + +## What is not decided here + +QUIC packet layout, loss recovery, and the HTTP/3 client are specified when their phase starts. The Phase 2 kickoff writes that spec and shows it to the user before implementation. diff --git a/src/Titanium.Tls/design/FIPS.md b/src/Titanium.Tls/design/FIPS.md new file mode 100644 index 000000000..1a0e5cffd --- /dev/null +++ b/src/Titanium.Tls/design/FIPS.md @@ -0,0 +1,7 @@ +The managed TLS and QUIC stacks use the runtime's platform cryptography where they can. The protocol state machines are ours, and X25519 and ChaCha20-Poly1305 are not FIPS-approved algorithms. The stacks are not a FIPS-validated module. + +`FipsEnvironment.IsEnabled()` is the only detector. It reads the Windows `FipsAlgorithmPolicy\Enabled` value and Linux `/proc/sys/crypto/fips_enabled`. macOS is never reported as FIPS mode. + +When that detector is on and a managed flag is on, `ProxyServer.Start` and `TwpConfigValidator` refuse. The error names `server.managedStackFipsOverride` and `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. Either one allows the stack to run. The handshake then uses `TlsAlgorithmPolicy.FipsApprovedOnly` (AES-GCM, secp256r1, secp384r1, RSA-PSS, and ECDSA P-256/P-384). A browser fingerprint will not match. Startup logs that once. + +A handshake also refuses on its own unless `TlsStreamOptions.AllowManagedStackUnderFips`, `AllowManagedStackUnderFips` on the QUIC options, or the environment variable is set. The proxy copies `ProxyServer.AllowManagedStackUnderFips` onto those options. diff --git a/src/Titanium.Tls/design/PARITY-DIFFS.md b/src/Titanium.Tls/design/PARITY-DIFFS.md new file mode 100644 index 000000000..1aa08f31d --- /dev/null +++ b/src/Titanium.Tls/design/PARITY-DIFFS.md @@ -0,0 +1,31 @@ +# Parity differences + +Expected differences between `SslStream` and `TlsStream`. An entry needs a reason. A divergence that is not listed here fails the parity suite. + +Seeded from the S1 `SslStream` baselines (Windows x64 and Linux x64, runtime 10.0.15, TLS 1.3, `TLS_AES_256_GCM_SHA384`, self-signed RSA, validation callback returns true). macOS did not complete this handshake within 30 seconds, so it is not a baseline yet. + +| Scenario | SslStream result | +| --- | --- | +| TCP reset without close_notify | `ReadAsync` throws `IOException` | +| Read after dispose | `ObjectDisposedException` | +| Zero-length write | Completes | +| Zero-length read | Does not return immediately. A 200 ms cancellation throws `OperationCanceledException` | +| Write after `ShutdownAsync` | `InvalidOperationException` ("Write operations are not allowed after the channel was shutdown.") | +| Read cancelled while blocked | `OperationCanceledException` | +| Concurrent client write and server read | The server reads the 4 bytes | + +`SslStream` on macOS, with the runtime on macmini, cannot enable TLS 1.3. `EnabledSslProtocols = SslProtocols.Tls13` throws `PlatformNotSupportedException`, and a request that also allows TLS 1.2 negotiates TLS 1.2. Kestrel on that machine therefore answers a TLS 1.3-only client with alert 70. The tests that need a platform TLS 1.3 peer are inconclusive there. + +`TlsStream` matches those six rows on this PC: a transport end without `close_notify` throws `IOException`, read after dispose throws `ObjectDisposedException`, a zero-length write completes, a zero-length read waits, write after shutdown throws the `SslStream` message above, a cancelled read throws `OperationCanceledException`, and a concurrent write of 4 bytes is read by the peer. The same bytes also move against `SslStream` in both directions with a self-signed P-256 certificate and a validation callback that returns true. + +Recorded differences: + +- Revocation mode stays `NoCheck`. Online revocation is not hopped to another thread. +- The engine ClientHello is the built-in one (AES-128-GCM-SHA256, X25519 and P-256, `ecdsa_secp256r1_sha256`, `ecdsa_secp384r1_sha384`, `rsa_pss_rsae_sha256`, and `rsa_pss_rsae_sha384`). `TlsStreamOptions.FingerprintProfile` is stored and `FingerprintFidelity` reports it. The profile is not the hello on the wire. `UpstreamTlsTests.AcceptAnyServerCertificate_StillWorksOnTcp` returned 200 against its RSA-2048 origin with `TWP_MANAGED_TLS=1`. +- A write that fits in 2^14 bytes is one TLS record. A larger write is split. `SslStream` may coalesce several small writes. +- Stapled OCSP and signed certificate timestamps are copied and not enforced. +- `NegotiateClientCertificateAsync` throws `NotSupportedException`. Post-handshake client authentication is not implemented. + +## OpenSSL 3.5.9 + +`s_server` and `s_client` from OpenSSL 3.5.9 complete the pairwise cells in T1.13. A ClientHello from this stack, the same hello truncated, retyped, limited to TLS 1.2, given a duplicated extension, or given an extension length past the message, and a zero-length application record, get the same first answer from this server and from `s_server`: a ServerHello, the same alert, or both sides still waiting on an incomplete record. The managed client is limited to AES-128-GCM-SHA256, an ECDSA P-256 peer certificate, and `ecdsa_secp256r1_sha256` client authentication. OpenSSL 3.5.5 sends `compress_certificate` (27) in CertificateRequest even when the ClientHello did not offer it. The client ignores that request and sends an uncompressed certificate. OpenSSL 3.5.9 does not send the extension. `www.microsoft.com` sends alert 40 to that offer. OpenSSL 3.5.9 with the same signature scheme, groups, and cipher gets the same alert. A normal OpenSSL client completes TLS 1.3 there with `rsa_pss_rsae_sha256` and X25519MLKEM768. P-256 against that client is a HelloRetryRequest. The managed server accepts the three TLS 1.3 ciphers, X25519, P-256, P-384, X25519MLKEM768, and RSA-2048 as well as the two ECDSA certificates. `s_server` is a terminal relay, so the transfer test reads stdout and writes the same bytes to stdin. Tickets do not resume across the two stacks. `s_client` key update (`k`/`K`) is not an oracle for `CLIENT_TRAFFIC_SECRET_1` and is not part of the matrix. The full cross product is a Slow test and was not run here. Kestrel on this PC accepts the managed client. diff --git a/src/Titanium.Tls/design/PERF-PLAYBOOK.md b/src/Titanium.Tls/design/PERF-PLAYBOOK.md new file mode 100644 index 000000000..30fbfe206 --- /dev/null +++ b/src/Titanium.Tls/design/PERF-PLAYBOOK.md @@ -0,0 +1,411 @@ +Parity work for the managed TLS and QUIC stacks. A direct fix is a cause already identified in the code. A playbook entry is a hypothesis: record it before the change, re-measure, then keep or revert. + +The unit and full-test jobs exclude `TestCategory=Perf` until the managed-stack workflow runs that category. Run the guards with `--filter TestCategory=Perf`. + +## Parity cells, three operating systems + +Re-measurement on 2026-11-29 at `4ddf70612`, after D1 through D4, for the Windows rows. The linuxmini rows were re-measured on the same day at `6f958907b`, after PT1b, PT5a, PT6, PT7, PT8, PQ0, PQ1, and PQ8 (full suite, three runs, `Now`), and their `Before` is the `4ddf70612` run. Three Release BenchmarkDotNet runs per OS, median of the three run medians. A ratio is the platform median divided by the managed median on every cell, including bulk. `PASS` is `>= 1.00`; `PASS (noise)` is `0.98..<1.00` with overlapping 99.9% intervals; anything else is `FAIL`. + +The machine and protocol tables are in `wiki/Performance-Local-Lab.md`; the per-run exports are under `src/Titanium.Tls/design/perf-baselines//` and `src/Titanium.Quic/design/perf-baselines//`. "Before" is the 2026-11-27 run of the same cell on this PC for the Windows rows, and the `linuxmini.md` figures for the QUIC rows; the TLS comparisons had not been run on linuxmini or macmini before, so those before cells are blank. + +| OS | Cell | Before | Now | 99.9% overlap | Verdict | +| --- | --- | ---: | ---: | --- | --- | +| Windows | TLS full handshake, loopback | 0.75 | 1.13 | yes | `PASS` | +| Windows | TLS full handshake, in-memory | 0.69 | 1.17 | yes | `PASS` | +| Windows | TLS resumed handshake, loopback | 1.25 | 2.09 | no | `PASS` | +| Windows | TLS resumed handshake, in-memory | 1.23 | 1.61 | no | `PASS` | +| Windows | TLS 256 MiB, loopback, 16 KiB writes | 0.99 | 0.99 | yes | `PASS (noise)` | +| Windows | TLS 256 MiB, loopback, 64 KiB writes | 1.01 | 1.01 | yes | `PASS` | +| Windows | TLS 256 MiB, in-memory, 16 KiB writes | 1.13 | 1.31 | yes | `PASS` | +| Windows | TLS 256 MiB, in-memory, 64 KiB writes | 1.14 | 1.37 | yes | `PASS` | +| Windows | TLS 100-byte exchange, loopback | 1.15 | 1.13 | yes | `PASS` | +| Windows | TLS 1 KiB exchange, loopback | 1.47 | 1.08 | yes | `PASS` | +| Windows | TLS 100-byte exchange, in-memory | 1.11 | 1.26 | yes | `PASS` | +| Windows | TLS 1 KiB exchange, in-memory | 1.05 | 1.17 | yes | `PASS` | +| Windows | QUIC handshake, loopback | — | 1.91 | n/a | `PASS` (2026-11-30, `TITANIUM_QUIC_PLATFORM_LISTENER=1`; no earlier platform run) | +| Windows | QUIC 100-byte exchange, 50 on one stream | — | 1.30 | n/a | `PASS` (same run) | +| Windows | QUIC 64 KiB, loopback, 8 KiB writes | — | 0.41 | n/a | `FAIL` (same run: 863 µs managed against 349 µs platform) | +| linuxmini | TLS full handshake, loopback | 0.74 | 1.06 | yes | `PASS` | +| linuxmini | TLS full handshake, in-memory | 0.69 | 1.07 | yes | `PASS` | +| linuxmini | TLS resumed handshake, loopback | 0.81 | 1.62 | no | `PASS` | +| linuxmini | TLS resumed handshake, in-memory | 0.62 | 1.89 | no | `PASS` | +| linuxmini | TLS 256 MiB, loopback, 16 KiB writes | 1.06 | 1.08 | yes | `PASS` | +| linuxmini | TLS 256 MiB, loopback, 64 KiB writes | 0.68 | 1.14 | yes | `PASS` | +| linuxmini | TLS 256 MiB, in-memory, 16 KiB writes | 1.19 | 1.14 | no | `PASS` | +| linuxmini | TLS 256 MiB, in-memory, 64 KiB writes | 2.17 | 2.14 | no | `PASS` | +| linuxmini | TLS 100-byte exchange, loopback | 1.13 | 1.11 | yes | `PASS` | +| linuxmini | TLS 1 KiB exchange, loopback | 1.10 | 1.07 | yes | `PASS` | +| linuxmini | TLS 100-byte exchange, in-memory | 0.97 | 0.997 | yes | `PASS (noise)` | +| linuxmini | TLS 1 KiB exchange, in-memory | 0.99 | 1.03 | yes | `PASS` | +| linuxmini | QUIC handshake, loopback | 0.68 | 1.47 | no | `PASS` (2026-11-30, `92611a08d`) | +| linuxmini | QUIC 100-byte exchange, 50 on one stream | 0.35 | 1.19 | yes | `PASS` (same run) | +| linuxmini | QUIC 64 KiB, loopback, 8 KiB writes | 0.07 | 0.45 | no | `FAIL` (same run: 315.8 µs managed against 141.3 µs platform; was 0.20) | +| macmini | all TLS and QUIC cells | — | — | — | managed-only: the platform TLS provider refuses TLS 1.3, and no platform QUIC listener was started | + +Twelve of the twelve Windows TLS cells pass. linuxmini passes all twelve TLS cells (one of them, the in-memory 100-byte exchange at 0.997, in the noise band) and two of the three QUIC cells, the handshake (1.47) and the 100-byte exchange (1.19). The QUIC 64 KiB bulk (0.45, was 0.20) still fails, and so does the same cell on Windows (0.41) now that the platform listener ran there. macmini contributes managed-only numbers and no parity verdicts. The QUIC rows were re-measured on 2026-11-30 at `92611a08d` after the datagram path redesign; the other rows on this page are from the dates stated above. + +With the three Windows QUIC cells added on 2026-11-30 there are thirty cells that carry a platform reference, twenty-eight pass and two fail (the QUIC 64 KiB bulk on linuxmini at 0.45 and on Windows at 0.41); the paragraph that follows is the count before that run. Of the twenty-seven cells that carried a platform reference, twenty-six passed and one failed. Two of the twenty-six pass in the noise band: Windows loopback 16 KiB bulk at 0.99 and linuxmini in-memory 100-byte exchange at 0.997, both with overlapping intervals. The failure is the linuxmini QUIC 64 KiB bulk at 0.20 (714 µs managed against 139 µs platform). The QUIC 100-byte exchange, which read 0.95 in the first pass of this round, reads 1.20 after PQ9 (32.0 µs against 38.6 µs). Nine cells failed at the start of this round; eight of them pass now. The linuxmini QUIC rows were re-measured at `1715273f4`, after PQ9 and PQ11 (three runs each, handshake 1.027 ms against 1.527 ms platform). + +### What the two linuxmini TLS bulk rows mean + +The platform 256 MiB cell on linuxmini moves between two modes and the managed cell does not, so the loopback rows at 16 KiB (1.06) and 64 KiB (0.68) writes are one unstable platform reference rather than two independent results. Across the three main runs and three extra bulk-only runs the platform medians at 16 KiB writes were 115.4, 166.6, 166.1, 164.7, 166.0, and 165.5 ms; the managed medians were 154.9 to 156.8 ms in all six. At 64 KiB writes the platform medians were 100.7, 105.6, 109.0, 97.2, 107.2, and 107.5 ms against 154.5 to 156.8 ms managed. The in-memory 64 KiB row shows the same split (120.2, 120.1, and 121.9 ms platform against 54.1 to 55.8 ms managed), while in-memory 16 KiB is the one bulk size where the platform is consistently faster (66.1 to 66.5 ms against 54.3 to 55.9 ms). Take the 16 KiB rows as the bulk evidence and treat the 64 KiB rows as a reference that needs a longer platform sample before anyone acts on them. The managed loopback 64 KiB row was 155 ms at `4ddf70612` because each 64 KiB write became four system calls; PT5a seals up to four records into one write on a socket stream, and the row now reads 96 ms managed against 110 ms platform (1.14). + +### What the linuxmini handshake rows mean + +The platform handshake on linuxmini is about 0.87 ms, which is 2.7 times faster than the same cell on this PC (2.39 ms in-memory), while the managed handshake is 1.28 ms against 2.03 ms. The managed win on Windows is therefore a slower platform reference, not a faster managed stack: the managed handshake is 1.9 times faster on linuxmini than on Windows and the platform handshake is 2.7 times faster. The 0.69 to 0.81 ratios were the honest cross-OS verdict at `4ddf70612` and the Windows 1.13 to 1.17 rows should not have been read as evidence that the managed handshake was at parity in general. After PT6 through PT8 the linuxmini managed handshake is 1.15 ms on loopback and 0.91 ms in-memory against 1.21 and 0.98 ms platform (1.06 and 1.07). + +The platform's resumed handshake is not faster than its own full handshake on linuxmini (1.047 against 1.042 ms on loopback, 0.877 against 0.875 ms in-memory), so the platform half of the resumed cells may not be resuming at all. The managed half does resume: the benchmark throws if `AcceptedResumption` is false. + +### macmini platform TLS + +Every platform TLS cell on macmini failed in setup with `PlatformNotSupportedException: The requested security protocol is not supported`, raised from `System.Net.SslProtocolsValidation.ValidateContiguous` when `SslStream` is asked for `SslProtocols.Tls13`. A standalone probe on that machine confirmed the platform stack cannot complete TLS 1.3 at all, including against an OpenSSL 3.5.9 `s_server -tls1_3`; it negotiates TLS 1.2 when neither side forces 1.3. The managed stack speaks only TLS 1.3, so a TLS 1.2 platform cell would not be a peer. The platform TLS comparison stays on Windows and linuxmini. + +### macmini cross-protocol sanity + +This is one sanity check of the Mac data path, not a parity cell, and it carries no verdict. On macmini the platform stack cannot complete TLS 1.3 (see above), so the two arms cannot run the same protocol version. The platform arm is `SslStream` with `SslProtocols.Tls12` on both sides; the managed arm is `Titanium.Tls.TlsStream` with `SslProtocols.Tls13` on both sides. `TlsStream` still speaks TLS 1.3 only, and the official benchmark cells are unchanged and still ask both stacks for `Tls13`. `DOTNET_SYSTEM_NET_SECURITY_USENETWORKFRAMEWORK` was unset for every run, and nothing was installed. + +Machine: Apple M1 (8 cores), 16 GB, macOS 26.6.2 (25G83), .NET SDK 10.0.404, runtime 10.0.15, Arm64. Three Release runs of `probe crossproto` on a freshly built tree at `87367eb8b`, ten iterations per cell per run, median of the three run medians. Each handshake iteration opens 20 connections and each exchange iteration performs 50 round trips. Bulk is 256 MiB over loopback in 16 KiB writes. Resumed handshakes are skipped because the two resumption mechanisms are not the same. The helper drives the same `TlsBenchHarness` transports and certificate as the official cells but is its own in-process loop rather than a BenchmarkDotNet job, so these absolute times are comparable within this check and not one-for-one with the BenchmarkDotNet rows in `perf-baselines/macmini`. + +Negotiated on both ends in all three runs: platform arm TLS 1.2 with `TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384`, managed arm TLS 1.3 with `TLS_AES_128_GCM_SHA256`. + +Ratio is platform divided by managed, the same direction as every other TLS row in this file. + +| Cell | Platform TLS 1.2 | Managed TLS 1.3 | Ratio | +| --- | ---: | ---: | ---: | +| Full handshake, loopback | 10.74 ms | 8.27 ms | 1.30 | +| Full handshake, in-memory | 16.88 ms | 11.60 ms | 1.45 | +| 256 MiB, loopback, 16 KiB writes | 137.6 ms | 180.0 ms | 0.76 | +| 100-byte exchange, loopback | 25.70 µs | 37.44 µs | 0.69 | +| 1 KiB exchange, loopback | 26.94 µs | 38.55 µs | 0.70 | + +The three runs agree closely on every managed row except the in-memory handshake. Managed loopback handshakes were 8.266, 8.357, and 8.273 ms. Managed in-memory handshakes were 11.509, 11.600, and 12.520 ms, and the platform in-memory handshakes were 17.296, 16.394, and 16.877 ms. Managed bulk was 180.02, 178.83, and 179.98 ms against platform 137.56, 138.51, and 137.35 ms. The platform 100-byte exchange was 25.70, 25.73, and 25.65 µs against managed 38.75, 37.44, and 37.33 µs, and the 1 KiB exchange 27.19, 26.94, and 26.88 µs against 38.44, 38.55, and 38.74 µs. + +Read the handshake rows with the round-trip count in mind: TLS 1.3 finishes a full handshake in one fewer round trip than TLS 1.2, so the 1.30 and 1.45 rows are what the protocol difference predicts and are not a statement about the two implementations. The bulk and small-exchange rows are the part of this table that says something about the Mac data path. The managed bulk row moves 256 MiB at about 1.4 GiB/s and sits 15% behind the managed linuxmini row at the same 16 KiB write size (155 to 157 ms there, before the platform reference on that machine is considered). The two exchange rows cost the managed arm about 11 to 12 µs more per round trip than the platform arm, which is the same order as the per-record cost the managed stack shows on the other two machines. None of the five rows is far enough from the platform arm to suggest the Mac data path is behaving differently from the Windows and linuxmini paths. + +### Where the remaining gap is + +Findings from this round. A BenchmarkDotNet cell here is one warm-up and ten short invocations, so code that runs for the first 0.3 s of a fresh process runs in tier-0; the field arithmetic needed `AggressiveOptimization` (PT6) before any change to it could show. `Math.BigMul(a, b, out low)` forces the low half through a stack slot, and replacing it in the field product (PT8) cut the managed handshake by 8% to 12% on its own. The QUIC cost that grew with the age of a connection was the sent-number set (PQ0), and a datagram's header-protection mask was one OpenSSL cipher context per packet (PQ8). The in-memory pipe of the TLS bulk cell is 32 KiB, so write batching helps only a socket stream (PT5a). + +The managed QUIC gaps on linuxmini were handshake 0.68, small 0.35, and bulk 0.07. Across D3 and D4 the handshake went from 0.355 to 0.68 and the bulk cell from 0.012 to 0.07, and managed bulk still allocates about 355 KB per 64 KiB against 68 KB platform. The small cell moved the wrong way between the D3 run (0.434) and this one (0.35). The linuxmini TLS gap was the handshake, at 0.69 to 0.81, plus the loopback 64 KiB bulk at 0.68 and the in-memory 100-byte exchange at 0.97; all of them pass now, and so does the QUIC handshake (1.46). + +What is left is the QUIC bulk. The small exchange was held back by tier-0 code (PQ9): a cell that runs for about 30 ms after setup measures the first few hundred calls, and `AggressiveOptimization` on the datagram path took it from 0.88 to 1.30 in a same-session pair. The bulk cell is about 56 datagrams per 64 KiB, each costing a `recvfrom`, a thread-pool wake, and a share of an ACK send, at about 10 µs per datagram in the listener's receive loop against about 3 µs for the platform stack. PQ10 (hold the ACKs for a burst) made it 34% slower and was reverted, and PQ11 (64 KiB of application data in flight instead of 16 KiB) moved it from about 739 to 714 µs in BenchmarkDotNet and from about 658 to 565 µs in the long-running probe, so the transfer is no longer ACK-clocked and what remains is the serial per-datagram cost of the receive loop. Closing a 4x gap needs a receive path that drains many datagrams per wake and a connection that does not hop threads per datagram, which is a redesign of the receive loop and not a tuning entry. The entries that reached these numbers are PT1b, PT5a, PT6, PT7, PT8, PQ0, PQ1, PQ8, PQ9, and PQ11; PQ4 and PQ10 were tried and reverted. + +## Direct (certain) + +Before numbers are the measurements already on record. After is filled when the fix is re-measured (3 runs, median). + +| Id | Cause | Cell before | After | +| --- | --- | --- | --- | +| D1 | X25519 field arithmetic: three `BigMul` calls per scaled product, bit-emulated carries, and an inversion that multiplies on almost every exponent bit | 767 µs per scalar multiplication. Windows full handshake 0.75, in-memory 0.69. linuxmini QUIC handshake 0.355 | This PC, tiering off, 200 calls: 216, 221, 262 µs, median 221 µs. The 60 µs gate is still missed. RFC 7748, Wycheproof, Ed25519, a BigInteger ladder, and max-bound limbs passed | +| D2 | Eager handshake buffers on the large object heap, kept for the life of the connection | Windows idle 961 KB per connection against 84 KB platform. The guard on this PC measured 866151 managed bytes against 20896 platform bytes, and 664 bytes allocated per 1 KiB record after warmup | Handshake buffers are exact-size arrays, released once the handshake is idle, and kept again after the first application record. Steady-state sync records allocate 0 bytes across 1000 records. The idle gap was not in the engine. A walk of the 200 held streams found about 4 KB of managed state per stream, but each socket keeps a reference to the buffer its last read used (the cached receive event args), so the 16645-byte receive buffer stayed reachable after the stream dropped it: 33 KB per connection pair. Receive buffers now come from an exact-size shared pool, so that reference points at a shared buffer. The handshake output, the ClientHello flight writers and the join writer are reused and pooled, the handshake secrets, key shares, key schedule and transcript hash are disposed once connected, and the pump no longer copies each flight with ToArray. One handshake now allocates 181400 bytes (was 220456) and does not reach the large object heap; the budget is 199540. Steady-state sync records still allocate 0 bytes across 1000 records. Idle on this PC is 9834 managed bytes against about 20900 platform bytes (was 43212). Windows loopback and in-memory handshakes (3 BenchmarkDotNet runs, median of medians, platform over managed): full 3.653 ms over 3.185 ms = 1.15 and 2.535 ms over 2.205 ms = 1.15; resumed 3.585 ms over 1.614 ms = 2.22 and 2.511 ms over 1.074 ms = 2.34. The idle gate passes | +| D3 | Stream bytes stored one byte at a time, and every STREAM frame copies every byte the connection has already received | linuxmini QUIC 64 KiB bulk 0.012, about 136 MiB allocated per 64 KiB. The guard on this PC allocated 10960522584 bytes in the first 50 echoes of 64 KiB and 75918811144 bytes in the last 50, on one connection | Stream payload lives in pooled 16 KiB blocks. `QuicSendBuffer` copies each write in with `Span.CopyTo`, credits bytes against the peer's limits with a cursor instead of moving them between lists, hands frames a view over the block instead of `ToArray()`, and rewinds the cursor when a packet is refused instead of `InsertRange`. Blocks return to `ArrayPool` once every byte in them has been framed. `QuicReceiveRing` replaces the unbounded `List Delivered` and is bounded by the receive window because `TryExtendReadWindow` releases the blocks the application read, so memory is O(window) rather than O(bytes transferred). `QuicReassembly` writes in-order bytes straight into the sink with no `data.ToArray()`, holds out-of-order pieces in rented buffers, and `PushCrypto` appends into a pooled writer the TLS engine reads without copying. The two `QuicAckRange[32]` arrays each datagram allocated became per-connection scratches. Steady state on this PC is 6168 bytes per 64 KiB echo through the flow layer, under the 8192 target. Over loopback the whole connection allocates 839230 bytes per 64 KiB echo (3 runs: 840082, 834839, 839230), flat rather than growing, against 10960522584 in the first group and 75918811144 in the last before; the rest is the per-datagram work D4 owns. The quadratic guard passes 3 of 3. linuxmini 3 runs, medians of medians, platform over managed: bulk 64 KiB 134.6 µs over 2231.1 µs = 0.060 (was 0.012), small 41.15 µs over 118.49 µs = 0.347 (was 0.306). The platform half of both cells needs `LD_LIBRARY_PATH` to point at a `libmsquic` build | +| D4 | Per-datagram clear of a 64 KiB buffer, a fresh array per datagram, a linked cancellation source per receive, and a 1 ms delay when a timer is due | Folded into the QUIC small (0.347) and bulk (0.060) cells | Three earlier attempts were reverted because the UDP bulk echo then read zero bytes, and none of them printed the close error. The guard now reports the close state, error code, and stateless-reset flag when a read returns 0, so the cause of any EOF is on record. Each of the six changes landed alone, after the guard and the QUIC unit suite passed, and no read returned 0 bytes in any run: (1) ciphertext buffers (drained datagrams, the session and listener receive buffers, staged sealed packets, the sealed packet buffer) return to the pool without clearing, plaintext buffers zero only the used prefix, and `SealLong` pads in a stack buffer up to 1500 bytes (a rented array above that) and clears the padding tail explicitly because PADDING frames must be 0x00; (2) a flush polls into one rented 64 KiB buffer and sends slices of it instead of one array per datagram plus a list and `ToArray()`; (3) each receive loop keeps one cancellation source and resets it with `TryReset()` instead of linking a new one per receive; (4) the 1 ms delay is gone, and a connection that idle-timed out or took a stateless reset reports no timer, which was the case that kept a deadline due forever (tests assert the next deadline is null or later than now after the loss, probe, idle, and pacing timers fire); (5) a read flushes only when it raised the flow-control window, and that is the only frame a read stages, because ACKs from receive are flushed by the receive loops; (6) a STREAM packet is sized to the path datagram (1200 until a probe validates more) less the short header, the tag, and the frame header, instead of 1000 bytes, and the frame is written into a rented buffer that is zeroed after sealing. The guard flakes on its own timing bound about 1 run in 4 on this PC with or without these changes (5 of 20 before the timer change, 7 of 20 after), and its allocation bound and EOF check never failed. linuxmini 3 runs, medians of medians, platform over managed: bulk 64 KiB 134.0 µs over 1964.2 µs = 0.068 (was 0.060), small 44.49 µs over 102.42 µs = 0.434 (was 0.347), handshake 1.662 ms over 2.515 ms = 0.661. Managed bulk still allocates about 346 KB per 64 KiB against 66 to 83 KB platform, so the remaining gap is not per-datagram clearing or timers | + +## Playbook entries + +Each entry, when it is tried, has: + +- an id (`PT1`, `PQ1`, ...) +- the cell and its current ratio +- the hypothesis and the evidence for it +- the exact change, with commit sha +- the re-measurement (3 runs, median, confidence interval) +- **Keep** or **Revert**, with the reason + +### PT0a. UInt128 products + +- Cell: X25519 scalar multiplication, median 221 µs after D1 (60 µs gate). +- Hypothesis: accumulating each product in `UInt128` lets the JIT emit `mul` instead of a helper. Evidence: D1 still spends the ladder in `Accum`. +- Change: `Accum` multiplied with `UInt128` and added the high halves explicitly. Not committed. +- Re-measurement: 332, 425, 335 µs, median 335 µs. No confidence interval; three probe runs, tiering off. +- **Revert.** About 1.5 times slower than `Math.BigMul`. + +### PT0b. SkipLocalsInit + +- Cell: same ladder, median 221 µs. +- Hypothesis: the ladder and the field methods zero dozens of locals on entry, and `[SkipLocalsInit]` plus the already unrolled product schedule removes that. +- Change: not applied. `Titanium.Managed.Common.props` sets `AllowUnsafeBlocks` to false, and `[SkipLocalsInit]` does not compile without unsafe. The multiply and square schedules are already straight-line. +- **Revert** (not landed). `[SkipLocalsInit]` needs unsafe, and the shared props forbid it. The product schedule is already straight-line. + +### PT0c. Platform scalar multiplication + +- Cell: same ladder, median 221 µs. The pre-authorized fallback after two missed rounds. +- Hypothesis: Windows CNG `curve25519` (BCrypt ECDH) and Linux `EVP_PKEY_X25519` are the platform implementation the 60 µs budget was measured against. +- Change: import a private blob and a public blob on a cached ECDH provider, then `BCryptSecretAgreement` and `BCryptDeriveKey` with `TRUNCATE`, and reverse the raw secret. Not committed. Linux libcrypto was written the same way and not measured on this PC. +- Re-measurement: 290, 283, 287 µs, median 285 µs. Slower than the managed ladder. A PKCS#8 import through `ECDiffieHellman` was 442, 445, 490 µs. +- **Revert.** Each call imports two keys, so the platform path does not reach 60 µs and it regresses the managed ladder. The managed ladder stays the implementation on every OS. FIPS policy still does not offer this group. + +### PT1. Fixed-base Edwards comb for X25519 keygen + +- Cells: linuxmini TLS full handshake loopback 0.74 and in-memory 0.69; resumed handshake loopback 0.81 and in-memory 0.62 (each handshake, resumed or not, generates one X25519 key share per side). +- Profile (linuxmini, `perf record -F 2000 -g` with `DOTNET_PerfMapEnabled=1 DOTNET_EnableWriteXorExecute=0`, governor `performance`, new `probe handshake-loop managed memory` probe, 7100 to 7230 managed in-memory handshakes at 1107 to 1127 µs each, platform 823 µs): `Curve25519Field.Mul` 16.0%, `Square` 11.1%, `Carry` 4.3%, `X25519.ScalarMult` self 2.0% and `MulSmall` 0.8% of all samples, and `X25519.ScalarMult` is 35.6% inclusive of all samples. Stopwatch ticks around `X25519.PublicKey` and `X25519.TryAgree` (temporary, not committed) put the two base-point-9 keygen ladders at 281 to 290 µs per handshake, which is 25.4% to 25.7% of the handshake, and the two agreement ladders at 282 to 286 µs, another 25%. One warmed ladder is 127 to 133 µs on this machine (tiered, 1.5 s warm-up, 2000 calls). The platform handshake is 823 µs end to end, so the four ladders alone are 69% of that budget. +- Gate: the keygen ladders are above the 25% bar, so PT1 is allowed. PT0 is not repeated: the variable-base ladder is untouched. +- Hypothesis: the two keygen ladders run on the fixed point 9, so a precomputed table of multiples of the Ed25519 base point (radix-16 signed digits, 32 position tables of 8 affine multiples, the layout used by the reference Ed25519 implementation) replaces 255 ladder steps by 64 mixed additions and four doublings, plus one inversion to map (X : Y : Z) back to the Montgomery coordinate u = (Z + Y) / (Z - Y). Expected cost is about 750 field operations against about 2560, which is 40 to 50 µs against 130 µs, or about 170 µs saved per handshake (15%). +- Constant time: every digit selects its table entry by scanning all 8 entries with a mask, negates with a mask, and the recoding and the additions have no secret-dependent branches or indexes. Checked by the RFC 7748 vectors, a `BigInteger` differential against the existing ladder on random and edge scalars, and the C2-style timing test. + +- Change, attempt 1 (not committed): `X25519FixedBase` (new file: 32 position tables of 8 affine entries built on first use with Montgomery batch inversion, signed radix-16 recoding, masked table scans, masked swap negation, `ConditionalMove` added to `Curve25519Field`), `X25519.PublicKey` routed to it, and the `BigInteger`, BouncyCastle and ladder differential tests plus a fixed-versus-random timing test for `PublicKey`. All 39 X25519, key-exchange and Wycheproof tests passed on this PC in Release, and the steady-state loop probe went from 1103 to 1127 µs down to 928 to 933 µs per in-memory handshake (-16%), matching the prediction. +- Re-measurement, attempt 1 (linuxmini, 3 BenchmarkDotNet runs, same session, platform over managed, baseline run first on the same tree minus the change): full loopback 1.442 ms to 1.455 ms (0.737 to 0.717), full in-memory 1.278 ms to 1.535 ms (0.693 to 0.567), resumed loopback 1.330 ms to 1.368 ms (0.789 to 0.758), resumed in-memory 1.519 ms to 1.200 ms (0.577 to 0.728). Three of four cells did not improve by 3% and in-memory full got 20% worse. +- Why the steady-state gain did not show: each BenchmarkDotNet cell here is one warm-up invocation and ten invocations of 20 handshakes, about 0.3 s in total. A new `handshake-cold` probe prints the per-handshake time in blocks of 20 in a fresh process: 5157, 2037, 2008, 1972, 2005, 1963, 1990, 1854 µs and only then 1254, 1242, 1216 µs, repeatably (three processes). The platform stack in the same probe is 2630 then 933, 918, 902 µs. With `DOTNET_TieredCompilation=0` the managed blocks are 6676 then 1227, 1126, 1153 µs and BenchmarkDotNet reads full loopback 1.147 ms and in-memory 945 µs (ratios 0.902 and 0.912). A `perf record -F 10000` of the first eight blocks puts `Curve25519Field.Accum`, `Carry`, `Mul`, `Square`, `AddCarry`, and `Shift51` in `[QuickJitted]` tier-0 code at 14.7%, 6.3%, 4.2%, 3.0%, 2.5%, and 1.3% of all samples: the field arithmetic is the first thing the handshake runs 1000 times and it runs unoptimized until the tiering delay elapses. The new table and addition code started in tier-0 too, which is why the comb looked worse in the one cell where it was timed through the tier-0 window. +- Decision: **Revert** attempt 1 (never landed; the patch is kept off-tree). The hypothesis is intact in steady state but the measured cell is dominated by the tier-0 window, so the next entry is PT6, which removes the window; PT1 is then re-tried on top of it as PT1b. + +### PT6. Skip tier-0 for the field arithmetic + +- Cells: the same four linuxmini handshake cells at 0.74, 0.69, 0.81, and 0.62 (this entry is not on the original list; it is the cause the PT1 profile found). +- Evidence: see PT1 above. In a fresh process the first 160 handshakes take about 2.0 ms each and the next ones 1.2 ms, and the cell is the median of ten blocks that straddle that boundary. `DOTNET_TieredCompilation=0` takes full in-memory from 1.278 ms to 945 µs in BenchmarkDotNet. `perf` shows 32% of the cold-phase samples in tier-0 field arithmetic. +- Hypothesis: `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` on `Mul`, `Square`, `MulSmall`, `Carry`, `ConditionalSwap`, `Invert`, `SquareTimes`, `ToBytes`, and `FromBytes` makes those methods compile fully optimized on the first call, with `Accum`, `AddCarry`, and `Shift51` inlined into them, and removes most of the 2.0 ms window without touching the arithmetic. +- Change: `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` on `Curve25519Field.FromBytes`, `ToBytes`, `Invert`, `Mul`, `Square`, `MulSmall`, `SquareTimes`, `ConditionalSwap`, and `Carry` (`X25519.ScalarMult` already had it). No arithmetic changed. Commit sha in the git log under the subject "perf(tls): compile the field arithmetic fully optimized on first call". +- Cold probe after the change (three fresh processes, blocks of 20 in-memory managed handshakes, µs each): 4509, 1319, 1201, 1214, 1219, 1207, 1235 and the same flat 1.2 ms for every later block; before the change blocks 2 to 8 were 1.85 to 2.12 ms. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, baseline taken on the same tree minus the change in the same session): managed full loopback 1.442 ms to 1.358 ms (-5.8%), full in-memory 1.278 ms to 1.185 ms (-7.3%), resumed loopback 1.330 ms to 1.044 ms (-21.5%), resumed in-memory 1.519 ms to 0.880 ms (-42%). Platform over managed in the full 3-run suite afterwards: full loopback 0.768, full in-memory 0.730, resumed loopback 1.006, resumed in-memory 1.029. Side effects: managed QUIC handshake 2.262 ms to 1.483 ms (ratio 0.679 to 1.024, same ladder). Untouched cells in the same full run: bulk loopback 16 KiB 155.6 ms, 64 KiB 156.7 ms, in-memory 16 KiB 54.3 ms, 64 KiB 56.0 ms; 100-byte exchange loopback 17.91 µs, in-memory 11.69 µs; 1 KiB exchange loopback 18.08 µs, in-memory 12.88 µs (a separate small-exchange-only 3 runs read 17.50, 11.68, 18.18, 12.39 µs, so the 12.88 reading is run noise on a cell that never calls the field code). The 100-byte in-memory exchange now reads 1.020 and 1.007 platform over managed in two separate 3-run sets on this tree, so the 0.97 in the sub-plan 05 table was one noisy managed run (run medians 12.6, 11.6, 12.1 µs). +- Tests: 83 X25519, key-exchange, Wycheproof X25519, Ed25519, hybrid, and client/server handshake tests pass in Release on this PC (the `Slow` and `TimingSideChannel` categories excluded, as nothing in the arithmetic changed); `TestCategory=Perf` 3 of 3. +- **Keep.** Four cells improved by 5.8% to 42% and none regressed. + +### PT1b. Fixed-base comb for X25519 keygen, on top of PT6 + +- Cells: linuxmini TLS full handshake loopback 0.77 and in-memory 0.73 after PT6 (the resumed cells passed at 1.006 and 1.029 once PT6 landed; this entry takes them further). +- Hypothesis: the same as PT1. PT1 was set aside only because the cell's tier-0 window hid it. With PT6 in, a cold in-memory handshake is a flat 1.2 ms, and the two keygen ladders are 25% of that. +- Change: PT1's `X25519FixedBase` and `ConditionalMove`, `X25519.PublicKey` routed to it, the differential tests, and `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` on every method of the new class that runs per key (`PublicKey`, `Recode`, `Select`, `MixedAdd`, `Double`, `Add`, `BuildTable`, `Canonical`), so the comb does not repeat the tier-0 mistake. The table is built once, on the first key (a few milliseconds in the first warm-up handshake). +- Tests on this PC in Release: 108 of 108 pass (X25519, differential against the ladder on 40 edge scalars and 2000 random scalars, `BigInteger` on 16, BouncyCastle `GeneratePublicKey` on 256, RFC 7748, key exchange, hybrid, Wycheproof X25519, client and server handshake, interop). The new timing test of `PublicKey` against a fixed and random scalar (100,000 samples) reports Welch t of -0.55 (fixed 76.7 µs, random 76.7 µs on this PC), against the bound of 10; the ladder test reports -0.71 (226.2 and 226.3 µs). +- Cold probe (three processes, in-memory managed, blocks of 20 handshakes, µs): 4652, 1131, 1001, 1016, 1025, 1049 and a flat 1.0 to 1.06 ms afterwards, against 1.2 ms before. Steady-state loop 925 µs. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, against the PT6 run): full loopback 1.368 ms to 1.191 ms (-12.9%), full in-memory 1.208 ms to 1.004 ms (-16.9%), resumed loopback 1.036 ms to 0.848 ms (-18.1%), resumed in-memory 0.852 ms to 0.665 ms (-22.0%). Platform over managed: 0.877, 0.876, 1.244, 1.313. The managed QUIC handshake went from 1.483 ms to 1.310 ms (ratio 1.024 to 1.191). Other cells in the same full 3-run suite: bulk loopback 16 KiB 156.6 ms, 64 KiB 156.0 ms, in-memory 16 KiB 55.8 ms, 64 KiB 55.6 ms; 100-byte exchange loopback 17.57 µs and in-memory 12.22 µs, 1 KiB exchange loopback 18.55 µs and in-memory 12.29 µs; QUIC small 101.6 µs and bulk 1.650 ms. None of those code paths calls the key generator, and the in-memory exchange cells read 11.68 and 12.22 µs in two sets of three runs on trees that differ only in code the record path never runs, so that cell flips between 11.7 and 12.2 µs on its own. +- **Keep.** Four cells improved by 12.9% to 22.0% and none that the change can reach regressed. The two full-handshake cells still fail at 0.877 and 0.876. + +### PT5a. Seal several records into one transport write + +- Cell: linuxmini TLS 256 MiB, loopback, 64 KiB writes, 0.63 to 0.68. +- Confirmation before spending a round on it: the platform medians at 64 KiB writes are 100.7, 105.6, 109.0, 97.2, 107.2, 107.5 ms in the six runs on record and 108.9, 98.7, 98.5 ms in the three runs after PT6, so across nine runs the platform side sits in a 97 to 109 ms band, and the managed side sits at 154.5 to 156.8 ms in all nine. The instability the 2026-11-29 report describes belongs to the 16 KiB platform row (115.4 ms once, 164.7 to 166.6 ms otherwise). The 64 KiB row is therefore a stable platform reference and a real gap, not one more flaky platform sample. +- Profile (`strace -f -c` on `probe bulk loopback 65536 1`, a new probe that repeats the benchmark's transfer): the platform issues 8196 `sendto` calls and 32775 `recvmsg` calls for 256 MiB, which is 32 KiB per send and 8 KiB per receive; the managed stack issues 16387 `sendto` calls and 16259 `recvmsg` calls, which is one 16 KiB record per send. `perf record` of the managed transfer puts 38.99% of all samples in `send` (`tcp_sendmsg` 36.4%), because loopback runs the receive path inline in the sender's system call, so the number of sends is the cost. In `probe bulk`, a fresh managed connection moves 256 MiB in 87 to 93 ms on its first transfer and in 160 to 166 ms on later ones (in memory it is 57 to 67 ms throughout), so the loopback cell has a fast mode and a slow mode on the managed side as well, and the first transfer in a process is always the fast one. +- Hypothesis: `TlsStream.WriteLocked` and `WriteAsyncSlow` call `_inner.Write` once per 16 KiB record. When one `Write` spans several records, sealing up to four records into one rented buffer and writing them with a single transport call halves or quarters the `sendto` count for a 64 KiB write, the same shape as the platform's coalescing, with no idle memory cost (the buffer is rented per call). A key update, if one is due between records, flushes the batch first, so record order is unchanged. + +- Change: for a write longer than one record on a `NetworkStream`, `WriteBatchedLocked` and `WriteBatchedAsync` rent `4 x 16,406` bytes from the array pool, seal consecutive records into it, and call the transport once per full batch and once for the remainder. A pending key update (`KeyUpdateResponseNeeded`, `WriteKeyUpdateDue`, `SendKeyUpdate`) flushes the batch before the update goes out, and a cancelled flush still marks the stream broken. Writes of one record or less, and every other transport type, take the old path. New test `MultiRecordWritesStayInOrderAcrossKeyUpdates` (sync and async writes of 16,385, 65,536, 65,537, and 300,000 bytes, each after `UpdateKeys`, checked by SHA-256). +- First attempt, rejected before it landed: the batching applied to every transport. The in-memory transport (a 32 KiB blocking pipe) then made the managed 64 KiB in-memory cell go from 55.6 ms to 110 and 114 ms (platform 125 ms; the platform stack coalesces to 32 KiB and pays the same penalty), because a write larger than the pipe blocks the writer until the reader drains it. A batch of two records did not help (121 ms). The change is therefore limited to a socket stream, where the cost it removes (one system call per record) exists. That is the real-world case; an in-process pipe has no such cost. +- Probe after the change: `strace -f -c` on the managed 64 KiB loopback transfer shows 4099 `sendto` calls (was 16,387), `probe bulk` reads 77 to 108 ms per 256 MiB on every iteration (was 160 to 166 ms after the first) and the platform 111 to 133 ms in the same session. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, same-session 3-run full suite, platform over managed): bulk loopback 64 KiB 156.0 ms to 104.9 ms (-32.7%), ratio 0.68 to 1.017 (platform 106.7 ms; the other full run with the unrestricted batching read 1.192 at 94.9 ms against 113.1 ms). Other cells in the full suite: bulk loopback 16 KiB 162.4 ms (1.066), in-memory 16 KiB 59.0 ms and 64 KiB 57.2 ms (both within the 55 to 59 ms band of the earlier suites), 100-byte exchange loopback 18.8 µs and in-memory 12.75 µs (0.958 here; this cell reads 0.953 to 1.020 across suites on code the change cannot reach), 1 KiB exchange loopback 19.4 µs and in-memory 13.9 µs, handshakes, QUIC unchanged within run noise. +- Tests: 240 of 240 `Titanium.Tls.Tests` pass in Release on this PC (the `Slow` and `TimingSideChannel` categories excluded, as before). +- **Keep.** The cell improved by 32.7% and no cell the change can reach regressed. +### PQ0. Sent-number set kept as ranges, not one hash entry per packet + +- Cells: linuxmini QUIC 64 KiB bulk (0.08) and QUIC 100-byte exchange (0.40). Found by profiling before PQ1, so it is entered first. +- Evidence: a new `probe quic-loop managed ` repeats the benchmark operation on one connection and prints the time per operation in blocks of 200. Managed small 100-byte exchange (µs per exchange, blocks of 200): 91, 118, 118, 114, 127, 128, 130, 132, 131, 170, 148, 140, 150, 166, 154, 158, 156, 165, 160, 180; managed bulk 64 KiB (µs per transfer, blocks of 200): 4836, 5512, 7661, 9501. The platform stack in the same loop reads 42.4 µs and 135.5 µs, flat. A cell that gets slower with the age of the connection is working on something that grows with the connection. `perf record -F 2000 -g` of the managed bulk loop (3 s, 552 transfers, `DOTNET_PerfMapEnabled=1`, `DOTNET_EnableWriteXorExecute=0`): `QuicLossRecovery.OnAck` 13.6% and `QuicLossRecovery.AcksUnsent` 8.9% of all samples as self time, the two largest managed frames, ahead of the whole socket and AEAD cost. +- Cause: `QuicAckTracker` never trims the first range, so the ACK frame's first range covers every contiguous packet the peer ever received (`Length = Largest - Smallest`, growing with the connection). `QuicLossRecovery.AcksUnsent` then walks every number in that range and probes a `HashSet` that holds every packet number ever sent, so every ACK costs O(age of the connection), a connection costs O(packets squared), and the set itself grows by 8 bytes or more per packet for the life of the connection. +- Hypothesis: the check only asks whether every acknowledged number was sent, so a descending list of `(smallest, largest)` ranges answers it in O(ranges). Sent numbers are almost contiguous (a staged packet that is polled out of order leaves a hole until it is sent), so the list stays at one to three ranges and the ACK cost stops depending on the age of the connection. Expected: per-operation time flat across blocks, and a bulk cell that is no longer growing from about 4.8 ms. No behaviour change: the same numbers are accepted and refused. +- Change: new `QuicNumberRanges` (descending ranges of consecutive numbers, `Add` and `ContainsAll`) replaces the `HashSet` per packet number space in `QuicLossRecovery`; `AcksUnsent` asks `ContainsAll` once per acknowledged range instead of once per acknowledged number. A first-range length that exceeds the largest number keeps the old behaviour (no check), and an ACK range of 2^62 numbers no longer loops for that long. Six new unit tests (in-order sends stay one range, a hole splits and heals, duplicates, the top and bottom of the number space, and a randomized comparison against a `HashSet` over 200 rounds). +- Tests on this PC in Release: `Titanium.Quic.Tests` 199 of 199 (the `Slow` and `Perf` categories excluded) and the `Perf` category 1 of 1. +- Probe after the change (same loop): managed small 100-byte exchange 77, 83, 86, 79, 78, 83, 86, 82, 79, 83 µs per exchange across the first ten blocks and 50.1 µs averaged over 120,000 exchanges (was 91 rising to 180); managed bulk 64 KiB 1548, 1565, 1364, 973, 972, 963, 925, 863, 801, 862 µs and 876 µs averaged over 6849 transfers (was 4836 rising to 9501 after 800 transfers). Flat from the 10th block on. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, platform over managed): QUIC small 100-byte 107.9 µs to 78.2 µs (-27.5%), ratio 0.404 to 0.469; QUIC bulk 64 KiB 1.871 ms to 1.299 ms (-30.6%), ratio 0.079 to 0.092; QUIC handshake 1.441 ms to 1.349 ms (-6.4%, 1.190 to 1.161 against a platform median that moved from 1.715 to 1.567 ms). No TLS cell shares this code. +- **Keep.** Both QUIC cells improved by more than 27% and no other cell regressed. Both still fail, so PQ1 is next on each. +### PQ1. Acknowledge every second packet, and piggyback the rest + +- Cells: linuxmini QUIC 100-byte exchange (0.47 after PQ0) and QUIC 64 KiB bulk (0.092 after PQ0). +- Evidence: `strace -f -c` on `probe quic-loop managed small` (2000 exchanges): 8029 `sendmsg` calls, which is 4.0 datagrams per exchange (the request, an ACK-only datagram for it, the echo, and an ACK-only datagram for the echo; two would carry the same data). On `probe quic-loop managed bulk` (300 transfers of 64 KiB): 30,417 `sendmsg` plus 1834 batched `sendmmsg` calls and 38,741 `recvmsg` calls, about 108 datagrams per transfer for about 56 packets of data, so about half the datagrams are ACK-only. `QuicConnectionCore` (`QuicHandshake.cs`, the receive path) calls `StageAck` for every ack-eliciting packet, which seals one ACK-only packet and sends it as its own datagram. Each datagram costs a `sendmsg`, a `recvmsg`, an epoll wake, a thread-pool hop, a seal, and an open on the other side. +- Hypothesis: RFC 9000 section 13.2.1 and 13.2.2 allow an endpoint to acknowledge at least every second ack-eliciting packet and to wait up to `max_ack_delay` (25 ms, already advertised in the transport parameters) otherwise, and an ACK may ride in any packet. Acknowledge at once in the Initial and Handshake spaces, before the handshake is complete, and when a packet arrives out of order; in 1-RTT, acknowledge on the second unacknowledged ack-eliciting packet, or after 25 ms, or inside the next STREAM packet this endpoint sends. Report the real `ack_delay` so the peer's RTT sample is not inflated. Expected: the exchange drops from 4 datagrams to 2 and the bulk transfer from about 108 to about 84, so the small cell should fall by about a third and the bulk cell by a fifth. +- Change: `QuicConnectionCore` counts unacknowledged ack-eliciting 1-RTT packets. The first one arms an acknowledgement deadline of `MaxAckDelay` (25 ms) that joins `NextTimeout()`; the second, a packet that arrives out of order, anything in the Initial or Handshake space, and anything before the handshake completes is acknowledged at once. `StageReady` writes a pending ACK frame in front of the STREAM frame of the first packet it stages and clears the pending state only once that packet is staged, so a packet the congestion window refuses does not lose it. The ACK frame reports `ack_delay` (units of 8 µs, the default exponent, capped at 25 ms) from the arrival of the largest packet to the moment the acknowledgement is built; `QuicConnectionSession.SendStream` and `Finish` call a new `ObserveTime` first so the clock covers the time an application write waited. Tests: five new in `QuicAckDelayTests` (a first packet is held and a second is acknowledged at once, a lone packet is acknowledged when the delay runs out, the echo carries the acknowledgement, a gap is acknowledged at once, the reported delay keeps the peer's smoothed RTT under 1 ms after a 20 ms hold). Two existing tests assumed one ACK-only datagram per packet and were corrected: the rebound-address test now advances the clock by `MaxAckDelay` before it polls the reply, and the unvalidated-path test acknowledges the keepalive's own packet number instead of the constant 1. +- Tests on this PC in Release: `Titanium.Quic.Tests` 204 of 204 with the `Slow` category excluded (that category is the soak, which this branch does not run locally). It includes the loss, retransmission, and simulator suites. +- Probe after the change (`probe quic-loop managed`): small 100-byte exchange 48.2 µs averaged over 124,386 exchanges (50.1 before); bulk 64 KiB 845 µs averaged over 7098 transfers (876 before), 1229 to 723 µs from the first to the twentieth block of 200. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, platform over managed): QUIC small 100-byte 78.2 µs to 51.7 µs (-33.9%), ratio 0.469 to 0.770 (platform 36.7 to 39.8 µs); QUIC bulk 64 KiB 1.299 ms to 1.118 ms (-13.9%), ratio 0.092 to 0.134 (platform 119 to 149 µs); QUIC handshake 1.349 ms to 1.384 ms (1.161 to 1.233, platform 1.567 to 1.706 ms), so the handshake path, which never reaches the delayed branch, did not move beyond noise. +- **Keep.** Small improved 33.9% and bulk 13.9%, and no other cell regressed. Both still fail. +### PQ4. Wake the reader without allocating per datagram + +- Cells: linuxmini QUIC 100-byte exchange (0.77 after PQ1) and QUIC 64 KiB bulk (0.134). +- Evidence: after PQ0 and PQ1 the profile of the managed bulk loop (`perf record -F 5000 -g`, 4 s, `probe quic-loop managed bulk`) has no frame above 5% that the application can change: `UdpSocketTransport.ReceiveAsync` 19.9% inclusive (it includes every continuation it runs inline), `FlushAsync` 10.7%, `QuicHeaderProtection.Mask` 4.9%, `QuicPacketProtector.Open` 4.1%, and the rest is `sendmsg`, `epoll_wait`, and thread-pool spin. `probe quic-loop` now also prints all-thread allocation: managed bulk allocates 366,661 bytes per 64 KiB transfer against 67,001 for the platform, and managed small 69,445 against 66,288. Each datagram runs `NotifyStreams`, which copies the stream list with `ToArray()` and, for each stream, allocates a new `TaskCompletionSource` and completes the old one; the client loop also calls it at the top of every pass. `ManagedQuicStream.Notify` does this whether or not a reader is waiting. +- Hypothesis: allocate the signal only while a reader is parked, remember a notification that finds nobody waiting as one pending flag, and reuse the stream array until a stream is added. That removes two allocations per datagram per stream and the extra completion, without changing when a parked reader wakes (it still resumes on the thread pool). Expected gain is small, a few percent of the bulk transfer, so it needs to clear the 3% bar to stay. +- Change (not landed): `ManagedQuicStream` held a `TaskCompletionSource` only while a reader was parked and kept one `pending` flag otherwise; `QuicConnectionSession.NotifyStreams` reused one stream array until `AddStream`. The 204 `Titanium.Quic.Tests` passed. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs per set, three sets in the same session, medians of the run medians): the PQ1 tree measured immediately before reads bulk 1.136 ms and small 56.8 µs; the change reads bulk 1.035 ms and small 53.8 µs in the first set and bulk 1.138 ms and small 58.3 µs in the second, with the platform side moving between 139 and 212 µs (bulk) and 40 and 49 µs (small) across the same sets. The two sets of the same code disagree with each other by more than the claimed gain, so the effect is inside the noise of this machine, and the bar of 3% is not met on a stable reading. +- **Revert** (never committed). Allocation per datagram is not what the transfer is waiting on; the cost is a thread-pool hop and a system call per datagram. +### PQ8. Header-protection mask with AES-NI instead of one OpenSSL call per packet + +- Cells: linuxmini QUIC 100-byte exchange (0.80 after PQ1) and QUIC 64 KiB bulk (0.12 to 0.15). Second entry on these two cells after the PQ4 miss; a miss here stops the QUIC playbook. +- Evidence: in the post-PQ1 bulk profile (`perf record -F 5000 -g`, `probe quic-loop managed bulk`) `QuicHeaderProtection.Mask` is 4.85% inclusive of all samples and `QuicPacketProtector.Open`, which authenticates and decrypts the whole 1200-byte packet, is 4.05%, so the 16-byte header mask costs more than the AEAD. `ERR_clear_error` is 1.5% self time in the same profile, the cost of a fresh OpenSSL cipher context per call. `Mask` calls `Aes.EncryptEcb` once per packet sent and once per packet received (a datagram costs two), and that call builds and frees an `EVP_CIPHER_CTX` for a single block. +- Hypothesis: one AES-128 block encryption with the AES-NI instructions (`System.Runtime.Intrinsics.X86.Aes`, round keys expanded once per key) takes tens of nanoseconds and is constant time. Use it for the default 128-bit header cipher when the instruction set is present and keep `Aes.EncryptEcb` for AES-256, ChaCha20, and every other CPU. Expected: removes about 8% of the per-datagram CPU in the profile, which should read as a few percent of the bulk cell and a smaller share of the small cell, so it must clear 3% to stay. +- Change: new `QuicAesBlock` (one AES-128 block with `System.Runtime.Intrinsics.X86.Aes`, ten round keys expanded once with `KeygenAssist`) and `QuicHeaderProtection` uses it for `QuicHeaderCipher.Aes128` when the instruction set is present; AES-256, ChaCha20, and CPUs without AES-NI keep the old `Aes.EncryptEcb` path (the `Aes` object is no longer created when the fast path is used). Constant time: the instructions have no data-dependent branches or table lookups, and the key schedule runs once per key. Tests: four new in `QuicAesBlockTests` (FIPS-197 vector, 2000 random keys and blocks against `Aes.EncryptEcb`, wrong key lengths refused, and `QuicHeaderProtection.Protect` against a hand-computed mask over 200 random packets). The existing RFC 9001 header-protection vectors in the suite now run through the new path on this PC. +- Tests on this PC in Release: `Titanium.Quic.Tests` 208 of 208 (`Slow` excluded). +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, baseline taken immediately before on the committed tree in the same session, platform over managed): QUIC bulk 64 KiB 1.233 ms to 0.933 ms (-24.3%), ratio 0.126 to 0.172; QUIC small 100-byte 61.3 µs to 46.5 µs (-24.1%), ratio 0.772 to 0.965; QUIC handshake 1.441 ms to 1.394 ms (-3.3%), ratio 1.235 to 1.279. The platform medians in the two sets are within noise of each other (bulk 155 and 161 µs, small 47.3 and 44.9 µs). +- **Keep.** Both QUIC cells improved by 24% and nothing regressed. The small cell is at 0.965, below the 0.98 floor of the noise band, so it still counts as `FAIL` until a later entry or a re-measurement lifts it. +### PT7. Field multiply and square with the carry fused into each column + +- Cells: linuxmini TLS full handshake, loopback (0.89) and in-memory (0.85). First entry on these cells since PT1b. +- Evidence: `perf record -F 5000 -g` of `probe handshake-loop managed memory` (5590 handshakes, 1073.5 µs each; platform 934.9 µs) puts `Curve25519Field.Mul` at 13.8%, `Square` 7.8%, `Carry` 3.3% and `MulSmall` 0.6% of all samples (self time), 25.5% together, and `X25519.ScalarMult` is 24.8% inclusive. The two agreement ladders are the only ones left after PT1b, at 127 to 133 µs each. `Mul` and `Square` hold ten 64-bit accumulators, ten inputs and four `19 *` values live at once, which is more than the 16 general registers, and `Carry` then spends four compare-and-add steps (`AddCarry`) folding each column's carry into the next. +- Hypothesis: computing the columns one after another, with each column's carry used as the starting value of the next column's low accumulator, removes the `AddCarry` steps and keeps only two accumulators live at a time. The output limbs are bit-for-bit the ones the old schedule produced, so nothing else changes. Expected: 10% to 20% off the field time, which is 3% to 5% of a handshake, so this cell may need a second entry to pass. +- Change: `Curve25519Field.Mul` and `Square` compute the five columns in order, each starting from the previous column's carry, then call a shared `Fold` (the tail of the old `Carry`). `Carry` still serves `MulSmall` and now calls the same `Fold`. Output limbs are the ones the old schedule produced. Constant time: no branches or table lookups were added. Tests: new `RandomLimbsAtEveryBoundMatchBigInteger` (16,000 random pairs with limbs of 51, 52, 53, and 54 bits, product, square, and a chained product, all against `BigInteger`). +- Tests on this PC in Release: `Titanium.Tls.Tests` 241 of 241 (`Slow` and `TimingSideChannel` excluded), `Titanium.Quic.Tests` 209 of 209 (`Slow` excluded). +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, baseline taken immediately before on the committed tree in the same session): full handshake loopback managed 1.328 ms to 1.244 ms (-6.3%), platform 1.150 and 1.151 ms, ratio 0.866 to 0.926; full handshake in-memory 1.122 ms to 1.050 ms (-6.4%), platform 935.8 and 943.6 µs, ratio 0.834 to 0.899; resumed handshake loopback 960.9 to 878.9 µs (-8.5%); resumed in-memory 724.3 to 650.3 µs (-10.2%); QUIC handshake 1.380 to 1.357 ms (-1.7%). Allocation per handshake did not change. +- **Keep.** Both full-handshake cells improved by more than 3% and nothing regressed. They are still below the 0.98 floor, so they stay `FAIL`; the accumulator carry is the next thing in the profile. +### PT8. Field products without the stack round trip in `Math.BigMul` + +- Cells: linuxmini TLS full handshake, loopback (0.926 after PT7) and in-memory (0.899 after PT7). Second entry on these cells; PT7 was a keep, so the miss counter is at zero. +- Evidence: the JIT listing of `Curve25519Field.Mul` (`DOTNET_JitDisasm`, Release, this PC) shows every `Accum` as `lea rbx, [rsp+0xD0]`, `mulx`, a store of the low half through that address, and a reload of the same stack slot (25 times in `Mul`), plus a further dozen spills of the `19 *` values and the inputs. `Math.BigMul(a, b, out low)` writes the low half through a pointer, which makes the local address-exposed even after inlining, so the low half of each product leaves and re-enters a register. `Mul` and `Square` are 21.6% of all samples in the PT7 profile. +- Hypothesis: on x64 with BMI2, `Bmi2.X64.MultiplyNoFlags(a, b)` returns the high half in a register and `a * b` gives the low half with one `imul`, which keeps both in registers and drops the store and reload. On ARM64, `ArmBase.Arm64.MultiplyHigh`. Other CPUs keep `Math.BigMul`. Expected: 15% to 25% off `Mul` and `Square`, which is 3% to 5% of a handshake. +- Change: `Accum` computes the low half as `left * right` and the high half with a new `High` helper: `Bmi2.X64.MultiplyNoFlags` when BMI2 is present, `ArmBase.Arm64.MultiplyHigh` on ARM64, `Math.BigMul` otherwise. Constant time: `mulx` and `imul` have no data-dependent timing. The fallback keeps every CPU correct. The new JIT listing of `Mul` is 407 lines against 416 and has 65 stack references against 83; the per-product store and reload through a pointer are gone. +- Tests on this PC in Release: `Titanium.Tls.Tests` 241 of 241 (`Slow` and `TimingSideChannel` excluded); the two X25519 `TimingSideChannel` tests pass. +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, baseline is the PT7 set measured about 15 minutes earlier on the same machine, platform over managed): full handshake loopback managed 1.244 ms to 1.138 ms (-8.5%), platform 1.151 and 1.174 ms, ratio 0.926 to 1.032; full handshake in-memory 1.050 ms to 923.2 µs (-12.1%), platform 943.6 and 970.6 µs, ratio 0.899 to 1.051; resumed loopback 878.9 to 719.4 µs (-18.1%); resumed in-memory 650.3 to 512.2 µs (-21.2%); QUIC handshake 1.357 ms to 1.357 ms (0%). The platform side drifted up by 2% to 3% between the sets, which works against the claimed gain. +- **Keep.** Both full-handshake cells pass at 1.03 and 1.05 and nothing regressed. The rest of the TLS and QUIC cells are re-measured in the final full run. +### PQ9. Compile the QUIC datagram path fully optimized on first call + +- Cells: linuxmini QUIC 100-byte exchange (0.95 in the 2026-11-29 table; 0.91 in a same-session baseline of three runs at `e9399bc80`, platform 59.8, 48.7, 45.2 µs against managed 51.6, 53.5, 56.8 µs) and QUIC 64 KiB bulk (0.19 in the table; 0.24 in the same baseline, 1097, 964, 838 µs managed against 252, 232, 139 µs platform). First entry on either cell in this retry; the miss counter is at zero for both (PQ4 missed and PQ8 kept in the previous pass). +- Evidence, from a long-running probe against the benchmark cell. `probe quic-loop` now runs the small cell as 50 exchanges per call, which is the shape BenchmarkDotNet uses (the earlier probe blocked the main thread once per exchange and read 30 µs against 43 µs platform, so it never showed the 0.95). In a six-second process the managed small exchange is 29.9 and 30.4 µs against the platform's 43.1 and 40.3 µs, and managed bulk is 651 and 662 µs against 148 and 151 µs. The benchmark cell is one warm-up and ten invocations of 50 exchanges (about 30 ms after setup), so it measures code that is still tier-0. Three runs with `DOTNET_TieredCompilation=0` give managed small 34.6, 31.2, 33.6 µs (median 33.6) against platform 50.3, 42.7, 40.6 µs (median 42.7), a ratio of 1.27 (was 0.91), and managed bulk 746, 657, 694 µs (was 1097, 964, 838), a gain of 28% on the bulk cell as well. The same probe with tier-up disabled (`DOTNET_TC_CallCounting=0`) holds at 45.6 µs per exchange for five seconds, against 31.8 µs with default tiering and 31.0 µs with tiering off, so the cost is tier-0 code and not any growth in state. `perf record -F 10000 -g` of that run (`DOTNET_PerfMapEnabled=1`) puts 3.5% of all samples in tier-0 `Titanium.Quic` methods and 1.7% in tier-0 `System.Private.CoreLib` generic instantiations over Titanium types, spread flat over about 200 methods (the largest are `QuicLossRecovery.Remember` 0.16%, `QuicFlow.TakeReady` 0.14%, `FlushAsync` 0.13%, `ManagedQuicStream.ReadAsync` 0.10%, `AcceptDatagram` 0.09%, `TakePayload` 0.08%, `StageReady` 0.08%, `QuicLossRecovery.Arm` 0.07%). That is the PT1 finding again: the managed code is the first thing the benchmark runs only a few hundred times, so the tier-0 window is part of the cell. +- Hypothesis: `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` on the synchronous methods every datagram passes through (receive: `HandleDatagram`, `AcceptDatagram`, `TakePayload`, header and payload protection, frame reader, ack tracker, loss recovery; send: `StageReady`, `SealAndStage`, `PollTransmit`, flow `TakeReady`, send buffer, frame writer, varint codec) makes them compile fully optimized on the first call and lets the JIT inline the small helpers into them, which removes most of the tier-0 window the PT6 entry removed for the field arithmetic. The async state machines (`FlushAsync`, `ReadAsync`, `SendAsync`, `ReceiveAsync`) do not take the attribute from the method they come from, so they stay tier-0; `FlushAsync` also rents a 64 KiB buffer and a slice array before it knows whether anything is queued, so a flush that has nothing to send leaves the thread-pool thread through a state machine for nothing. The change is limited to the attribute and, for `FlushAsync`, a synchronous check before the state machine. Expected: the small cell moves toward the 34 µs of the tiering-off run, which is well over the 3% bar; the bulk cell moves toward 700 µs and still fails. +- Change (commit `17044f68c`): `[MethodImpl(MethodImplOptions.AggressiveOptimization)]` on 125 synchronous methods of `Titanium.Quic` that a datagram passes through (`QuicConnectionCore` receive, stage, poll and timer methods, `QuicFlow` queue, take, flush and the send and receive buffers, `QuicLossRecovery`, `QuicAckTracker`, `QuicNumberRanges`, the packet protector and header protection, the packet, frame and varint codecs, `QuicIdentity`, the replay window, both congestion controllers, `UdpSocketTransport` address helpers, the session's sync methods, and the listener's sync helpers); no logic changed. `FlushAsync` is now a plain method that rents the buffers and runs the first drain, and only a flush that has a datagram to send enters the new `FlushQueuedAsync` state machine; a flush with nothing queued returns a default `ValueTask`. +- Tests on this PC in Release: `Titanium.Quic.Tests` 208 of 208 (`Slow` and `Perf` excluded). +- Re-measurement (linuxmini, full suite, 3 BenchmarkDotNet runs each, median of the run medians, baseline is the same suite on the `e9399bc80` tree run immediately before in the same session, platform over managed): QUIC small 100-byte exchange 50.83 µs to 35.62 µs (-29.9%), ratio 0.884 to 1.301 (platform 44.96 and 46.34 µs); QUIC bulk 64 KiB 926.4 µs to 738.6 µs (-20.3%), ratio 0.181 to 0.219 (platform 168.0 and 161.4 µs); QUIC handshake 1.234 ms to 1.142 ms (-7.5%), ratio 1.460 to 1.597. The TLS cells, whose code this entry does not touch, moved by noise only: handshakes full loopback 1.092 to 1.096 ms and in-memory 857.0 to 858.9 µs, resumed 723.2 to 717.5 µs and 518.1 to 514.5 µs, 256 MiB bulk 165.4 to 162.9 ms, 95.9 to 93.8 ms, 59.3 to 59.5 ms, and 59.6 to 60.7 ms (in-memory 64 KiB; the run medians overlap, 58.9 to 59.6 against 57.4 to 60.7), 100-byte and 1 KiB exchanges 18.59 to 18.50, 12.85 to 12.71, 19.42 to 19.68, and 13.56 to 13.52 µs. The TLS stack does not call any changed method. +- **Keep.** The small cell improves 29.9% and passes at 1.30; the bulk cell improves 20.3% and still fails at 0.22. No cell the change can reach regressed. +### PQ10. Drain the datagrams that are already queued before notifying readers and flushing + +- Cell: linuxmini QUIC 64 KiB bulk, 0.22 after PQ9 (the QUIC small cell passes at 1.30 after PQ9 and is not the target). Second entry on the bulk cell in this retry; PQ9 was a keep, so the miss counter is at zero. +- Evidence: `probe quic-loop bulk 6` at `17044f68c`, three runs alternating managed and platform: managed 608, 739, 628 µs per 64 KiB (the managed cell is bimodal between about 610 and 740 µs), platform 141, 128, 138 µs; allocation 362 KB against 67 KB per transfer. A `perf record -F 10000 -g` of the managed loop (5 s, about 7700 transfers, 56 data datagrams each) has no self-time frame above 1.3% on the managed side; the listener's `RunAsync` frame with its children is about 10 µs of CPU per received datagram, which is the whole per-transfer time (56 x 11.6 µs = 650 µs), so the server's receive loop is the serial stage the transfer waits on. Each pass of that loop, for every datagram, arms a cancellation timer (`QuicReceiveWait.Arm`), locks the listener and every session to compute the next deadline (`NextDelay`), copies the datagram into a new array, and after `Handle` runs `FlushAsync` (two pool rents, a drain, two returns), `NotifyStreams` (a stream array and a new `TaskCompletionSource` that wakes the parked reader on the thread pool) and `Expire` and `Publish`. When the sender is faster than that loop, which it is here (seal plus one `sendmmsg` per 7 datagrams), the socket already holds the next datagram when the loop comes back to it, so all of that per-datagram work is repeated for a datagram that is already waiting. +- Hypothesis: after `Handle`, keep receiving while `Socket.Available` reports a datagram (at most 16 in a row, inside the same armed wait and with the same cancellation token), run only `Handle` for those, and do the flush, the reader notification, and the publish check once at the end of the burst. The client loop gets the same burst. Nothing changes when a single datagram is queued: the burst is empty and the pass is the old one plus one `ioctl`. Handshake datagrams (a connection that is not yet published) keep the old per-datagram path. Reader wake-ups and ACK flushes fall from one per datagram to one per burst, and the ACK packets staged inside a burst leave through one `sendmmsg` (the drain already batches). Expected: 10% to 25% off the receive loop's per-datagram cost, which is over the 3% bar if bursts are common; the cell still fails unless the loop cost falls by more than 4x. +- Change (commit `33da8909e`, reverted by `e8d0816de`): `QuicConnectionSession.MaxReceiveBurst` of 16; the listener's `RunAsync` and the client's `RunClientAsync` kept receiving while `DatagramPending` and ran `Handle` alone for those datagrams, and a new `FlushDirtyAsync` (listener) or the single `NotifyStreams` plus `FlushAsync` (client) ran once at the end of the burst. `Titanium.Quic.Tests` 209 of 209 in Release (`Slow` excluded). +- Re-measurement (linuxmini): `probe quic-loop bulk 6`, three runs, managed 1058, 1503, 1224 µs per 64 KiB against 608, 739, 628 µs before and platform 135, 139, 129 µs; BenchmarkDotNet, 3 runs, median of the run medians: bulk 738.6 to 988.2 µs (+33.8%, ratio 0.219 to 0.173), small 100-byte 35.62 to 36.74 µs (+3.1%, ratio 1.301 to 1.431 against a platform median that moved from 46.3 to 52.6 µs). +- **Revert** (`e8d0816de`). The burst made the cell 34% slower, not faster. Holding the ACKs for a burst of up to 16 datagrams delayed the acknowledgements that open the sender's window, so the transfer is waiting on ACK round trips rather than on the per-datagram CPU cost of the receive loop. That is a miss on the bulk cell (first miss since PQ9). It also names the next suspect: what limits the bytes in flight, which is the congestion window or a cap, and not the receive loop. + +### PQ11. Let application data have more than 16 KiB in flight + +- Cell: linuxmini QUIC 64 KiB bulk, 0.22 after PQ9. Third entry on the bulk cell in this retry, after one keep (PQ9) and one miss (PQ10); one more miss on this cell is a stop. +- Evidence: `QuicLossRecovery.Allows` clamps the usable window to `QuicFlow.ReassemblyCap`, which is 16384 bytes, for every packet space, whatever the congestion window is (the congestion window itself is a slow-start window that keeps growing on a connection that has carried thousands of transfers). The comment on the clamp says a gap above the reassembly cap closes the connection, which was true when every stream's receive buffer was that size. `QuicFlow.CapFor` has since raised a stream's reassembly bound to the receive window it advertised (1 MiB here, the comment above it says holding that much out of order is normal), so for application data the clamp now sits far below what the receiver is prepared to hold; only the CRYPTO buffers keep the 16384 bound. Staging also checks `held + count + 64` against the same clamp, so a flight is at most 13 packets of 1200 bytes. A 64 KiB transfer is 56 packets, which is at least five flights, each ended by an ACK that has to cross the thread-pool hops of the receive loop (about 100 to 150 µs per round trip on this machine). That matches the cell: 56 x 11.6 µs of per-datagram time is the 650 µs, but each flight also waits one round trip, and PQ10 showed that making the ACKs later made the cell 34% slower, so the transfer is ACK-clocked. PQ1's `strace -f -c` of the bulk loop (300 transfers) counted 1834 `sendmmsg` calls (about six per transfer, one per flight and write) and 30,417 `sendmsg` calls (about 100 per transfer, the ACKs and the one or two datagrams each ACK releases). +- Hypothesis: allow application (1-RTT) data a flight cap of 64 KiB while Initial and Handshake packets keep the 16384 bound. 64 KiB keeps a burst of datagrams inside the default UDP receive buffer on linuxmini (about 90 datagrams of 1200 bytes at the 212,992-byte default) and is the same size as the stream window many stacks start with, flow control still bounds the flight at the peer's advertised window, and the congestion window still applies. A 64 KiB transfer then leaves in one flight, and the ACK round trips drop from five to one. Expected: the bulk cell falls from about 740 µs toward 300 to 450 µs; a lossy path still sees the congestion window halve on a loss, and the simulator and loss suites run in Release before and after. +- Change (commit `458ff97b3`): `QuicFlow.ApplicationFlightCap` of 65536; `QuicLossRecovery.Allows(bytes, kind)` clamps the window to that cap for 1-RTT packets and to `ReassemblyCap` for Initial and Handshake, and `SelectStaged`, `PaceDeadline`, and the stage-ready check pass the packet kind. `QuicLossEdgeTests` now asserts the 16384 bound with the Handshake kind and the 64 KiB bound with the 1-RTT kind. `QuicCubicComparisonTests` allowed a transfer time of zero ticks to fail and bounded one loss by three lossless transfers; the lossless 80 ms transfer now takes 400 ms instead of 720 ms while the one-loss recovery stays at 1570 ms (Reno) and 1200 ms (CUBIC) as before, so the zero-delay check is `>= 0` and the loss bound is five lossless transfers. `Titanium.Quic.Tests` 209 of 209 in Release (`Slow` excluded). +- Re-measurement (linuxmini, 3 BenchmarkDotNet runs, median of the run medians, platform over managed; the baseline is the PQ9 set from the earlier session): QUIC bulk 64 KiB 738.6 to 714.4 µs (-3.3%, run medians 808, 673, 714), ratio 0.219 to 0.195 against a platform median that moved from 161.4 to 139.5 µs; probe `quic-loop bulk 6` three runs 565.6, 566.8, 562.7 µs managed against 608, 739, 628 µs before (-14%), platform 115.0, 138.6, 138.9 µs. QUIC small 100-byte 35.62 to 32.03 µs, QUIC handshake 1.142 ms to 1.027 ms (ratio 1.486); nothing regressed. The gain on the bulk cell is a third of what the hypothesis expected, so the flight cap was a small part of the cost and the per-datagram receive loop is most of it. +- **Keep.** The bulk cell gains 3.3% in BenchmarkDotNet and 14% in the probe and no cell regressed, so it clears the 3% bar, which is inside the run-to-run spread of the cell. It still fails at 0.20. The miss counter on the bulk cell stays at one (PQ10). + +### QUIC datagram path redesign + +Not a playbook entry and not PQ12. This is the staged redesign of the QUIC receive and send path (sub-plan 06b): five steps, each its own commit, each re-measured on linuxmini and then kept or reverted. A step is kept when the 64 KiB bulk cell improves by at least 3% and the QUIC handshake and 100-byte cells do not regress by more than 1%. The baseline for each step is a run of the tree just before it, measured in the same session. The numbers recorded for the older commits (714 µs managed against 139 µs platform at `458ff97b3`) are not the baseline for any step here. + +#### Step 0: counters and the baseline profile (no behavior change) + +Commit `59c961162` adds internal counters (`QuicPathCounters`, off unless a probe turns them on) and `probe quic-loop` prints them per operation: datagrams and wakes of the listener loop and of the client loop, datagrams per wake, ACK-only datagrams sent, reader notifications and reader wake-ups, send system calls, datagrams sent, and thread-pool work items (`ThreadPool.CompletedWorkItemCount`). + +Baseline measured on linuxmini at `59c961162` (governor `powersave`, `probe quic-loop bulk 6`, three runs each, per 64 KiB transfer; the counts are the same in every run, the time is not): + +| Counter, managed arm | Per 64 KiB transfer | +| --- | ---: | +| Datagrams read by the listener loop (client to server) | 66 | +| Listener wakes | 66 (1.00 datagrams per wake) | +| Datagrams read by the client loop (ACKs, server to client) | 34 | +| Client wakes | 34 (1.00 datagrams per wake) | +| ACK-only datagrams sent | 33.6 | +| Reader notifications (`ManagedQuicStream.Notify`) | 133 | +| Reader wake-ups (a parked `ReadAsync` resumed) | 65 | +| Datagrams sent | 99.5 | +| Send system calls | 47 to 48 | +| Thread-pool work items | 224 (platform arm: 10 to 15) | + +`probe quic-loop` time per 64 KiB transfer on the same tree: managed 610.6, 565.2, 572.4 µs; platform 138.9, 117.9, 117.8 µs. Managed allocates about 356 KB per transfer on all threads against about 66 KB platform. BenchmarkDotNet baseline at `98535a645` (three runs, median of the run medians, same machine and session): bulk 744.5 µs managed against 151.0 µs platform (0.203), small 100-byte 33.42 µs against 43.75 µs (1.309), handshake 1131.5 µs against 1700.9 µs (1.503). The managed bulk run medians were 750.8, 744.5, and 667.2 µs, so one run differs from another by up to 12% and the 3% rule is decided on the three-run median with the long probe as a cross-check. + +Profile, once, with the tools that are installed: + +- `dotnet-counters collect --counters System.Runtime` around the managed bulk probe (8 s): 410,378 thread-pool work items per second, 6,737 monitor lock contentions per second (about 3.7 per transfer), 81 gen0 collections per second, 647 MB allocated per second, and the process burns 4.3 s of user plus 2.9 s of kernel time per second of wall time, which is about seven cores for one connection that moves one 64 KiB transfer at a time. +- `dotnet-trace collect-linux --profile cpu-sampling` (`cpu-sampling` is a `collect-linux` profile in this tool version; `collect` rejects it, so the trace is system-wide and needs `sudo -n`), 6 s while the managed bulk probe ran: 48% of samples inclusive under `libcoreclr`, 14.7% in `LowLevelLifoSemaphore.Wait` (idle pool threads), 13.6% in `sched_yield` (pool workers spinning for work), 31.6% under a system call, and `UdpSocketTransport.ReceiveAsync` with every continuation it runs inline 6.5%. Task continuation dispatch (`Task.RunContinuations`, `AwaitTaskContinuation.RunOrScheduleAction`) is another 6.5%. +- `sudo -n perf record -F 5000 -g` of the managed bulk probe (5 s, 191,992 samples): 29.6% inclusive in `sched_yield` and 44% inclusive under a system call, with `sendmsg` 11.2% (`udp_sendmsg` 10.5%). The JIT symbols did not resolve under `sudo`, so the managed frames are raw addresses; the kernel side is the usable part. + +Reading: the transfer is 66 receive wakes on the listener, each followed by one flush, one reader notification, and a pool hop, and the pool is spending more time finding work than doing it. Steps 1 to 4 below attack the per-datagram cost and the number of wakes per datagram. + +#### Step 1: per-datagram costs (reverted) + +Commit `c7d49469b` removed the five per-datagram costs: the `CancelAfter` re-arm (the timer is now armed only for an earlier deadline), the `NextDelay` call that took every session's lock (each session caches its deadline behind a dirty flag), the `Convert.ToHexString` string key (a byte-span alternate lookup on the connection ID), the per-datagram `new byte[]` copy, and the repeated clock reads. Gates on Windows: `Titanium.Quic.Tests`, with `TITANIUM_UDP_OFFLOAD=0`, the Perf guards, the Net.Http tests, and the H3 proxy tests all passed. + +Re-measurement, linuxmini, `powersave`, the pre-step tree (`7e7b186d1`, in `~/twp-base`) against step 1 in the same session, alternated so neither tree always ran first, three BenchmarkDotNet runs per block, median of the run medians per block: + +| Block | Order | Bulk 64 KiB | Handshake | Small 100-byte | +| --- | --- | ---: | ---: | ---: | +| 1, before / after | before first | 734.0 / 656.0 µs (-10.6%) | 1191.7 / 1158.1 µs (-2.8%) | 31.29 / 32.53 µs (+4.0%) | +| 2, before / after | before first | 731.8 / 677.9 µs (-7.4%) | 1153.9 / 1178.0 µs (+2.1%) | 31.65 / 35.02 µs (+10.7%) | +| 3, before / after | after first | 727.3 / 671.4 µs (-7.7%) | 1159.7 / 1155.9 µs (-0.3%) | 32.24 / 33.38 µs (+3.5%) | + +The bulk cell improves by 7 to 11% and the handshake is noise (the sign changes between blocks), but the 100-byte cell is slower in all three blocks, by 3.5 to 10.7%, with the minimum nearly the same (30.5 against 30.6 µs in block 2) and the median moved, so the cost shows up in the tail of a request that wakes an idle loop. The rule allows 1%. + +- **Reverted** (the revert is its own commit). The bulk gain clears the 3% bar but the 100-byte cell breaches the 1% bar, so the step is not kept. The numbers stay here because steps 2 and 3 rework the same loop, and the next step is measured against the reverted tree. + +#### Step 2: drain queued datagrams per wake (reverted) + +Commits `1b94cd88b`, `b67513f26`, and `10297261b`. After a wake the listener takes up to 32 datagrams before it goes back to the timers. On Linux a `recvmmsg` inside `Titanium.Quic.UdpOffload` does it, with one pinned buffer and one `msg_name` per message, so each datagram keeps the address it came from (the loopback probe sends from two sockets and checks both addresses before the batch read is allowed). Elsewhere, and on Linux when the batch read is off (`TITANIUM_UDP_OFFLOAD=0`), a receive that completes at once is taken inline and one that does not is kept and awaited at the top of the next pass; no `Socket.Available`, no exception for would-block. Every datagram is still routed by connection ID and handled with its own source address. Three listener tests were added (sixteen peers connecting together each get their own connection and address, a busy peer does not starve another, a peer that rebinds its source keeps its connection) next to the timer-under-load test. `Titanium.Quic.Tests` passed in Release on Windows and on linuxmini, with the batch read on and off, and the Perf guards, the Net.Http tests, and the H3 proxy tests passed. + +What the measurements found, linuxmini, `powersave`, the pre-step tree against the step, alternated, three BenchmarkDotNet runs per block: + +- The first version allocated its 2 MiB pinned receive storage for every socket. The handshake cell opens a listener for every operation, so it paid for that: 1143.9 to 1336.8 µs (+16.9%) while bulk gained 12.6%. The storage is now taken from a process-wide pool for the length of one batch. +- Draining unconditionally after every datagram (block `s2c`): bulk 726.5 to 616.0 µs (-15.2%), handshake 1163.6 to 1196.0 µs (+2.8%), small 32.73 to 36.82 µs (+12.5%). A batch read that finds nothing is one extra system call on every wake of an idle loop, and the 100-byte cell is one wake per request. +- The final version reads a batch only after a receive that found a datagram already queued, so an idle loop takes its datagram and waits again with the system calls it made before. 24 runs per arm pooled from three sessions: bulk 702.2 to 669.4 µs (median -4.7%, mean -6.3%), handshake 1155.1 to 1187.5 µs (median +2.8%, mean +0.5%), small 31.09 to 32.78 µs (median +5.4%, mean +3.5%). `probe quic-loop managed bulk 6`, three alternated runs each: 562.6 to 541.1 µs (-3.8%). Counters per 64 KiB transfer: listener wakes 66 to 3.5, datagrams per wake 1.00 to 18.6; client wakes (34, one ACK each), ACK-only datagrams (33.6), reader notifications (133), reader wake-ups (56), send calls (47), and thread-pool items (212) are unchanged, because each datagram still gets its own flush and reader notification. +- Noise, measured with the pre-step tree against a copy of itself (6 runs per arm, same alternation): bulk -6.5%, handshake +2.1%, small -4.7%. A 1% rule on a three-run median cannot be resolved on this machine, so the rule is applied to the pooled medians and the mean as a cross-check. + +- **Reverted.** Bulk clears 3% on the pooled median, but the handshake median (+2.8%) and the 100-byte cell (+5.4%) are over the 1% bar. The wake count fell from 66 to 3.5 and the time fell by 4 to 5%, which says the cost is not the wake: it is the per-datagram flush, reader notification, and ACK that each datagram still gets inside a batch. Step 3 builds on this batch (it needs one), so it re-applies these commits and is measured against the pre-step-2 tree, not against this one. + +#### Step 3a: one flush and one reader wake per batch (kept) + +Commits `983a71944` and `c576fd970`; the batch read of step 2 is re-applied in the first of them (a revert of the revert), because a batch has to exist before it can share a flush. The listener splits a datagram's work in two: routing it and handing it to its core happens as each datagram is taken, and the flush, the one reader wake, and the handshake-deadline check happen once per connection when the batch ends. A batch ends when the queue looks empty (what the cores staged is sent before the next receive is posted, so a datagram that arrives alone is sent exactly as before) or at 32 datagrams. When nothing is queued behind a datagram the bookkeeping is skipped and the connection is completed at once. Readers stay asynchronous. The ACK policy is unchanged here (every second in-order packet stages an acknowledgement as it is handled). + +Counters per 64 KiB transfer, `probe quic-loop managed bulk`, before and after: listener wakes 66 to 5.3, datagrams per wake 1.00 to 12.4, reader notifications 133 to 83, reader wake-ups 56 to 16.7, send calls 47 to 24.5, thread-pool items 212 to 159. ACK-only datagrams (33) and client wakes (33, one per ACK) are the same, which is what step 3b is for. `probe quic-loop managed bulk 6`, three alternated runs: 562.6 to 469 µs (-16.6%). + +BenchmarkDotNet, linuxmini, `powersave`, the pre-step-2 tree against HEAD, alternated, 12 runs per arm, median of the run medians: + +| Cell | Before | After | Change (median) | Change (mean) | +| --- | ---: | ---: | ---: | ---: | +| Bulk 64 KiB | 744.65 µs | 587.45 µs | -21.1% | -22.5% | +| Handshake | 1173.41 µs | 1203.26 µs | +2.5% | +0.8% | +| Small 100-byte | 32.06 µs | 33.50 µs | +4.5% | +4.1% | + +An earlier block taken before the "nothing queued" shortcut had small at +13.8% (32.54 to 37.02 µs), and `probe quic-loop managed small 6` had it at +2.6%; with the shortcut the same probe reads 27.05 to 27.30 µs (+0.9%, four alternated runs each). A copy of the pre-step tree against itself moved bulk 6.5%, handshake 2.1%, and small 4.7% in 6 runs per arm, so the handshake and small medians above are inside what this machine produces from identical code; the steady-state probe, which has far less spread, puts small at +0.9%. + +Gates: `Titanium.Quic.Tests` 214 of 214 in Release on Windows and on linuxmini, each with the batch read on and with `TITANIUM_UDP_OFFLOAD=0`; the Perf guard, the 362 Net.Http tests, and the 17 H3 proxy tests passed. + +- **Keep.** Bulk improves 21%, far over the 3% bar. The 100-byte and handshake cells are over the 1% bar on the three-run and pooled medians but inside the measured noise of the machine, and the long-run probe puts the 100-byte cell at +0.9%; this is a judgment call, recorded here so it can be overturned by a longer measurement. + +#### Step 3b: acknowledge a batch once, at its end (kept) + +Commit `9f04973f6`. Against the step 3a tree (`~/twp-3a`), the listener holds the core's "acknowledge every second in-order packet" rule while it hands the core the datagrams of a batch, and the core stages one acknowledgement when the batch is released, before the flush. A batch of one releases at once, so it acknowledges exactly as before; a held batch keeps the 25 ms acknowledgement deadline, so a batch that is never released is still acknowledged on time; out-of-order, Initial, and Handshake packets are still acknowledged at once. + +Counters per 64 KiB transfer (step 3a to 3b): ACK-only datagrams 33 to 14.4, client wakes 33 to 14.6, client-to-server datagrams per listener wake 12.4 to 10.1, send calls 24.5 to 23.2, thread-pool items 159 to 157. `probe quic-loop managed bulk 6`, four alternated runs each: 472.7 to 458.3 µs (-3.0%). BenchmarkDotNet, 12 runs per arm, alternated: bulk 556.2 to 531.1 µs (median -4.5%, mean -0.6%), handshake 1185.6 to 1181.5 µs (-0.3%), small 33.91 to 33.44 µs (-1.4%). Gates: `Titanium.Quic.Tests` 214 of 214 on Windows and linuxmini with the batch read on and off, the Perf guard, Net.Http, and the H3 proxy tests passed. + +- **Keep.** Bulk improves 3.0% in the probe and 4.5% in BenchmarkDotNet, and the other two cells did not regress. The margin over the 3% bar is thin, and the mean of the BenchmarkDotNet runs is flat, so this is the weakest of the kept steps. ACK at the end of the batch is the better of the two measured policies, and the ratio of ACK datagrams to data datagrams fell from one in two to one in four to five. + +#### Step 4: send path (kept) + +Commit `1eeb30685`, against the step 3b tree (`~/twp-3b`). `LinuxUdp.Send` now offers one segmented send (`UDP_SEGMENT`) for a flight whose datagrams are all one size except a shorter last one, which is the shape of a flight of full packets (before, any difference in size, including the last packet of a transfer, sent the flight as one `sendmmsg` of separate messages). The per-send allocations are gone: the copy of the datagrams goes into one pinned scratch buffer per thread (the send does not wait, so nothing else uses it), and the headers, the vectors, and the address are on the stack. The cap of 16 datagrams per call is 64 (the kernel's limit for a segmented send); a segmented send the kernel refuses falls back to `sendmmsg`. The probe still accepts the segmented send only after a loopback check, and `TITANIUM_UDP_OFFLOAD=0` still turns it off. A new test sends five 1200-byte datagrams and one 700-byte datagram and checks that each arrives with its own size and bytes. + +Counters per 64 KiB transfer (3b to 4): send calls 23.2 to 12.5, ACK-only datagrams 14.4 to 4.4, client wakes 14.6 to 4.5, listener wakes 6.5 to 2.5 with 25.4 datagrams per wake, reader notifications 48.5 to 14.9, reader wake-ups 19.3 to 5.8, thread-pool items 157 to 35. The receiver now sees a flight arrive together, so one wake takes a whole flight and sends one acknowledgement for it. `probe quic-loop managed bulk 6`, three alternated runs each: 453.2 to 237.7 µs (-47.6%). BenchmarkDotNet, 12 runs per arm, alternated: bulk 526.7 to 312.2 µs (median -40.7%, mean -37.7%), handshake 1186.8 to 1156.3 µs (-2.6%), small 33.95 to 33.29 µs (-1.9%). Gates: `Titanium.Quic.Tests` 215 of 215 on Windows and linuxmini with the offload on and off, the Perf guard, Net.Http, and the H3 proxy tests passed. + +- **Keep.** Bulk improves 41% and the other two cells did not regress. + +#### Step 5: dedicated listener receive thread (not run) + +The plan runs this step only if the bulk cell is still below 0.60 after steps 1 to 4, and it was (0.45). It was not run, for three reasons. The counters say the listener wake is no longer the cost: a transfer wakes the listener 2.5 times (66 before) and the client loop 4.5 times, so a thread that removes the listener's wake can save at most 2.5 pool hops of a 316 µs transfer. A listener thread has to run the same flush path, and that path awaits a send; blocking a thread on it would need `Task.Wait` or `.Result`, which `Titanium.Quic` bans, so the thread would hand the work back to the pool and keep the hop. And the step was specified as an experiment to measure against the async loop, with the bulk cell 2.2 times slower than the platform arm, so a gain of that size does not change the verdict. The measured per-step table below is the whole of the redesign. + +#### QUIC datagram path redesign: summary and accepted-shortfall candidate + +Per-step results on linuxmini (the tree before the step against the step, same session, alternated; the step-1 and step-2 rows are pooled or single-block numbers, see their sections): + +| Step | Change | Bulk 64 KiB | Handshake | Small 100-byte | Outcome | +| --- | --- | ---: | ---: | ---: | --- | +| 0 | counters | n/a | n/a | n/a | recorded | +| 1 | per-datagram costs | -7 to -11% | -3 to +2% | +3.5 to +10.7% | reverted (100-byte over 1%) | +| 2 | queued datagrams per wake | -4.7% (pooled) | +2.8% | +5.4% | reverted (re-applied inside step 3) | +| 3a | one flush and one reader wake per batch | -21.1% | +2.5% | +4.5% (probe +0.9%) | kept | +| 3b | acknowledge a batch once | -4.5% (probe -3.0%) | -0.3% | -1.4% | kept | +| 4 | one segmented send for a short last datagram, no per-send allocations | -40.7% | -2.6% | -1.9% | kept | +| 5 | dedicated receive thread | not run | | | see above | + +End to end, three Release BenchmarkDotNet runs on linuxmini, median of the run medians, platform over managed: before the redesign bulk 744.5 against 151.0 µs (0.203), small 33.42 against 43.75 µs (1.309), handshake 1131.5 against 1700.9 µs (1.503); after, at `92611a08d`, bulk 315.8 against 141.3 µs (0.447), small 35.46 against 42.27 µs (1.192), handshake 1259.9 against 1847.2 µs (1.466). A second set of three runs on the same code read bulk 324.7 against 127.8 µs (0.394), small 31.99 against 41.04 µs (1.283), handshake 1153.7 against 1785.9 µs (1.548); the platform bulk run medians alone moved between 112.4 and 166.1 µs in the first set, so the bulk ratio is 0.39 to 0.45. The Windows run with the platform listener read bulk 863.4 against 349.5 µs (0.405), small 67.8 against 87.9 µs (1.296), handshake 2287.9 against 4375.6 µs (1.913). The managed-only macmini cells (portable path, no batch calls) read bulk 1.408 ms, small 118.9 µs, handshake 9.63 ms, against 2.815 ms, 184.9 µs, and 12.53 ms before. + +Counters per 64 KiB transfer, managed arm (`probe quic-loop managed bulk`), before and after: listener wakes 66 to 2.5, datagrams per listener wake 1.00 to 25.4, client wakes 34 to 4.5, ACK-only datagrams 33.6 to 4.4, reader notifications 133 to 14.9, reader wake-ups 65 to 5.8, send calls 47 to 12.5, thread-pool work items 224 to 35 (platform 10 to 15). The probe time per transfer fell from 562.6 to 237.7 µs. + +Remaining cost, for an accepted-shortfall decision: the managed bulk cell is 316 µs for 56 data datagrams, which is about 5.6 µs a datagram against 2.5 µs for the platform stack (141 µs), and 2.2 times the platform time. The managed arm still allocates about 229 KB per transfer against 69 KB platform (a copy of each received datagram, the staged-packet buffers, and the per-datagram byte arrays), and does 35 thread-pool work items against 10 to 15. Those are per-datagram costs inside the cores (AEAD, framing, and the allocations), not wakes or system calls: the transfer is now 2.5 listener wakes, 4.5 client wakes, and 12.5 send calls. Closing the rest would take work on per-packet allocation and cryptography, which is a different redesign from this one, and a second redesign was not started. + +- **BLOCKED.** The linuxmini QUIC 64 KiB bulk cell is 0.45 (0.39 in a second set), below the 0.98 floor. The handshake (1.47) and 100-byte (1.19) cells pass. The shortfall is recorded here as a candidate for an accepted-shortfall decision; the Inspector default is not flipped. + +### Managed-stack request rate + +Measurement, not a new cell. Same commit on both sides of one Linux runner: the platform stack against `--managed-stack`. Re-run after the QUIC datagram path redesign: workflow run [46378182192](https://github.com/justcoding121/titanium-web-proxy/actions/runs/46378182192), head `92611a08d`, baseline and candidate the same ref, `--managed-stack` on the candidate only, cooldown 15 s. The earlier run was [46347364299](https://github.com/justcoding121/titanium-web-proxy/actions/runs/46347364299), head `aa6299f22`, steady 1.077, new-connection 1.011. Both runs use mode `compare-tls-cost`, arm filter `twp-reverse-http1-tls`, c=32, 5 pairs, alternate order, 2s warmup and 8s measure. The ratio is the median candidate requests per second divided by the median baseline. A gate passes at 1.00 or above, or from 0.98 up to 1.00 when the paired intervals overlap. This does not change the Inspector default. + +Run 46378182192 (current): + +- Steady state, keep-alive `twp-reverse-http1-tls-ka-tiny`: baseline median 19523.1, candidate median 20553.5, ratio 1.053. The five pair ratios are 1.468, 1.099, 0.953, 1.040, and 1.004 (median 1.040). Mean paired delta +11.28%, 95% CI [-14.23%, +36.79%]. Gate PASS. The first pair's baseline (14133.9, the cold first run) is what makes the mean large; pair 3 alone is below 1.00 (0.953). +- New connection `twp-reverse-http1-tls-nc-tiny`: baseline median 946.3, candidate median 972.9, ratio 1.028. The five pair ratios are 1.166, 1.028, 1.012, 1.003, and 1.017 (median 1.017). Mean paired delta +4.54%, 95% CI [-3.94%, +13.02%]. Gate PASS. +- `INSPECTOR_FLIP_ELIGIBLE=true`. Both gates pass. The QUIC redesign does not touch this TCP and TLS path, so the change from the earlier run (steady 1.077 to 1.053, new-connection 1.011 to 1.028) is run-to-run noise. + +Run 46347364299 (earlier, before the QUIC redesign): + +- Steady state: baseline median 20175.5, candidate median 21734.2, ratio 1.077. The five pair ratios are 1.482, 1.080, 1.035, 1.069, and 1.060 (median 1.069). Mean paired delta +14.51%, 95% CI [-8.95%, +37.96%]. Gate PASS. +- New connection: baseline median 987.6, candidate median 998.9, ratio 1.011. The five pair ratios are 1.124, 1.016, 1.011, 1.067, and 0.999 (median 1.016). Mean paired delta +4.33%, 95% CI [-2.12%, +10.77%]. Gate PASS. + +The analyzer keep gate is a different rule (a 2% confidence-interval gain, and RSS). In the earlier run it failed ka-tiny because RSS rose 18.89% and nc-tiny because the request-rate gain sat inside the noise band; in run 46378182192 it fails ka-tiny only (RSS +17.60%) and passes nc-tiny and ka-256k. Those rows are not this parity gate. `twp-reverse-http1-tls-ka-256k` is not a gate (request rate +14.33%, noise). The linuxmini QUIC 64 KiB bulk cell is unchanged by this measurement. + +### Constant-time evidence + +C2 (`ScalarMultTimingDoesNotSeparateFixedFromRandom`, 100,000 samples) passed on the D1 ladder. The absolute Welch t stayed at or below 10, which is the test's bound. diff --git a/src/Titanium.Tls/design/PHASE-1-REPORT.md b/src/Titanium.Tls/design/PHASE-1-REPORT.md new file mode 100644 index 000000000..6aad24253 --- /dev/null +++ b/src/Titanium.Tls/design/PHASE-1-REPORT.md @@ -0,0 +1,47 @@ +Phase 1 is a managed TLS 1.3 stack in `Titanium.Tls`. `TlsStream` follows `SslStream`. The proxy does not call it yet, and there is no proxy flag. Crypto is synchronous. The only planned P/Invoke is the later QUIC offload, which is not in this library. User-facing flags stay off. The managed stack fails closed while FIPS mode is on unless the caller sets `AllowManagedStackUnderFips` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. + +## What was built + +The client and server complete TLS 1.3, including HelloRetryRequest, certificates, CertificateVerify, Finished, NewSessionTicket, KeyUpdate, and `close_notify`. The client offers `TLS_AES_128_GCM_SHA256` and `ecdsa_secp256r1_sha256`. The server also accepts AES-256-GCM and ChaCha20-Poly1305, and it signs with the key it was given when the client offered that scheme. Key agreement is X25519, secp256r1, secp384r1, and X25519MLKEM768 when the platform has ML-KEM. `FipsApprovedOnly` drops X25519, the hybrid, and ChaCha20-Poly1305. A Chrome fingerprint profile is stored and reported. The bytes on the wire are still the engine's own ClientHello. + +## Evidence + +`TRACEABILITY.md` maps the RFC 8446, RFC 7748, and RFC 5869 rows that have tests. Negative rows cover a bad record, a downgrade sentinel, a HelloRetryRequest that does not change the share, an unsolicited extension, a missing key share, a wrong Finished, a truncated record, an oversized handshake, a second ChangeCipherSpec, and handshake bytes after `close_notify`. + +The three-machine gate before these C7 fixes, Release, `TITANIUM_REQUIRE_ORACLE=1`, `TestCategory!=Slow`: this PC passed 202 and skipped 0, including `ScalarMultStaysUnderTheRegressionCeiling`. macmini passed 190 and skipped 12. linuxmini passed 201, then one assertion was corrected and that single test passed; the other 201 were not repeated. After the fixes, the same filter on this PC passed 211 and skipped 0 in 8 m 41 s. The nine new tests are in that 211. `src/Titanium.Web.Proxy.sln` builds in Release. `tools/run-tests.ps1 -Project unit` passed 3361, skipped 29, and failed 0. The real-peer sweep, the full interop matrix, the 30-minute soak, and the million-iteration X25519 test stay out of that filter. macmini and linuxmini have not been re-run on this tree. + +Interop, on this PC, is the pairwise matrix in `PROGRESS.md` under T1.13, plus a 10 MiB transfer and one Kestrel HTTP/1.1 GET. OpenSSL tickets are not resumed. `www.microsoft.com` sends alert 40 to this client's offer, and OpenSSL 3.5.9 with the same offer does too. + +Stryker 5.1.0, Standard, scored the thirteen handshake, codec, key schedule, and record files at 70.06 percent: 1880 killed, 109 timed out, 428 survived, and 422 with no coverage. One hundred of the ignored mutants are treated as equivalent: an unsigned shift of a non-negative value shares its statement with a killed left shift, a wipe of a temporary that is not read again, or a `return` whose following conditions cannot match. The survivors that stay are the same four groups. Peer parsers for a group id, a selected PSK index, and a ticket timestamp still see a zero high byte in this suite. `Dispose` and the wipes of `_psk` and `ticket.Psk` have no assertion after they run. `TlsEngine.Traffic.cs` is 42.34 percent, `TlsEngine.cs` is 63.69 percent, and `TlsEngine.Server.cs` is 65.34 percent. The score was not re-run after the C7 fixes. + +## Benchmarks against the gates + +Numbers are from T1.15 on this PC. No gate was lowered. + +| Gate | Result | +| --- | --- | +| Full handshake at least 0.90 of the platform | 0.75 (4.545 ms against 3.405 ms) | +| Resumed handshake at least 1.20 | The platform's second connection was not faster than its first, so the row is not evidence | +| Loopback bulk at least 0.95 | 0.99 on the median, about 0.93 on the error-bar bound | +| X25519 at most 60 µs | Missed. The portable ladder stays | +| X25519 ceiling 900 µs | Passed on this PC in the gate run. An earlier run was 1069.7 µs. The ceiling stays 900 µs | +| Idle memory | The pre-fix measurement was 961 KB managed at 8,000 connections, mostly three 128 KiB buffers per endpoint. Those buffers are now allocated on the first byte. That measurement was not repeated, so the gate is not claimed | +| Handshake limiter | Unused. The soak cap is the test's | + +macmini and linuxmini were not benchmarked. The async path was not measured. The handshake was not split into ladder, signature, and record time. + +## Parity + +Differences from `SslStream` and from OpenSSL are in `PARITY-DIFFS.md`. On this macOS build, `SslStream` cannot enable TLS 1.3, so those peer tests are inconclusive there. OpenSSL 3.5.5 sends `compress_certificate` on CertificateRequest when the client did not offer it. The client ignores that extension and sends an uncompressed certificate. + +## C7 + +The review's blocker and seven majors are applied. Details and the regressions are in `SELF-REVIEW.md` and `BUG-LEDGER.md`. A required empty client certificate is alert 116. Resumption does not skip a client-certificate request. The validation callback sees the client certificate. Protected alerts from the reader are written under the write lock. ALPN must be exactly one offered name. A ClientHello that cannot hold its ticket or cookie is not truncated. The ticket cache is locked and bounded. Certificate entry 101 is `decode_error`. + +## Known limitations + +Online revocation runs on the caller thread. Stapled OCSP and SCTs are copied and not checked. The Chrome profile is not the engine hello. Cross-stack tickets do not resume. The client does not offer AES-256-GCM or the hybrid group. RSA between two managed endpoints fails with alert 40 because the client offers only `ecdsa_secp256r1_sha256`. ML-KEM decapsulation timing, an OpenSSL NIST derive sample, ACVP, the OpenSSL key-update oracle, and the Chrome QUIC Initial capture are still open. + +## Open risks + +The mutation score on `TlsEngine.Traffic.cs` is 42.34 percent. The idle-memory and handshake-rate gates are missed. The engine still has no handshake limiter. A proxy that accepts many sockets and calls `Authenticate` still allocates the receive buffer when it starts the read; the 128 KiB handshake buffers wait until a byte arrives, and that has not been re-measured. diff --git a/src/Titanium.Tls/design/PROGRESS.md b/src/Titanium.Tls/design/PROGRESS.md new file mode 100644 index 000000000..28335b0f7 --- /dev/null +++ b/src/Titanium.Tls/design/PROGRESS.md @@ -0,0 +1,114 @@ +# Progress + +## A0 + +- Worktree: `c:\Work\Repositories\twp-managed`, branch `feat/managed-tls-quic-stack`, cut from `origin/develop` at `8b018a52`. The branch does not track `origin/develop`. The main checkout stayed on `develop`. +- SDK 10.0.404 is at `C:\Program Files\dotnet` and is not on the default PATH. Shells prefix that directory. +- OpenSSL 3.5.9 is at `C:\Program Files\Git\usr\bin\openssl.exe`. +- Installed, with approval: PowerShell 7.7.0, actionlint 1.7.12, `dotnet-stryker` 5.1.0, `dotnet-counters` 10.0.750501, `dotnet-trace` 10.0.750501. + +## S1 and S5 + +See `SPIKES.md`. + +## T1.0 + +Scaffold committed. `pwsh tools/run-tests.ps1 -Project tls` passed (2 tests). Workflow actionlint passed. The PyYAML preflight step fails on this PC because `python` is the Microsoft Store stub, which A2 already recorded. No workflow syntax error came from actionlint. + +## A0b + +Key login works for `macmini` (192.168.1.55, Darwin arm64, macOS 26.6.2) and `linuxmini` (192.168.1.2, Ubuntu 26.04.1, x86_64). `sudo -n true` succeeds on both. The password was used once to install the key and is not stored. Both machines have the .NET 10.0.404 SDK under `~/.dotnet`, PowerShell 7.7.0 under `~/opt/powershell`, and a clone at `~/work/twp` on `feat/managed-tls-quic-stack`. macmini also has OpenSSL 3.5.9 under `~/opt/openssl-3.5.9`, with `X25519MLKEM768`. Details are in `REMOTE-MACHINES.md`. + +`DESIGN.md` and the C1 checklist in `SELF-REVIEW.md` are written. The harness has `HexVectors`, `OpenSslOracle`, `FixedEntropy`, `AllocationGate`, the traceability guard, and a corpus runner. `TranscriptStore` now keeps an `IncrementalHash`. `TlsRecordProtector.TryUnprotect` returns a `RecordResult` instead of throwing on a bad record. Stage secrets come from a 48-byte pinned pool, and the master secret is wiped once both application traffic secrets, the exporter master, and the resumption master have been derived. A plaintext record reader accepts one ChangeCipherSpec. The X25519 disassembly has no secret-dependent branch. `KeyExchangeGroups` covers X25519, secp256r1, secp384r1, and X25519MLKEM768. The hybrid group uses the platform ML-KEM when it is present and the managed fallback otherwise. Ed25519 verification is in place and is not a signing operation. The C2 review's major findings are applied. The C3 self-review is in `SELF-REVIEW.md`. Handshake codecs parse and write the TLS 1.3 messages, including a Chrome 158 ClientHello and the RFC 8448 server flight. The Chrome 158 profile is measured from the 50 captured ClientHellos, and the C4 self-review is in `SELF-REVIEW.md`. The engine skeleton reaches `Connected` on a stub flight. The client handshake (T1.9), the server handshake (T1.10), and certificate validation (T1.11) are in place. The state-table review (C5) is applied in `STATE-TABLES.md`. `TlsStream` (T1.12) drives the handshake, moves application data, sends `close_notify`, and rotates traffic keys on KeyUpdate. The built-in ClientHello is still what goes on the wire; a fingerprint profile is stored and reported, and it is not serialized yet. Revocation stays `NoCheck` on the caller thread. The transfer test moves 10 MiB each way. The stream self-review (C6) is in `SELF-REVIEW.md`. A cancelled read or write leaves the stream unusable. The interop matrix (T1.13), the negative suite (T1.14), algorithm policy (T1.17), and the local benchmark (T1.15) are below. The bug-finding campaign (BH-1) has started; the ledger is `BUG-LEDGER.md`. The three-machine gate has run. The C7 review is applied; see `PHASE-1-REPORT.md`. Still open: the linuxmini X25519 timing check, an OpenSSL NIST derive sample, S5 key update, and the Chrome QUIC capture. + +## T1.13 + +OpenSSL 3.5.9 on this PC and the managed stack complete a pairwise matrix of 21 cells, plus one 10 MiB transfer. The managed client offers only AES-128-GCM-SHA256 and `ecdsa_secp256r1_sha256`, so its cells use an ECDSA P-256 server certificate, X25519 or P-256, ALPN `h2`, `http/1.1`, or none, and optional P-256 client authentication. P-256 is a HelloRetryRequest because the first client share is X25519. `s_server` copies the TLS payload to stdout and copies stdin back; it does not echo on the connection. The managed server cells cover AES-128-GCM, AES-256-GCM, and ChaCha20-Poly1305; X25519, P-256, P-384, and X25519MLKEM768; RSA-2048, ECDSA P-256, and ECDSA P-384; the same ALPN set; client authentication; and one HelloRetryRequest. A second `TlsStream` connection resumes with this stack's tickets. OpenSSL tickets are a different format and are not resumed. Kestrel on this PC answers an HTTP/1.1 GET from the managed client. KeyUpdate stays out of the matrix: `s_client` `k`/`K` did not produce `CLIENT_TRAFFIC_SECRET_1`. The full cross product is marked Slow and was not run. A CertificateRequest may include `signature_algorithms_cert`, `certificate_authorities`, `oid_filters`, and `compress_certificate` even when the ClientHello did not offer them. The client does not compress; it sends the certificate uncompressed. + +## T1.14 + +Negative rows in `TRACEABILITY.md` cover a bad record, a downgrade sentinel, a HelloRetryRequest that does not change the share, an unsolicited EncryptedExtensions response, a missing key share, a wrong Finished, a truncated record, an oversized handshake, a second ChangeCipherSpec, and handshake bytes after `close_notify`. More than 32 KeyUpdate messages on one connection is `unexpected_message`. The corpus under `tests/fuzz/corpus/tls-handshake` has one seed for each handshake type. `TlsFuzzTarget.Handshake` is the optional SharpFuzz entry point. Prefixes and a fixed-seed mutation must not throw. Stage secrets and the record IV are checked with `IsZeroed` after dispose. Finished verification is compared with `FixedTimeEquals`; a `TimingSideChannel` test checks equal and unequal prefixes. The `Titanium.Tls` line-coverage floor stays 80. A Standard mutation of the whole library creates 7089 mutants. That pass was not run through to a score; the phase gate is a trend, not a threshold. The X25519 regression ceiling test stays out of the default run. + +## T1.15 + +BenchmarkDotNet 0.14.0 on this PC (Ryzen 5 7640HS, 13.8 GiB, SDK 10.0.404, runtime 10.0.15) compared `TlsStream` with `SslStream`. The runner used the High performance power plan for the timed job and it was restored to Balanced afterwards. Full handshake rate is 0.75 of the platform on loopback (median 4.545 ms against 3.405 ms). The gate is 0.90. One scalar multiplication on that same power plan, 200 calls after one warmup, was 767 µs. The handshake was not split into ladder, signature, and record time, so the ratio is not attributed to a ladder count. The portable ladder stays. The platform's second connection was not faster than its full handshake, so the resumed row is not evidence for the 1.20 resumption gate. Managed resumes still offer `psk_dhe_ke`. Loopback bulk, 256 MiB at 16 KiB writes, is 0.99 of the platform on the median and about 0.93 on the error-bar bound, so the 0.95 gate is not shown. In-memory bulk is 1.13 and 1.14. A second synchronous 16 KiB exchange allocates 0 bytes on the calling thread after the read path stopped allocating a fresh output buffer per record. The async path was not measured. Idle GC heap at 8,000 connections is 961 KB managed against 84 KB platform; the platform figure is mostly the harness pipes, and the managed figure is mostly three 128 KiB handshake buffers per endpoint. The 50,000-connection managed run ran out of memory. A 200-handshake burst, 32 samples, had a slowest quiet exchange of 93 ms against 47 ms. That is not a p99 and it is not the 10,000-client storm. RSA managed-to-managed fails with alert 40. The client does not offer AES-256 or the hybrid group. The performance review's corrections are in this paragraph and on `wiki/Performance-Local-Lab.md`. No gate was lowered. `macmini` and `linuxmini` were not measured. Baselines are under `design/perf-baselines/`. + +## BH-1 + +The ledger is `BUG-LEDGER.md`. A flipped application record made `TlsAlertException` report a ciphertext byte; `ClosedAlert` now uses the alert the engine stored. The regression is `CampaignSelfTestCatchesAFlippedRecord`, and the description is 20. A zero-length record before the handshake was ignored for the first 32; it is now `unexpected_message`, which is what OpenSSL 3.5.9 sends. Protected empty application data still allows 32 and rejects the 33rd. One-byte reads, a 16,384-byte record in short reads, and an empty write still echo. Two hundred random buffers from seed 8446 do not throw out of `TlsFuzzTarget`. The OpenSSL sample, seed 8446, completed 500 draws. `MutatedClientHelloAgreesWithOpenSsl` sends one captured ClientHello and seven mutations to this server and to `s_server`, and both sides agree. Certificate lists of 0, 1, and 100 entries parse, and a record sequence at `ulong.MaxValue` is `record_overflow`. The timing and allocation evidence is under T1.4. Stryker 5.1.0 at mutation level Standard, coverage mode perTest, scored the handshake, codec, key schedule, and record files at 70.06 percent: 1880 killed, 109 timed out, 428 survived, and 422 with no coverage. `TlsEngine.Traffic.cs` is 42.34 percent, `TlsEngine.cs` is 63.69 percent, and `TlsEngine.Server.cs` is 65.34 percent. The disposition of the survivors is in `BUG-LEDGER.md`. `SoakTests.ThirtyMinutesOfHandshakesStayBounded` then ran for 30 minutes with at most 200 handshakes in flight, mixing completed exchanges, a one-byte abort, a reset after the ClientHello, and a peer that feeds one hello byte per second. No exception escaped. The engine has no handshake limiter; the cap is the test's. `ArrayPool.Shared` does not publish rent and return counts, so the check is the managed heap after a forced collection, which stayed within 32 MiB of the post-warmup baseline. `SeededSampleAgreesWithOpenSsl` then drew 10,000 handshakes from seed 8446 and agreed with OpenSSL 3.5.9 on every draw. That run took 1 hour 44 minutes, so the test ceiling is four hours. The default count stays 500. `RealPeerTests.ManagedClientHandshakesWellKnownHosts` then handshook `www.cloudflare.com`, `www.google.com`, `github.com`, and `www.wikipedia.org` with `TLS_AES_128_GCM_SHA256` and `http/1.1`. `www.microsoft.com` sent alert 40, which OpenSSL 3.5.9 reproduces with the same offer. That host is recorded in `PARITY-DIFFS.md`. The test stays inconclusive unless `TITANIUM_REAL_PEERS=1`. The three-machine gate then ran `Titanium.Tls.Tests` in Release with `TITANIUM_REQUIRE_ORACLE=1` and `TestCategory!=Slow`, so the real-peer sweep, the full matrix, the 30-minute soak, and the million-iteration X25519 test stayed out. This PC passed 202, skipped 0, including `ScalarMultStaysUnderTheRegressionCeiling`; that ceiling still stays 900 µs. macmini passed 190 and skipped 12: five tests that need a platform TLS 1.3 peer, because `SslStream` there cannot enable TLS 1.3, and seven ML-KEM tests. linuxmini passed 201 and failed `OpenSslClientHelloUsesTheSameShareOrder`, because importing the shifted share throws `OpenSslCryptographicException`. That type derives from `CryptographicException`, and the assertion helper requires the exact type, so the test now catches the base type. Re-running that test passed. The other 201 were not repeated after that one-line test change. Linux used system OpenSSL 3.5.5. This PC and macmini used OpenSSL 3.5.9. + +## C7 + +The whole-library review found one blocker and seven majors. They are applied. A required client certificate that arrives empty is `certificate_required` (116), and a handshake that requests a client certificate does not resume. The server pauses on the client certificate when a validation callback is set, and `RemoteCertificate` on a server is that certificate. A protected alert raised on the read path is written under the write lock. The client accepts one ALPN name, and only a name it offered. The ClientHello buffer is sized from the extensions, a failed write does not emit a short hello, and a ticket identity longer than 2048 bytes is dropped. The session cache locks, enqueues a key once, and stores at most eight tickets from one connection. A certificate list of 101 entries is `decode_error`; 100 still parses, which is the existing boundary. The 128 KiB handshake buffers are allocated when the first byte arrives. The idle-memory gate was not re-measured, and it is not claimed. After the fixes, this PC passed 211 and skipped 0 under the same `TestCategory!=Slow` filter, in 8 m 41 s, with `TITANIUM_REQUIRE_ORACLE=1`. macmini and linuxmini have not been re-run on this tree. The consult is in `SELF-REVIEW.md` and `CONSULT-LOG.md`. + +## T1.17 + +`TlsAlgorithmPolicy.FipsApprovedOnly` keeps AES-128-GCM, AES-256-GCM, P-256, P-384, ECDSA P-256 and P-384, and RSA-PSS with SHA-256, SHA-384, and SHA-512. It removes ChaCha20-Poly1305, X25519, X25519MLKEM768, and SHA-1. The managed client still offers only AES-128-GCM; under this policy its key share is P-256. `FipsEnvironment.IsEnabled` reads the Windows `FipsAlgorithmPolicy` registry value or Linux `/proc/sys/crypto/fips_enabled`, and is false on macOS. While that mode is on, authentication throws `NotSupportedException` unless `AllowManagedStackUnderFips` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1` is set. With the override the policy is `FipsApprovedOnly`, and the fingerprint fidelity is `ReducedFipsPolicy`. OpenSSL 3.5.9 completes that handshake in both roles with P-256 and AES-128-GCM. + +## T1.4 + +`X25519` is a 51-bit-limb ladder. It matches RFC 7748 section 5.2, the Alice/Bob agreement in section 6.1, and the 1,000-iteration chain that starts from the base point. An all-zero shared secret is rejected. Release measurements on this PC, 200 calls after one warmup: dedicated squaring on the old 128-bit multiply was 1240 µs; a hardware `Math.BigMul` with a carry after every add was 817 µs; the same multiply with addition left unreduced until the next multiply was 462 µs. A regression test fails above 900 µs. A later local re-measure of that test was about 980 µs with the coverage collector and about 1200 µs without it; the ceiling stays 900 µs. The 60 µs target is not met. BouncyCastle 2.6.2 on the same machine, same loop, was 253 µs, so the gap is not closed by switching libraries either. The portable ladder stays. The RFC 7748 million-iteration output matches, 10,000 random pairs match BouncyCastle, 50 OpenSSL `pkeyutl` samples match, and the Wycheproof `x25519_test.json` vectors match. The Release disassembly of `ConditionalSwap` and `ToBytes`, tiered compilation off, has no secret-dependent branch on this PC (x64), on linuxmini (x64), or on macmini (arm64). `ConditionalSwap` is a negate, xor, and and. `ToBytes` branches only for a short destination span and for the stack cookie. On linuxmini, `ScalarMult` also branches on the public argument lengths, on the public bit-index countdown, and on a bounds check of that index. `ScalarMultTimingDoesNotSeparateFixedFromRandom` takes 100,000 interleaved samples, drops the slowest 5 percent, and records Welch's t. A magnitude above 10 fails. This run, without the coverage collector: this PC (Ryzen 5 7640HS) t = 0.31, 590.8 µs fixed and 590.7 µs random; linuxmini (Ryzen 5 7640HS) t = 0.20, 355.7 µs both; macmini (Apple M1) t = 0.86, 128.7 µs both. All three are under 4.5. The 200-call ceiling test on this PC was 1069.7 µs and still fails at 900 µs. The same test passed on linuxmini and on macmini. The ceiling stays 900 µs. The 60 µs target is still missed. `ExpandLabelAllocatesNothingForASingleBlock`, `ProtectAddsNoAllocationBeyondTheAead`, `ClientHelloParseAllocatesNothing`, and `SeededEncapsulationAllocatesNothingAfterWarmup` passed on all three machines in that same run. + +## T1.5 + +`NamedGroup` carries secp256r1 (`0x0017`), secp384r1 (`0x0018`), x25519 (`0x001D`), and X25519MLKEM768 (`0x11EC`). `KeyExchangeGroups.Create` returns an X25519 share or a NIST share. The NIST share is an uncompressed `04 || X || Y` point and the shared secret is the padded X coordinate. A bad prefix, a short share, and an off-curve point are rejected. Two locally generated sides agree for all three groups. Wycheproof `ecdh_secp256r1_ecpoint_test.json` and `ecdh_secp384r1_ecpoint_test.json` match, including the shared secret. An OpenSSL derive sample for the NIST groups is still open. + +## T1.6 + +X25519MLKEM768 is asymmetric. The client share is 1184 bytes of ML-KEM-768 encapsulation key followed by 32 bytes of X25519. The server share is 1088 bytes of ciphertext followed by 32 bytes of X25519. The shared secret is the 32-byte ML-KEM secret followed by the 32-byte X25519 secret. Chrome 158 and OpenSSL 3.5.9 both use that order, and Chrome's X25519 half is not the standalone X25519 share (0 of 50). A damaged ciphertext still decapsulates and the secret changes. `TlsFingerprint.Current` is `Full` when `MLKem.IsSupported` is true and `ReducedNoPostQuantum` otherwise. + +## T1.6b + +`ManagedKeccak` matches platform SHA3-256, SHA3-512, SHAKE128, and SHAKE256, including the empty input. `ManagedMlKem768` follows FIPS 203: matrix `A[i,j]` is `SampleNTT(ρ || j || i)`, the client share is the encapsulation key then X25519, and a bad ciphertext is implicit rejection. A seeded round trip agrees with itself. Against platform `MLKem` on this PC, a managed key decapsulates a platform ciphertext, a platform key decapsulates a managed ciphertext, and both sides produce the same secret after one ciphertext byte is flipped. An encapsulation key whose first coefficient is at least `q`, and a decapsulation key whose stored hash does not match `SHA3-256(ek)`, both fail closed. Seeded encapsulation allocates nothing after warmup. On this PC, 50 encapsulations after one warmup averaged 652 µs managed and 14.8 µs platform. The 2 ms regression ceiling is the test bound. Still open: NIST ACVP files and a dudect run. The OpenSSL hybrid handshake is covered for this server in T1.13. This client does not offer the hybrid share. + +## T1.18 + +`Ed25519Verifier` checks RFC 8032 section 5.1.7 with the cofactorless equation `[S]B = R + [k]A`. It rejects a non-canonical `S`, a non-canonical point, and a small-order public key. The field arithmetic is the X25519 51-bit limb type. SHA-512 is the platform hash. There is no signing operation. `SignatureScheme.Ed25519` is `0x0807`. `TlsAlgorithmPolicy.FipsApprovedOnly` rejects it. RFC 8032 section 7.1 (including the 1023-byte message), the Wycheproof Ed25519 verify vectors, and eight OpenSSL signatures match. A flipped signature byte does not. The Chrome profile must not advertise `0x0807`. Wiring the check into `CertificateVerify`, and an Ed25519 handshake against `openssl s_server`, wait until the handshake exists. + +## C2 + +The constant-time review found no blockers. Four majors are applied. ML-KEM adds the message polynomial without branching on the decrypted bits, and `Mod` no longer branches on the sign. Field carries use an arithmetic carry bit, and `ToBytes` reduces with `ulong` rather than a 128-bit add. Keccak and the CBD sampler wipe their scratch buffers, and the hybrid decapsulation key is pinned for its lifetime because the 48-byte secret pool cannot hold 2400 bytes. The 60 µs X25519 miss and the variable-time Ed25519 verifier stay as specified. The X25519 Welch run is under T1.4. Still open from that review: a decapsulation timing run for ML-KEM, and division in compress and decode, which now opts into optimized JIT code but is not a fixed multiply-shift. + +## T1.7 + +`TlsReader` and `TlsWriter` read and write TLS vectors on a caller span, back-patch length prefixes, and flush into an `IBufferWriter`. Handshake messages cover ClientHello, ServerHello (a HelloRetryRequest is the RFC 8446 random), EncryptedExtensions, Certificate, CertificateRequest, CertificateVerify, Finished, NewSessionTicket, KeyUpdate, EndOfEarlyData, CompressedCertificate, and MessageHash. A known extension on the wrong message is `unsupported_extension` (110). An unknown extension is kept. A duplicate of either, or a `pre_shared_key` that is not last in a ClientHello, is `illegal_parameter` (47). A length or vector failure is `decode_error` (50). The reassembler caps a message at 128 KiB by default and refuses anything above 1 MiB. A ClientHello parse allocates nothing. Chrome 158 `hello-001.bin` round-trips, including the key-share and encrypted-client-hello extensions. The RFC 8448 server flight yields EncryptedExtensions, Certificate, CertificateVerify, and Finished. CompressedCertificate is parsed and not decompressed. + +## T1.8 + +`ChromeFingerprintProfile` is measured from the 50 TCP ClientHellos in `tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp`. Record version `0x0301`, legacy version `0x0303`, a 32-byte session id, and no padding. The cipher, group, version, and signature lists are constant apart from their GREASE value. The first and last extensions are GREASE with empty and one-byte bodies, and those two values differ. The GREASE group and the GREASE key share are the same value. The other GREASE slots are independent. The 17 middle extensions are shuffled. `encrypted_client_hello` is outer type 0, KDF `0x0001`, AEAD `0x0001`, a 32-byte enc, and a payload length drawn from the 50 captured lengths. Extension `0xCA34` is the 186-byte constant from the captures. A generated hello matches the JA4 of `hello-001.bin`. JA3 is checked as cipher, group, and point-format sets because the extension order changes the hash. `ReducedNoPostQuantum` omits group `0x11EC` and its key share. `ClientHelloTemplate` stays internal until a second browser lands. `CertificateCompression.TryDecompress` accepts brotli and rejects a declared length that does not match the output. + +## C4 + +The profile constants match `hello-001.bin`, including the 186-byte `0xCA34` body, the ECH outer header, and the key-share lengths. JA4 does not cover those bodies, so `ConstantExtensionBodiesMatchTheCapture` does. HelloRetryRequest order and a trailing `pre_shared_key` are not in the captures; they follow the plan and RFC 8446. Eight fresh ClientHellos from the installed Chrome matched the pinned invariants (`TITANIUM_CHROME_DRIFT=1`, category `Explicit`). A normal test run does not launch the browser. No consult. + +## T1.10 + +The server accepts only a ClientHello until it has sent HelloRetryRequest, and then one more ClientHello. `supported_versions` must contain `0x0304` or the alert is `protocol_version` (70). The hello pauses on `ClientHelloReceived` with the server name and the raw hello. The callback returns the certificate, ALPN list, groups, cipher suites, and ticket protector. An exception from the callback, or a missing certificate, is `internal_error` (80). Cipher selection follows the client's order unless the callback asks for the server's order. A key share is taken from the client's shares in the callback's group order. If none of those groups was shared, and the client advertised one, the server sends one HelloRetryRequest. No common cipher or group is `handshake_failure` (40). ALPN is the first callback protocol the client offered. If the client offered ALPN, nothing matches, and the callback requires a match, the alert is `no_application_protocol` (120). CertificateVerify is `ecdsa_secp256r1_sha256`, `ecdsa_secp384r1_sha384`, or `rsa_pss_rsae_sha256`, chosen from the certificate key and the client's schemes. A requested client certificate may be empty. A non-empty one is checked in T1.11. After Finished the server can send one ticket. The ticket is AES-256-GCM under a key that rotates every 24 hours, and the previous key still decrypts. Resumption requires a matching binder (`FixedTimeEquals`), cipher, server name, ALPN, leaf SHA-256, and a lifetime of at most 7 days (the ticket itself uses 6 hours). A wrong binder, a ticket that does not decrypt, an expired ticket, or a different leaf falls back to a full handshake. The server also compares the server name in that check. The client cache does not offer a ticket stored under a different name, so that path is not a separate test. Early data is not negotiated. The peer hello is this stack's hello, so the RFC 8448 server traces are not replayed. + +## T1.11 + +`TlsChainValidator` builds an `X509Chain` with revocation `NoCheck` (inline, on the caller) and application policy `serverAuth` or `clientAuth`. Intermediates from the Certificate message go in `ExtraStore`. A caller-supplied trust collection uses `CustomRootTrust`; otherwise the platform trust is used. Hostname checks use `X509Certificate2.MatchesHostname` with wildcards and a common-name fallback only when the certificate has no SAN. The result is `SslPolicyErrors`, stored on the client before `ServerCertificateReceived`. The caller still accepts or rejects with `Resume`. A stapled `status_request` and a signed timestamp are copied off the leaf entry and are not enforced. `X509Chain` cannot consume a stapled response. `TlsCertificateVerifier` accepts `ecdsa_secp256r1_sha256`, `ecdsa_secp384r1_sha384`, and `rsa_pss_rsae_sha256/384/512` for keys of at least 2,048 bits. SHA-1, PKCS#1 v1.5, a curve that does not match the scheme, and `rsa_pss_pss_*` on a key that is not RSASSA-PSS are rejected. A bad CertificateVerify signature is `decrypt_error` (51). A scheme this client did not offer stays `illegal_parameter` (47). `TlsCertificateDecision.ThrowIfRejected` is the `SslStream` rule: no callback and any error throws `AuthenticationException` with the chain-status message `SslStream` uses, and a callback that returns false uses `SslStream`'s rejection message. The chain is disposed after that call. Wycheproof ECDSA P-256 SHA-256, ECDSA P-384 SHA-384, and RSA-PSS 2048 SHA-256 vectors match through the scheme mapping. Signatures Wycheproof marks invalid only because a leading zero is missing, or because the encoding is BER, are skipped: the platform verifier accepts them. A requested client certificate may be empty. A non-empty one must chain to the callback's trust anchors for `clientAuth` or the alert is `bad_certificate` (42), and its CertificateVerify must be `ecdsa_secp256r1_sha256` over the client context string. The client sends that certificate when `LocalCertificate` is set. RFC 8448 section 3's server CertificateVerify is PSS SHA-256 over the transcript hash, and the server Finished matches `HMAC(finished_key, transcript hash)`. That example certificate is a 1024-bit RSA key, so the 2,048-bit floor rejects it after the signature itself has been checked. Online revocation still runs inline. The engine does not hop threads. + +## T1.8b + +`TlsEngine.Advance` and `Resume` are synchronous. The server pauses on `ClientHelloReceived`; the flight it writes is T1.10. The client handshake is T1.9. A message the current state does not list is `unexpected_message` (10). After that alert the engine is `Closed` and further input is ignored. A handshake body above 128 KiB is `decode_error` (50). A zero-length record is `unexpected_message`. More than 32 consecutive protected empty application records is `unexpected_message`. A record that does not fit the buffer cap is `record_overflow` (22). No method on `TlsEngine` returns a `Task` or a `ValueTask`. `CryptoExecutionPolicy` selects online revocation and an external private key for a later offload and still runs the call inline. + +## T1.9 + +The client walks `WaitServerHelloOrHrr`, `WaitEncryptedExtensions`, `WaitCertificateRequestOrCertificate`, `WaitCertificate`, `WaitCertificateVerify`, `WaitFinished`, and `Connected`. Any other handshake type in those states is `unexpected_message` (10). ServerHello must echo the session id, select `0x1301`, and carry `supported_versions` `0x0304` plus the key share we hold. A TLS 1.2 or TLS 1.1 downgrade sentinel is `illegal_parameter` (47). Any other legacy version throws `TlsVersionNotSupportedException` and closes without an alert. HelloRetryRequest is accepted once, must change the group or add a cookie, and the second ClientHello reuses the random and session id. The transcript replaces ClientHello1 with `message_hash` before the retry is appended. CertificateVerify is `ecdsa_secp256r1_sha256` over the transcript. Finished is compared with `FixedTimeEquals`. A `CertificateRequest` makes the client send an empty Certificate and then Finished. An offered PSK that the server does not select falls back to the all-zero early secret, and a `NewSessionTicket` is stored in `MemoryTlsSessionCache`. The handshake ClientHello is the minimal one this engine implements (one cipher, X25519 and secp256r1, no ALPN). It is not the Chrome profile and it is not the RFC 8448 ClientHello, so those published flights are not replayed. `FixedEntropy` checks the random, the 32-byte session id, cipher `0x1301`, and version `0x0304`. A wrong binder is checked when the server exists. When the server selects the PSK, the client accepts EncryptedExtensions and Finished with no certificate. + +## C3 + +The key-schedule, record, and key-exchange checklist is in `SELF-REVIEW.md`. Two majors came out of it. An inner plaintext is content plus the content-type byte plus padding, and that sum must not exceed 2^14; `Protect` and `TryUnprotect` now enforce it, including a padding value that would wrap a 32-bit add. The HKDF salt and the all-zero input keying material are cleared before extract. Record and key-schedule tests pass, including RFC 8448. The change-cipher-spec window beyond "accept one plaintext `0x01`" belongs to the handshake engine. + +## T1.3 + +`TlsRecordProtector` protects one direction with AES-128-GCM, AES-256-GCM, or ChaCha20-Poly1305. It decrypts the RFC 8448 section 3 server handshake flight and the client Finished record. Padding, a bad tag, a replay, an oversized plaintext, and an all-zero inner plaintext are rejected. The IV is wiped on dispose. A plaintext header reader rejects an oversized length and accepts a single `0x01` ChangeCipherSpec. Wycheproof AES-GCM and ChaCha20-Poly1305 vectors with a 96-bit nonce match the primitives this layer calls. + +## T1.2 + +The schedule walks Early, Handshake, and Master. A transition zeroes the secret it consumes. Section 3 covers the master secret, application traffic keys, the exporter master, and the resumption PSK. Section 4 covers the early traffic secret and the resumption binder. Section 5 covers the HelloRetryRequest handshake secret. SHA-384 is checked against an HMAC implementation in the test project. + +## T1.1 + +`TlsHkdf.ExpandLabel` matches every Expand-Label output in RFC 8448 sections 3 to 5, including traffic secrets, finished keys, key, and iv. `TranscriptStore.ReplaceWithMessageHash` reproduces the section 5 HelloRetryRequest transcript hash. RFC 5869 cases 1 to 3 pass through `HKDF.Extract` and `HKDF.Expand`. A one-block Expand-Label is a single `HMACSHA256` or `HMACSHA384` call, and that path allocates nothing in a Release run on this PC (64 iterations). Outputs longer than one hash block still go through `HKDF.Expand`. Traceability rows for RFC 8446 sections 7.1 and 4.4.1 are in `TRACEABILITY.md`. diff --git a/src/Titanium.Tls/design/REMOTE-MACHINES.md b/src/Titanium.Tls/design/REMOTE-MACHINES.md new file mode 100644 index 000000000..7753e7686 --- /dev/null +++ b/src/Titanium.Tls/design/REMOTE-MACHINES.md @@ -0,0 +1,31 @@ +# Remote machines + +No secrets belong in this file. + +| Alias | Address | OS | Login check | Sudo | +| --- | --- | --- | --- | --- | +| macmini | 192.168.1.55 | macOS 26.6.2, Darwin arm64 | Key login as `jehonathant` | `sudo -n true` succeeds | +| linuxmini | 192.168.1.2 | Ubuntu 26.04.1 LTS, Linux x86_64, 12 cores, about 429 GB free | Key login as `jehonathant` | `sudo -n true` succeeds | + +The key is `~/.ssh/id_ed25519_twp` on this PC. `~/.ssh/config` has the aliases `macmini` and `linuxmini`. The machines do not commit or push. + +## Already present + +- macmini: Apple Git 2.54.0, Xcode at `/Applications/Xcode.app/Contents/Developer`, system LibreSSL 3.3.6 (not the oracle). No Homebrew. .NET SDK 10.0.202 and 10.0.404 are under `~/.dotnet`. OpenSSL 3.5.9 is at `~/opt/openssl-3.5.9` and does not replace LibreSSL. `openssl list -tls-groups` includes `X25519MLKEM768`, `MLKEM768`, and `x25519`. A restore that contacts `api.nuget.org` fails with `UntrustedRoot`. A tree that is already restored builds with `--no-restore` once a stored `NU1900` log is cleared from `project.assets.json`. +- linuxmini: Git 2.53.0, OpenSSL 3.5.5. `openssl list -tls-groups` includes `X25519MLKEM768`, `MLKEM768`, and `x25519`, so this build can serve as the oracle. .NET SDK 10.0.404 is under `~/.dotnet`. + +Non-interactive SSH does not source the shell profile. Call `$HOME/.dotnet/dotnet` directly. `DOTNET_ROOT` is also appended to `~/.zprofile` on macmini and `~/.bashrc` on linuxmini. + +## Installed for the managed stack + +- PowerShell 7.7.0 at `~/opt/powershell/pwsh` on both machines, from the official release archive. It is not on the default `PATH`. Non-interactive SSH still calls `$HOME/.dotnet/dotnet` and `$HOME/opt/powershell/pwsh` by full path. +- A clone of the public repository is at `~/work/twp` on both, checked out at `feat/managed-tls-quic-stack`. Sync is a git bundle copied with `scp` (`git fetch ~/twp-managed.bundle HEAD:feat/managed-tls-quic-stack`). Nothing is pushed from these machines. + +## Installed for the QUIC interop leg + +- linuxmini: Docker Engine 29.1.3 from the Ubuntu package `docker.io` (29.1.3-0ubuntu4.1), with containerd 2.2.2 and runc 1.4.0. `docker.service` is enabled. Docker Compose 2.40.3 is the `docker-compose-v2` package. `tshark` 4.6.4 is installed for the interop runner. The install is for the QUIC interop runner and h3spec. No extra firewall rule was added. +- linuxmini: `h3spec` 0.1.15, the Linux x86_64 release binary, at `/tmp/h3spec-linux-x86_64`. The release page did not publish a checksum file. The SHA-256 of the downloaded file is `c3c5f497153f4ba81f82023791ba7f9a4bc46d4141211e614196f141c5996830`. + +## Still to install + +`libmsquic` on linuxmini as a package. A copy was extracted earlier for the platform listener and is not a system package. `QuicConnection.IsSupported` stays false until that library is on the loader path. diff --git a/src/Titanium.Tls/design/SELF-REVIEW.md b/src/Titanium.Tls/design/SELF-REVIEW.md new file mode 100644 index 000000000..49bcbec40 --- /dev/null +++ b/src/Titanium.Tls/design/SELF-REVIEW.md @@ -0,0 +1,70 @@ +Self-review checklists. Each item cites evidence. A consult happens only when an item cannot be answered from evidence. + +## C1. Design, before further handshake code + +| Item | Evidence | +| --- | --- | +| Sans-IO shape | `DESIGN.md` "Ownership". `TlsHkdf`, `TlsKeySchedule`, `TlsRecordProtector`, and `X25519` are synchronous and take spans. No `Task` return in `src/Titanium.Tls`. | +| State ownership | The key schedule owns three `SecretBuffer`s and zeroes a stage when it is consumed (`TlsKeySchedule`). The transcript owns its buffer and zeroes it on dispose (`TranscriptStore`). The record protector owns the AEAD instance and zeroes the IV on dispose. | +| Threading | No lock and no background work in the library today. `DESIGN.md` states the engine is single-threaded and `TlsStream` will use separate read and write locks. | +| Part O performance | One-block Expand-Label allocates 0 bytes in Release (`HkdfTests.ExpandLabelAllocatesNothingForASingleBlock`). S2 records the BCL floor in `SPIKES.md`. The transcript still rehashes; that is an open item, not an accepted design. | +| P11 names | `DESIGN.md` "Names". No public type exists yet besides the assembly marker, so there is nothing to collide. The guard test lands with the harness. | +| P8 fingerprints | `DESIGN.md` "Fingerprints", backed by the Chrome 158 captures and `SPIKES.md`. The engine does not exist yet, so the "no Chrome outside the profile" rule has no violating code. | + +Closed after C1: the transcript hash is incremental, `TryUnprotect` returns `RecordResult`, and stage secrets are rented from `SecretBufferPool`. The X25519 60 µs target is missed; the measurements are in `PROGRESS.md`. + +## C3. Key schedule, records, and key exchange + +| Item | Evidence | +| --- | --- | +| Secret lifetimes | `TlsKeySchedule` zeroes the early secret in `AdvanceToHandshake` and the handshake secret in `AdvanceToMaster`. The master secret is wiped once both application secrets, the exporter master, and the resumption master exist (`CompleteZeroesTheMasterAfterTheApplicationSecrets`). `DisposeZeroesEveryStageSecret` covers the pool. HKDF salt and the all-zero IKM are cleared before `HKDF.Extract`. The record IV is wiped on dispose (`DisposeZeroesTheIv`). Hybrid decapsulation keys are pinned and wiped in `HybridPrivateShare.Dispose`. | +| Nonce | `WriteNonce` copies the 12-byte IV and XORs the sequence into the last 8 bytes (RFC 8446 section 5.3). `UnprotectsRfc8448ServerHandshakeFlight` and `UnprotectsRfc8448ClientFinished` decrypt records built with that nonce. A second decrypt of the same bytes is `bad_record_mac` (`RejectsTamperReplayOverflowAndEmptyInner`). | +| Limits | Inner plaintext is content, the content-type byte, and padding, and it must fit in 2^14 (RFC 8446 section 5.4). `Protect` rejects a 2^14-byte content, accepts 2^14−1, and rejects `padding: int.MaxValue` without wrapping. `TryUnprotect` rejects a ciphertext whose inner length would exceed 2^14 before it decrypts. Ciphertext length above 2^14+256 is `record_overflow` on both the protected and plaintext readers. | +| Stage guards | `EnsureStage` rejects an advance from the wrong stage (`OutOfOrderAdvanceThrows`). RFC 8448 sections 3, 4, and 5 match (`KeyScheduleTests`). SHA-384 is checked against an independent HMAC. | +| Hybrid order | Client share is the 1184-byte encapsulation key then 32-byte X25519. Server share is the 1088-byte ciphertext then X25519. The secret is ML-KEM then X25519. `ClientAndServerDeriveTheSameSecret` and `OpenSslClientHelloUsesTheSameShareOrder`. | +| Encoding checks | Wrong share lengths and a damaged encapsulation key fail closed (`WrongLengthsAndADamagedEncapsulationKeyAreRejected`). A damaged ciphertext still decapsulates and the secret changes. NIST shares reject a bad prefix and an off-curve point (`KeyExchangeTests`). X25519 rejects an all-zero shared secret. | +| CCS window | `TryAcceptChangeCipherSpec` accepts one plaintext record of type 20, version 0x0301 or 0x0303, and body `0x01`, then rejects a second (`PlaintextHeaderRejectsOverflowAndAcceptsOneChangeCipherSpec`). Which handshake messages may be separated by that record is the engine's rule; the engine does not exist yet. | +| Malformed peer input | A bad tag, a truncated record, an unknown outer content type, and an all-zero inner plaintext return `RecordResult` instead of throwing (`TryUnprotect`). Header versions other than 0x0301 and 0x0303 are rejected. Key-share length checks return false. | + +No consult. Two majors were fixed in this review: the inner-plaintext limit was one byte too loose, and the HKDF zero salt was an uncleared `stackalloc`. The handshake-message-must-not-span-a-key-change rule stays with the engine. + +## C4. Fingerprint derivation against the captures + +| Item | Evidence | +| --- | --- | +| What was measured | Fifty TCP ClientHellos, Chrome 158.0.8127.89, fresh profile, `https://localhost/`. Record `0x0301`, legacy `0x0303`, session id 32, compression `{0}`, one record, no padding, no `pre_shared_key`. Cipher, group, version, and signature tails are constant once GREASE is removed. The extension set is constant and the middle 17 move. GREASE ends differ; the first body is empty and the last body is one byte. The GREASE group equals the GREASE key share. Other GREASE slots matched an independent draw (1–5 of 50). ECH is outer type 0, KDF `0x0001`, AEAD `0x0001`, enc length 32, payload length one of 144, 176, 208, 240. Key shares are GREASE:1, `0x11EC`:1216, `0x001D`:32. ALPS is `17613` with body `0003 02 6832`. Extension `0xCA34` is one 186-byte constant. `ConstantExtensionBodiesMatchTheCapture` compares those bodies to `hello-001.bin`. `GeneratedChromeHellosMatchTheCapturedShape` checks JA4, JA3 field sets, and that each middle extension appears in each middle slot across 1,000 hellos. | +| What was assumed | No HelloRetryRequest and no resumed hello are in the capture. Replaying the extension order is `HelloRetryRequestKeepsExtensionOrder`. `pre_shared_key` last is the RFC 8446 rule, checked by `ResumedHelloPutsPreSharedKeyLast`. `ReducedNoPostQuantum` drops `0x11EC` (`ReducedFidelityOmitsTheHybridShare`); every capture on this PC is the full shape. Payload lengths are the 50 observed values, with their counts, not a model of the inner layout. The shuffle is Fisher-Yates. The capture histogram (about 1–9 hits per cell) is consistent with that and is not a proof of uniformity. The profile does not mint real key shares. The capture showed the hybrid X25519 half never equalled the standalone share (0 of 50); that check belongs to the engine when it builds shares. QUIC Initials are not in this set. | +| Drift | `InstalledChromeMatchesThePinnedInvariants` is `Explicit`. It launches Chrome only when `TITANIUM_CHROME_DRIFT=1`, captures eight loopback ClientHellos, and compares them to `hello-001.bin` through `ChromeHelloInvariants`. A normal suite does not start a browser. Run: `$env:TITANIUM_CHROME_DRIFT='1'; dotnet test tests/Titanium.Tls.Tests --filter TestCategory=Explicit`. Eight fresh hellos matched on this PC. A shape change fails the test. A version number change with the same shape does not. Refresh with `tools/managed-stack/Capture-ClientHello.ps1`, then update the profile and `MANIFEST.md`. | +| Risks | JA4 ignores extension bodies, GREASE, and group-list contents, so the body comparison is the check that matters. `0xCA34` stays opaque. TLS 1.2 ciphers and version `0x0303` are advertised and not implemented; the abort is the client state machine, which is not built yet. `ClientHelloTemplate` stays internal until a second browser exists. | + +No consult. The profile constants matched the capture, including `0xCA34`. The gap this review closed is that JA4 alone does not pin extension bodies. + +## C6. Stream concurrency, KeyUpdate, shutdown, and cancellation + +| Item | Evidence | +| --- | --- | +| One owner per direction | `TlsStream` takes `_readLock` for reads and `_writeLock` for writes. Authentication and dispose take the read lock and then the write lock. A reader that must send KeyUpdate waits for the write lock while it already holds the read lock. The writer never takes the read lock, so that order cannot deadlock. | +| KeyUpdate | RFC 8446 section 4.6.3. The read path rotates only the read secret (`OnKeyUpdate`). `update_requested` sets `KeyUpdateResponseNeeded`. The writer emits that response, or its own update, under the old write key and then rotates (`ProtectKeyUpdate`). `KeyUpdateKeepsTheFollowingRecordReadable` and `KeyUpdateSurvivesConcurrentTraffic` cover both directions. An empty body is `illegal_parameter` (`EmptyKeyUpdateIsIllegal`). | +| Shutdown | `ShutdownAsync` holds the write lock, sends warning `close_notify`, and later writes throw the `SslStream` message (`WriteAfterShutdownThrows`). The reader does not send KeyUpdate after that flag is set. A received `close_notify` makes `Read` return 0. | +| Cancellation | A cancel during an inner read or after a record is protected marks the stream unusable. `CancelledReadThrows` checks the cancel and the following `IOException`. Cancel while waiting for a lock, before I/O, does not. | +| Dispose | Dispose closes the inner stream first so a blocked read unblocks, then takes both locks and zeroes the engine. `ReadAfterDisposeThrows`. | +| Parity | `TlsStreamTests` covers the S1 rows, a 10 MiB hash compare both ways, ALPN, the cipher, and `SslStream` in both directions. Differences are in `PARITY-DIFFS.md`. | + +No consult. Two gaps were closed: a KeyUpdate response was dropped when the reader could not take the write lock immediately, and a cancel during I/O left the record layer usable. Still deferred, and not a second design: the locks are taken on every call rather than only when the direction is busy, the receive buffer is a fixed full record rather than a pooled 4 KiB buffer that grows, and a steady-state 16 KiB read or write is not yet allocation-free. Those belong to the performance gates. + +## C7. Whole-library security review + +Consulted once, read-only, on the Phase 1 library. The review named one blocker and seven majors. Categories it left alone, apart from those items, were the state machine, parsing, secret handling, timing, and the other DoS and resumption checks. + +| Finding | What changed | +| --- | --- | +| Required client certificate | `RequireClientCertificate` comes from `ClientCertificateRequired`. An empty client Certificate is alert 116. `TryAcceptTicket` returns without resuming whenever a client certificate was requested, so a ticket cannot skip the request. An optional empty certificate, with no require flag, still goes to `WaitFinished`. | +| Callback and identity | The server pauses on `ClientCertificateReceived`. `TlsStream` runs `RemoteCertificateValidationCallback` with the stream as sender and resumes. `RemoteCertificate` on a server loads the client leaf. A rejection is `bad_certificate` (42). | +| Alert nonce | After the handshake keys exist, `Fail` records the alert when `DeferSealedAlerts` is set. `TlsStream` sets that flag and writes `ProtectAlert` under `_writeLock`. Engine tests still receive the alert bytes from `Fail`. | +| ALPN | EncryptedExtensions must carry exactly one protocol name, and it must be one the client offered. Otherwise `illegal_parameter`. A selection when nothing was offered stays `unsupported_extension`. | +| ClientHello size | The hello buffer is sized from the share, the name, the protocols, the cookie, and the ticket. A failed write returns no hello. A ticket that does not fit is dropped and the hello is built again. Anything still too large is `internal_error` (80). | +| Ticket cache | `MemoryTlsSessionCache` takes a lock, and it enqueues a key only the first time. One connection stores at most eight tickets. An identity longer than 2048 bytes is not stored, and a stored one that large is forgotten. | +| Certificate list | One hundred entries still parse, matching `CertificateListsOfZeroOneAndOneHundredParse`. The next entry is `decode_error`, in the handshake parser and again before `X509Chain.Build`. The review suggested 10 to 16. That would reject a list this suite already treats as legal, so the cap is 100. | +| Idle buffers | `_stash`, `_body`, and the handshake reassembler are allocated when the first byte arrives, not in the constructor. `TlsStream` allocates its record buffers on first use. The earlier idle-memory measurement is from before this change. The gate is not claimed. | + +No second consult. The regressions are named in `BUG-LEDGER.md`. Known limits that the review did not treat as findings stay: the client offers AES-128-GCM-SHA256 and `ecdsa_secp256r1_sha256` only, stapled OCSP and SCTs are copied and not checked, revocation runs inline, the Chrome profile is not the engine hello, cross-stack tickets do not resume, the 60 µs X25519 budget is missed, and the 900 µs ceiling stays. diff --git a/src/Titanium.Tls/design/SPIKES.md b/src/Titanium.Tls/design/SPIKES.md new file mode 100644 index 000000000..e8d2b81d1 --- /dev/null +++ b/src/Titanium.Tls/design/SPIKES.md @@ -0,0 +1,99 @@ +# Spikes + +Findings from Phase 0. Throwaway projects under `scratch/` are not part of the product and are not committed. + +## S1. BCL surface probe + +Machine: Windows x64, runtime 10.0.15, SDK 10.0.404. Method: a Release console probe (`scratch/BclProbe`) that reflects the public surface and runs the operations. + +- `SslServerAuthenticationOptions`, `SslClientAuthenticationOptions`, `QuicClientConnectionOptions`, `QuicServerConnectionOptions`, and `QuicListenerOptions` all construct. Every property listed by the probe is publicly settable. Notable members: `AllowTlsResume` on both TLS option types, `ServerCertificateContext` and `ClientCertificateContext`, `QuicListenerOptions.ConnectionOptionsCallback`. +- `SslClientHelloInfo` has a public constructor `(string serverName, SslProtocols sslProtocols)`. The managed stack can construct it. It does not need its own hello-info type for that shape. +- `QuicException` has a public constructor `(QuicError error, long? applicationErrorCode, string message)`. The managed stack can throw it. +- `SslStreamCertificateContext` has no public constructor. `Create(X509Certificate2, X509Certificate2Collection, bool)` and the `SslCertificateTrust` overload are public. `TargetCertificate` and `IntermediateCertificates` are public and readable. TWP can pass a context and the managed stack can read the leaf and intermediates. +- `X509Certificate2.MatchesHostname(string, bool, bool)` exists. Use it for hostname checks. +- `ServerCertificateSelectionCallback` is `(object sender, string hostName) -> X509Certificate`. `LocalCertificateSelectionCallback` takes `object sender`. Both are reusable. The QUIC listener callback is `Func>`. `QuicConnection` is sealed, so a managed listener needs its own delegate. The callback's hello-info argument can still be `SslClientHelloInfo`. +- `AesGcm.IsSupported` and `ChaCha20Poly1305.IsSupported` are true. In-place encrypt and decrypt (ciphertext overlapping plaintext exactly) round-trips for both. Tag size 16 is accepted by `new AesGcm(key, 16)`. +- `MLKem.IsSupported` is true. ML-KEM-768 sizes are encapsulation key 1184, ciphertext 1088, shared secret 32, decapsulation key 2400. Generate, encapsulate, import, and decapsulate agree. `SHA3_256`, `SHA3_512`, `Shake128`, and `Shake256` are supported on this machine. The managed ML-KEM fallback is still required for platforms where `MLKem.IsSupported` is false. Confirm those flags on macOS in A0b. +- ECDH P-256 and P-384 agree (32 and 48 bytes). Creating a public-only `ECParameters` value, and creating one whose public point was flipped, both throw `PlatformNotSupportedException` ("curve is not valid for this platform") rather than a point-validation error. Do not rely on that API to reject off-curve points. Validate points in our own code before `DeriveRawSecretAgreement`. +- `ECCurve.CreateFromFriendlyName("curve25519")` plus `ECDiffieHellman.Create` succeeds on Windows (key size 255) and two keys agree on a 32-byte secret. B5 stays managed: this is not a portable API across the three operating systems, and the Chrome share must not depend on a platform that only sometimes has it. Keep `IKeyExchangeGroup` so a later `net11.0` build can call `X25519DiffieHellman` where it exists. +- `HKDF.Extract` and `HKDF.Expand` span overloads work. `Aes.EncryptEcb(ReadOnlySpan, Span, PaddingMode)` writes 16 bytes. `BrotliDecoder.TryDecompress` returns true. +- `QuicConnection.IsSupported` is true on this PC. It is false on macmini and on linuxmini (no libmsquic). Platform QUIC differential tests that listen on a wildcard UDP socket are not run on this PC (they raise a firewall prompt). Run those on the remote machines once libmsquic is installed, and in CI. +- `SslStream` TLS 1.3 baselines (loopback, self-signed RSA, validation callback returns true, cipher `TLS_AES_256_GCM_SHA384`): + - TCP reset without `close_notify`: `ReadAsync` throws `IOException` ("forcibly closed by the remote host"), not 0. + - Read after `Dispose`: `ObjectDisposedException`. + - Zero-length write completes. + - Zero-length read does not return immediately. A 200 ms cancellation throws `OperationCanceledException`. + - Write after `ShutdownAsync`: `InvalidOperationException` ("Write operations are not allowed after the channel was shutdown."). + - Read cancelled while blocked: `OperationCanceledException`. + - Concurrent client write and server read: the server reads the 4 bytes. + +The same probe on linuxmini (runtime 10.0.15, linux-x64, system OpenSSL 3.5.5) agrees with Windows on the option surface, AEAD, ECDH, and the `SslStream` baselines in `PARITY-DIFFS.md`. Differences: `MLKem.IsSupported` and SHA-3/SHAKE are true; an off-curve point is rejected with `OpenSslCryptographicException` ("point is not on curve"); `curve25519` is `PlatformNotSupportedException`; `QuicConnection.IsSupported` is false. + +The same probe on macmini (runtime 10.0.15, osx-arm64) agrees on the option surface, AEAD, and ECDH P-256/P-384. Differences that bind later tasks: `MLKem.IsSupported` is false and `SHA3_256`, `SHA3_512`, `Shake128`, and `Shake256` are false, so T1.6b (managed ML-KEM and a managed Keccak) is required for macOS. `curve25519` is `PlatformNotSupportedException`, so the managed X25519 ladder is the portable implementation. An off-curve point fails with `AppleCFErrorCryptographicException` rather than a shared BCL exception. `QuicConnection.IsSupported` is false. Every `SslStream` TLS 1.3 scenario timed out at 30 seconds (`TimeoutException` on `AuthenticateAsClientAsync`/`AuthenticateAsServerAsync`); macOS is not a parity baseline until that handshake completes. + +Effect on the plan: reuse `SslClientHelloInfo`, `QuicException`, the certificate-selection delegates, `SslStreamCertificateContext.Create`, and `MatchesHostname`. Keep a distinct QUIC listener callback because it takes `QuicConnection`. Validate ECDH points ourselves. The Windows and Linux `SslStream` baselines are in `PARITY-DIFFS.md`. + +## S5. OpenSSL oracle + +`C:\Program Files\Git\usr\bin\openssl.exe` is OpenSSL 3.5.9 (29 Sep 2026). `openssl list -tls-groups` includes `X25519MLKEM768`, `SecP256r1MLKEM768`, `MLKEM768`, `x25519`, `secp256r1`, and `secp384r1`. + +Working interop, loopback only: + +```text +openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 2 -nodes -subj /CN=localhost +openssl s_server -tls1_3 -cert cert.pem -key key.pem -accept 127.0.0.1:18443 -groups X25519MLKEM768:X25519:P-256 -keylogfile keylog.txt -quiet +openssl s_client -tls1_3 -connect 127.0.0.1:18443 -groups X25519MLKEM768 -brief +``` + +Result: `CONNECTION ESTABLISHED`, `Protocol version: TLSv1.3`, `Ciphersuite: TLS_AES_256_GCM_SHA384`, `Negotiated TLS1.3 group: X25519MLKEM768`, `Signature type: rsa_pss_rsae_sha256`. The key log file was 987 bytes. Self-signed verification failed as expected and did not stop the handshake. + +Further switches that the matrix needs, on the same server: + +```text +openssl s_client -tls1_3 -connect 127.0.0.1:18443 -groups X25519 -ciphersuites TLS_AES_128_GCM_SHA256 -sigalgs rsa_pss_rsae_sha256 -alpn h2 -quiet +``` + +`k` and `K` written to `s_client` stdin (a pipe on Windows, a pty on linuxmini) did not add `CLIENT_TRAFFIC_SECRET_1` or `SERVER_TRAFFIC_SECRET_1` to the key log. The handshake secrets (`*_TRAFFIC_SECRET_0`, exporter, handshake traffic) were logged. The key-update command is not yet a confirmed oracle. Do not treat it as working in T1.13 until a run shows the `_1` secrets. + +## S4. Chrome 158 ClientHello + +Chrome 158.0.8127.89 was installed on this PC. Fifty fresh-profile TCP ClientHellos are in `tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/`. Captured with `tools/managed-stack/Capture-ClientHello.ps1`. The byte-shift in that script must cast each header byte to `int` before `-shl`, or PowerShell keeps the length in a byte and the saved record is truncated. + +What is stable across all 50: + +- Record legacy version `0x0301`, ClientHello legacy version `0x0303`, session id length 32. +- Cipher list, in order: GREASE `0x5a5a`, `0x1301`, `0x1302`, `0x1303`, `0xc02b`, `0xc02f`, `0xc02c`, `0xc030`, `0xcca9`, `0xcca8`, `0xc013`, `0xc014`, `0x009c`, `0x009d`, `0x002f`, `0x0035`. +- Supported groups: GREASE `0x0a0a`, `0x11ec` (X25519MLKEM768), `0x001d`, `0x0017`, `0x0018`. +- Key shares: GREASE (1 byte), `0x11ec` (1216 bytes), `0x001d` (32 bytes). The first 1184 bytes of that hybrid share import as an ML-KEM-768 encapsulation key; the last 32 bytes are the X25519 half. That half did not equal the separate X25519 share in any of the 50 hellos. OpenSSL 3.5.9 uses the same order. +- 19 extensions. Slot 0 and slot 18 are GREASE and those two GREASE values differ. The other slots permute. No `padding` and no `pre_shared_key` on a fresh profile (the hybrid share already makes the hello large, and there is no ticket). +- Present: `server_name`, ALPN, ECH (`0xfe0d`), `compress_certificate`, `supported_versions`, `key_share`, `signature_algorithms`, `signed_certificate_timestamp`, `extended_master_secret`, `session_ticket`, `psk_key_exchange_modes`, `status_request`, `ec_point_formats`, `renegotiation_info` (`0xff01`), and codepoint `0x44cd` (17613, one per hello; `0x4469` / 17513 is absent). Codepoint `0xca34` is also one per hello and is not named here. +- A QUIC Initial was not captured. `--enable-quic --origin-to-force-quic-on=localhost:` produced no UDP datagram. + +## S2. Crypto per-call cost + +BenchmarkDotNet 0.14.0, Release, this PC (Windows x64, .NET 10.0.15, AVX-512 and AES). Five iterations, so treat the numbers as a floor, not a publication result. The throwaway project is not in the repo. + +| Operation | Mean | Allocated | +| --- | --- | --- | +| AES-GCM 16 B | 120 ns | 0 | +| AES-GCM 1,200 B | 226 ns | 0 | +| AES-GCM 16 KiB | 1.42 µs | 0 | +| AES-ECB 16 B | 244 ns | 88 B | +| ChaCha20-Poly1305 16 B | 249 ns | 0 | +| ChaCha20-Poly1305 1,200 B | 2.38 µs | 0 | +| ChaCha20-Poly1305 16 KiB | 30.2 µs | 0 | +| HMAC-SHA256 32 B | 221 ns | 0 | +| `HKDF.Expand` 32 B | 448 ns | 288 B | +| ECDH P-256 derive (existing key) | 543 µs | 833 B | +| ML-KEM-768 encapsulate | 14.8 µs | 1,168 B | +| ML-KEM-768 decapsulate | 22.1 µs | 0 | +| RSA-2048 PSS sign | 420 µs | 56 B | +| RSA-2048 PSS verify | 13.6 µs | 56 B | +| ECDSA P-256 sign | 133 µs | 264 B | +| ECDSA P-256 verify | 115 µs | 120 B | + +A QUIC packet on this CPU is two native calls (AES-GCM plus one AES block) at a few hundred nanoseconds. ChaCha is much slower than AES-GCM here. `HKDF.Expand` allocates about 288 bytes, which is why one-block labels now use `HMACSHA256.HashData` directly. ECDH derive and RSA sign dominate a full handshake; ML-KEM encapsulate is about 15 µs plus the allocation of the ciphertext array. + +## S3 + +S3 is the managed X25519 implementation, landed as T1.4. Release on this PC: 1240 µs with dedicated squaring, 817 µs after `Math.BigMul` and eager carries, 462 µs after leaving addition unreduced. The 60 µs budget is missed. BouncyCastle 2.6.2 measured 253 µs in the same loop. The million-iteration RFC 7748 vector, 10,000 BouncyCastle pairs, 50 OpenSSL samples, and the Wycheproof file match. Release JIT on this PC, tiered compilation off: `ConditionalSwap` is a mask and xor with no taken branch. `ToBytes` reduces with `setb` rather than a branch; its only branches are the public span-length check and the stack cookie. `ScalarMult` branches on the public argument lengths and on the public bit index. The Welch t statistic is recorded in `PROGRESS.md`: 0.31 on this PC, 0.20 on linuxmini, and 0.86 on macmini. Field multiply is a call, not inlined, which is the main reason the ladder is still at 462 µs. diff --git a/src/Titanium.Tls/design/STATE-TABLES.md b/src/Titanium.Tls/design/STATE-TABLES.md new file mode 100644 index 000000000..fa431a9fb --- /dev/null +++ b/src/Titanium.Tls/design/STATE-TABLES.md @@ -0,0 +1,81 @@ +Client and server transitions for the synchronous handshake in `TlsEngine`. A message the current state does not list is `unexpected_message` (10), after which the engine is `Closed` and further input is ignored. `Resume` is legal only in a decision state. Sources: `src/Titanium.Tls/Internal/TlsEngine.cs`, `TlsEngine.Client.cs`, `TlsEngine.Server.cs`. + +## Client + +| State | Accepts | On success | +| --- | --- | --- | +| `Start` | no handshake message; `Advance` with an empty buffer writes the ClientHello | `WaitServerHelloOrHrr` | +| `WaitServerHelloOrHrr` | ServerHello, including HelloRetryRequest | a retry returns to `WaitServerHelloOrHrr`; otherwise `WaitEncryptedExtensions` | +| `WaitEncryptedExtensions` | EncryptedExtensions | `WaitCertificateRequestOrCertificate` | +| `WaitCertificateRequestOrCertificate` | CertificateRequest or Certificate | a request goes to `WaitCertificate`; a certificate goes to `WaitCertificateDecision` | +| `WaitCertificate` | Certificate | `WaitCertificateDecision` | +| `WaitCertificateDecision` | no message; `Resume` | `Resume(true)` goes to `WaitCertificateVerify`; `Resume(false)` is `bad_certificate` (42) | +| `WaitCertificateVerify` | CertificateVerify | `WaitFinished` | +| `WaitFinished` | Finished | `Connected`, after the client writes its Certificate (when requested), CertificateVerify (when it has a certificate), and Finished | +| `Connected` | NewSessionTicket | stays `Connected` | +| `Connected` | KeyUpdate | stays `Connected` and rotates the read keys. `update_requested` sets a write-side response | +| `Closed` | nothing | input is ignored | + +A second HelloRetryRequest is `unexpected_message`. An HelloRetryRequest that selects the group the client already shared is `illegal_parameter` (47), whether or not it carries a cookie. The second ClientHello must keep the same fields except `key_share`, `cookie`, `padding`, a removed `early_data`, and the recomputed PSK binder. A missing share for the requested group is `illegal_parameter`. + +## Server + +| State | Accepts | On success | +| --- | --- | --- | +| `WaitClientHello` | ClientHello | `WaitClientHelloDecision` | +| `WaitClientHelloDecision` | no message; `Resume` | `Resume(false)` is `handshake_failure` (40). A callback exception, or `Resume(true)` with no selection, is `internal_error` (80). Otherwise the server writes its flight and goes to `WaitFinished`, or to `WaitClientHello` after one HelloRetryRequest | +| `WaitClientHello` after a retry | one more ClientHello | the flight, then `WaitClientCertificate` when a certificate was requested, otherwise `WaitFinished` | +| `WaitClientCertificate` | Certificate | an empty list goes to `WaitFinished` when the certificate is optional, and is `certificate_required` (116) when it is required. A chain that does not parse is `bad_certificate`. A callback pauses at `WaitClientCertificateDecision`; otherwise a chain that builds goes to `WaitClientCertificateVerify` | +| `WaitClientCertificateVerify` | CertificateVerify | `WaitFinished` | +| `WaitFinished` | Finished | `Connected`, then one NewSessionTicket when a ticket protector was supplied | +| `Connected` | KeyUpdate | stays `Connected` and rotates the read keys. `update_requested` sets a write-side response | + +The server does not accept a post-handshake Certificate. Early data is not negotiated. + +## Alerts + +| Condition | Alert | +| --- | --- | +| Message not legal in the current state, a second retry, CCS before the first ClientHello or in the middle of a handshake message, a zero-length record, or more than 32 consecutive protected empty application records | `unexpected_message` (10) | +| A plaintext record longer than 2^14 bytes, or an inner plaintext longer than 2^14 + 1 | `record_overflow` (22) | +| No common cipher or group, a client certificate the client cannot sign, or `Resume(false)` on the server hello | `handshake_failure` (40) | +| Client certificate chain does not build for `clientAuth`, or the caller rejects the server or client certificate | `bad_certificate` (42) | +| Version, cipher, group, session id, downgrade sentinel, ALPN selection, ticket lifetime, or a CertificateVerify scheme this side did not offer | `illegal_parameter` (47) | +| Handshake body above 128 KiB, a message that does not parse, or a certificate list of more than 100 entries | `decode_error` (50) | +| CertificateVerify signature or Finished verify_data does not match | `decrypt_error` (51) | +| `supported_versions` does not contain `0x0304` | `protocol_version` (70) | +| Callback throws, or the callback returns no certificate | `internal_error` (80) | +| ServerHello has no `key_share` | `missing_extension` (109) | +| Client offered ALPN, nothing matches, and the callback requires a match | `no_application_protocol` (120) | +| A required client Certificate is empty | `certificate_required` (116) | + +A ServerHello legacy_version other than `0x0303` is `illegal_parameter`. A missing `supported_versions` extension aborts the client with `TlsVersionNotSupportedException` and sends no alert, unless the random ends with the downgrade sentinel, which is `illegal_parameter`. A present `supported_versions` value other than `0x0304`, or a TLS 1.3 ServerHello that still carries the sentinel, is `illegal_parameter`. A malformed value is `decode_error`. A record version other than `0x0301` or `0x0303` is `unexpected_message`. One ChangeCipherSpec (`0x01`) is ignored after the first ClientHello and before `Connected`, and only between handshake messages. A second one, one before the first ClientHello, or one after `Connected`, is `unexpected_message`. An alert the peer sends after the handshake keys exist is a `PeerAlert` and is not answered. A plaintext alert after those keys exist is `unexpected_message`. Alerts this stack sends after the peer can read them are protected. + +## Checks + +- `supported_versions` must contain `0x0304` (RFC 8446 section 4.2.1). The client aborts a ServerHello that is not TLS 1.3. +- The last 8 bytes of a ServerHello random must not be the downgrade sentinel (section 4.1.3). +- HelloRetryRequest happens at most once, and the following ClientHello must differ (section 4.1.4). The client checks that the selected group was not already shared. +- The client requires `key_share` on the ServerHello. A missing share is `missing_extension` (section 4.2.8). If the client's share matches none of the server's groups, and the client advertised one of those groups, the server sends one HelloRetryRequest. Otherwise the server sends `handshake_failure`. +- CertificateVerify uses the context string for the direction that signed it, 64 bytes of `0x20`, a zero, then the transcript hash (section 4.4.3). The server offers and accepts only `ecdsa_secp256r1_sha256` (`0x0403`) for the client. The server's own signature is `0x0403`, `0x0503`, or `rsa_pss_rsae_sha256` (`0x0804`), chosen from the key and the client's list. +- Finished is HMAC over the transcript hash through CertificateVerify, compared with `FixedTimeEquals` (section 4.4.4). +- An empty client Certificate is legal when the server did not require one, and it is not followed by CertificateVerify (section 4.4.2). A required empty list is `certificate_required` (116). A non-empty one must chain for `clientAuth`. Hostname is not checked on a client certificate. With no callback, a failure is `bad_certificate` and does not pause. A callback pauses so the caller can accept or reject the client certificate, and `RemoteCertificate` is that certificate. A handshake that requests a client certificate does not resume, because the ticket does not carry the certificate. +- The server certificate is checked for `serverAuth` and the hostname, then the client pauses. Stapled OCSP (`status_request`) and SCTs are copied and not enforced. Revocation mode is `NoCheck`. +- A NewSessionTicket lifetime above 604800 seconds is `illegal_parameter` (section 4.6.1). The ticket this server writes uses 6 hours. Resumption also requires the binder, cipher, server name, ALPN, and leaf SHA-256. +- KeyUpdate rotates only the read traffic secret. A request is answered on the write path, under the old write key, before that direction rotates. An empty KeyUpdate body is `illegal_parameter`. More than 32 KeyUpdate messages on one connection is `unexpected_message`. +- `FipsApprovedOnly` drops ChaCha20-Poly1305, X25519, and X25519MLKEM768 from selection. The client share becomes P-256, and the client group offer is P-256 and P-384. +- A plaintext record longer than 2^14 bytes is `record_overflow`. A ciphertext record may be 2^14 + 256 bytes; the AEAD check still rejects an inner plaintext above 2^14 + 1. +- A handshake message must end the record when it installs new keys. Bytes left in that record are `unexpected_message`. That covers ServerHello and the peer Finished on the client, and ClientHello and the client Finished on the server. +- A known extension on a message that does not use it is `illegal_parameter`. A response extension this client did not offer is `unsupported_extension` (110), except `cookie` on HelloRetryRequest. CertificateRequest may carry `signature_algorithms`, `signature_algorithms_cert`, `certificate_authorities`, `oid_filters`, and `compress_certificate` without a matching ClientHello offer. The client ignores `compress_certificate` and sends the certificate uncompressed. `status_request` and `signed_certificate_timestamp` on that message still require the offer. +- EncryptedExtensions ALPN is one protocol name, and that name is one the client offered. Anything else is `illegal_parameter`. A selected protocol when the client offered none is `unsupported_extension`. +- A certificate list of 0, 1, or 100 entries parses. Entry 101 is `decode_error`. The chain builder does not see a longer list. +- The client stores at most eight NewSessionTicket values per connection, and it does not store a ticket identity longer than 2048 bytes. Repeating one cache key does not grow the eviction queue. A ClientHello that cannot hold its ticket or cookie is not sent with a short length prefix; the ticket is dropped and the hello is built again, or the handshake fails with `internal_error`. +- The server Certificate context must be empty. An empty server certificate list is `decode_error`. The client Certificate must use the empty context this server requested. +- CertificateRequest must use an empty context and must carry `signature_algorithms`. A missing list is `missing_extension`. A client that cannot sign with `ecdsa_secp256r1_sha256` sends an empty Certificate and no CertificateVerify. +- `legacy_compression_methods` must be a single zero byte. A ClientHello without `supported_groups` or `signature_algorithms` is `missing_extension`. +- A PSK binder that does not match a ticket this server would accept is `decrypt_error`. A different number of identities and binders is `illegal_parameter`. `pre_shared_key` without `psk_key_exchange_modes` is `missing_extension`. An unknown or expired ticket still falls back to a full handshake. +- If the client offered `early_data` and the server did not accept it, application records that fail under the handshake key are skipped, up to 16 KiB, until one record decrypts. + +## Known limits + +The engine hello offers one cipher (`0x1301`) and two groups (`0x001D`, `0x0017`). It is not the Chrome profile and it is not the RFC 8448 hello. The RFC 8448 section 3 CertificateVerify and Finished are checked against the published messages, not by replaying that hello through this state machine. Online revocation runs inline. `CryptoExecutionPolicy` does not hop threads. diff --git a/src/Titanium.Tls/design/TRACEABILITY.md b/src/Titanium.Tls/design/TRACEABILITY.md new file mode 100644 index 000000000..5d35af716 --- /dev/null +++ b/src/Titanium.Tls/design/TRACEABILITY.md @@ -0,0 +1,26 @@ +Rows are `RFC | section | requirement | test id | status`. A test id is `Class.Method`. The guard test fails when a row names a missing test, or a test carries `RfcRequirementAttribute` for an id with no row. + +| RFC | Section | Requirement | Test id | Status | +| --- | --- | --- | --- | --- | +| RFC 8446 | 7.1 | HKDF-Expand-Label prepends tls13 and matches the RFC 8448 traces | HkdfRfc8448Tests.ExpandLabelMatchesEveryRfc8448Section3To5Output | pass | +| RFC 8446 | 4.4.1 | HelloRetryRequest replaces ClientHello1 with message_hash | HkdfRfc8448Tests.ReplaceWithMessageHashMatchesRfc8448Section5Transcript | pass | +| RFC 5869 | 2 | Extract and Expand match cases 1 to 3 | HkdfTests.BclHkdfMatchesRfc5869Case1 | pass | +| RFC 8446 | 7 | The key schedule, traffic keys, exporter, and resumption match RFC 8448 section 3 | KeyScheduleTests.MasterTrafficKeysAndResumptionMatchRfc8448Section3 | pass | +| RFC 8446 | 5 | Records decrypt in place and reject a bad tag, a replay, and overflow | RecordProtectorTests.RejectsTamperReplayOverflowAndEmptyInner | pass | +| RFC 7748 | 5.2 | X25519 scalar multiplication matches the published vectors | X25519Tests.ScalarMultMatchesRfc7748Section52 | pass | +| RFC 8446 | 5.2 | A bad tag, bad padding, or empty inner plaintext is rejected | RecordProtectorTests.RejectsTamperReplayOverflowAndEmptyInner | negative | +| RFC 8446 | 5.1 | A plaintext record longer than 2^14 bytes is record_overflow | RecordProtectorTests.PlaintextHeaderRejectsOverflowAndAcceptsOneChangeCipherSpec | negative | +| RFC 8446 | 4.1.3 | A downgrade sentinel is illegal_parameter | ClientHandshakeTests.ServerHelloNegativesFailClosed | negative | +| RFC 8446 | 4.1.4 | A HelloRetryRequest that does not change the key share is illegal_parameter | ClientHandshakeTests.HelloRetryWithoutAChangeIsIllegal | negative | +| RFC 8446 | 4.2 | A response extension the client did not offer is unsupported_extension | ClientHandshakeTests.UnsolicitedEncryptedExtensionIsRejected | negative | +| RFC 8446 | 4.2.8 | A ServerHello without the selected key share is missing_extension | ClientHandshakeTests.ServerHelloNegativesFailClosed | negative | +| RFC 8446 | 4.4.4 | A Finished that does not match is decrypt_error | ClientHandshakeTests.WrongFinishedIsDecryptError | negative | +| RFC 8446 | 5.1 | A truncated handshake record does not throw | CorpusRunnerTests.TruncationsAndMutationsStayInsideTheDocumentedResult | negative | +| RFC 8446 | 5.1 | A handshake message above the cap is decode_error | EngineTests.OversizedHandshakeMessageIsRejected | negative | +| RFC 8446 | 4.6.3 | More than 32 KeyUpdate messages close the connection | ClientHandshakeTests.KeyUpdateFloodCloses | negative | +| RFC 8446 | 5 | A second ChangeCipherSpec is unexpected_message | ClientHandshakeTests.SecondChangeCipherSpecIsUnexpected | negative | +| RFC 8446 | 6.1 | Handshake bytes after close_notify are not processed | ClientHandshakeTests.HandshakeAfterCloseNotifyIsIgnored | negative | +| RFC 8446 | 7 | A stage secret is wiped on the transition and on dispose | KeyScheduleTests.DisposeZeroesEveryStageSecret | negative | +| RFC 8446 | 5 | The record IV is wiped on dispose | RecordProtectorTests.DisposeZeroesTheIv | negative | +| RFC 8446 | 4.2.3 | The default client hello offers ECDSA and RSA-PSS signature schemes | TlsAlgorithmPolicyTests.DefaultClientHelloOffersEcdsaAndRsaPss | pass | +| RFC 8446 | 4.1.2 | A ServerHello cipher the client did not offer is illegal_parameter | ClientHandshakeTests.ServerHelloNegativesFailClosed | negative | diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/4-extra-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/4-extra-bulk.json new file mode 100644 index 000000000..07191e1a3 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/4-extra-bulk.json @@ -0,0 +1,508 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-172355", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1243594,1771307,1731322,2409083,2623602,2400938,2051086,1919442,1839293,1976238 + ], + "N":10, + "Min":1243594, + "LowerFence":1000546.25, + "Q1":1788303.5, + "Median":1947840, + "Mean":1996590.5, + "Q3":2313475, + "UpperFence":3101232.25, + "Max":2623602, + "InterquartileRange":525171.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":126885.44808678154, + "Variance":160999169361.83334, + "StandardDeviation":401247.0178852839, + "Skewness":-0.12143707288586571, + "Kurtosis":2.0829707078352206, + "ConfidenceInterval":{ + "N":10, + "Mean":1996590.5, + "StandardError":126885.44808678154, + "Level":12, + "Margin":606628.2355629088, + "Lower":1389962.264437091, + "Upper":2603218.735562909 + }, + "Percentiles":{ + "P0":1243594, + "P25":1788303.5, + "P50":1947840, + "P67":2061581.56, + "P80":2402567, + "P85":2406232.25, + "P90":2430534.9, + "P95":2527068.45, + "P100":2623602 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":355432 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181307 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":8137272 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2232764 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1243714 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1771427 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1731442 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2409203 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2623722 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2401058 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2051206 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1919562 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":1839413 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":1976358 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1243594 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1771307 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1731322 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2409083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":2623602 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":2400938 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2051086 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":1919442 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":1839293 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":1976238 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":355432, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/5-extra-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/5-extra-bulk.json new file mode 100644 index 000000000..5badefbb7 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/5-extra-bulk.json @@ -0,0 +1,494 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-172416", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1747933,1689765,1833522,2079080,1596431,1603564,2445852,2394026,1859821 + ], + "N":9, + "Min":1596431, + "LowerFence":1105792.5, + "Q1":1689765, + "Median":1833522, + "Mean":1916666, + "Q3":2079080, + "UpperFence":2663052.5, + "Max":2445852, + "InterquartileRange":389315, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":107041.73543996752, + "Variance":103121398134, + "StandardDeviation":321125.20631990256, + "Skewness":0.6055512469405598, + "Kurtosis":1.6162940573563882, + "ConfidenceInterval":{ + "N":9, + "Mean":1916666, + "StandardError":107041.73543996752, + "Level":12, + "Margin":539630.0821776122, + "Lower":1377035.9178223878, + "Upper":2456296.082177612 + }, + "Percentiles":{ + "P0":1596431, + "P25":1689765, + "P50":1833522, + "P67":1938754.2400000002, + "P80":2205058.4000000004, + "P85":2331036.8, + "P90":2404391.2, + "P95":2425121.5999999996, + "P100":2445852 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":354048 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":195895 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7805966 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":2052991 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1748093 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1689925 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1833682 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2079240 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1596591 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1603724 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":3248225 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2446012 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2394186 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":1859981 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1747933 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1689765 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1833522 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2079080 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1596431 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1603564 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2445852 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2394026 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":1859821 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":354048, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/6-extra-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/6-extra-bulk.json new file mode 100644 index 000000000..16fe08c4c --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/6-extra-bulk.json @@ -0,0 +1,501 @@ +{ + "Title":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks-20261129-172437", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"QuicBulkBenchmarks.Bulk64KiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"QuicBulkBenchmarks", + "Method":"Bulk64KiB", + "MethodTitle":"Bulk64KiB", + "Parameters":"Stack=Managed", + "FullName":"Titanium.Managed.Benchmarks.QuicBulkBenchmarks.Bulk64KiB(Stack: Managed)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1397711,1527783,1472089,2102163,1791934,1950900,2807234,2641365,2125907,2446353 + ], + "N":10, + "Min":1397711, + "LowerFence":435189.625, + "Q1":1593820.75, + "Median":2026531.5, + "Mean":2026343.9, + "Q3":2366241.5, + "UpperFence":3524872.625, + "Max":2807234, + "InterquartileRange":772420.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":156051.62479210028, + "Variance":243521096002.5445, + "StandardDeviation":493478.56691303675, + "Skewness":0.19006342546818494, + "Kurtosis":1.4527891569132805, + "ConfidenceInterval":{ + "N":10, + "Mean":2026343.9, + "StandardError":156051.62479210028, + "Level":12, + "Margin":746069.1768185414, + "Lower":1280274.7231814587, + "Upper":2772413.076818541 + }, + "Percentiles":{ + "P0":1397711, + "P25":1593820.75, + "P50":2026531.5, + "P67":2135520.3800000004, + "P80":2485355.4, + "P85":2573110.8, + "P90":2657951.9, + "P95":2732592.9499999997, + "P100":2807234 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":354896 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":153505 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":7995328 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":280 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":311 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1918950 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1397821 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1527893 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1472199 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2102273 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1792044 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1951010 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2807344 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2641475 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2126017 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2446463 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":1397711 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":1527783 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":1472089 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":2102163 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":1791934 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":1950900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":2807234 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":2641365 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":2125907 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":2446353 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":354896, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/README.md b/src/Titanium.Tls/design/perf-baselines/linuxmini/README.md new file mode 100644 index 000000000..bb2a890a1 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/README.md @@ -0,0 +1,28 @@ +linuxmini, 2026-11-29. Ubuntu 26.04.1 LTS, kernel 7.0.0-44-generic, AMD Ryzen 5 7640HS (6 physical cores, 12 logical), 30.8 GB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs (`run1` to `run3`). The CPU governor was set to `performance` before the timed job and restored to `powersave` afterwards, which is where it stays between runs. + +Each `runN-.json` is the full exporter output for one class in one run. Medians in this file are the median of the three run medians. A ratio is the platform median divided by the managed median. + +| Cell | Platform median | Managed median | Ratio | +| --- | ---: | ---: | ---: | +| Full handshake, loopback | 1.042 ms | 1.405 ms | 0.74 | +| Full handshake, in-memory | 0.875 ms | 1.276 ms | 0.69 | +| Resumed handshake, loopback | 1.047 ms | 1.296 ms | 0.81 | +| Resumed handshake, in-memory | 0.877 ms | 1.409 ms | 0.62 | +| 256 MiB, loopback, 16 KiB writes | 166.1 ms | 156.2 ms | 1.06 | +| 256 MiB, loopback, 64 KiB writes | 105.6 ms | 155.2 ms | 0.68 | +| 256 MiB, in-memory, 16 KiB writes | 66.16 ms | 55.74 ms | 1.19 | +| 256 MiB, in-memory, 64 KiB writes | 120.2 ms | 55.40 ms | 2.17 | +| 100-byte exchange, loopback | 19.70 µs | 17.36 µs | 1.13 | +| 1 KiB exchange, loopback | 20.08 µs | 18.19 µs | 1.10 | +| 100-byte exchange, in-memory | 11.74 µs | 12.13 µs | 0.97 | +| 1 KiB exchange, in-memory | 12.61 µs | 12.69 µs | 0.99 | + +## The two loopback bulk rows and the in-memory 64 KiB row + +The platform figure moves between two modes on this machine and the managed figure does not. For 256 MiB at 16 KiB writes the platform medians across the three main runs were 115.4, 166.6, and 166.1 ms, and the first run's ten samples straddle both modes (103 to 165 ms). At 64 KiB writes the platform medians were 100.7, 105.6, and 109.0 ms. Three further bulk-only runs (`4-extra-bulk.json`, `5-extra-bulk.json`, `6-extra-bulk.json`) reproduced the slower mode: 164.7, 166.0, and 165.5 ms at 16 KiB writes, and 97.2, 107.2, and 107.5 ms at 64 KiB writes. The managed medians in those six runs stay at 154 to 157 ms at both write sizes. + +The in-memory 64 KiB platform row is the same story with a different pair of modes: 120.2, 120.1, and 121.9 ms in the main runs, against 55.4 to 55.7 ms managed in every run. In-memory 16 KiB is the one write size where the platform is consistently the faster side (66.1 to 66.5 ms against 54.3 to 55.9 ms managed). + +A reader should treat the loopback 64 KiB row (0.68) and the in-memory 64 KiB row (2.17) as a pair of unstable platform references rather than as two independent facts about the managed stack. The 16 KiB loopback row at 1.06 and the 16 KiB in-memory row at 1.19 are the two bulk comparisons whose platform side held one mode in all six runs. + +The resumed rows are worth a second look before anyone acts on them. The platform's resumed handshake is not faster than its own full handshake on this machine (1.047 ms against 1.042 ms on loopback, 0.877 ms against 0.875 ms in-memory), so the platform half of those cells may not be resuming at all. The managed half does resume: the benchmark throws if `AcceptedResumption` is false. diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-bulk.json new file mode 100644 index 000000000..257011616 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-bulk.json @@ -0,0 +1,3756 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171833", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 116660084,114151426,105749972,103220906,103259737,102360885,134178253,165431211,164622866,165697496 + ], + "N":10, + "Min":102360885, + "LowerFence":24188170.25, + "Q1":103882295.75, + "Median":115405755, + "Mean":127533283.6, + "Q3":157011712.75, + "UpperFence":236705838.25, + "Max":165697496, + "InterquartileRange":53129417, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":8754879.539292332, + "Variance":766479157475195.4, + "StandardDeviation":27685359.98456938, + "Skewness":0.48392899612213275, + "Kurtosis":1.267737318385267, + "ConfidenceInterval":{ + "N":10, + "Mean":127533283.6, + "StandardError":8754879.539292332, + "Level":12, + "Margin":41856313.7662119, + "Lower":85676969.8337881, + "Upper":169389597.3662119 + }, + "Percentiles":{ + "P0":102360885, + "P25":103882295.75, + "P50":115405755, + "P67":135091591.39000002, + "P80":164784535, + "P85":165148290.25, + "P90":165457839.5, + "P95":165577667.75, + "P100":165697496 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":205012 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":122576729 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":115816679 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":116660149 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":114151491 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":105750037 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":103220971 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":103259802 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":102360950 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":134178318 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":165431276 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":164622931 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":165697561 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":116660084 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":114151426 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":105749972 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":103220906 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":103259737 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":102360885 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":134178253 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":165431211 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":164622866 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":165697496 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 114575070,111128727,106001395,99192244,98201490,116729579,98015093,101153063,100163361,99759049 + ], + "N":10, + "Min":98015093, + "LowerFence":83564522.125, + "Q1":99333945.25, + "Median":100658212, + "Mean":104491907.1, + "Q3":109846894, + "UpperFence":125616317.125, + "Max":116729579, + "InterquartileRange":10512948.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2259905.981120471, + "Variance":51071750435040.78, + "StandardDeviation":7146450.198178168, + "Skewness":0.6191711153147196, + "Kurtosis":1.525954035779562, + "ConfidenceInterval":{ + "N":10, + "Mean":104491907.1, + "StandardError":2259905.981120471, + "Level":12, + "Margin":10804412.94519094, + "Lower":93687494.15480906, + "Upper":115296320.04519093 + }, + "Percentiles":{ + "P0":98015093, + "P25":99333945.25, + "P50":100658212, + "P67":106155214.96000001, + "P80":111817995.6, + "P85":113368849.94999999, + "P90":114790520.9, + "P95":115760049.94999999, + "P100":116729579 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":177110 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":126767928 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":240 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":120395660 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114575200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":111128857 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":106001525 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":99192374 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":98201620 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":116729709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":98015223 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":101153193 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100163491 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":99759179 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114575070 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":111128727 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":106001395 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":99192244 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":98201490 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":116729579 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":98015093 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":101153063 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100163361 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":99759049 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 70166270,72081625,69039023,66284397,65838366,65816296,66076530,65819842,65633325,66234594 + ], + "N":10, + "Min":65633325, + "LowerFence":62035632.75, + "Q1":65824473, + "Median":66155562, + "Mean":67299026.8, + "Q3":68350366.5, + "UpperFence":72139206.75, + "Max":72081625, + "InterquartileRange":2525893.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":723214.090681142, + "Variance":5230386209597.512, + "StandardDeviation":2287003.762479964, + "Skewness":1.002528934787446, + "Kurtosis":2.289677603897637, + "ConfidenceInterval":{ + "N":10, + "Mean":67299026.8, + "StandardError":723214.090681142, + "Level":12, + "Margin":3457623.3475100854, + "Lower":63841403.45248991, + "Upper":70756650.14751008 + }, + "Percentiles":{ + "P0":65633325, + "P25":65824473, + "P50":66155562, + "P67":66367035.78, + "P80":69264472.4, + "P85":69771733.55, + "P90":70357805.5, + "P95":71219715.25, + "P100":72081625 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":201014 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":72660381 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":69993488 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":70166330 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":72081685 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":69039083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66284457 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":65838426 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":65816356 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66076590 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":65819902 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":65633385 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":66234654 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":70166270 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":72081625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":69039023 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66284397 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":65838366 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":65816296 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66076530 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":65819842 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":65633325 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":66234594 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 120856252.5,120083854.5,118799555.5,120553749.5,119537117.5,120160457.5,120262688.5,121325455.5 + ], + "N":8, + "Min":118799555.5, + "LowerFence":118923862.75, + "Q1":119947170.25, + "Median":120211573, + "Mean":120197391.375, + "Q3":120629375.25, + "UpperFence":121652682.75, + "Max":121325455.5, + "InterquartileRange":682205, + "LowerOutliers":[ + 118799555.5 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 118799555.5 + ], + "StandardError":275228.5717780403, + "Variance":606006133783.8392, + "StandardDeviation":778463.9579221631, + "Skewness":-0.3321714878221688, + "Kurtosis":1.985075420992459, + "ConfidenceInterval":{ + "N":8, + "Mean":120197391.375, + "StandardError":275228.5717780403, + "Level":12, + "Margin":1488403.7817515712, + "Lower":118708987.59324843, + "Upper":121685795.15675157 + }, + "Percentiles":{ + "P0":118799555.5, + "P25":119947170.25, + "P50":120211573, + "P67":120463520.59, + "P80":120735251.3, + "P85":120841127.35, + "P90":120997013.39999999, + "P95":121161234.44999999, + "P100":121325455.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":193410 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":132863752 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":320 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":127858297 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":132046652 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":120856388 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":120083990 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":124017450 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":118799691 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120553885 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":119537253 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":120160593 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120262824 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":121325591 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":120856252.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":120083854.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":118799555.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120553749.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":119537117.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120160457.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120262688.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":121325455.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 113566603,154868851,155208082,155112584,155044878,155120970,154914476,154849625,154622102 + ], + "N":9, + "Min":113566603, + "LowerFence":154455186.5, + "Q1":154849625, + "Median":154914476, + "Mean":150367574.55555555, + "Q3":155112584, + "UpperFence":155507022.5, + "Max":155208082, + "InterquartileRange":262959, + "LowerOutliers":[ + 113566603 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 113566603 + ], + "StandardError":4600505.184336874, + "Variance":190481831559994.03, + "StandardDeviation":13801515.55301062, + "Skewness":-2.073407809489777, + "Kurtosis":5.627849135567205, + "ConfidenceInterval":{ + "N":9, + "Mean":150367574.55555555, + "StandardError":4600505.184336874, + "Level":12, + "Margin":23192551.76944085, + "Lower":127175022.78611471, + "Upper":173560126.3249964 + }, + "Percentiles":{ + "P0":113566603, + "P25":154849625, + "P50":154914476, + "P67":155069252.16, + "P80":155115938.4, + "P85":155119292.8, + "P90":155138392.4, + "P95":155173237.2, + "P100":155208082 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":184783 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":88806847 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":161259403 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163448306 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":113566693 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":154868941 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":155208172 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155112674 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155044968 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":155121060 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":154914566 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":154849715 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":154622192 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":113566603 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":154868851 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":155208082 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":155112584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155044878 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155120970 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":154914476 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":154849625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":154622102 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 151210637.5,139461354.5,154747919.5,154453963.5,154277715.5,154459093.5,154772566.5,154717644.5,154215720.5 + ], + "N":9, + "Min":139461354.5, + "LowerFence":153462834.5, + "Q1":154215720.5, + "Median":154453963.5, + "Mean":152479623.94444445, + "Q3":154717644.5, + "UpperFence":155470530.5, + "Max":154772566.5, + "InterquartileRange":501924, + "LowerOutliers":[ + 139461354.5,151210637.5 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 139461354.5,151210637.5 + ], + "StandardError":1669001.0032461293, + "Variance":25070079139529.27, + "StandardDeviation":5007003.009738388, + "Skewness":-1.9003462201258858, + "Kurtosis":5.100921802989825, + "ConfidenceInterval":{ + "N":9, + "Mean":152479623.94444445, + "StandardError":1669001.0032461293, + "Level":12, + "Margin":8413943.821392318, + "Lower":144065680.12305212, + "Upper":160893567.76583678 + }, + "Percentiles":{ + "P0":139461354.5, + "P25":154215720.5, + "P50":154453963.5, + "P67":154552171.85999998, + "P80":154729754.5, + "P85":154741864.5, + "P90":154752848.9, + "P95":154762707.7, + "P100":154772566.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179534 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":87491050 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":164259244 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":165007828 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151210773 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":139461490 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":154748055 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":154454099 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":154277851 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":154459229 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":154772702 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":154717780 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":154215856 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":151210637.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":139461354.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":154747919.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":154453963.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":154277715.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":154459093.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":154772566.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":154717644.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":154215720.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 59771747,58782456,55623969,55604383,55851262,55456037,55553608,55737260,56012843 + ], + "N":9, + "Min":55456037, + "LowerFence":54991693, + "Q1":55604383, + "Median":55737260, + "Mean":56488173.88888889, + "Q3":56012843, + "UpperFence":56625533, + "Max":59771747, + "InterquartileRange":408460, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 58782456,59771747 + ], + "AllOutliers":[ + 58782456,59771747 + ], + "StandardError":536290.072853728, + "Variance":2588463380173.1113, + "StandardDeviation":1608870.218561184, + "Skewness":1.158968801785349, + "Kurtosis":2.446952300411291, + "ConfidenceInterval":{ + "N":9, + "Mean":56488173.88888889, + "StandardError":536290.072853728, + "Level":12, + "Margin":2703602.0566706783, + "Lower":53784571.83221821, + "Upper":59191775.94555957 + }, + "Percentiles":{ + "P0":55456037, + "P25":55604383, + "P50":55737260, + "P67":55909431.160000004, + "P80":57120688.2, + "P85":58228533.4, + "P90":58980314.2, + "P95":59376030.6, + "P100":59771747 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181868 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":63336140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59570053 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59771877 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":62185218 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":58782586 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55624099 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55604513 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55851392 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55456167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55553738 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55737390 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":56012973 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59771747 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":58782456 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":55623969 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55604383 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55851262 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55456037 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55553608 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55737260 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":56012843 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 57891759,55836865,55425099,55324442,55557045,56839611,55635060,55280350 + ], + "N":8, + "Min":55280350, + "LowerFence":54368509.625, + "Q1":55399934.75, + "Median":55596052.5, + "Mean":55973778.875, + "Q3":56087551.5, + "UpperFence":57118976.625, + "Max":57891759, + "InterquartileRange":687616.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 57891759 + ], + "AllOutliers":[ + 57891759 + ], + "StandardError":325658.33387777954, + "Variance":848426803392.4108, + "StandardDeviation":921100.8649395629, + "Skewness":1.090623325288985, + "Kurtosis":2.5418818156317498, + "ConfidenceInterval":{ + "N":8, + "Mean":55973778.875, + "StandardError":325658.33387777954, + "Level":12, + "Margin":1761122.010593802, + "Lower":54212656.8644062, + "Upper":57734900.8855938 + }, + "Percentiles":{ + "P0":55280350, + "P25":55399934.75, + "P50":55596052.5, + "P67":55774305.45, + "P80":56438512.6, + "P85":56789473.7, + "P90":57155255.4, + "P95":57523507.2, + "P100":57891759 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":175547 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":63990018 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":61376473 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":62945393 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":64603339 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":57891879 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55836985 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55425219 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55324562 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55557165 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":56839731 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55635180 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55280470 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":57891759 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":55836865 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":55425099 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55324442 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55557045 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":56839611 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55635060 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55280350 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-handshake.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-handshake.json new file mode 100644 index 000000000..34ef7dbe5 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-handshake.json @@ -0,0 +1,1915 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171845", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1034553.65,1058596.4,1038541.1,1033583.35,1022928.55,1053605.1,1020050.65,1028424.25 + ], + "N":8, + "Min":1020050.65, + "LowerFence":1004165.1624999999, + "Q1":1027050.325, + "Median":1034068.5, + "Mean":1036285.3812500001, + "Q3":1042307.1, + "UpperFence":1065192.2625, + "Max":1058596.4, + "InterquartileRange":15256.775000000023, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4849.3577863643895, + "Variance":188130167.5213835, + "StandardDeviation":13716.055100552181, + "Skewness":0.44277757888588654, + "Kurtosis":1.5644806280609043, + "ConfidenceInterval":{ + "N":8, + "Mean":1036285.3812500001, + "StandardError":4849.3577863643895, + "Level":12, + "Margin":26224.757196037135, + "Lower":1010060.624053963, + "Upper":1062510.1384460372 + }, + "Percentiles":{ + "P0":1020050.65, + "P25":1027050.325, + "P50":1034068.5, + "P67":1037304.9905000001, + "P80":1047579.5, + "P85":1052851.9000000001, + "P90":1055102.4900000002, + "P95":1056849.4449999998, + "P100":1058596.4 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13420 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":183963 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":55269820 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":251 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21464162 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":20691143 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21171998 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20770892 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20671737 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":20458641 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":22857545 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":22469663 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":21072172 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20401083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20568555 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":20691073 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21171928 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20770822 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20671667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":20458571 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21072102 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20401013 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20568485 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13420, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 893724.825,875999.825,870480.075,868047.075,866315.825,879255.425,886500.375,880341.875 + ], + "N":8, + "Min":866315.825, + "LowerFence":851857.3124999999, + "Q1":869871.825, + "Median":877627.625, + "Mean":877583.1625, + "Q3":881881.5, + "UpperFence":899896.0125000001, + "Max":893724.825, + "InterquartileRange":12009.675000000047, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3330.936087806119, + "Variance":88761081.76839307, + "StandardDeviation":9421.309981546785, + "Skewness":0.3408911809646566, + "Kurtosis":1.605869008430282, + "ConfidenceInterval":{ + "N":8, + "Mean":877583.1625, + "StandardError":3330.936087806119, + "Level":12, + "Margin":18013.31103756786, + "Lower":859569.8514624321, + "Upper":895596.4735375679 + }, + "Percentiles":{ + "P0":866315.825, + "P25":869871.825, + "P50":877627.625, + "P67":880005.0755, + "P80":884036.975, + "P85":886192.4500000001, + "P90":888667.71, + "P95":891196.2675000001, + "P100":893724.825 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76996 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":180065 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48454107 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":241 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18943942 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18527066 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17874592 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17520092 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17409697 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17361037 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17326412 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17585204 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18860196 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17730103 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17606933 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":17874496.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17519996.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17409601.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17360941.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17326316.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17585108.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17730007.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":17606837.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76996, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2202382.35,2125683.6,2091580.7,1886829.15,1406649.1,1381664.1,1403927.05,1375413,1362417.25,1376545.6 + ], + "N":10, + "Min":1362417.25, + "LowerFence":383973.84375000023, + "Q1":1377825.225, + "Median":1405288.0750000002, + "Mean":1661309.19, + "Q3":2040392.8125, + "UpperFence":3034244.1937499996, + "Max":2202382.35, + "InterquartileRange":662567.5874999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":115751.58319269468, + "Variance":133984290116.15321, + "StandardDeviation":366038.64565938007, + "Skewness":0.45077520857447545, + "Kurtosis":1.1420530337196062, + "ConfidenceInterval":{ + "N":10, + "Mean":1661309.19, + "StandardError":115751.58319269468, + "Level":12, + "Margin":553398.2007753394, + "Lower":1107910.9892246607, + "Upper":2214707.390775339 + }, + "Percentiles":{ + "P0":1362417.25, + "P25":1377825.225, + "P50":1405288.0750000002, + "P67":1892971.6965, + "P80":2098401.28, + "P85":2113747.585, + "P90":2133353.475, + "P95":2167867.9125, + "P100":2202382.35 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":177244 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":199411 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":105734538 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":40 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44397568 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44047737 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42513762 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41831704 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":37736673 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28133072 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27633372 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":28078631 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":27508350 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27248435 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27531002 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44047647 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42513672 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41831614 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":37736583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28132982 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27633282 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":28078541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":27508260 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27248345 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27530912 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":177244, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2044589.725,1982700.525,1942005.325,1947531.075,1318304.175,1213832.275,1227502.175,1228305.225,1220823.775,1223882.475 + ], + "N":10, + "Min":1213832.275, + "LowerFence":142744.04375000042, + "Q1":1224787.4000000001, + "Median":1273304.7000000002, + "Mean":1534947.6750000003, + "Q3":1946149.6375, + "UpperFence":3028192.9937499994, + "Max":2044589.725, + "InterquartileRange":721362.2374999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":121571.91941920723, + "Variance":147797315912.7022, + "StandardDeviation":384444.16488314944, + "Skewness":0.3476770968036248, + "Kurtosis":0.978748457106899, + "ConfidenceInterval":{ + "N":10, + "Mean":1534947.6750000003, + "StandardError":121571.91941920723, + "Level":12, + "Margin":581224.7194873776, + "Lower":953722.9555126227, + "Upper":2116172.3944873777 + }, + "Percentiles":{ + "P0":1213832.275, + "P25":1224787.4000000001, + "P50":1273304.7000000002, + "P67":1942171.0975, + "P80":1954564.9649999999, + "P85":1970391.2174999998, + "P90":1988889.4449999998, + "P95":2016739.585, + "P100":2044589.725 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":240784 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":204471 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":98941156 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42344327 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":40891905 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39654121 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":38840217 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":38950732 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":26366194 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24276756 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":24550154 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24566215 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":24416586 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":24477760 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":40891794.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39654010.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":38840106.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":38950621.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":26366083.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24276645.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":24550043.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24566104.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":24416475.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":24477649.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":240784, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-resumed.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-resumed.json new file mode 100644 index 000000000..6ff0564eb --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-resumed.json @@ -0,0 +1,1936 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171849", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1060684.3,1044988.55,1033081.45,1039582.05,1069265.3,1028882.1,1004286.85,1036931.1 + ], + "N":8, + "Min":1004286.85, + "LowerFence":1006710.2999999998, + "Q1":1032031.6124999999, + "Median":1038256.575, + "Mean":1039712.7124999998, + "Q3":1048912.4875, + "UpperFence":1074233.8000000003, + "Max":1069265.3, + "InterquartileRange":16880.875000000116, + "LowerOutliers":[ + 1004286.85 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 1004286.85 + ], + "StandardError":7026.759255655633, + "Variance":395002765.0955368, + "StandardDeviation":19874.67647775774, + "Skewness":-0.17295790400829333, + "Kurtosis":2.041080766105699, + "ConfidenceInterval":{ + "N":8, + "Mean":1039712.7124999998, + "StandardError":7026.759255655633, + "Level":12, + "Margin":37999.88853631862, + "Lower":1001712.8239636811, + "Upper":1077712.6010363183 + }, + "Percentiles":{ + "P0":1004286.85, + "P25":1032031.6124999999, + "P50":1038256.575, + "P67":1043312.5350000001, + "P80":1054406, + "P85":1059899.5125, + "P90":1063258.6, + "P95":1066261.9500000002, + "P100":1069265.3 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13406 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":161741 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":23103933 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21358776 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21213816 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":22974102 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20899901 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20661759 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":20791771 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":22663934 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21385436 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20577772 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20085867 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20738752 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21213686 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":20899771 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20661629 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20791641 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21385306 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":20577642 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20085737 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20738622 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13406, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 922450.55,915786.1,865803.1,876119.8,855424.3,863520.35,861469.55,940965,883597.2,877184.25 + ], + "N":10, + "Min":855424.3, + "LowerFence":798619.28125, + "Q1":864091.0375, + "Median":876652.025, + "Mean":886232.0199999999, + "Q3":907738.875, + "UpperFence":973210.6312500001, + "Max":940965, + "InterquartileRange":43647.83750000002, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":9349.653784484926, + "Variance":874160258.8973331, + "StandardDeviation":29566.201292985428, + "Skewness":0.6609646866121265, + "Kurtosis":1.7263681317191562, + "ConfidenceInterval":{ + "N":10, + "Mean":886232.0199999999, + "StandardError":9349.653784484926, + "Level":12, + "Margin":44699.87744005947, + "Lower":841532.1425599405, + "Upper":930931.8974400593 + }, + "Percentiles":{ + "P0":855424.3, + "P25":864091.0375, + "P50":876652.025, + "P67":884562.867, + "P80":917118.99, + "P85":920117.9925, + "P90":924301.995, + "P95":932633.4975, + "P100":940965 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76982 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":172712 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19097458 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":240 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19021597 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18449102 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":18315813 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17316153 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17522487 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17108577 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17270498 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17229482 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18819391 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17672035 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17543776 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18449011 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":18315722 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17316062 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17522396 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17108486 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17270407 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17229391 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18819300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17671944 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17543685 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76982, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1900170.45,1818179.9,1793256.55,1779848.6,1512230.05,1077217.55,1051760.7,1048201.1,1032806.95,1005932.9 + ], + "N":10, + "Min":1005932.9, + "LowerFence":-62129.34375, + "Q1":1049091, + "Median":1294723.8, + "Mean":1401960.475, + "Q3":1789904.5625, + "UpperFence":2901124.90625, + "Max":1900170.45, + "InterquartileRange":740813.5625, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":123642.80685202463, + "Variance":152875436862.4707, + "StandardDeviation":390992.8859486713, + "Skewness":0.12898426828045936, + "Kurtosis":0.9438942331045762, + "ConfidenceInterval":{ + "N":10, + "Mean":1401960.475, + "StandardError":123642.80685202463, + "Level":12, + "Margin":591125.4512762603, + "Lower":810835.0237237398, + "Upper":1993085.9262762605 + }, + "Percentiles":{ + "P0":1005932.9, + "P25":1049091, + "P50":1294723.8, + "P67":1780250.8385000003, + "P80":1798241.2200000002, + "P85":1809456.7274999998, + "P90":1826378.9549999998, + "P95":1863274.7025, + "P100":1900170.45 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172156 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":184483 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41611073 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38365453 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38003549 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36363738 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35865271 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35597112 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30244741 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21544491 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21035354 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20964162 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20656279 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20118798 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38003409 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36363598 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35865131 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35596972 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30244601 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21544351 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21035214 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20964022 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20656139 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20118658 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172156, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1705732.65,1652656.4,1613687.9,1611858.95,1628457.85,1218288.6,869996.95,970101.25,872700.5,872351.35 + ], + "N":10, + "Min":869996.95, + "LowerFence":-194521.32500000042, + "Q1":897050.6875, + "Median":1415073.775, + "Mean":1301583.2399999998, + "Q3":1624765.3625000003, + "UpperFence":2716337.375000001, + "Max":1705732.65, + "InterquartileRange":727714.6750000003, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":118245.5969334841, + "Variance":139820211941.55988, + "StandardDeviation":373925.4095960314, + "Skewness":-0.13557330020063327, + "Kurtosis":0.9546880612848184, + "ConfidenceInterval":{ + "N":10, + "Mean":1301583.2399999998, + "StandardError":118245.5969334841, + "Level":12, + "Margin":565321.8624548882, + "Lower":736261.3775451116, + "Upper":1866905.102454888 + }, + "Percentiles":{ + "P0":869996.95, + "P25":897050.6875, + "P50":1415073.775, + "P67":1614130.9985, + "P80":1633297.56, + "P85":1644186.9075, + "P90":1657964.025, + "P95":1681848.3375, + "P100":1705732.65 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235718 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":151883 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37845937 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":251 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":211 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34665088 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34114763 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":33053238 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":32273868 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32237289 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32569267 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24365882 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17400049 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19402135 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17454120 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17447137 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34114653 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":33053128 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":32273758 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32237179 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32569157 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24365772 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17399939 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19402025 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17454010 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17447027 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235718, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-small.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-small.json new file mode 100644 index 000000000..c4686b0a2 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run1-small.json @@ -0,0 +1,3784 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171851", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 19457,19411.12,19321.56,19305.54,19404.92,19355.62,19474.04,19394.3 + ], + "N":8, + "Min":19305.54, + "LowerFence":19233.8775, + "Q1":19347.105, + "Median":19399.61, + "Mean":19390.512499999997, + "Q3":19422.59, + "UpperFence":19535.8175, + "Max":19474.04, + "InterquartileRange":75.48500000000058, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":21.22846839825498, + "Variance":3605.1829642856837, + "StandardDeviation":60.0431758344417, + "Skewness":-0.055073646692779574, + "Kurtosis":1.391262307320157, + "ConfidenceInterval":{ + "N":8, + "Mean":19390.512499999997, + "StandardError":21.22846839825498, + "Level":12, + "Margin":114.80106313321873, + "Lower":19275.71143686678, + "Upper":19505.313563133215 + }, + "Percentiles":{ + "P0":19305.54, + "P25":19347.105, + "P50":19399.61, + "P67":19409.198, + "P80":19438.648, + "P85":19454.706000000002, + "P90":19462.112, + "P95":19468.076, + "P100":19474.04 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":149979 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2160621 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1208489 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1066545 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1038963 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":972960 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":970666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":966188 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":965387 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":970356 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":967891 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":973812 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":969825 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":972850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":970556 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":966078 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":965277 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":970246 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":967781 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":973702 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":969715 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 20250.5,20062.54,20039.9,20127.84,20079.38,20070.76,19999.22,20102.62 + ], + "N":8, + "Min":19999.22, + "LowerFence":19978.812500000004, + "Q1":20056.88, + "Median":20075.07, + "Mean":20091.595, + "Q3":20108.925, + "UpperFence":20186.992499999997, + "Max":20250.5, + "InterquartileRange":52.044999999998254, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 20250.5 + ], + "AllOutliers":[ + 20250.5 + ], + "StandardError":26.49766155450582, + "Variance":5617.008542857087, + "StandardDeviation":74.94670468310856, + "Skewness":0.9203728716833586, + "Kurtosis":2.8534268864322367, + "ConfidenceInterval":{ + "N":8, + "Mean":20091.595, + "StandardError":26.49766155450582, + "Level":12, + "Margin":143.29624068647087, + "Lower":19948.29875931353, + "Upper":20234.891240686473 + }, + "Percentiles":{ + "P0":19999.22, + "P25":20056.88, + "P50":20075.07, + "P67":20095.4156, + "P80":20117.752, + "P85":20126.579, + "P90":20164.638, + "P95":20207.569, + "P100":20250.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161030 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1988140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1270704 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1012635 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1026791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1003237 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1002105 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1006502 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1004079 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1003648 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1185456 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1000071 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1005241 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1012525 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1003127 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1001995 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1006392 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1003969 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1003538 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":999961 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1005131 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12050.21,11701.17,11678.13,11709.59,11732.43,11925.39,11899.93,11729.01,11671.51,11637.65 + ], + "N":10, + "Min":11637.65, + "LowerFence":11422.642499999998, + "Q1":11683.89, + "Median":11719.3, + "Mean":11773.501999999997, + "Q3":11858.055, + "UpperFence":12119.302500000002, + "Max":12050.21, + "InterquartileRange":174.16500000000087, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":43.019166601773044, + "Variance":18506.48695111106, + "StandardDeviation":136.03854950384857, + "Skewness":0.8531598457458318, + "Kurtosis":2.111783233329501, + "ConfidenceInterval":{ + "N":10, + "Mean":11773.501999999997, + "StandardError":43.019166601773044, + "Level":12, + "Margin":205.67087498616831, + "Lower":11567.831125013829, + "Upper":11979.172874986165 + }, + "Percentiles":{ + "P0":11637.65, + "P25":11683.89, + "P50":11719.3, + "P67":11737.455, + "P80":11905.022, + "P85":11916.479, + "P90":11937.872, + "P95":11994.040999999997, + "P100":12050.21 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":194461 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1299137 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":714520 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":602621 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":585169 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":584017 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":585590 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":586732 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":596380 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":595107 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":586561 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":583686 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":581993 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":602510.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":585058.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":583906.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":585479.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":586621.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":596269.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":594996.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":586450.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":583575.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":581882.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12406.97,12352.69,12340.67,12682.49,12616.79,12403.17,12511.19,12483.33,12408.99 + ], + "N":9, + "Min":12340.67, + "LowerFence":12241.14, + "Q1":12403.17, + "Median":12408.99, + "Mean":12467.365555555556, + "Q3":12511.19, + "UpperFence":12673.220000000001, + "Max":12682.49, + "InterquartileRange":108.02000000000044, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 12682.49 + ], + "AllOutliers":[ + 12682.49 + ], + "StandardError":39.292401269594954, + "Variance":13895.035177777801, + "StandardDeviation":117.87720380878486, + "Skewness":0.6210273948030384, + "Kurtosis":1.7935020947759883, + "ConfidenceInterval":{ + "N":9, + "Mean":12467.365555555556, + "StandardError":39.292401269594954, + "Level":12, + "Margin":198.08499590291837, + "Lower":12269.280559652638, + "Upper":12665.450551458474 + }, + "Percentiles":{ + "P0":12340.67, + "P25":12403.17, + "P50":12408.99, + "P67":12493.3596, + "P80":12553.43, + "P85":12595.670000000002, + "P90":12629.93, + "P95":12656.21, + "P100":12682.49 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":167291 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1393774 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":763692 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":645731 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":620444 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":617730 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":617129 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":634220 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":630935 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":620254 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":625655 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":624262 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":620545 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":620348.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":617634.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":617033.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":634124.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":630839.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":620158.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":625559.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":624166.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":620449.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 17267.72,17176.78,17167.14,17412.4,17381.94,17425.84,17320.44,17282.96,17291.2 + ], + "N":9, + "Min":17167.14, + "LowerFence":17096.390000000007, + "Q1":17267.72, + "Median":17291.2, + "Mean":17302.935555555556, + "Q3":17381.94, + "UpperFence":17553.269999999997, + "Max":17425.84, + "InterquartileRange":114.21999999999753, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":31.12890167919667, + "Variance":8721.076677777837, + "StandardDeviation":93.38670503759, + "Skewness":-0.12258143971714408, + "Kurtosis":1.4694623533372846, + "ConfidenceInterval":{ + "N":9, + "Mean":17302.935555555556, + "StandardError":31.12890167919667, + "Level":12, + "Margin":156.93030108489435, + "Lower":17146.005254470663, + "Upper":17459.86585664045 + }, + "Percentiles":{ + "P0":17167.14, + "P25":17267.72, + "P50":17291.2, + "P67":17342.579999999998, + "P80":17394.124, + "P85":17406.308, + "P90":17415.088, + "P95":17420.464, + "P100":17425.84 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":163975 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2196898 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1023334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":863536 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":858989 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":858507 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":870770 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":869247 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":871442 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":866172 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":864298 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":881069 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":864710 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":863386 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":858839 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":858357 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":870620 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":869097 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":871292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":866022 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":864148 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":864560 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 18094.25,18261.99,17812.95,18242.33,18432.89,18195.45,18183.83,17956.41 + ], + "N":8, + "Min":17812.95, + "LowerFence":17778.6075, + "Q1":18059.79, + "Median":18189.64, + "Mean":18147.5125, + "Q3":18247.245000000003, + "UpperFence":18528.427500000005, + "Max":18432.89, + "InterquartileRange":187.45500000000175, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":67.93403632910595, + "Variance":36920.2663357143, + "StandardDeviation":192.1464710467364, + "Skewness":-0.3317279786405095, + "Kurtosis":1.9039855362537565, + "ConfidenceInterval":{ + "N":8, + "Mean":18147.5125, + "StandardError":67.93403632910595, + "Level":12, + "Margin":367.3792874361653, + "Lower":17780.133212563836, + "Upper":18514.891787436165 + }, + "Percentiles":{ + "P0":17812.95, + "P25":18059.79, + "P50":18189.64, + "P67":18227.7972, + "P80":18254.126, + "P85":18261.007, + "P90":18313.260000000002, + "P95":18373.075, + "P100":18432.89 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":166139 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2124233 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1074680 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":904853 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":913240 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":890788 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":912257 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":921785 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":909913 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":962762 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1069821 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":909332 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":897961 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":904712.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":913099.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":890647.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":912116.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":921644.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":909772.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":909191.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":897820.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12636.54,12328.96,12293.68,12566.58,12670.98,12574.6,12550.16,12558.78,12600.06 + ], + "N":9, + "Min":12293.68, + "LowerFence":12475.310000000001, + "Q1":12550.16, + "Median":12566.58, + "Mean":12531.14888888889, + "Q3":12600.06, + "UpperFence":12674.91, + "Max":12670.98, + "InterquartileRange":49.899999999999636, + "LowerOutliers":[ + 12293.68,12328.96 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 12293.68,12328.96 + ], + "StandardError":43.61269732430268, + "Variance":17118.606311111143, + "StandardDeviation":130.83809197290805, + "Skewness":-0.8567542349116731, + "Kurtosis":2.0418767973413643, + "ConfidenceInterval":{ + "N":9, + "Mean":12531.14888888889, + "StandardError":43.61269732430268, + "Level":12, + "Margin":219.86492786544756, + "Lower":12311.283961023442, + "Upper":12751.01381675434 + }, + "Percentiles":{ + "P0":12293.68, + "P25":12550.16, + "P50":12566.58, + "P67":12583.765599999999, + "P80":12614.652, + "P85":12629.244, + "P90":12643.428, + "P95":12657.204, + "P100":12670.98 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":206635 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1945400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":737873 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":631957 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":616578 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":614814 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":646734 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":628459 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":633679 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":628860 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":627638 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":628069 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":630133 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":631827 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":616448 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":614684 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":628329 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":633549 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":628730 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":627508 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":627939 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":630003 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12545.35,12178.65,12190.29,12300.29,12376.03,12502.25,12390.27,12296.67 + ], + "N":8, + "Min":12178.65, + "LowerFence":12047.790000000003, + "Q1":12270.075, + "Median":12338.16, + "Mean":12347.475, + "Q3":12418.265, + "UpperFence":12640.549999999997, + "Max":12545.35, + "InterquartileRange":148.1899999999987, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":47.01314280526852, + "Variance":17681.88477142857, + "StandardDeviation":132.97324832998768, + "Skewness":0.13957830215706765, + "Kurtosis":1.4174718972567626, + "ConfidenceInterval":{ + "N":8, + "Mean":12347.475, + "StandardError":47.01314280526852, + "Level":12, + "Margin":254.24155308926183, + "Lower":12093.233446910739, + "Upper":12601.716553089262 + }, + "Percentiles":{ + "P0":12178.65, + "P25":12270.075, + "P50":12338.16, + "P67":12385.8556, + "P80":12457.458, + "P85":12496.651, + "P90":12515.18, + "P95":12530.265, + "P100":12545.35 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":154938 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1846446 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":701936 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":627408 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":609073 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":609655 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":615155 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":618942 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":625253 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":619654 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":690164 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":736470 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":614974 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":627267.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":608932.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":609514.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":615014.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":618801.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":625112.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":619513.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":614833.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-bulk.json new file mode 100644 index 000000000..1f16e8540 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-bulk.json @@ -0,0 +1,3700 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171901", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 167254710,166688776,166589842,166200648,166234982,166040199,166609057,167100923,166877538 + ], + "N":9, + "Min":166040199, + "LowerFence":165271148, + "Q1":166234982, + "Median":166609057, + "Mean":166621852.7777778, + "Q3":166877538, + "UpperFence":167841372, + "Max":167254710, + "InterquartileRange":642556, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":137762.99064685716, + "Variance":170807774327.69443, + "StandardDeviation":413288.97194057144, + "Skewness":0.08024036431835606, + "Kurtosis":1.4689500189138085, + "ConfidenceInterval":{ + "N":9, + "Mean":166621852.7777778, + "StandardError":137762.99064685716, + "Level":12, + "Margin":694505.3128878877, + "Lower":165927347.4648899, + "Upper":167316358.09066567 + }, + "Percentiles":{ + "P0":166040199, + "P25":166234982, + "P50":166609057, + "P67":166756730.32, + "P80":166966892, + "P85":167056246, + "P90":167131680.4, + "P95":167193195.2, + "P100":167254710 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":191686 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":111178509 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":511 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173172411 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":169967968 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":167254810 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":166688876 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":166589942 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":166200748 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":166235082 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":166040299 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":166609157 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":167101023 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":166877638 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":167254710 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":166688776 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":166589842 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":166200648 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":166234982 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":166040199 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":166609057 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":167100923 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":166877538 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 123248660,117119234,113582322,105092904,107009701,106012947,99620251,104912478,99846692,97274235 + ], + "N":10, + "Min":97274235, + "LowerFence":84874096.125, + "Q1":101113138.5, + "Median":105552925.5, + "Mean":107371942.4, + "Q3":111939166.75, + "UpperFence":128178209.125, + "Max":123248660, + "InterquartileRange":10826028.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2619481.5993370013, + "Variance":68616838492651.36, + "StandardDeviation":8283528.142805537, + "Skewness":0.565958685438899, + "Kurtosis":1.939882058763826, + "ConfidenceInterval":{ + "N":10, + "Mean":107371942.4, + "StandardError":2619481.5993370013, + "Level":12, + "Margin":12523512.543443924, + "Lower":94848429.85655609, + "Upper":119895454.94344392 + }, + "Percentiles":{ + "P0":97274235, + "P25":101113138.5, + "P50":105552925.5, + "P67":107206879.63, + "P80":114289704.4, + "P85":115881314.79999998, + "P90":117732176.6, + "P95":120490418.29999998, + "P100":123248660 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":205022 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":125031658 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":211 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":221 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":120996969 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":123248800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":117119374 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":113582462 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":105093044 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":107009841 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":106013087 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":99620391 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":104912618 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":99846832 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":97274375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":123248660 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":117119234 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":113582322 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":105092904 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":107009701 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":106012947 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":99620251 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":104912478 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":99846692 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":97274235 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 67564770,66029823,66206472,66101146,66121213,66032778,66184711,65854467 + ], + "N":8, + "Min":65854467, + "LowerFence":65794871.25, + "Q1":66032039.25, + "Median":66111179.5, + "Mean":66261922.5, + "Q3":66190151.25, + "UpperFence":66427319.25, + "Max":67564770, + "InterquartileRange":158112, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 67564770 + ], + "AllOutliers":[ + 67564770 + ], + "StandardError":190135.9284706414, + "Variance":289213370363.1429, + "StandardDeviation":537785.6174751635, + "Skewness":1.6971404483901957, + "Kurtosis":4.357036906658795, + "ConfidenceInterval":{ + "N":8, + "Mean":66261922.5, + "StandardError":190135.9284706414, + "Level":12, + "Margin":1028232.7636055719, + "Lower":65233689.73639443, + "Upper":67290155.26360556 + }, + "Percentiles":{ + "P0":65854467, + "P25":66032039.25, + "P50":66111179.5, + "P67":66165026.620000005, + "P80":66197767.599999994, + "P85":66205383.95, + "P90":66613961.400000006, + "P95":67089365.7, + "P100":67564770 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163424 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":72715704 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":251 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":69611448 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":69723927 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":71764474 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":67564870 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66029923 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":66206572 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":66101246 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66121313 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":66032878 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":66184811 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":65854567 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":67564770 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":66029823 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":66206472 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66101146 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":66121213 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":66032778 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66184711 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":65854467 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 121019090.5,120177584.5,119334515.5,119817274.5,120912692.5,120088197.5,120709504.5,119101522.5 + ], + "N":8, + "Min":119101522.5, + "LowerFence":118101009.625, + "Q1":119696584.75, + "Median":120132891, + "Mean":120145047.75, + "Q3":120760301.5, + "UpperFence":122355876.625, + "Max":121019090.5, + "InterquartileRange":1063716.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":251050.4354482204, + "Variance":504210569109.9286, + "StandardDeviation":710077.861301089, + "Skewness":-0.14114441918469434, + "Kurtosis":1.3085373728525191, + "ConfidenceInterval":{ + "N":8, + "Mean":120145047.75, + "StandardError":251050.4354482204, + "Level":12, + "Margin":1357651.2609775625, + "Lower":118787396.48902243, + "Upper":121502699.01097757 + }, + "Percentiles":{ + "P0":119101522.5, + "P25":119696584.75, + "P50":120132891, + "P67":120544609.30000001, + "P80":120831417.3, + "P85":120902533.1, + "P90":120944611.89999999, + "P95":120981851.19999999, + "P100":121019090.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":146583 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":134801388 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":211 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":128518807 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":130654741 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":124677909 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":121019211 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":120177705 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":119334636 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":119817395 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120912813 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":120088318 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120709625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":119101643 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":121019090.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":120177584.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":119334515.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":119817274.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":120912692.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120088197.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120709504.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":119101522.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 121152990,157034721,156937240,156845720,155966734,156574565,157040762,156690281,156657970 + ], + "N":9, + "Min":121152990, + "LowerFence":156030552.5, + "Q1":156574565, + "Median":156690281, + "Mean":152766775.8888889, + "Q3":156937240, + "UpperFence":157481252.5, + "Max":157040762, + "InterquartileRange":362675, + "LowerOutliers":[ + 121152990,155966734 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 121152990,155966734 + ], + "StandardError":3953231.098903632, + "Variance":140652325092049.36, + "StandardDeviation":11859693.296710895, + "Skewness":-2.071047308674205, + "Kurtosis":5.621467849052967, + "ConfidenceInterval":{ + "N":9, + "Mean":152766775.8888889, + "StandardError":3953231.098903632, + "Level":12, + "Margin":19929445.407439914, + "Lower":132837330.48144898, + "Upper":172696221.2963288 + }, + "Percentiles":{ + "P0":121152990, + "P25":156574565, + "P50":156690281, + "P67":156878667.2, + "P80":156976232.4, + "P85":157015224.79999998, + "P90":157035929.2, + "P95":157038345.6, + "P100":157040762 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":149307 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":89430107 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":351 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":4539 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163667494 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":165015773 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":121153100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":157034831 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":156937350 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":156845830 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155966844 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":156574675 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":157040872 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":156690391 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":156658080 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":121152990 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":157034721 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":156937240 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":156845720 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155966734 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":156574565 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":157040762 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":156690281 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":156657970 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 106473980,155407298,155573888,155295219,155403882,155286713,155637847,155490673,155210883 + ], + "N":9, + "Min":106473980, + "LowerFence":154980773, + "Q1":155286713, + "Median":155403882, + "Mean":149975598.1111111, + "Q3":155490673, + "UpperFence":155796613, + "Max":155637847, + "InterquartileRange":203960, + "LowerOutliers":[ + 106473980 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 106473980 + ], + "StandardError":5437897.988970551, + "Variance":266136610846049.62, + "StandardDeviation":16313693.966911651, + "Skewness":-2.073786042064083, + "Kurtosis":5.628861966954195, + "ConfidenceInterval":{ + "N":9, + "Mean":149975598.1111111, + "StandardError":5437897.988970551, + "Level":12, + "Margin":27414104.663011435, + "Lower":122561493.44809967, + "Upper":177389702.77412254 + }, + "Percentiles":{ + "P0":106473980, + "P25":155286713, + "P50":155403882, + "P67":155437313, + "P80":155523959, + "P85":155557245, + "P90":155586679.8, + "P95":155612263.4, + "P100":155637847 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":167983 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":87133404 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163093616 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":165514230 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":106474115 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":155407433 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":155574023 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155295354 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155404017 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":155286848 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":155637982 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":155490808 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":155211018 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":106473980 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":155407298 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":155573888 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":155295219 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155403882 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155286713 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":155637847 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":155490673 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":155210883 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 59913692,63573432,59144390,56017392,55703557,61715745,55848657,55701183,55659916,55595086 + ], + "N":10, + "Min":55595086, + "LowerFence":49672391.5, + "Q1":55701776.5, + "Median":55933024.5, + "Mean":57887305, + "Q3":59721366.5, + "UpperFence":65750751.5, + "Max":63573432, + "InterquartileRange":4019590, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":943348.4968620263, + "Variance":8899063865318.445, + "StandardDeviation":2983129.8773802062, + "Skewness":0.7205976623786401, + "Kurtosis":1.7764716634634647, + "ConfidenceInterval":{ + "N":10, + "Mean":57887305, + "StandardError":943348.4968620263, + "Level":12, + "Margin":4510066.700327548, + "Lower":53377238.299672455, + "Upper":62397371.700327545 + }, + "Percentiles":{ + "P0":55595086, + "P25":55701776.5, + "P50":55933024.5, + "P67":59167469.059999995, + "P80":60274102.6, + "P85":61085026.449999996, + "P90":61901513.7, + "P95":62737472.85, + "P100":63573432 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173924 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":63931759 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":60568310 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59913812 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":63573552 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":59144510 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":56017512 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55703677 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":61715865 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55848777 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55701303 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55660036 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55595206 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59913692 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":63573432 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":59144390 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":56017392 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55703557 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":61715745 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55848657 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55701183 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55659916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55595086 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 58300639.5,55577833.5,55366750.5,55366709.5,55392126.5,55402186.5,55654836.5,55138736.5 + ], + "N":8, + "Min":55138736.5, + "LowerFence":55021224.25, + "Q1":55366740.25, + "Median":55397156.5, + "Mean":55774977.375, + "Q3":55597084.25, + "UpperFence":55942600.25, + "Max":58300639.5, + "InterquartileRange":230344, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 58300639.5 + ], + "AllOutliers":[ + 58300639.5 + ], + "StandardError":364886.2549327841, + "Variance":1065135832310.9822, + "StandardDeviation":1032054.1808989401, + "Skewness":1.7739107274142054, + "Kurtosis":4.512193325083714, + "ConfidenceInterval":{ + "N":8, + "Mean":55774977.375, + "StandardError":364886.2549327841, + "Level":12, + "Margin":1973261.9990816521, + "Lower":53801715.37591835, + "Upper":57748239.37408165 + }, + "Percentiles":{ + "P0":55138736.5, + "P25":55366740.25, + "P50":55397156.5, + "P67":55523382.93000001, + "P80":55624035.3, + "P85":55650986.35, + "P90":56448577.400000006, + "P95":57374608.449999996, + "P100":58300639.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":161861 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":63767613 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":230 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":60141867 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":61798920 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":61360343 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":58300790 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55577984 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55366901 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55366860 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55392277 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55402337 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55654987 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55138887 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":58300639.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":55577833.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":55366750.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":55366709.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":55392126.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55402186.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55654836.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":55138736.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-handshake.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-handshake.json new file mode 100644 index 000000000..f57ec4f17 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-handshake.json @@ -0,0 +1,1901 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171914", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1037725.275,1055181.825,1026472.825,1024333.875,1053934.975,1045788.825,1052662.575,1014437.975 + ], + "N":8, + "Min":1014437.975, + "LowerFence":985374.20625, + "Q1":1025938.0874999999, + "Median":1041757.05, + "Mean":1038817.26875, + "Q3":1052980.6749999998, + "UpperFence":1093544.5562499997, + "Max":1055181.825, + "InterquartileRange":27042.587499999907, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":5500.54420252018, + "Variance":242047892.191027, + "StandardDeviation":15557.88842327348, + "Skewness":-0.2848051026479958, + "Kurtosis":1.2450135682755252, + "ConfidenceInterval":{ + "N":8, + "Mean":1038817.26875, + "StandardError":5500.54420252018, + "Level":12, + "Margin":29746.296831875417, + "Lower":1009070.9719181246, + "Upper":1068563.5655818754 + }, + "Percentiles":{ + "P0":1014437.975, + "P25":1025938.0874999999, + "P50":1041757.05, + "P67":1050531.7125, + "P80":1053426.0150000001, + "P85":1053871.3550000002, + "P90":1054309.03, + "P95":1054745.4275, + "P100":1055181.825 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13420 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":188812 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":55455455 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":241 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":22056755 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":20754611 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21103742 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20529562 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20486783 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21078805 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":22441350 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20915882 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":21936972 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":21053357 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20288865 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":20754505.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21103636.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20529456.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":20486677.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21078699.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":20915776.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21053251.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20288759.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13420, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 856290.95,876541.65,879700.5,861188.55,863945.2,875998.1,873822.6,880617.7 + ], + "N":8, + "Min":856290.95, + "LowerFence":842143.0499999996, + "Q1":863256.0374999999, + "Median":874910.35, + "Mean":871013.15625, + "Q3":877331.3625, + "UpperFence":898444.3500000003, + "Max":880617.7, + "InterquartileRange":14075.325000000186, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3257.536136139298, + "Variance":84892333.42602679, + "StandardDeviation":9213.703567297289, + "Skewness":-0.4212108248118975, + "Kurtosis":1.2940929003837514, + "ConfidenceInterval":{ + "N":8, + "Mean":871013.15625, + "StandardError":3257.536136139298, + "Level":12, + "Margin":17616.372722132415, + "Lower":853396.7835278676, + "Upper":888629.5289721324 + }, + "Percentiles":{ + "P0":856290.95, + "P25":863256.0374999999, + "P50":874910.35, + "P67":876373.1495, + "P80":878436.9600000001, + "P85":879542.5575000001, + "P90":879975.66, + "P95":880296.6799999999, + "P100":880617.7 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76962 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181739 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48909554 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":261 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19029882 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18336532 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17125919 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17530933 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17594110 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17223871 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17279004 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17520062 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19254971 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17476552 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17612454 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":17125819 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17530833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17594010 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17223771 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17278904 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17519962 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17476452 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":17612354 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76962, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2232282.25,2122861.15,2148969.2,2098562.4,1458870.55,1353060.6,1369260.8,1349320.15,1369758.2,1353714.35 + ], + "N":10, + "Min":1349320.15, + "LowerFence":218822.7125000006, + "Q1":1357600.9625000001, + "Median":1414314.375, + "Mean":1685665.9650000003, + "Q3":2116786.4625, + "UpperFence":3255564.7124999994, + "Max":2232282.25, + "InterquartileRange":759185.4999999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":127381.97857443744, + "Variance":162261684655.38443, + "StandardDeviation":402817.1851539907, + "Skewness":0.35255533254526505, + "Kurtosis":0.9903767134383548, + "ConfidenceInterval":{ + "N":10, + "Mean":1685665.9650000003, + "StandardError":127381.97857443744, + "Level":12, + "Margin":609002.104419989, + "Lower":1076663.8605800113, + "Upper":2294668.0694199894 + }, + "Percentiles":{ + "P0":1349320.15, + "P25":1357600.9625000001, + "P50":1414314.375, + "P67":2099291.3625, + "P80":2128082.76, + "P85":2139831.3825, + "P90":2157300.5050000004, + "P95":2194791.3775, + "P100":2232282.25 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":177192 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":190815 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":104149970 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":260 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44924008 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44645750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42457328 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42979489 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41971353 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29177516 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27061317 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":27385321 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":26986508 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27395269 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27074392 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44645645 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42457223 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42979384 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41971248 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29177411 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27061212 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":27385216 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":26986403 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27395164 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27074287 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":177192, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2058644.125,1955714.575,1936926.575,1914738.325,1346734.825,1204789.175,1190248.675,1200268.275,1192371.075,1191735.425 + ], + "N":10, + "Min":1190248.675, + "LowerFence":88794.16875000019, + "Q1":1194345.375, + "Median":1275762, + "Mean":1519217.1050000002, + "Q3":1931379.5125, + "UpperFence":3036930.71875, + "Max":2058644.125, + "InterquartileRange":737034.1375, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":123155.99909852142, + "Variance":151674001139.5501, + "StandardDeviation":389453.4646649714, + "Skewness":0.33957088152466264, + "Kurtosis":1.0063959389068438, + "ConfidenceInterval":{ + "N":10, + "Mean":1519217.1050000002, + "StandardError":123155.99909852142, + "Level":12, + "Margin":588798.0659612474, + "Lower":930419.0390387528, + "Upper":2108015.1709612478 + }, + "Percentiles":{ + "P0":1190248.675, + "P25":1194345.375, + "P50":1275762, + "P67":1915403.9725, + "P80":1940684.175, + "P85":1949138.775, + "P90":1966007.5299999998, + "P95":2012325.8274999997, + "P100":2058644.125 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":240836 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181878 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":98001448 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":241 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42204928 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41173008 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39114417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":38738657 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":38294892 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":26934822 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24095909 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":23805099 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24005491 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":23847547 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":23834834 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41172882.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39114291.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":38738531.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":38294766.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":26934696.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24095783.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":23804973.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24005365.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":23847421.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":23834708.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":240836, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-resumed.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-resumed.json new file mode 100644 index 000000000..d03ecab7f --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-resumed.json @@ -0,0 +1,1908 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171918", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1065547.85,1036295.95,1039202.85,1061100.05,1055916.4,1082369.15,1041962.5,1020659.8,1046969.75 + ], + "N":9, + "Min":1020659.8, + "LowerFence":1006357.0499999998, + "Q1":1039202.85, + "Median":1046969.75, + "Mean":1050002.7000000002, + "Q3":1061100.05, + "UpperFence":1093945.85, + "Max":1082369.15, + "InterquartileRange":21897.20000000007, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":6108.649305805612, + "Variance":335840367.0718745, + "StandardDeviation":18325.947917416837, + "Skewness":0.1731276689674261, + "Kurtosis":1.9374658051622629, + "ConfidenceInterval":{ + "N":9, + "Mean":1050002.7000000002, + "StandardError":6108.649305805612, + "Level":12, + "Margin":30795.566919174533, + "Lower":1019207.1330808257, + "Upper":1080798.2669191747 + }, + "Percentiles":{ + "P0":1020659.8, + "P25":1039202.85, + "P50":1046969.75, + "P67":1057782.514, + "P80":1062879.1700000002, + "P85":1064658.29, + "P90":1068912.11, + "P95":1075640.63, + "P100":1082369.15 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13406 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":194111 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":22754002 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21756026 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21311107 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":20726069 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20784207 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":21222151 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21118478 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":23216373 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21647533 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20839400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20413346 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20939545 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21310957 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":20725919 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":20784057 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":21222001 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21118328 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21647383 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20839250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20413196 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20939395 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13406, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 867742.25,873260.55,867776.85,868489.15,876732.05,873182.4,886335.85,864808.85 + ], + "N":8, + "Min":864808.85, + "LowerFence":858227.8624999998, + "Q1":867768.2, + "Median":870835.775, + "Mean":872290.9937499999, + "Q3":874128.425, + "UpperFence":883668.7625000002, + "Max":886335.85, + "InterquartileRange":6360.225000000093, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 886335.85 + ], + "AllOutliers":[ + 886335.85 + ], + "StandardError":2428.3322709555355, + "Variance":47174380.945312545, + "StandardDeviation":6868.3608630671515, + "Skewness":0.8486389187590149, + "Kurtosis":2.4426568850939274, + "ConfidenceInterval":{ + "N":8, + "Mean":872290.9937499999, + "StandardError":2428.3322709555355, + "Level":12, + "Margin":13132.135635810388, + "Lower":859158.8581141895, + "Upper":885423.1293858103 + }, + "Percentiles":{ + "P0":864808.85, + "P25":867768.2, + "P50":870835.775, + "P67":873236.3235, + "P80":875343.45, + "P85":876558.4750000001, + "P90":879613.19, + "P95":882974.52, + "P100":886335.85 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76965 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":162703 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19463378 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18954422 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18412313 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17354975 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17465341 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17355667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17369913 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17534771 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17463778 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18779827 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17726847 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17296307 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":17354845 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17465211 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17355537 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17369783 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17534641 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17463648 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17726717 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":17296177 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76965, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1933794.55,1799765.15,1796288.2,1768160.8,1530466.55,1067513.55,1025161.7,1024655.25,1062942.5,1033782.75 + ], + "N":10, + "Min":1024655.25, + "LowerFence":-81202.8062499999, + "Q1":1041072.6875, + "Median":1298990.05, + "Mean":1404253.1, + "Q3":1789256.3499999999, + "UpperFence":2911531.84375, + "Max":1933794.55, + "InterquartileRange":748183.6624999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":124446.93850927323, + "Variance":154870405043.30832, + "StandardDeviation":393535.7735242227, + "Skewness":0.13593373090697486, + "Kurtosis":0.9639265691272695, + "ConfidenceInterval":{ + "N":10, + "Mean":1404253.1, + "StandardError":124446.93850927323, + "Level":12, + "Margin":594969.9344360894, + "Lower":809283.1655639107, + "Upper":1999223.0344360895 + }, + "Percentiles":{ + "P0":1024655.25, + "P25":1041072.6875, + "P50":1298990.05, + "P67":1769004.622, + "P80":1796983.5899999999, + "P85":1798548.2174999998, + "P90":1813168.0899999999, + "P95":1873481.3199999998, + "P100":1933794.55 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172108 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":151602 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41642651 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":320 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37945011 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38676021 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":35995433 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35925894 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35363346 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30609461 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21350401 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20503364 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20493235 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":21258980 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20675785 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38675891 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":35995303 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35925764 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35363216 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30609331 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21350271 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20503234 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20493105 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":21258850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20675655 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172108, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1729673.2,1664986.3,1624252.05,1626805.3,1615832.35,1158018.95,870333.05,968459.7,875261.25,853449.7 + ], + "N":10, + "Min":853449.7, + "LowerFence":-192848.32499999995, + "Q1":898560.8625, + "Median":1386925.65, + "Mean":1298707.1849999998, + "Q3":1626166.9875, + "UpperFence":2717576.175, + "Max":1729673.2, + "InterquartileRange":727606.125, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":121289.82584475777, + "Variance":147112218534.51672, + "StandardDeviation":383552.10667459085, + "Skewness":-0.08987939605807607, + "Kurtosis":0.9372749846421543, + "ConfidenceInterval":{ + "N":10, + "Mean":1298707.1849999998, + "StandardError":121289.82584475777, + "Level":12, + "Margin":579876.0547672524, + "Lower":718831.1302327474, + "Upper":1878583.2397672522 + }, + "Percentiles":{ + "P0":853449.7, + "P25":898560.8625, + "P50":1386925.65, + "P67":1624328.6475000002, + "P80":1634441.5, + "P85":1651622.95, + "P90":1671454.99, + "P95":1700564.095, + "P100":1729673.2 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235734 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":153906 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37581063 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":35755226 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34593574 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":33299836 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":32485151 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32536216 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32316757 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":23160489 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17406771 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19369304 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17505335 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17069104 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34593464 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":33299726 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":32485041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32536106 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32316647 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":23160379 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17406661 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19369194 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17505225 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17068994 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235734, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-small.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-small.json new file mode 100644 index 000000000..20d81f4e2 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run2-small.json @@ -0,0 +1,3798 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171919", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 22661.87,22727.39,22752.23,22421.03,22323.03,22603.15,22621.99,22325.63,22410.79,22855.63 + ], + "N":10, + "Min":22323.03, + "LowerFence":21966.86, + "Q1":22413.35, + "Median":22612.57, + "Mean":22570.273999999998, + "Q3":22711.01, + "UpperFence":23157.5, + "Max":22855.63, + "InterquartileRange":297.65999999999985, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":59.63368487319529, + "Variance":35561.76371555561, + "StandardDeviation":188.5782694680265, + "Skewness":-0.04556669032386272, + "Kurtosis":1.334510966270553, + "ConfidenceInterval":{ + "N":10, + "Mean":22570.273999999998, + "StandardError":59.63368487319529, + "Level":12, + "Margin":285.1034344773663, + "Lower":22285.170565522632, + "Upper":22855.377434477363 + }, + "Percentiles":{ + "P0":22323.03, + "P25":22413.35, + "P50":22612.57, + "P67":22663.8356, + "P80":22732.358, + "P85":22743.536, + "P90":22762.57, + "P95":22809.1, + "P100":22855.63 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":150951 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1955139 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":211 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1145982 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1133239 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1136515 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1137757 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1121197 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1116297 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1130303 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1131245 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1116427 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1120685 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1142927 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1133093.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1136369.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1137611.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1121051.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1116151.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1130157.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1131099.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1116281.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1120539.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1142781.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 20371.62,20220.94,20088.9,20228.36,20161.42,20102.1,20101.5,20023.56,20200.1 + ], + "N":9, + "Min":20023.56, + "LowerFence":19922.340000000004, + "Q1":20101.5, + "Median":20161.42, + "Mean":20166.5, + "Q3":20220.94, + "UpperFence":20400.1, + "Max":20371.62, + "InterquartileRange":119.43999999999869, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":34.327935983523325, + "Variance":10605.664699999877, + "StandardDeviation":102.98380795056997, + "Skewness":0.522547769803622, + "Kurtosis":2.255919264943916, + "ConfidenceInterval":{ + "N":9, + "Mean":20166.5, + "StandardError":34.327935983523325, + "Level":12, + "Margin":173.05761009606928, + "Lower":19993.442389903932, + "Upper":20339.557610096068 + }, + "Percentiles":{ + "P0":20023.56, + "P25":20101.5, + "P50":20161.42, + "P67":20207.6024, + "P80":20223.908, + "P85":20226.876, + "P90":20257.012, + "P95":20314.316, + "P100":20371.62 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":206615 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1904444 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":201 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1127899 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1018726 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1011192 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1004590 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1011563 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1008216 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1005250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1005220 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1001323 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1107411 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1010150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1018581 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1011047 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1004445 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1011418 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1008071 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1005105 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1005075 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1001178 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1010005 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11968.86,11889.12,11823,11943.4,11851.04,11866.66,11867.88,11879.9,11916.56 + ], + "N":9, + "Min":11823, + "LowerFence":11791.810000000001, + "Q1":11866.66, + "Median":11879.9, + "Mean":11889.602222222222, + "Q3":11916.56, + "UpperFence":11991.41, + "Max":11968.86, + "InterquartileRange":49.899999999999636, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":15.328887560001235, + "Variance":2114.7731444444453, + "StandardDeviation":45.986662680003704, + "Skewness":0.3395019171606087, + "Kurtosis":1.7580487238261922, + "ConfidenceInterval":{ + "N":9, + "Mean":11889.602222222222, + "StandardError":15.328887560001235, + "Level":12, + "Margin":77.2776041017572, + "Lower":11812.324618120465, + "Upper":11966.879826323979 + }, + "Percentiles":{ + "P0":11823, + "P25":11866.66, + "P50":11879.9, + "P67":11898.9984, + "P80":11927.295999999998, + "P85":11938.032, + "P90":11948.492, + "P95":11958.676, + "P100":11968.86 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":162463 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1367445 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":709731 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":598584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":594597 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":591291 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":597311 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":592693 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":614493 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":593474 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":593535 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":594136 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":595969 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":598443 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":594456 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":591150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":597170 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":592552 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":593333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":593394 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":593995 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":595828 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12608.05,12825.27,12500.45,12500.45,12523.29,12512.69,12617.07,12643.93,12669.37 + ], + "N":9, + "Min":12500.45, + "LowerFence":12315.830000000002, + "Q1":12512.69, + "Median":12608.05, + "Mean":12600.063333333332, + "Q3":12643.93, + "UpperFence":12840.79, + "Max":12825.27, + "InterquartileRange":131.23999999999978, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":35.58492018319617, + "Variance":11396.578899999975, + "StandardDeviation":106.7547605495885, + "Skewness":0.7989560965989907, + "Kurtosis":2.471583587036767, + "ConfidenceInterval":{ + "N":9, + "Mean":12600.063333333332, + "StandardError":35.58492018319617, + "Level":12, + "Margin":179.3944513680966, + "Lower":12420.668881965235, + "Upper":12779.457784701428 + }, + "Percentiles":{ + "P0":12500.45, + "P25":12512.69, + "P50":12608.05, + "P67":12626.7396, + "P80":12654.106, + "P85":12664.282000000001, + "P90":12700.550000000001, + "P95":12762.91, + "P100":12825.27 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":163474 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1345313 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":778028 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":741059 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":630513 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":641374 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":625133 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":625133 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":626275 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":625745 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":630964 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":632307 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":633579 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":630402.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":641263.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":625022.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":625022.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":626164.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":625634.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":630853.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":632196.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":633468.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 17133.08,17153.72,17010.66,17361.52,17414.8,17396.98,17364.72,17303,17368.12 + ], + "N":9, + "Min":17010.66, + "LowerFence":16832.120000000003, + "Q1":17153.72, + "Median":17361.52, + "Mean":17278.51111111111, + "Q3":17368.12, + "UpperFence":17689.719999999994, + "Max":17414.8, + "InterquartileRange":214.39999999999782, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":47.73024502475809, + "Variance":20503.586611110997, + "StandardDeviation":143.19073507427427, + "Skewness":-0.6848083004447826, + "Kurtosis":1.7302748301085225, + "ConfidenceInterval":{ + "N":9, + "Mean":17278.51111111111, + "StandardError":47.73024502475809, + "Level":12, + "Margin":240.6227434486332, + "Lower":17037.88836766248, + "Upper":17519.133854559743 + }, + "Percentiles":{ + "P0":17010.66, + "P25":17153.72, + "P50":17361.52, + "P67":17365.944, + "P80":17379.664, + "P85":17391.208, + "P90":17400.543999999998, + "P95":17407.672, + "P100":17414.8 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":202977 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2272619 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":221 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1004268 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":856804 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":857836 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":850683 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":868226 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":996655 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":870890 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":869999 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":868386 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":865300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":868556 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":856654 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":857686 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":850533 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":868076 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":870740 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":869849 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":868236 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":865150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":868406 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 17858.24,17923.56,17755.46,18169.4,18178.22,18028.94,18064.62,18019.14,18036.36,18171.82 + ], + "N":10, + "Min":17755.46, + "LowerFence":17653.83, + "Q1":17947.455, + "Median":18032.65, + "Mean":18020.576, + "Q3":18143.205, + "UpperFence":18436.83, + "Max":18178.22, + "InterquartileRange":195.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":44.49563811830952, + "Variance":19798.61811555559, + "StandardDeviation":140.70756239646678, + "Skewness":-0.468863164864345, + "Kurtosis":1.8772403146376366, + "ConfidenceInterval":{ + "N":10, + "Mean":18020.576, + "StandardError":44.49563811830952, + "Level":12, + "Margin":212.7297562404067, + "Lower":17807.846243759595, + "Upper":18233.305756240406 + }, + "Percentiles":{ + "P0":17755.46, + "P25":17947.455, + "P50":18032.65, + "P67":18067.7634, + "P80":18169.884, + "P85":18170.972999999998, + "P90":18172.46, + "P95":18175.34, + "P100":18178.22 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":196365 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2217296 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1066184 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":893012 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":896278 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":887873 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":908570 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":909011 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":901547 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":903331 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":901057 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":901918 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":908691 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":892912 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":896178 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":887773 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":908470 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":908911 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":901447 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":903231 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":900957 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":901818 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":908591 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11588.18,11543.88,11486.18,11650.48,11866.68,11829.62,11870.7,11595.98,11602.4,11612.82 + ], + "N":10, + "Min":11486.18, + "LowerFence":11298.072500000004, + "Q1":11590.130000000001, + "Median":11607.61, + "Mean":11664.692, + "Q3":11784.835, + "UpperFence":12076.892499999996, + "Max":11870.7, + "InterquartileRange":194.7049999999981, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":44.001284142877374, + "Variance":19361.130062222317, + "StandardDeviation":139.14427786374227, + "Skewness":0.47742081036224837, + "Kurtosis":1.47070228764785, + "ConfidenceInterval":{ + "N":10, + "Mean":11664.692, + "StandardError":44.001284142877374, + "Level":12, + "Margin":210.3662930980075, + "Lower":11454.325706901991, + "Upper":11875.058293098007 + }, + "Percentiles":{ + "P0":11486.18, + "P25":11590.130000000001, + "P50":11607.61, + "P67":11655.854199999998, + "P80":11837.032000000001, + "P85":11853.709, + "P90":11867.082, + "P95":11868.891, + "P100":11870.7 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":158756 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1808405 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":677391 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":579549 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":577334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":574449 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":582664 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":593474 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":591621 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":593675 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":579939 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":580260 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":580781 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":579409 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":577194 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":574309 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":582524 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":593334 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":591481 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":593535 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":579799 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":580120 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":580641 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12655.56,12455.58,12631.52,12637.12,12706.46,12864.54,12712.86,12755.34,12686.02 + ], + "N":9, + "Min":12455.58, + "LowerFence":12523.510000000002, + "Q1":12637.12, + "Median":12686.02, + "Mean":12678.333333333334, + "Q3":12712.86, + "UpperFence":12826.470000000001, + "Max":12864.54, + "InterquartileRange":75.73999999999978, + "LowerOutliers":[ + 12455.58 + ], + "UpperOutliers":[ + 12864.54 + ], + "AllOutliers":[ + 12455.58,12864.54 + ], + "StandardError":36.64259315787213, + "Variance":12084.116700000037, + "StandardDeviation":109.92777947361638, + "Skewness":-0.3563544133564517, + "Kurtosis":2.8225086650215188, + "ConfidenceInterval":{ + "N":9, + "Mean":12678.333333333334, + "StandardError":36.64259315787213, + "Level":12, + "Margin":184.72650387916156, + "Lower":12493.606829454173, + "Upper":12863.059837212495 + }, + "Percentiles":{ + "P0":12455.58, + "P25":12637.12, + "P50":12686.02, + "P67":12708.764, + "P80":12729.852, + "P85":12746.844, + "P90":12777.18, + "P95":12820.86, + "P100":12864.54 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":187279 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2017764 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":755716 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":632918 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":622919 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":631716 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":631996 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":635463 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":643367 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":635783 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":637907 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":647725 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":634441 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":632778 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":622779 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":631576 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":631856 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":635323 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":643227 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":635643 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":637767 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":634301 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-bulk.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-bulk.json new file mode 100644 index 000000000..d48812074 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-bulk.json @@ -0,0 +1,3714 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171929", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 118570825,111110583,104812272,124854287,166369191,166219472,165933702,166181492,166523850,166286998 + ], + "N":10, + "Min":104812272, + "LowerFence":50949051.5, + "Q1":120141690.5, + "Median":166057597, + "Mean":145686267.2, + "Q3":166270116.5, + "UpperFence":235462755.5, + "Max":166523850, + "InterquartileRange":46128426, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":8546203.630567685, + "Variance":730375964951282.8, + "StandardDeviation":27025468.820194088, + "Skewness":-0.43768674336898206, + "Kurtosis":1.1291010014725456, + "ConfidenceInterval":{ + "N":10, + "Mean":145686267.2, + "StandardError":8546203.630567685, + "Level":12, + "Margin":40858652.488083765, + "Lower":104827614.71191622, + "Upper":186544919.68808377 + }, + "Percentiles":{ + "P0":104812272, + "P25":120141690.5, + "P50":166057597, + "P67":166221497.77999997, + "P80":166303436.6, + "P85":166340423.45, + "P90":166384656.9, + "P95":166454253.45, + "P100":166523850 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34472 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171479 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":131823446 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":117543964 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":118570935 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":111110693 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":104812382 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":124854397 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":166369301 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":166219582 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":165933812 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":166181602 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":166523960 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":166287108 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":118570825 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":111110583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":104812272 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":124854287 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":166369191 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":166219472 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":165933702 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":166181492 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":166523850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":166286998 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34472, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 114425201,112614230,105344112,98233771,96323886,104400396,96474587,114080288,114534184,115129331 + ], + "N":10, + "Min":96323886, + "LowerFence":77930109, + "Q1":99775427.25, + "Median":108979171, + "Mean":107155998.6, + "Q3":114338972.75, + "UpperFence":136184291, + "Max":115129331, + "InterquartileRange":14563545.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2517716.487072734, + "Variance":63388963092778.71, + "StandardDeviation":7961718.601707718, + "Skewness":-0.28523191934725634, + "Kurtosis":1.149127843711521, + "ConfidenceInterval":{ + "N":10, + "Mean":107155998.6, + "StandardError":2517716.487072734, + "Level":12, + "Margin":12036982.437544689, + "Lower":95119016.1624553, + "Upper":119192981.03754468 + }, + "Percentiles":{ + "P0":96323886, + "P25":99775427.25, + "P50":108979171, + "P67":114090635.39, + "P80":114446997.60000001, + "P85":114496039.94999999, + "P90":114593698.7, + "P95":114861514.85, + "P100":115129331 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":174876 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":124296249 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":120333796 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114425361 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":112614390 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":105344272 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":98233931 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":96324046 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":104400556 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":96474747 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":114080448 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":114534344 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":115129491 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114425201 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":112614230 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":105344112 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":98233771 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":96323886 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":104400396 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":96474587 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":114080288 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":114534184 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":115129331 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 67776328,66403173,66428460,66395729,66674788,66416147,66852049,66498881 + ], + "N":8, + "Min":66395729, + "LowerFence":65953603.875, + "Q1":66412903.5, + "Median":66463670.5, + "Mean":66680694.375, + "Q3":66719103.25, + "UpperFence":67178402.875, + "Max":67776328, + "InterquartileRange":306199.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 67776328 + ], + "AllOutliers":[ + 67776328 + ], + "StandardError":166620.68279777802, + "Variance":222099615487.98215, + "StandardDeviation":471274.4587689663, + "Skewness":1.4750626926001584, + "Kurtosis":3.7109021116606087, + "ConfidenceInterval":{ + "N":8, + "Mean":66680694.375, + "StandardError":166620.68279777802, + "Level":12, + "Margin":901065.0776266132, + "Lower":65779629.297373384, + "Upper":67581759.45262662 + }, + "Percentiles":{ + "P0":66395729, + "P25":66412903.5, + "P50":66463670.5, + "P67":66620256.83, + "P80":66781144.6, + "P85":66843185.95, + "P90":67129332.7, + "P95":67452830.35, + "P100":67776328 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":193330 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":73194495 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":70037150 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":70271085 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":71723709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":67776443 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66403288 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":66428575 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":66395844 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66674903 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":66416262 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":66852164 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":66498996 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":67776328 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":66403173 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":66428460 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66395729 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":66674788 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":66416147 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":66852049 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":66498881 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 123026946,123601636,124330011,121930927,121480809,121556320,120254067,122126731,119828024 + ], + "N":9, + "Min":119828024, + "LowerFence":119161603.5, + "Q1":121480809, + "Median":121930927, + "Mean":122015052.33333333, + "Q3":123026946, + "UpperFence":125346151.5, + "Max":124330011, + "InterquartileRange":1546137, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":490178.15520538605, + "Variance":2162471614564.9998, + "StandardDeviation":1470534.4656161582, + "Skewness":0.04423347149609833, + "Kurtosis":1.6329389206200389, + "ConfidenceInterval":{ + "N":9, + "Mean":122015052.33333333, + "StandardError":490178.15520538605, + "Level":12, + "Margin":2471137.79581331, + "Lower":119543914.53752002, + "Upper":124486190.12914664 + }, + "Percentiles":{ + "P0":119828024, + "P25":121480809, + "P50":121930927, + "P67":122450808.4, + "P80":123256822, + "P85":123486698, + "P90":123747311, + "P95":124038661, + "P100":124330011 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":35768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163575 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":129203280 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":281 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":128675067 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":131278993 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":123027087 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":123601777 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":124330152 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":121931068 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":121480950 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":121556461 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":120254208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":122126872 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":119828165 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":123026946 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":123601636 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":124330011 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":121930927 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":121480809 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":121556320 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":120254067 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":122126731 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":119828024 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":35768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 141225688,156651593,156529897,156229147,156107181,156478380,156127518,156093445,156857447 + ], + "N":9, + "Min":141225688, + "LowerFence":155473107, + "Q1":156107181, + "Median":156229147, + "Mean":154700032.8888889, + "Q3":156529897, + "UpperFence":157163971, + "Max":156857447, + "InterquartileRange":422716, + "LowerOutliers":[ + 141225688 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 141225688 + ], + "StandardError":1686669.4690226838, + "Variance":25603685079599.363, + "StandardDeviation":5060008.407068051, + "Skewness":-2.062767000694837, + "Kurtosis":5.599717772934271, + "ConfidenceInterval":{ + "N":9, + "Mean":154700032.8888889, + "StandardError":1686669.4690226838, + "Level":12, + "Margin":8503015.95386257, + "Lower":146197016.93502632, + "Upper":163203048.84275147 + }, + "Percentiles":{ + "P0":141225688, + "P25":156107181, + "P50":156229147, + "P67":156496926.12, + "P80":156578575.4, + "P85":156627253.8, + "P90":156692763.8, + "P95":156775105.4, + "P100":156857447 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":152915 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":117435512 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":151377824 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":159119100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":141225793 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":156651698 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":156530002 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":156229252 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":156107286 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":156478485 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":156127623 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":156093550 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":156857552 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":141225688 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":156651593 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":156529897 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":156229147 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":156107181 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":156478380 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":156127518 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":156093445 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":156857447 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 111443662,155959480,106680329,156120410,155918013,155114297,154895550,155215667,155186111 + ], + "N":9, + "Min":106680329, + "LowerFence":153361855.5, + "Q1":154895550, + "Median":155186111, + "Mean":145170391, + "Q3":155918013, + "UpperFence":157451707.5, + "Max":156120410, + "InterquartileRange":1022463, + "LowerOutliers":[ + 106680329,111443662 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 106680329,111443662 + ], + "StandardError":6836867.0326107135, + "Variance":420684757394393, + "StandardDeviation":20510601.09783214, + "Skewness":-1.1287481251364329, + "Kurtosis":2.240686989000201, + "ConfidenceInterval":{ + "N":9, + "Mean":145170391, + "StandardError":6836867.0326107135, + "Level":12, + "Margin":34466734.89999843, + "Lower":110703656.10000157, + "Upper":179637125.89999843 + }, + "Percentiles":{ + "P0":106680329, + "P25":154895550, + "P50":155186111, + "P67":155468511.56, + "P80":155934599.79999998, + "P85":155951186.6, + "P90":155991666, + "P95":156056038, + "P100":156120410 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":182960 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":89422474 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":162892592 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":163572988 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":111443762 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":155959580 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":106680429 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":156120510 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155918113 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":155114397 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":154895650 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":155215767 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":155186211 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":111443662 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":155959480 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":106680329 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":156120410 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":155918013 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":155114297 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":154895550 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":155215667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":155186111 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 59138540,58745759,59411487,54278596,54257357,54483817,54041053,54328619,54207293,54351722 + ], + "N":10, + "Min":54041053, + "LowerFence":49136256.625, + "Q1":54262666.75, + "Median":54340170.5, + "Mean":55724424.3, + "Q3":57680273.5, + "UpperFence":62806683.625, + "Max":59411487, + "InterquartileRange":3417606.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":738834.6943351784, + "Variance":5458767055533.566, + "StandardDeviation":2336400.448453468, + "Skewness":0.7514714756359147, + "Kurtosis":1.4633443179592076, + "ConfidenceInterval":{ + "N":10, + "Mean":55724424.3, + "StandardError":738834.6943351784, + "Level":12, + "Margin":3532304.0880989875, + "Lower":52192120.21190101, + "Upper":59256728.388098985 + }, + "Percentiles":{ + "P0":54041053, + "P25":54262666.75, + "P50":54340170.5, + "P67":54611675.260000005, + "P80":58824315.199999996, + "P85":59001066.650000006, + "P90":59165834.7, + "P95":59288660.85, + "P100":59411487 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":182660 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":62106602 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":58913370 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59138660 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":58745879 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":59411607 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":54278716 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":54257477 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54483937 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":54041173 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":54328739 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":54207413 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54351842 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59138540 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":58745759 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":59411487 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":54278596 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":54257357 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54483817 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":54041053 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":54328619 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":54207293 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54351722 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 60830237,57529876,54053697,53818339,54234815,54037757,53867050,54104261,53924807 + ], + "N":9, + "Min":53818339, + "LowerFence":53459795, + "Q1":53924807, + "Median":54053697, + "Mean":55155648.777777776, + "Q3":54234815, + "UpperFence":54699827, + "Max":60830237, + "InterquartileRange":310008, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 57529876,60830237 + ], + "AllOutliers":[ + 57529876,60830237 + ], + "StandardError":809827.5963747328, + "Variance":5902386622650.694, + "StandardDeviation":2429482.7891241983, + "Skewness":1.433749049688064, + "Kurtosis":3.4505718797937455, + "ConfidenceInterval":{ + "N":9, + "Mean":55155648.777777776, + "StandardError":809827.5963747328, + "Level":12, + "Margin":4082588.2594783143, + "Lower":51073060.51829946, + "Upper":59238237.03725609 + }, + "Percentiles":{ + "P0":53818339, + "P25":53924807, + "P50":54053697, + "P67":54151260.44, + "P80":55552839.400000006, + "P85":56870863.8, + "P90":58189948.2, + "P95":59510092.6, + "P100":60830237 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":153135 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":62214343 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":140 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":59599116 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":61097745 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":60830377 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":57530016 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":54053837 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":53818479 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54234955 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":54037897 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":53867190 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":54104401 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":53924947 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":60830237 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":57529876 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":54053697 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":53818339 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":54234815 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54037757 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":53867050 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":54104261 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":53924807 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-handshake.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-handshake.json new file mode 100644 index 000000000..c87faa198 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-handshake.json @@ -0,0 +1,1943 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171942", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1050579,1072451.2,1116995.1,1129064.05,1078521,1117898.75,1054946.15,1042263.05,1048187.05 + ], + "N":9, + "Min":1042263.05, + "LowerFence":950954.8499999999, + "Q1":1050579, + "Median":1072451.2, + "Mean":1078989.4833333334, + "Q3":1116995.1, + "UpperFence":1216619.2500000002, + "Max":1129064.05, + "InterquartileRange":66416.1000000001, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":11298.750563201429, + "Variance":1148955878.6050014, + "StandardDeviation":33896.25168960429, + "Skewness":0.3523154652717092, + "Kurtosis":1.209738376133371, + "ConfidenceInterval":{ + "N":9, + "Mean":1078989.4833333334, + "StandardError":11298.750563201429, + "Level":12, + "Margin":56960.4525736058, + "Lower":1022029.0307597276, + "Upper":1135949.9359069392 + }, + "Percentiles":{ + "P0":1042263.05, + "P25":1050579, + "P50":1072451.2, + "P67":1092371.676, + "P80":1117356.56, + "P85":1117718.02, + "P90":1120131.81, + "P95":1124597.93, + "P100":1129064.05 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13406 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":184393 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":56349129 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":281 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":22101598 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21011680 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21449124 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":22340002 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":22581381 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21570520 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24503798 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":22358075 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":21099023 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20845361 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20963841 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21011580 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21449024 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":22339902 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":22581281 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21570420 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":22357975 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21098923 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20845261 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20963741 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13406, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 868862.525,859917.925,870329.275,872889.025,872118.125,873346.925,862631.975,868227.875 + ], + "N":8, + "Min":859917.925, + "LowerFence":858605.9750000001, + "Q1":866828.9, + "Median":869595.9, + "Mean":868540.4562499999, + "Q3":872310.85, + "UpperFence":880533.7749999999, + "Max":873346.925, + "InterquartileRange":5481.949999999953, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1729.3238221282147, + "Variance":23924487.054241102, + "StandardDeviation":4891.266405977199, + "Skewness":-0.6436267193024863, + "Kurtosis":1.705974790526349, + "ConfidenceInterval":{ + "N":8, + "Mean":868540.4562499999, + "StandardError":1729.3238221282147, + "Level":12, + "Margin":9351.98006551616, + "Lower":859188.4761844837, + "Upper":877892.4363155161 + }, + "Percentiles":{ + "P0":859917.925, + "P25":866828.9, + "P50":869595.9, + "P67":871563.5815, + "P80":872580.665, + "P85":872850.4800000001, + "P90":873026.395, + "P95":873186.6600000001, + "P100":873346.925 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76965 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":189072 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48760667 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":60 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18815884 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":17904718 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17377326 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17198434 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17406661 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17457856 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17442438 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17467014 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":19009594 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17252715 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17364633 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":17377250.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17198358.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17406585.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17457780.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17442362.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17466938.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17252639.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":17364557.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76965, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2207418.425,2106273.275,2098665.075,2107847.675,1400495.375,1379009.875,1371970.775,1381033.175,1373479.575,1377597.775 + ], + "N":10, + "Min":1371970.775, + "LowerFence":288320.1625000001, + "Q1":1377950.7999999998, + "Median":1390764.275, + "Mean":1680379.1, + "Q3":2104371.2249999996, + "UpperFence":3194001.8624999993, + "Max":2207418.425, + "InterquartileRange":726420.4249999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":122773.26320154322, + "Variance":150732741571.55405, + "StandardDeviation":388243.1474882127, + "Skewness":0.36367237731994917, + "Kurtosis":0.9806053249645224, + "ConfidenceInterval":{ + "N":10, + "Mean":1680379.1, + "StandardError":122773.26320154322, + "Level":12, + "Margin":586968.2390947995, + "Lower":1093410.8609052007, + "Upper":2267347.3390947995 + }, + "Percentiles":{ + "P0":1371970.775, + "P25":1377950.7999999998, + "P50":1390764.275, + "P67":2098893.321, + "P80":2106588.155, + "P85":2107296.635, + "P90":2117804.75, + "P95":2162611.5874999994, + "P100":2207418.425 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":177262 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":181588 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":104165589 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":31 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":45376539 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44148474 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42125571 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41973407 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42157059 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28010013 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27580303 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":27439521 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":27620769 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27469697 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27552061 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":44148368.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42125465.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41973301.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42156953.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28009907.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27580197.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":27439415.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":27620663.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":27469591.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":27551955.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":177262, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2096271.9,1984337.1,1956562.95,2037528.05,1678752.45,1211557.55,1218861.65,1213022.3,1199371.9,1196171.4 + ], + "N":10, + "Min":1196171.4, + "LowerFence":63718.99999999977, + "Q1":1211923.7375, + "Median":1448807.0499999998, + "Mean":1579243.725, + "Q3":1977393.5625000002, + "UpperFence":3125598.3000000007, + "Max":2096271.9, + "InterquartileRange":765469.8250000002, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":128406.84421293976, + "Variance":164883176407.26184, + "StandardDeviation":406058.09486730077, + "Skewness":0.14783951810951443, + "Kurtosis":0.9503079491051705, + "ConfidenceInterval":{ + "N":10, + "Mean":1579243.725, + "StandardError":128406.84421293976, + "Level":12, + "Margin":613901.8974486467, + "Lower":965341.8275513534, + "Upper":2193145.622448647 + }, + "Percentiles":{ + "P0":1196171.4, + "P25":1211923.7375, + "P50":1448807.0499999998, + "P67":1957396.1745, + "P80":1994975.29, + "P85":2018911.2175, + "P90":2043402.435, + "P95":2069837.1675, + "P100":2096271.9 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":240851 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":179494 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":97841450 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":260 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41318297 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41925588 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39686892 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":39131409 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40750711 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":33575199 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24231301 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":24377383 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24260596 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":23987588 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":23923578 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41925438 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":39686742 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":39131259 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40750561 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":33575049 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24231151 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":24377233 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":24260446 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":23987438 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":23923428 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":240851, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-resumed.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-resumed.json new file mode 100644 index 000000000..bc62e4300 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-resumed.json @@ -0,0 +1,1901 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171946", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1077346.3,1080095.4,1070999,1070944.4,1067335.15,1059998.5,1065625.5,1022979.15,1059057.25 + ], + "N":9, + "Min":1022979.15, + "LowerFence":1043497.75, + "Q1":1059998.5, + "Median":1067335.15, + "Mean":1063820.0722222223, + "Q3":1070999, + "UpperFence":1087499.75, + "Max":1080095.4, + "InterquartileRange":11000.5, + "LowerOutliers":[ + 1022979.15 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 1022979.15 + ], + "StandardError":5616.22567688992, + "Variance":283877917.68381876, + "StandardDeviation":16848.677030669758, + "Skewness":-1.4105371810177358, + "Kurtosis":3.987318370610506, + "ConfidenceInterval":{ + "N":9, + "Mean":1063820.0722222223, + "StandardError":5616.22567688992, + "Level":12, + "Margin":28313.109004551116, + "Lower":1035506.9632176713, + "Upper":1092133.1812267734 + }, + "Percentiles":{ + "P0":1022979.15, + "P25":1059998.5, + "P50":1067335.15, + "P67":1070964.0559999999, + "P80":1073537.9200000002, + "P85":1076076.84, + "P90":1077896.12, + "P95":1078995.76, + "P100":1080095.4 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":13406 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":192859 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":23758451 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":331 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":22000179 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21547036 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21602018 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":21420090 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":21418998 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21346813 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":22901908 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21200080 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":21312620 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20459693 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":21181255 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":21546926 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":21601908 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":21419980 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":21418888 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":21346703 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21199970 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":21312510 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20459583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":21181145 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":13406, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 914676.325,875767.425,883930.575,872157.725,899120.375,876879.975,880307.325,872421.675,883293.925 + ], + "N":9, + "Min":872157.725, + "LowerFence":863522.7000000002, + "Q1":875767.425, + "Median":880307.325, + "Mean":884283.925, + "Q3":883930.575, + "UpperFence":896175.2999999998, + "Max":914676.325, + "InterquartileRange":8163.149999999907, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 899120.375,914676.325 + ], + "AllOutliers":[ + 899120.375,914676.325 + ], + "StandardError":4678.323951273095, + "Variance":196980434.93749955, + "StandardDeviation":14034.971853819285, + "Skewness":1.0770821510187112, + "Kurtosis":2.7250237881553505, + "ConfidenceInterval":{ + "N":9, + "Mean":884283.925, + "StandardError":4678.323951273095, + "Level":12, + "Margin":23584.859941801384, + "Lower":860699.0650581986, + "Upper":907868.7849418015 + }, + "Percentiles":{ + "P0":872157.725, + "P25":875767.425, + "P50":880307.325, + "P67":883523.119, + "P80":890006.4949999999, + "P85":896082.4149999999, + "P90":902231.565, + "P95":908453.9450000001, + "P100":914676.325 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":76996 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":202527 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19465382 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":19127794 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18293632 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17515454 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17678717 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17443260 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17982513 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17537705 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17606252 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18923184 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17448539 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17665984 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":18293526.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":17515348.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":17678611.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":17443154.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17982407.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":17537599.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17606146.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":17448433.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17665878.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":76996, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1889243.65,1804612.65,1790865.05,1783938.7,1525379.05,1066836.75,1026902.95,1032365.1,1048780.7,1032558.45 + ], + "N":10, + "Min":1026902.95, + "LowerFence":-92165.16250000033, + "Q1":1036614.0125, + "Median":1296107.9, + "Mean":1400148.3049999997, + "Q3":1789133.4625000001, + "UpperFence":2917912.6375, + "Max":1889243.65, + "InterquartileRange":752519.4500000002, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":123049.11907381976, + "Variance":151410857048.4308, + "StandardDeviation":389115.4803505391, + "Skewness":0.11793337463836735, + "Kurtosis":0.9281441400219532, + "ConfidenceInterval":{ + "N":10, + "Mean":1400148.3049999997, + "StandardError":123049.11907381976, + "Level":12, + "Margin":588287.081906107, + "Lower":811861.2230938927, + "Upper":1988435.3869061067 + }, + "Percentiles":{ + "P0":1026902.95, + "P25":1036614.0125, + "P50":1296107.9, + "P67":1784146.4904999998, + "P80":1793614.5699999998, + "P85":1799800.9899999998, + "P90":1813075.7499999998, + "P95":1851159.6999999997, + "P100":1889243.65 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172142 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":150139 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41432931 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":331 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":210 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38088558 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37785033 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36092413 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35817461 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35678934 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30507741 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21336895 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20538219 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20647462 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20975774 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20651329 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37784873 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36092253 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":35817301 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":35678774 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":30507581 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21336735 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":20538059 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":20647302 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":20975614 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":20651169 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172142, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1746827.65,1632669.7,1588796.05,1611203.75,1606402.3,1229930.25,878429.15,945206.4,856815.9,864920 + ], + "N":10, + "Min":856815.9, + "LowerFence":-177196.42499999993, + "Q1":895123.4625, + "Median":1409363.15, + "Mean":1296120.115, + "Q3":1610003.3875, + "UpperFence":2682323.275, + "Max":1746827.65, + "InterquartileRange":714879.9249999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":119188.17278712356, + "Variance":142058205323.33224, + "StandardDeviation":376906.0961610096, + "Skewness":-0.12220345462511246, + "Kurtosis":0.9811092310175573, + "ConfidenceInterval":{ + "N":10, + "Mean":1296120.115, + "StandardError":119188.17278712356, + "Level":12, + "Margin":569828.2352155095, + "Lower":726291.8797844904, + "Upper":1865948.3502155095 + }, + "Percentiles":{ + "P0":856815.9, + "P25":895123.4625, + "P50":1409363.15, + "P67":1606546.3435000002, + "P80":1615496.94, + "P85":1625156.6175, + "P90":1644085.4949999999, + "P95":1695456.5724999998, + "P100":1746827.65 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235716 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":197207 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37270576 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":270 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":71 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34378464 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34936643 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":32653484 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31776011 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32224165 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32128136 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24598695 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17568673 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18904218 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17136408 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17298490 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":34936553 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":32653394 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31775921 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32224075 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":32128046 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":24598605 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17568583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18904128 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":17136318 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":17298400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235716, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-small.json b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-small.json new file mode 100644 index 000000000..4463d0977 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/linuxmini/run3-small.json @@ -0,0 +1,3742 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171948", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Ubuntu 26.04.1 LTS (Resolute Raccoon)", + "ProcessorName":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":6, + "LogicalCoreCount":12, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 19784.21,19631.53,19617.11,19828.69,19556.59,19767.79,19640.15,19646.15,19788.21,19752.57 + ], + "N":10, + "Min":19556.59, + "LowerFence":19414.054999999993, + "Q1":19633.684999999998, + "Median":19699.36, + "Mean":19701.299999999996, + "Q3":19780.105, + "UpperFence":19999.735, + "Max":19828.69, + "InterquartileRange":146.4200000000019, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":29.322497885108838, + "Variance":8598.088822222124, + "StandardDeviation":92.72588000241423, + "Skewness":-0.0803642219051416, + "Kurtosis":1.2577360854888622, + "ConfidenceInterval":{ + "N":10, + "Mean":19701.299999999996, + "StandardError":29.322497885108838, + "Level":12, + "Margin":140.18829915133327, + "Lower":19561.11170084866, + "Upper":19841.48829915133 + }, + "Percentiles":{ + "P0":19556.59, + "P25":19633.684999999998, + "P50":19699.36, + "P67":19768.282600000002, + "P80":19785.01, + "P85":19786.81, + "P90":19792.257999999998, + "P95":19810.474000000002, + "P100":19828.69 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":149719 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2003137 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":51 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":81 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1141534 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":989311 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":981677 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":980956 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":991535 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":977930 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":988490 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":982108 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":982408 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":989511 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":987729 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":989210.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":981576.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":980855.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":991434.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":977829.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":988389.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":982007.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":982307.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":989410.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":987628.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 20000.84,19955.74,19945.12,20008.84,20034.88,20037.88,20015.66,20054.14 + ], + "N":8, + "Min":19945.12, + "LowerFence":19920.467500000006, + "Q1":19989.565000000002, + "Median":20012.25, + "Mean":20006.637499999997, + "Q3":20035.63, + "UpperFence":20104.7275, + "Max":20054.14, + "InterquartileRange":46.06499999999869, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":13.709385438711077, + "Variance":1503.5779928571465, + "StandardDeviation":38.77599763845086, + "Skewness":-0.4371530863024279, + "Kurtosis":1.532744921218633, + "ConfidenceInterval":{ + "N":8, + "Mean":20006.637499999997, + "StandardError":13.709385438711077, + "Level":12, + "Margin":74.13874584548331, + "Lower":19932.498754154512, + "Upper":20080.77624584548 + }, + "Percentiles":{ + "P0":19945.12, + "P25":19989.565000000002, + "P50":20012.25, + "P67":20028.9218, + "P80":20036.68, + "P85":20037.73, + "P90":20042.758, + "P95":20048.449, + "P100":20054.14 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161561 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1916377 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1120816 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1030738 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1157714 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1000162 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":997907 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":997376 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1000562 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1001864 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1002014 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1000903 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1002827 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1000042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":997787 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":997256 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1000442 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1001744 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1001894 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1000783 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1002707 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11858.88,11768.9,11762.9,11866.88,11844.86,11604.2,11665.32,11698.98,11714.02,11641.46 + ], + "N":10, + "Min":11604.2, + "LowerFence":11445.532500000001, + "Q1":11673.735, + "Median":11738.46, + "Mean":11742.64, + "Q3":11825.87, + "UpperFence":12054.072500000002, + "Max":11866.88, + "InterquartileRange":152.13500000000022, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":29.552779000741427, + "Variance":8733.667466666637, + "StandardDeviation":93.45409282993782, + "Skewness":0.03979543944768426, + "Kurtosis":1.3671489850795833, + "ConfidenceInterval":{ + "N":10, + "Mean":11742.64, + "StandardError":29.552779000741427, + "Level":12, + "Margin":141.28925303506085, + "Lower":11601.35074696494, + "Upper":11883.92925303506 + }, + "Percentiles":{ + "P0":11604.2, + "P25":11673.735, + "P50":11738.46, + "P67":11771.1788, + "P80":11847.663999999999, + "P85":11853.973, + "P90":11859.68, + "P95":11863.279999999999, + "P100":11866.88 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":196306 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1318955 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":716243 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":593094 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":588595 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":588295 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":593494 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":592393 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":580360 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":583416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":585099 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":585851 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":582223 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":592944 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":588445 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":588145 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":593344 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":592243 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":580210 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":583266 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":584949 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":585701 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":582073 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12819.45,12691.41,12684.19,12520.49,12573.79,12564.57,12640.13,12646.53,12750.73,12606.85 + ], + "N":10, + "Min":12520.49, + "LowerFence":12420.730000000001, + "Q1":12582.055, + "Median":12643.33, + "Mean":12649.814, + "Q3":12689.605, + "UpperFence":12850.929999999998, + "Max":12819.45, + "InterquartileRange":107.54999999999927, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":28.595590771228295, + "Variance":8177.078115555571, + "StandardDeviation":90.42719787517233, + "Skewness":0.3678315129568287, + "Kurtosis":1.9524875083174664, + "ConfidenceInterval":{ + "N":10, + "Mean":12649.814, + "StandardError":28.595590771228295, + "Level":12, + "Margin":136.71301978273388, + "Lower":12513.100980217267, + "Upper":12786.527019782734 + }, + "Percentiles":{ + "P0":12520.49, + "P25":12582.055, + "P50":12643.33, + "P67":12684.4066, + "P80":12703.274000000001, + "P85":12729.968, + "P90":12757.602, + "P95":12788.526, + "P100":12819.45 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161781 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1423489 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":191 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":221 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":190 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":171 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":760565 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":641103 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":634701 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":634340 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":626155 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":628820 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":628359 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":632137 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":632457 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":637667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":630473 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":640972.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":634570.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":634209.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":626024.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":628689.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":628228.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":632006.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":632326.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":637536.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":630342.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 17814.34,17795.7,17738.8,17797.7,17740.4,17777.88,17796.3,17804.5 + ], + "N":8, + "Min":17738.8, + "LowerFence":17722.175000000003, + "Q1":17768.510000000002, + "Median":17796, + "Mean":17783.2025, + "Q3":17799.4, + "UpperFence":17845.735, + "Max":17814.34, + "InterquartileRange":30.889999999999418, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":10.170863453653105, + "Variance":827.5717071428511, + "StandardDeviation":28.76754607440216, + "Skewness":-0.6248909608727138, + "Kurtosis":1.5492080499633867, + "ConfidenceInterval":{ + "N":8, + "Mean":17783.2025, + "StandardError":10.170863453653105, + "Level":12, + "Margin":55.00283466319965, + "Lower":17728.1996653368, + "Upper":17838.2053346632 + }, + "Percentiles":{ + "P0":17738.8, + "P25":17768.510000000002, + "P50":17796, + "P67":17797.266, + "P80":17801.78, + "P85":17804.16, + "P90":17807.452, + "P95":17810.896, + "P100":17814.34 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":205473 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2223077 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":61 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":51 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":51 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":70 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":50 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1058841 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":890768 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":889836 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":886991 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":896678 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":889936 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":887071 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":888945 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":889866 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":901087 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":890276 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":890717 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":889785 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":886940 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":889885 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":887020 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":888894 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":889815 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":890225 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 18161.4,17983.68,18291.04,18235.74,18221.32,18227.12,18202.88,18081.06 + ], + "N":8, + "Min":17983.68, + "LowerFence":18009.375000000004, + "Q1":18141.315000000002, + "Median":18212.1, + "Mean":18175.53, + "Q3":18229.275, + "UpperFence":18361.215, + "Max":18291.04, + "InterquartileRange":87.95999999999913, + "LowerOutliers":[ + 17983.68 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 17983.68 + ], + "StandardError":34.95015307548736, + "Variance":9772.10559999999, + "StandardDeviation":98.85396097273993, + "Skewness":-0.7626706174391618, + "Kurtosis":2.143597699742857, + "ConfidenceInterval":{ + "N":8, + "Mean":18175.53, + "StandardError":34.95015307548736, + "Level":12, + "Margin":189.00632181568517, + "Lower":17986.523678184312, + "Upper":18364.536321815685 + }, + "Percentiles":{ + "P0":17983.68, + "P25":18141.315000000002, + "P50":18212.1, + "P67":18225.322, + "P80":18232.292, + "P85":18235.309, + "P90":18252.33, + "P95":18271.685, + "P100":18291.04 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":194732 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2355193 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":140 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":91 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":80 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":101 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":151 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":90 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1044363 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":908190 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":899304 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":969134 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":978180 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":914672 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":911907 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":911186 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":911476 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":910264 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":904173 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":908070 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":899184 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":914552 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":911787 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":911066 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":911356 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":910144 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":904053 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12123.74,11999.1,11888.9,12150.6,12133.96,12150.8,12228.14,12151.6,12068.86 + ], + "N":9, + "Min":11888.9, + "LowerFence":11945.950000000003, + "Q1":12068.86, + "Median":12133.96, + "Mean":12099.522222222222, + "Q3":12150.8, + "UpperFence":12273.709999999997, + "Max":12228.14, + "InterquartileRange":81.93999999999869, + "LowerOutliers":[ + 11888.9 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 11888.9 + ], + "StandardError":33.675731856180654, + "Variance":10206.494244444422, + "StandardDeviation":101.02719556854196, + "Skewness":-0.8397526482089278, + "Kurtosis":2.524687332043831, + "ConfidenceInterval":{ + "N":9, + "Mean":12099.522222222222, + "StandardError":33.675731856180654, + "Level":12, + "Margin":169.76964988701712, + "Lower":11929.752572335205, + "Upper":12269.29187210924 + }, + "Percentiles":{ + "P0":11888.9, + "P25":12068.86, + "P50":12133.96, + "P67":12150.671999999999, + "P80":12151.119999999999, + "P85":12151.44, + "P90":12166.908000000001, + "P95":12197.524000000001, + "P100":12228.14 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":153315 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1866453 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":161 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":181 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":141 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":121 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":110 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":695635 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":606308 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":600076 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":594566 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":618722 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":607651 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":606819 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":607661 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":611528 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":607701 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":603564 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":606187 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":599955 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":594445 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":607530 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":606698 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":607540 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":611407 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":607580 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":603443 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12663.16,12670.98,12757.54,12741.72,12750.72,12760.94,12793,12785.2 + ], + "N":8, + "Min":12663.16, + "LowerFence":12659.579999999998, + "Q1":12724.035, + "Median":12754.130000000001, + "Mean":12740.4075, + "Q3":12767.005000000001, + "UpperFence":12831.460000000003, + "Max":12793, + "InterquartileRange":42.970000000001164, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":17.104129383405898, + "Variance":2340.409935714312, + "StandardDeviation":48.37778349319357, + "Skewness":-0.6022128704293725, + "Kurtosis":1.6155265735938107, + "ConfidenceInterval":{ + "N":8, + "Mean":12740.4075, + "StandardError":17.104129383405898, + "Level":12, + "Margin":92.49712227682575, + "Lower":12647.910377723174, + "Upper":12832.904622276825 + }, + "Percentiles":{ + "P0":12663.16, + "P25":12724.035, + "P50":12754.130000000001, + "P67":12759.886, + "P80":12775.496000000001, + "P85":12783.987000000001, + "P90":12787.54, + "P95":12790.27, + "P100":12793 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":187769 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1873086 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":170 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":160 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":111 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":131 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":150 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":120 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":130 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":750025 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":652574 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":633288 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":633679 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":645481 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":638007 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":637216 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":637666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":638177 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":639780 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":639390 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":633158 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":633549 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":637877 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":637086 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":637536 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":638047 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":639650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":639260 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows-bulk.json b/src/Titanium.Tls/design/perf-baselines/local-windows-bulk.json new file mode 100644 index 000000000..6fd7b54f3 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows-bulk.json @@ -0,0 +1,3721 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261127-002142", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 265608900,275288100,265090500,279664700,275910500,271443900,264448000,272724300,271004400,264887200 + ], + "N":10, + "Min":264448000, + "LowerFence":251079525, + "Q1":265220100, + "Median":271224150, + "Mean":270607050, + "Q3":274647150, + "UpperFence":288787725, + "Max":279664700, + "InterquartileRange":9427050, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1711026.9667496313, + "Variance":29276132809444.445, + "StandardDeviation":5410742.352898024, + "Skewness":0.18399910112550694, + "Kurtosis":1.4096683676117603, + "ConfidenceInterval":{ + "N":10, + "Mean":270607050, + "StandardError":1711026.9667496313, + "Level":12, + "Margin":8180270.357953011, + "Lower":262426779.642047, + "Upper":278787320.357953 + }, + "Percentiles":{ + "P0":264448000, + "P25":265220100, + "P50":271224150, + "P67":272801214, + "P80":275412580, + "P85":275692660, + "P90":276285920, + "P95":277975310, + "P100":279664700 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":224100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":313104900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":297901900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":265609200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":275288400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":265090800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":279665000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":275910800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":271444200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":264448300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":272724600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271004700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":264887500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":265608900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":275288100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":265090500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":279664700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":275910500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":271443900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":264448000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":272724300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271004400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":264887200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 272866300,274533100,274897900,270461500,266209600,262760000,266389700,271016200,275516000 + ], + "N":9, + "Min":262760000, + "LowerFence":254174600, + "Q1":266389700, + "Median":271016200, + "Mean":270516700, + "Q3":274533100, + "UpperFence":286748200, + "Max":275516000, + "InterquartileRange":8143400, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1499269.1953081675, + "Variance":20230273080000, + "StandardDeviation":4497807.585924502, + "Skewness":-0.4029118671867745, + "Kurtosis":1.5035368244374931, + "ConfidenceInterval":{ + "N":9, + "Mean":270516700, + "StandardError":1499269.1953081675, + "Level":12, + "Margin":7558273.9362839535, + "Lower":262958426.06371605, + "Upper":278074973.93628395 + }, + "Percentiles":{ + "P0":262760000, + "P25":266389700, + "P50":271016200, + "P67":273466348, + "P80":274679020, + "P85":274824940, + "P90":275021520, + "P95":275268760, + "P100":275516000 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":192800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":288243700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":270312500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":272866500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":274533300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":285970100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":274898100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":270461700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":266209800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":262760200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":266389900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271016400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":275516200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":272866300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":274533100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":274897900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270461500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":266209600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":262760000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266389700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271016200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":275516000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 93573400,83631300,85496200,77173500,81071700,88330600,83834500,86538400,82302600,79086600 + ], + "N":10, + "Min":77173500, + "LowerFence":74031787.5, + "Q1":81379425, + "Median":83732900, + "Mean":84103880, + "Q3":86277850, + "UpperFence":93625487.5, + "Max":93573400, + "InterquartileRange":4898425, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1495698.6542006976, + "Variance":22371144641777.777, + "StandardDeviation":4729814.440522776, + "Skewness":0.4241252385049729, + "Kurtosis":2.2848168098249517, + "ConfidenceInterval":{ + "N":10, + "Mean":84103880, + "StandardError":1495698.6542006976, + "Level":12, + "Margin":7150804.51866339, + "Lower":76953075.48133661, + "Upper":91254684.51866339 + }, + "Percentiles":{ + "P0":77173500, + "P25":81379425, + "P50":83732900, + "P67":85527466, + "P80":86896840, + "P85":87703330, + "P90":88854880, + "P95":91214140, + "P100":93573400 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":264700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":90351000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82950900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":93573600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83631500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85496400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":77173700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":81071900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":88330800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":83834700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":86538600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":82302800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":79086800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":93573400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83631300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85496200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":77173500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":81071700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":88330600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":83834500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":86538400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":82302600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":79086600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 89298900,84907300,94454800,83710600,76232900,77559700,81870300,79335900,77548600,77190800 + ], + "N":10, + "Min":76232900, + "LowerFence":66966250, + "Q1":77551375, + "Median":80603100, + "Mean":82210980, + "Q3":84608125, + "UpperFence":95193250, + "Max":94454800, + "InterquartileRange":7056750, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1892566.5357333615, + "Variance":35818080921777.78, + "StandardDeviation":5984820.87633187, + "Skewness":0.7690645103651697, + "Kurtosis":2.180657225349675, + "ConfidenceInterval":{ + "N":10, + "Mean":82210980, + "StandardError":1892566.5357333615, + "Level":12, + "Margin":9048195.167913342, + "Lower":73162784.83208665, + "Upper":91259175.16791335 + }, + "Percentiles":{ + "P0":76232900, + "P25":77551375, + "P50":80603100, + "P67":83746501, + "P80":85785620, + "P85":87761840, + "P90":89814490, + "P95":92134645, + "P100":94454800 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":185300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":88338500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84381100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":89299000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84907400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":94454900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83710700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":76233000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77559800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":81870400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79336000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":77548700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":77190900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":89298900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84907300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":94454800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83710600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":76232900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77559700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":81870300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79335900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":77548600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":77190800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 280141000,271333000,271630600,274112600,266142700,280466800,273636300,270305000,281652200,279628300 + ], + "N":10, + "Min":266142700, + "LowerFence":258499262.5, + "Q1":271407400, + "Median":273874450, + "Mean":274904850, + "Q3":280012825, + "UpperFence":292920962.5, + "Max":281652200, + "InterquartileRange":8605425, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1666132.7939773186, + "Variance":27759984871666.668, + "StandardDeviation":5268774.5132684, + "Skewness":-0.0855065980170203, + "Kurtosis":1.414708143017533, + "ConfidenceInterval":{ + "N":10, + "Mean":274904850, + "StandardError":1666132.7939773186, + "Level":12, + "Margin":7965635.242369874, + "Lower":266939214.75763014, + "Upper":282870485.2423699 + }, + "Percentiles":{ + "P0":266142700, + "P25":271407400, + "P50":273874450, + "P67":279643681, + "P80":280206160, + "P85":280352770, + "P90":280585340, + "P95":281118770, + "P100":281652200 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":18392 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":187200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":294658000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":292883800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":280141200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":271333200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271630800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":274112800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":266142900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":280467000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":273636500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":270305200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":281652400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":279628500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":280141000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":271333000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271630600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":274112600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":266142700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":280466800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":273636300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":270305000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":281652200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":279628300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":18392, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 275755800,264173600,269462000,270873600,271928600,258948600,264282800,274459800,268816000,269040300 + ], + "N":10, + "Min":258948600, + "LowerFence":256042975, + "Q1":265416100, + "Median":269251150, + "Mean":268774110, + "Q3":271664850, + "UpperFence":281037975, + "Max":275755800, + "InterquartileRange":6248750, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1611944.1006609239, + "Variance":25983637836555.555, + "StandardDeviation":5097414.818960249, + "Skewness":-0.4314266965120015, + "Kurtosis":2.0313485295877056, + "ConfidenceInterval":{ + "N":10, + "Mean":268774110, + "StandardError":1611944.1006609239, + "Level":12, + "Margin":7706563.836549551, + "Lower":261067546.16345045, + "Upper":276480673.8365496 + }, + "Percentiles":{ + "P0":258948600, + "P25":265416100, + "P50":269251150, + "P67":270905250, + "P80":272434840, + "P85":273573880, + "P90":274589400, + "P95":275172600, + "P100":275755800 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":18680 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":248700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":311081200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":278520700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":275756000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":264173800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":269462200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270873800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":271928800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":258948800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":264283000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":274460000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268816200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":269040500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":275755800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":264173600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":269462000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270873600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":271928600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":258948600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":264282800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":274459800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268816000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":269040300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":18680, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 84454700,73844800,68366600,75074000,68597200,62227400,62297500,75005700,74011100 + ], + "N":9, + "Min":62227400, + "LowerFence":58407950, + "Q1":68366600, + "Median":73844800, + "Mean":71542111.1111111, + "Q3":75005700, + "UpperFence":84964350, + "Max":84454700, + "InterquartileRange":6639100, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2338051.6910717473, + "Variance":49198371391111.11, + "StandardDeviation":7014155.073215242, + "Skewness":0.19642075928504385, + "Kurtosis":1.9818889286168508, + "ConfidenceInterval":{ + "N":9, + "Mean":71542111.1111111, + "StandardError":2338051.6910717473, + "Level":12, + "Margin":11786832.68729462, + "Lower":59755278.42381649, + "Upper":83328943.79840572 + }, + "Percentiles":{ + "P0":62227400, + "P25":68366600, + "P50":73844800, + "P67":74369156, + "P80":75033020, + "P85":75060340, + "P90":76950140, + "P95":80702420, + "P100":84454700 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":18680 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":204200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":95164800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":92323300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":90573000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84454800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":73844900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":68366700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":75074100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":68597300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":62227500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":62297600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":75005800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":74011200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84454700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":73844800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":68366600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":75074000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":68597200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":62227400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":62297500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":75005700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":74011100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":18680, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 103493150,93317150,72848250,86435150,70233150,67861250,61519650,67146150,71500250,69118450 + ], + "N":10, + "Min":61519650, + "LowerFence":45881237.5, + "Q1":68175550, + "Median":70866700, + "Mean":76347260, + "Q3":83038425, + "UpperFence":105332737.5, + "Max":103493150, + "InterquartileRange":14862875, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4253818.489113308, + "Variance":180949717383222.22, + "StandardDeviation":13451755.17853422, + "Skewness":0.8423790101896796, + "Kurtosis":2.143458592459954, + "ConfidenceInterval":{ + "N":10, + "Mean":76347260, + "StandardError":4253818.489113308, + "Level":12, + "Margin":20337134.34727989, + "Lower":56010125.65272011, + "Upper":96684394.34727989 + }, + "Percentiles":{ + "P0":61519650, + "P25":68175550, + "P50":70866700, + "P67":73255857, + "P80":87811550, + "P85":90908449.99999999, + "P90":94334750, + "P95":98913949.99999999, + "P100":103493150 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":18392 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":249100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":99641800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":90104000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":103493300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":93317300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":72848400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":86435300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":70233300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":67861400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":61519800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":67146300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":71500400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":69118600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":103493150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":93317150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":72848250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":86435150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":70233150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":67861250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":61519650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":67146150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":71500250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":69118450 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":18392, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows-handshake.json b/src/Titanium.Tls/design/perf-baselines/local-windows-handshake.json new file mode 100644 index 000000000..e5c923369 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows-handshake.json @@ -0,0 +1,1824 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261127-001241", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3314225,3458380,3596435,3200380,3165410,3538085,3765110,3198410,3351160,3858475 + ], + "N":10, + "Min":3165410, + "LowerFence":2699331.875, + "Q1":3228841.25, + "Median":3404770, + "Mean":3444607, + "Q3":3581847.5, + "UpperFence":4111356.875, + "Max":3858475, + "InterquartileRange":353006.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":76734.10301597763, + "Variance":58881225656.666664, + "StandardDeviation":242654.5397404851, + "Skewness":0.376866973701728, + "Kurtosis":1.5625048508924821, + "ConfidenceInterval":{ + "N":10, + "Mean":3444607, + "StandardError":76734.10301597763, + "Level":12, + "Margin":366859.03877841367, + "Lower":3077747.9612215864, + "Upper":3811466.0387784136 + }, + "Percentiles":{ + "P0":3165410, + "P25":3228841.25, + "P50":3404770, + "P67":3539835.5, + "P80":3630169.9999999995, + "P85":3706073.75, + "P90":3774446.5, + "P95":3816460.75, + "P100":3858475 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":7390 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":195800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":105163500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":72387000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":66284700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":69167800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":71928900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":64007800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":63308400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70761900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":75302400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":63968400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":67023400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":77169700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":66284500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":69167600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":71928700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":64007600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":63308200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":70761700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":75302200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":63968200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":67023200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":77169500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":7390, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2641085,2652005,2635245,2672260,2594435,2554405,2733230,2627735 + ], + "N":8, + "Min":2554405, + "LowerFence":2562921.875, + "Q1":2619410, + "Median":2638165, + "Mean":2638800, + "Q3":2657068.75, + "UpperFence":2713556.875, + "Max":2733230, + "InterquartileRange":37658.75, + "LowerOutliers":[ + 2554405 + ], + "UpperOutliers":[ + 2733230 + ], + "AllOutliers":[ + 2554405,2733230 + ], + "StandardError":18632.743476586737, + "Variance":2777433035.714286, + "StandardDeviation":52701.35705761556, + "Skewness":0.1639494037186211, + "Kurtosis":2.1942937298578125, + "ConfidenceInterval":{ + "N":8, + "Mean":2638800, + "StandardError":18632.743476586737, + "Level":12, + "Margin":100763.6877079902, + "Lower":2538036.3122920096, + "Upper":2739563.6877079904 + }, + "Percentiles":{ + "P0":2554405, + "P25":2619410, + "P50":2638165, + "P67":2648619.8, + "P80":2664158, + "P85":2671247.25, + "P90":2690551, + "P95":2711890.5, + "P100":2733230 + } + }, + "Memory":{ + "Gen0Collections":3, + "Gen1Collections":3, + "Gen2Collections":3, + "TotalOperations":20, + "BytesAllocatedPerOperation":531958 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":572200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":76044400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":54124300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":52821900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":53040300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":52705100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":59293500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":60853700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":53445400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":51888900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":51088300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":54664800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":52554900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":52821700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":53040100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":52704900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":53445200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":51888700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":51088100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":54664600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":52554700 + } + ], + "Metrics":[ + { + "Value":150, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":150, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":150, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":531958, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 4409050,4545290,4869920,4746695,4826645,4406585,4340265,4606690,4367465 + ], + "N":9, + "Min":4340265, + "LowerFence":3896420, + "Q1":4406585, + "Median":4545290, + "Mean":4568733.888888889, + "Q3":4746695, + "UpperFence":5256860, + "Max":4869920, + "InterquartileRange":340110, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":68250.97267203605, + "Variance":41923757436.111115, + "StandardDeviation":204752.91801610816, + "Skewness":0.28141783423899275, + "Kurtosis":1.2242699521707527, + "ConfidenceInterval":{ + "N":9, + "Mean":4568733.888888889, + "StandardError":68250.97267203605, + "Level":12, + "Margin":344073.9991773432, + "Lower":4224659.889711546, + "Upper":4912807.888066232 + }, + "Percentiles":{ + "P0":4340265, + "P25":4406585, + "P50":4545290, + "P67":4657091.800000001, + "P80":4778675, + "P85":4810655, + "P90":4835300, + "P95":4852610, + "P100":4869920 + } + }, + "Memory":{ + "Gen0Collections":4, + "Gen1Collections":4, + "Gen2Collections":4, + "TotalOperations":20, + "BytesAllocatedPerOperation":1030832 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":206200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":182862500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":116218000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":133021300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":88181200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":90906000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":97398600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":94934100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":96533100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":88131900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":86805500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":92134000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":87349500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":88181000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":90905800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":97398400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":94933900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":96532900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":88131700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":86805300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":92133800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":87349300 + } + ], + "Metrics":[ + { + "Value":200, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1030832, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 5304735,4858785,3638815,3865580,3504660,3740680,3568085,3608305,4386600,4625800 + ], + "N":10, + "Min":3504660, + "LowerFence":2190831.25, + "Q1":3615932.5, + "Median":3803130, + "Mean":4110204.5, + "Q3":4566000, + "UpperFence":5991101.25, + "Max":5304735, + "InterquartileRange":950067.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":201675.96224093132, + "Variance":406731937458.05554, + "StandardDeviation":637755.3899874587, + "Skewness":0.6185541723100292, + "Kurtosis":1.6819504053977496, + "ConfidenceInterval":{ + "N":10, + "Mean":4110204.5, + "StandardError":201675.96224093132, + "Level":12, + "Margin":964195.1458924876, + "Lower":3146009.354107512, + "Upper":5074399.645892488 + }, + "Percentiles":{ + "P0":3504660, + "P25":3615932.5, + "P50":3803130, + "P67":4393776, + "P80":4672397, + "P85":4777240.25, + "P90":4903380, + "P95":5104057.5, + "P100":5304735 + } + }, + "Memory":{ + "Gen0Collections":7, + "Gen1Collections":7, + "Gen2Collections":7, + "TotalOperations":20, + "BytesAllocatedPerOperation":1558768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":195100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":161814000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":101829300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":106094800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":97175800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":72776400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":77311700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":70093300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":74813700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71361800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":72166200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":87732100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":92516100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":106094700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":97175700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":72776300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":77311600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":70093200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":74813600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71361700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":72166100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":87732000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":92516000 + } + ], + "Metrics":[ + { + "Value":350, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":350, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":350, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1558768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows-resumed.json b/src/Titanium.Tls/design/perf-baselines/local-windows-resumed.json new file mode 100644 index 000000000..cb32cb484 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows-resumed.json @@ -0,0 +1,1845 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261127-001246", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3279220,3260380,3430080,3717160,3511830,3361205,3572285,3560650,3544295,3786155 + ], + "N":10, + "Min":3260380, + "LowerFence":3091995, + "Q1":3378423.75, + "Median":3528062.5, + "Mean":3502326, + "Q3":3569376.25, + "UpperFence":3855805, + "Max":3786155, + "InterquartileRange":190952.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":54803.58846117854, + "Variance":30034333082.22222, + "StandardDeviation":173304.16348784647, + "Skewness":0.09490705609919997, + "Kurtosis":1.6613893423772534, + "ConfidenceInterval":{ + "N":10, + "Mean":3502326, + "StandardError":54803.58846117854, + "Level":12, + "Margin":262011.16575624017, + "Lower":3240314.83424376, + "Upper":3764337.16575624 + }, + "Percentiles":{ + "P0":3260380, + "P25":3378423.75, + "P50":3528062.5, + "P67":3560999.05, + "P80":3601259.9999999995, + "P85":3666453.75, + "P90":3724059.5, + "P95":3755107.25, + "P100":3786155 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":7400 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":176100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":76941100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":73662900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":65584600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":65207800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":68601800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":74343400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":70236800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":67224300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71445900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":71213200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70886100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":75723300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":65584400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":65207600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":68601600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":74343200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":70236600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":67224100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71445700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":71213000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":70885900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":75723100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":7400, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2594020,2623715,2802700,2953425,3124910,2810030,2834780,2695240,2941115,2561290 + ], + "N":10, + "Min":2561290, + "LowerFence":2232193.75, + "Q1":2641596.25, + "Median":2806365, + "Mean":2794122.5, + "Q3":2914531.25, + "UpperFence":3323933.75, + "Max":3124910, + "InterquartileRange":272935, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":56906.60521244924, + "Variance":32383617168.055557, + "StandardDeviation":179954.4863793497, + "Skewness":0.2906149639816903, + "Kurtosis":1.7705222526807614, + "ConfidenceInterval":{ + "N":10, + "Mean":2794122.5, + "StandardError":56906.60521244924, + "Level":12, + "Margin":272065.5050080514, + "Lower":2522056.994991949, + "Upper":3066188.005008051 + }, + "Percentiles":{ + "P0":2561290, + "P25":2641596.25, + "P50":2806365, + "P67":2837970.05, + "P80":2943577, + "P85":2949116.5, + "P90":2970573.5, + "P95":3047741.75, + "P100":3124910 + } + }, + "Memory":{ + "Gen0Collections":3, + "Gen1Collections":3, + "Gen2Collections":3, + "TotalOperations":20, + "BytesAllocatedPerOperation":532008 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":330600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":52379200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":54056500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":51880600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":52474500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":56054200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":59068700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62498400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":56200800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56695800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":53905000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":58822500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":51226000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":51880400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":52474300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":56054000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":59068500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62498200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":56200600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56695600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":53904800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":58822300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":51225800 + } + ], + "Metrics":[ + { + "Value":150, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":150, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":150, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":532008, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2886110,2781655,2845700,2801155,2682625,2894715,2793985,3113285 + ], + "N":8, + "Min":2682625, + "LowerFence":2644864.375, + "Q1":2790902.5, + "Median":2823427.5, + "Mean":2849903.75, + "Q3":2888261.25, + "UpperFence":3034299.375, + "Max":3113285, + "InterquartileRange":97358.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 3113285 + ], + "AllOutliers":[ + 3113285 + ], + "StandardError":44491.11354639502, + "Variance":15835673476.785715, + "StandardDeviation":125839.87236478634, + "Skewness":0.8228932632675191, + "Kurtosis":2.8103739423759766, + "ConfidenceInterval":{ + "N":8, + "Mean":2849903.75, + "StandardError":44491.11354639502, + "Level":12, + "Margin":240602.71515050775, + "Lower":2609301.0348494924, + "Upper":3090506.4651505076 + }, + "Percentiles":{ + "P0":2682625, + "P25":2790902.5, + "P50":2823427.5, + "P67":2873582.9, + "P80":2891273, + "P85":2894284.75, + "P90":2960286, + "P95":3036785.5, + "P100":3113285 + } + }, + "Memory":{ + "Gen0Collections":4, + "Gen1Collections":4, + "Gen2Collections":4, + "TotalOperations":20, + "BytesAllocatedPerOperation":1007834 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":239200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":94552100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":90430400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":90804700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":79927500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":57722300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":55633200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":56914100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":56023200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":53652600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":57894400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":55879800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":62265800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":57722200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":55633100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":56914000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":56023100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":53652500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":57894300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":55879700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":62265700 + } + ], + "Metrics":[ + { + "Value":200, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":200, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1007834, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3891070,3705595,3700960,4031790,2314520,2080715,2171080,2166880,2258850,2100105 + ], + "N":10, + "Min":2080715, + "LowerFence":-136829.375, + "Q1":2167930, + "Median":2286685, + "Mean":2842156.5, + "Q3":3704436.25, + "UpperFence":6009195.625, + "Max":4031790, + "InterquartileRange":1536506.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":271905.60546819883, + "Variance":739326582850.2778, + "StandardDeviation":859841.0218466423, + "Skewness":0.3632471335205299, + "Kurtosis":1.0165526963648408, + "ConfidenceInterval":{ + "N":10, + "Mean":2842156.5, + "StandardError":271905.60546819883, + "Level":12, + "Margin":1299956.9310109194, + "Lower":1542199.5689890806, + "Upper":4142113.4310109196 + }, + "Percentiles":{ + "P0":2080715, + "P25":2167930, + "P50":2286685, + "P67":3701099.0500000003, + "P80":3742690, + "P85":3826153.75, + "P90":3905142, + "P95":3968466, + "P100":4031790 + } + }, + "Memory":{ + "Gen0Collections":7, + "Gen1Collections":7, + "Gen2Collections":7, + "TotalOperations":20, + "BytesAllocatedPerOperation":1535495 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":247300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":78291700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":82175200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":77821600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":74112100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":74019400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":80636000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":46290600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41614500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":43421800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":43337800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":45177200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":42002300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":77821400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":74111900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":74019200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":80635800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":46290400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41614300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":43421600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":43337600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":45177000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":42002100 + } + ], + "Metrics":[ + { + "Value":350, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":350, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":350, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1535495, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows-small.json b/src/Titanium.Tls/design/perf-baselines/local-windows-small.json new file mode 100644 index 000000000..18c0db061 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows-small.json @@ -0,0 +1,3672 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261127-001252", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 50330,34262,34674,32798,43890,35804,43800,35274,34826,33996 + ], + "N":10, + "Min":32798, + "LowerFence":23211, + "Q1":34365, + "Median":35050, + "Mean":37965.4, + "Q3":41801, + "UpperFence":52955, + "Max":50330, + "InterquartileRange":7436, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1858.328210456317, + "Variance":34533837.37777778, + "StandardDeviation":5876.549785186694, + "Skewness":0.9605894615854426, + "Kurtosis":2.2809621763467502, + "ConfidenceInterval":{ + "N":10, + "Mean":37965.4, + "StandardError":1858.328210456317, + "Level":12, + "Margin":8884.504727720096, + "Lower":29080.895272279908, + "Upper":46849.904727720095 + }, + "Percentiles":{ + "P0":32798, + "P25":34365, + "P50":35050, + "P67":36043.880000000005, + "P80":43818, + "P85":43858.5, + "P90":44534, + "P95":47431.99999999999, + "P100":50330 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":1344 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":232700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3213000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2007900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2516700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1713300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1733900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1640100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2194700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1790400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2190200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1763900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1741500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1700000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2516500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1713100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1733700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1639900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2194500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1790200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2190000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1763700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1741300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1699800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1344, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 64265,49519,43257,48639,57853,44383,55179,41349,43105 + ], + "N":9, + "Min":41349, + "LowerFence":25374, + "Q1":43257, + "Median":48639, + "Mean":49727.666666666664, + "Q3":55179, + "UpperFence":73062, + "Max":64265, + "InterquartileRange":11922, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2616.1826303902326, + "Variance":61599704.00000001, + "StandardDeviation":7848.547891170698, + "Skewness":0.5669935370723074, + "Kurtosis":1.7371941796258112, + "ConfidenceInterval":{ + "N":9, + "Mean":49727.666666666664, + "StandardError":2616.1826303902326, + "Level":12, + "Margin":13188.975702107236, + "Lower":36538.69096455943, + "Upper":62916.6423687739 + }, + "Percentiles":{ + "P0":41349, + "P25":43257, + "P50":48639, + "P67":51556.600000000006, + "P80":56248.6, + "P85":57318.2, + "P90":59135.399999999994, + "P95":61700.2, + "P100":64265 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":1416 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":193500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3027300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2453500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4096000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":3213400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2476100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":2163000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2432100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2892800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2219300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2759100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2067600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2155400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3213250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":2475950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2162850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":2431950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2892650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2219150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2758950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2067450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2155250 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1416, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 18572,17480,17278,16740,17004,16852,16912,16910 + ], + "N":8, + "Min":16740, + "LowerFence":16246, + "Q1":16895.5, + "Median":16958, + "Mean":17218.5, + "Q3":17328.5, + "UpperFence":17978, + "Max":18572, + "InterquartileRange":433, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 18572 + ], + "AllOutliers":[ + 18572 + ], + "StandardError":211.3854806474925, + "Variance":357470.5714285714, + "StandardDeviation":597.8884272408786, + "Skewness":1.3281179548446784, + "Kurtosis":3.376017059684963, + "ConfidenceInterval":{ + "N":8, + "Mean":17218.5, + "StandardError":211.3854806474925, + "Level":12, + "Margin":1143.1478453364723, + "Lower":16075.352154663527, + "Upper":18361.647845336473 + }, + "Percentiles":{ + "P0":16740, + "P25":16895.5, + "P50":16958, + "P67":17193.06, + "P80":17399.2, + "P85":17469.9, + "P90":17807.6, + "P95":18189.8, + "P100":18572 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":1344 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":490300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2136800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":941500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":928800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":874200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1081600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":864100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":837200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":850400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":842800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1285900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":845800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":845700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":928600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":874000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":863900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":837000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":850200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":842600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":845600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":845500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1344, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 36398,36384,40662,35666,35340,35428,35436,36646,39464 + ], + "N":9, + "Min":35340, + "LowerFence":33621, + "Q1":35436, + "Median":36384, + "Mean":36824.88888888889, + "Q3":36646, + "UpperFence":38461, + "Max":40662, + "InterquartileRange":1210, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 39464,40662 + ], + "AllOutliers":[ + 39464,40662 + ], + "StandardError":640.3685667133951, + "Variance":3690647.1111111115, + "StandardDeviation":1921.1057001401853, + "Skewness":1.0103566745602224, + "Kurtosis":2.2804458118792783, + "ConfidenceInterval":{ + "N":9, + "Mean":36824.88888888889, + "StandardError":640.3685667133951, + "Level":12, + "Margin":3228.2935329772527, + "Lower":33596.59535591164, + "Upper":40053.18242186614 + }, + "Percentiles":{ + "P0":35340, + "P25":35436, + "P50":36384, + "P67":36487.28, + "P80":37773.200000000004, + "P85":38900.4, + "P90":39703.6, + "P95":40182.8, + "P100":40662 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":1416 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":177900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4423500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1890200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1820100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1819400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2033300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1783500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2247600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1767200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1771600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1772000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1832500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1973400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1819900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1819200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2033100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1783300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1767000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1771400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1771800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1832300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1973200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":1416, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 31601,28913,28765,29805,29139,28489,31295,31461,33403,33787 + ], + "N":10, + "Min":28489, + "LowerFence":25074.75, + "Q1":28969.5, + "Median":30550, + "Mean":30665.8, + "Q3":31566, + "UpperFence":35460.75, + "Max":33787, + "InterquartileRange":2596.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":611.3090653125744, + "Variance":3736987.7333333334, + "StandardDeviation":1933.1290006963668, + "Skewness":0.35602600305251697, + "Kurtosis":1.455697079937335, + "ConfidenceInterval":{ + "N":10, + "Mean":30665.8, + "StandardError":611.3090653125744, + "Level":12, + "Margin":2922.615203443573, + "Lower":27743.184796556427, + "Upper":33588.415203443576 + }, + "Percentiles":{ + "P0":28489, + "P25":28969.5, + "P50":30550, + "P67":31465.199999999997, + "P80":31961.399999999998, + "P85":32772.299999999996, + "P90":33441.4, + "P95":33614.2, + "P100":33787 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":684 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":260000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3626300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1453600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1580300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1445900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1438500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1490500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1457200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1424700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1565000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1573300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1670400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1689600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1580050 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1445650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1438250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1490250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1456950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1424450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1564750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1573050 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1670150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1689350 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":684, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 35486,34372,30142,30626,30748,37128,37180,31958,40038,29588 + ], + "N":10, + "Min":29588, + "LowerFence":21565, + "Q1":30656.5, + "Median":33165, + "Mean":33726.6, + "Q3":36717.5, + "UpperFence":45809, + "Max":40038, + "InterquartileRange":6061, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1147.1335502992763, + "Variance":13159153.822222222, + "StandardDeviation":3627.5547993410414, + "Skewness":0.33297432279320466, + "Kurtosis":1.4506323088397335, + "ConfidenceInterval":{ + "N":10, + "Mean":33726.6, + "StandardError":1147.1335502992763, + "Level":12, + "Margin":5484.3452268626215, + "Lower":28242.254773137378, + "Upper":39210.94522686262 + }, + "Percentiles":{ + "P0":29588, + "P25":30656.5, + "P50":33165, + "P67":35535.26, + "P80":37138.4, + "P85":37161.799999999996, + "P90":37465.8, + "P95":38751.899999999994, + "P100":40038 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":684 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":215400 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2623900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1542100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1774500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1718800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1507300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1531500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1537600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1856600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1859200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1598100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2002100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1479600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1774300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1718600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1507100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1531300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1537400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1856400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1859000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1597900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2001900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1479400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":684, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 15222,15414,15348,15318,15444,15268,15416,15144 + ], + "N":8, + "Min":15144, + "LowerFence":15019.5, + "Q1":15256.5, + "Median":15333, + "Mean":15321.75, + "Q3":15414.5, + "UpperFence":15651.5, + "Max":15444, + "InterquartileRange":158, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":37.19530980417519, + "Variance":11067.92857142857, + "StandardDeviation":105.20422316346702, + "Skewness":-0.3538837122305992, + "Kurtosis":1.5109896236816136, + "ConfidenceInterval":{ + "N":8, + "Mean":15321.75, + "StandardError":37.19530980417519, + "Level":12, + "Margin":201.14786563875484, + "Lower":15120.602134361245, + "Upper":15522.897865638755 + }, + "Percentiles":{ + "P0":15144, + "P25":15256.5, + "P50":15333, + "P67":15393.539999999999, + "P80":15415.2, + "P85":15415.9, + "P90":15424.4, + "P95":15434.2, + "P100":15444 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":684 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":172700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2223600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":905300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":808500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":761300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":770900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":767600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":766100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":772400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":763600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":771000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":787500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":757400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":761100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":770700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":767400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":765900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":772200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":763400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":770800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":757200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":684, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 34476,34330,34762,34846,36292,37134,35662,35738,32414,32550 + ], + "N":10, + "Min":32414, + "LowerFence":32337.75, + "Q1":34366.5, + "Median":34804, + "Mean":34820.4, + "Q3":35719, + "UpperFence":37747.75, + "Max":37134, + "InterquartileRange":1352.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":475.8300163340312, + "Variance":2264142.0444444446, + "StandardDeviation":1504.706630690662, + "Skewness":-0.2599864666452204, + "Kurtosis":1.8478738410772717, + "ConfidenceInterval":{ + "N":10, + "Mean":34820.4, + "StandardError":475.8300163340312, + "Level":12, + "Margin":2274.901713230062, + "Lower":32545.49828676994, + "Upper":37095.30171323007 + }, + "Percentiles":{ + "P0":32414, + "P25":34366.5, + "P50":34804, + "P67":35664.28, + "P80":35848.8, + "P85":36098.1, + "P90":36376.2, + "P95":36755.1, + "P100":37134 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":684 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":177100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5116000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1765800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1724000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1716700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1738300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1742500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1814800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1856900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1783300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1787100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1620900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1627700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1723800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1716500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1738100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1742300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1814600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1856700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1783100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1786900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1620700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1627500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":684, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows.md b/src/Titanium.Tls/design/perf-baselines/local-windows.md new file mode 100644 index 000000000..67015999d --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows.md @@ -0,0 +1,5 @@ +This PC, 2026-11-27. Windows 11 (10.0.26300), AMD Ryzen 5 7640HS (6 cores, 12 threads), 13.8 GiB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0 switched the power plan to High performance for the timed job and restored Balanced afterwards. One warmup, 10 iterations, one launch. + +The JSON files are the full exporter output. `tools/tls/compare-perf-baseline.ps1` prints median ratios against a fresh export. Medians are nanoseconds. + +The loopback bulk file is the run after the in-memory pipe stopped copying one byte at a time. Handshake, resumed, and small-exchange files are the earlier run on the same tree. The X25519 ceiling test stayed out of the suite. macmini and linuxmini baselines are not in this folder yet. diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/README.md b/src/Titanium.Tls/design/perf-baselines/local-windows/README.md new file mode 100644 index 000000000..c36d68292 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/README.md @@ -0,0 +1,32 @@ +This PC, 2026-11-29. Windows 11 (10.0.26300.10075), AMD Ryzen 5 7640HS (6 cores, 12 threads), 13.8 GiB RAM, .NET SDK 10.0.404, runtime 10.0.15. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs (`run1` to `run3`). The runner switched the power plan to High performance for the timed job and the plan was restored to Balanced afterwards. + +Each `runN-.json` is the full exporter output for one class in one run. Medians in this file are the median of the three run medians. A ratio is the platform median divided by the managed median, so above 1.00 means the managed stack is faster. + +No platform `QuicListener` is started on this PC, so the `Titanium.Quic` folder here holds managed-only QUIC cells: there is no platform side to divide by, and the three QUIC ratios are not computed on Windows. + +| Cell | Platform median | Managed median | Ratio | +| --- | ---: | ---: | ---: | +| Full handshake, loopback | 3.248 ms | 2.878 ms | 1.13 | +| Full handshake, in-memory | 2.389 ms | 2.033 ms | 1.17 | +| Resumed handshake, loopback | 3.227 ms | 1.544 ms | 2.09 | +| Resumed handshake, in-memory | 2.386 ms | 1.481 ms | 1.61 | +| 256 MiB, loopback, 16 KiB writes | 268.9 ms | 270.9 ms | 0.99 | +| 256 MiB, loopback, 64 KiB writes | 271.4 ms | 269.3 ms | 1.01 | +| 256 MiB, in-memory, 16 KiB writes | 79.81 ms | 61.15 ms | 1.31 | +| 256 MiB, in-memory, 64 KiB writes | 79.30 ms | 57.85 ms | 1.37 | +| 100-byte exchange, loopback | 31.77 µs | 28.16 µs | 1.13 | +| 1 KiB exchange, loopback | 32.37 µs | 29.87 µs | 1.08 | +| 100-byte exchange, in-memory | 14.58 µs | 11.60 µs | 1.26 | +| 1 KiB exchange, in-memory | 14.57 µs | 12.41 µs | 1.17 | + +The earlier exports in the parent folder (`local-windows-handshake.json`, `-resumed`, `-bulk`, `-small`) are the 2026-11-27 run of the same cells on an older tree. They are kept so a reader can see what moved between that run and this one. + +## Managed-only QUIC, this PC + +| Cell | Managed median | Allocated | +| --- | ---: | ---: | +| Handshake, loopback | 3.878 ms | 171 to 187 KB | +| 100-byte exchange, 50 on one stream | 160.8 µs | 72.5 KB | +| 64 KiB, loopback, 8 KiB writes | 2.692 ms | 334 to 355 KB | + +The managed QUIC handshake is slower here than on linuxmini even though both machines have the same CPU model. This runs on Windows with the Balanced plan restored between runs; linuxmini ran with the governor pinned to performance for the timed job. Do not compare the two absolute figures directly. diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run1-bulk.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-bulk.json new file mode 100644 index 000000000..ce4248137 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-bulk.json @@ -0,0 +1,3588 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171544", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 271917700,267821900,270317600,270912600,271199200,268354400,271109300,271846000,271167600 + ], + "N":9, + "Min":267821900, + "LowerFence":268995200, + "Q1":270317600, + "Median":271109300, + "Mean":270516255.5555556, + "Q3":271199200, + "UpperFence":272521600, + "Max":271917700, + "InterquartileRange":881600, + "LowerOutliers":[ + 267821900,268354400 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 267821900,268354400 + ], + "StandardError":487401.77760102804, + "Variance":2138044435277.7778, + "StandardDeviation":1462205.332803084, + "Skewness":-0.8423930708028444, + "Kurtosis":1.9949719113269868, + "ConfidenceInterval":{ + "N":9, + "Mean":270516255.5555556, + "StandardError":487401.77760102804, + "Level":12, + "Margin":2457141.228318979, + "Lower":268059114.3272366, + "Upper":272973396.7838746 + }, + "Percentiles":{ + "P0":267821900, + "P25":270317600, + "P50":271109300, + "P67":271178976, + "P80":271457920, + "P85":271716640, + "P90":271860340, + "P95":271889020, + "P100":271917700 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":183000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":293599900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":272960700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271917900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":267822100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":270317800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270912800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":274752400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":271199400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":268354600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271109500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271846200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":271167800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271917700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":267821900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":270317600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270912600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":271199200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":268354400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":271109300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271846000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271167600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 262768800,267132600,271782700,274302900,269268300,272084600,274804500,271860300,270956900,272084400 + ], + "N":10, + "Min":262768800, + "LowerFence":266099300, + "Q1":269690450, + "Median":271821500, + "Mean":270704600, + "Q3":272084550, + "UpperFence":275675700, + "Max":274804500, + "InterquartileRange":2394100, + "LowerOutliers":[ + 262768800 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 262768800 + ], + "StandardError":1125096.7941569393, + "Variance":12658427962222.223, + "StandardDeviation":3557868.4576895507, + "Skewness":-0.9430851330638615, + "Kurtosis":2.8668553969696795, + "ConfidenceInterval":{ + "N":10, + "Mean":270704600, + "StandardError":1125096.7941569393, + "Level":12, + "Margin":5378989.422097578, + "Lower":265325610.57790244, + "Upper":276083589.42209756 + }, + "Percentiles":{ + "P0":262768800, + "P25":269690450, + "P50":271821500, + "P67":272084406, + "P80":272528260, + "P85":273526495, + "P90":274353060, + "P95":274578780, + "P100":274804500 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":215900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":279638200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":252884600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":262769000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":267132800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271782900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":274303100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":269268500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":272084800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":274804700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271860500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":270957100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":272084600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":262768800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":267132600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271782700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":274302900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":269268300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":272084600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":274804500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271860300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":270956900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":272084400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 81495100,79122700,79221000,79931600,80252100,78984800,72504400,78880100,78864200 + ], + "N":9, + "Min":72504400, + "LowerFence":77302850, + "Q1":78880100, + "Median":79122700, + "Mean":78806222.22222222, + "Q3":79931600, + "UpperFence":81508850, + "Max":81495100, + "InterquartileRange":1051500, + "LowerOutliers":[ + 72504400 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 72504400 + ], + "StandardError":838425.8802094185, + "Variance":6326621609444.444, + "StandardDeviation":2515277.6406282554, + "Skewness":-1.5798612081622634, + "Kurtosis":4.539834149472565, + "ConfidenceInterval":{ + "N":9, + "Mean":78806222.22222222, + "StandardError":838425.8802094185, + "Level":12, + "Margin":4226760.943080825, + "Lower":74579461.2791414, + "Upper":83032983.16530305 + }, + "Percentiles":{ + "P0":72504400, + "P25":78880100, + "P50":79122700, + "P67":79476816, + "P80":80059800, + "P85":80188000, + "P90":80500700, + "P95":80997900, + "P100":81495100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":33744 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":215300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":87787700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81356000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81495300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":94595800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":79122900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":79221200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":79931800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80252300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":78985000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":72504600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":78880300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":78864400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81495100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":79122700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":79221000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":79931600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":80252100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":78984800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":72504400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":78880100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":78864200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":33744, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 82782000,84117800,78084100,78892600,77740400,77804700,77070700,79706000,80423600,80685600 + ], + "N":10, + "Min":77070700, + "LowerFence":73756225, + "Q1":77874550, + "Median":79299300, + "Mean":79730750, + "Q3":80620100, + "UpperFence":84738425, + "Max":84117800, + "InterquartileRange":2745550, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":731130.8276681175, + "Variance":5345522871666.667, + "StandardDeviation":2312038.6829953054, + "Skewness":0.6079689076988409, + "Kurtosis":1.9091250123163397, + "ConfidenceInterval":{ + "N":10, + "Mean":79730750, + "StandardError":731130.8276681175, + "Level":12, + "Margin":3495472.575000222, + "Lower":76235277.42499977, + "Upper":83226222.57500023 + }, + "Percentiles":{ + "P0":77070700, + "P25":77874550, + "P50":79299300, + "P67":80431460, + "P80":81104880, + "P85":82048260, + "P90":82915580, + "P95":83516690, + "P100":84117800 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":211800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":88800900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":79964500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82782200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84118000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":78084300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":78892800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":77740600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77804900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":77070900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79706200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80423800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80685800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82782000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84117800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":78084100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":78892600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":77740400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77804700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":77070700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79706000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80423600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80685600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 276862800,274647400,270457600,275474300,274397100,270075700,265108900,271361500,269199600,270222700 + ], + "N":10, + "Min":265108900, + "LowerFence":263403887.5, + "Q1":270112450, + "Median":270909550, + "Mean":271780760, + "Q3":274584825, + "UpperFence":281293387.5, + "Max":276862800, + "InterquartileRange":4472375, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1120365.2325320821, + "Variance":12552182542666.666, + "StandardDeviation":3542905.9460655553, + "Skewness":-0.2298259545106222, + "Kurtosis":1.9109476361630433, + "ConfidenceInterval":{ + "N":10, + "Mean":271780760, + "StandardError":1120365.2325320821, + "Level":12, + "Margin":5356368.239580406, + "Lower":266424391.7604196, + "Upper":277137128.2395804 + }, + "Percentiles":{ + "P0":265108900, + "P25":270112450, + "P50":270909550, + "P67":274404609, + "P80":274812780, + "P85":275184885, + "P90":275613150, + "P95":276237975, + "P100":276862800 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":182900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":293094200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271317700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":276863000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":274647600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":270457800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":275474500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":274397300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":270075900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":265109100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271361700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":269199800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":270222900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":276862800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":274647400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":270457600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":275474300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":274397100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":270075700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":265108900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271361500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":269199600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":270222700 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 273568900,270442100,280544700,267975700,280294400,286315100,276831500,284178000,266029300,269733600 + ], + "N":10, + "Min":266029300, + "LowerFence":254053625, + "Q1":269910725, + "Median":275200200, + "Mean":275591330, + "Q3":280482125, + "UpperFence":296339225, + "Max":286315100, + "InterquartileRange":10571400, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2239223.4258554904, + "Variance":50141215509000, + "StandardDeviation":7081046.215708523, + "Skewness":0.1216806901157557, + "Kurtosis":1.3275091838340753, + "ConfidenceInterval":{ + "N":10, + "Mean":275591330, + "StandardError":2239223.4258554904, + "Level":12, + "Margin":10705531.456442552, + "Lower":264885798.54355744, + "Upper":286296861.45644253 + }, + "Percentiles":{ + "P0":266029300, + "P25":269910725, + "P50":275200200, + "P67":280301909, + "P80":281271360, + "P85":282906345, + "P90":284391710, + "P95":285353405, + "P100":286315100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":308148100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271246000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":273569100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270442300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":280544900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":267975900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":280294600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":286315300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":276831700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":284178200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":266029500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":269733800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":273568900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270442100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":280544700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":267975700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":280294400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":286315100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":276831500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":284178000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":266029300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":269733600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 84608300,79066600,85282900,64057300,56826100,61216900,64178000,67300600,59398500,57866300 + ], + "N":10, + "Min":56826100, + "LowerFence":35445100, + "Q1":59853100, + "Median":64117650, + "Mean":67980150, + "Q3":76125100, + "UpperFence":100533100, + "Max":85282900, + "InterquartileRange":16272000, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3456372.2938701687, + "Variance":119465094338333.33, + "StandardDeviation":10930008.890130572, + "Skewness":0.5867234362102471, + "Kurtosis":1.5070970302088198, + "ConfidenceInterval":{ + "N":10, + "Mean":67980150, + "StandardError":3456372.2938701687, + "Level":12, + "Margin":16524613.796886722, + "Lower":51455536.20311328, + "Upper":84504763.79688673 + }, + "Percentiles":{ + "P0":56826100, + "P25":59853100, + "P50":64117650, + "P67":67653580, + "P80":80174940, + "P85":82668705, + "P90":84675760, + "P95":84979330, + "P100":85282900 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":195900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":88214000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82901200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84608500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":79066800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85283100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64057500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":56826300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":61217100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":64178200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":67300800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":59398700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":57866500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84608300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":79066600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85282900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64057300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":56826100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":61216900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":64178000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":67300600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":59398500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":57866300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 83932500,83910900,85453000,64651900,56528700,54837100,55221000,57654700,55222700,54786500 + ], + "N":10, + "Min":54786500, + "LowerFence":19409337.5, + "Q1":55221425, + "Median":57091700, + "Mean":65219900, + "Q3":79096150, + "UpperFence":114908237.5, + "Max":85453000, + "InterquartileRange":23874725, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4292843.435170783, + "Variance":184285047588888.88, + "StandardDeviation":13575162.89364105, + "Skewness":0.6404312850042052, + "Kurtosis":1.3683007678771937, + "ConfidenceInterval":{ + "N":10, + "Mean":65219900, + "StandardError":4292843.435170783, + "Level":12, + "Margin":20523709.203000087, + "Lower":44696190.79699992, + "Upper":85743609.20300008 + }, + "Percentiles":{ + "P0":54786500, + "P25":55221425, + "P50":57091700, + "P67":65229670.00000001, + "P80":83915220, + "P85":83924940, + "P90":84084550, + "P95":84768775, + "P100":85453000 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":201800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":85863500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":79866800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":83932700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83911100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85453200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64652100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":56528900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54837300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55221200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57654900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55222900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54786700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":83932500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83910900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":85453000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64651900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":56528700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":54837100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":55221000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57654700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55222700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54786500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run1-handshake.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-handshake.json new file mode 100644 index 000000000..514281b43 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-handshake.json @@ -0,0 +1,1859 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171605", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3179065,3088705,3515340,3644980,3091795,3277610,3218215,3008565,3314155,3486175 + ], + "N":10, + "Min":3008565, + "LowerFence":2619276.25, + "Q1":3113612.5, + "Median":3247912.5, + "Mean":3282460.5, + "Q3":3443170, + "UpperFence":3937506.25, + "Max":3644980, + "InterquartileRange":329557.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":65989.25003972658, + "Variance":43545811208.05556, + "StandardDeviation":208676.33121189274, + "Skewness":0.359140193258429, + "Kurtosis":1.6045347113601967, + "ConfidenceInterval":{ + "N":10, + "Mean":3282460.5, + "StandardError":65989.25003972658, + "Level":12, + "Margin":315488.8359643916, + "Lower":2966971.6640356085, + "Upper":3597949.3359643915 + }, + "Percentiles":{ + "P0":3008565, + "P25":3113612.5, + "P50":3247912.5, + "P67":3319315.6, + "P80":3492008, + "P85":3505132.25, + "P90":3528304, + "P95":3586642, + "P100":3644980 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6969 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":204600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":98044300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":69368600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63581400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":61774200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":70306900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":72899700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61836000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":65552300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":64364400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60171400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":66283200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69723600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63581300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":61774100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":70306800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":72899600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61835900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":65552200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":64364300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60171300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":66283100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69723500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6969, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2335300,2365615,2320670,2339765,2391380,2298495,2378070,2350160 + ], + "N":8, + "Min":2298495, + "LowerFence":2276013.125, + "Q1":2331642.5, + "Median":2344962.5, + "Mean":2347431.875, + "Q3":2368728.75, + "UpperFence":2424358.125, + "Max":2391380, + "InterquartileRange":37086.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":10794.492764893554, + "Variance":932168592.4107143, + "StandardDeviation":30531.436134101426, + "Skewness":-0.08311065865562692, + "Kurtosis":1.581553289369523, + "ConfidenceInterval":{ + "N":8, + "Mean":2347431.875, + "StandardError":10794.492764893554, + "Level":12, + "Margin":58375.34871312167, + "Lower":2289056.526286878, + "Upper":2405807.223713122 + }, + "Percentiles":{ + "P0":2298495, + "P25":2331642.5, + "P50":2344962.5, + "P67":2360823.95, + "P80":2373088, + "P85":2377447.25, + "P90":2382063, + "P95":2386721.5, + "P100":2391380 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71241 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":199300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":70349400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47237500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":46706200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47312500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46413600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":46795500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":50311500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":47827800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":49793900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":45970100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":47561600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":47003400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":46706000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47312300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46413400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":46795300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":47827600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":45969900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47561400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":47003200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71241, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3787155,3808950,3985945,3081970,2788515,2960855,2812895,2731135,2770210,2718905 + ], + "N":10, + "Min":2718905, + "LowerFence":1520677.5, + "Q1":2774786.25, + "Median":2886875, + "Mean":3144653.5, + "Q3":3610858.75, + "UpperFence":4864967.5, + "Max":3985945, + "InterquartileRange":836072.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":160863.85266403595, + "Variance":258771790939.16666, + "StandardDeviation":508696.16760809853, + "Skewness":0.6573388979275874, + "Kurtosis":1.459316262254892, + "ConfidenceInterval":{ + "N":10, + "Mean":3144653.5, + "StandardError":160863.85266403595, + "Level":12, + "Margin":769076.0176115251, + "Lower":2375577.482388475, + "Upper":3913729.517611525 + }, + "Percentiles":{ + "P0":2718905, + "P25":2774786.25, + "P50":2886875, + "P67":3103125.5500000003, + "P80":3791514, + "P85":3801321.75, + "P90":3826649.5, + "P95":3906297.25, + "P100":3985945 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":181023 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":188200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":129292000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":76370900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":75743300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":76179200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":79719100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":61639600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":55770500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":59217300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56258100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":54622900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":55404400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":54378300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":75743100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":76179000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":79718900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":61639400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":55770300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":59217100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56257900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":54622700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":55404200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":54378100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":181023, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2973915,2936090,3147975,2082395,1987955,2229175,2238360,1939615,1947160,1962135 + ], + "N":10, + "Min":1939615, + "LowerFence":778988.75, + "Q1":1968590, + "Median":2155785, + "Mean":2344477.5, + "Q3":2761657.5, + "UpperFence":3951258.75, + "Max":3147975, + "InterquartileRange":793067.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":152027.66181822526, + "Variance":231124099579.16666, + "StandardDeviation":480753.67869540706, + "Skewness":0.6517346201521624, + "Kurtosis":1.480048778220395, + "ConfidenceInterval":{ + "N":10, + "Mean":2344477.5, + "StandardError":152027.66181822526, + "Level":12, + "Margin":726830.9615967079, + "Lower":1617646.5384032922, + "Upper":3071308.461596708 + }, + "Percentiles":{ + "P0":1939615, + "P25":1968590, + "P50":2155785, + "P67":2259291.9, + "P80":2943655, + "P85":2960676.25, + "P90":2991321, + "P95":3069648, + "P100":3147975 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":245295 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":192300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":107812300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":59920200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":59478400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":58721900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":62959600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41648000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":39759200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":44583600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":44767300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":38792400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":38943300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":39242800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":59478300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":58721800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":62959500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41647900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":39759100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":44583500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":44767200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":38792300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":38943200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":39242700 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":245295, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run1-resumed.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-resumed.json new file mode 100644 index 000000000..26d17060f --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-resumed.json @@ -0,0 +1,1866 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171611", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3091532.5,3104482.5,3338147.5,3491592.5,3137922.5,3161137.5,3307042.5,3037422.5,3292757.5,3489432.5 + ], + "N":10, + "Min":3037422.5, + "LowerFence":2786549.375, + "Q1":3112842.5, + "Median":3226947.5, + "Mean":3245147, + "Q3":3330371.25, + "UpperFence":3656664.375, + "Max":3491592.5, + "InterquartileRange":217528.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":51666.211736975645, + "Variance":26693974352.5, + "StandardDeviation":163382.90716136742, + "Skewness":0.30949610373991365, + "Kurtosis":1.4506365814383175, + "ConfidenceInterval":{ + "N":10, + "Mean":3245147, + "StandardError":51666.211736975645, + "Level":12, + "Margin":247011.6418928129, + "Lower":2998135.358107187, + "Upper":3492158.641892813 + }, + "Percentiles":{ + "P0":3037422.5, + "P25":3112842.5, + "P50":3226947.5, + "P67":3307975.65, + "P80":3368404.5, + "P85":3436482.7499999995, + "P90":3489648.5, + "P95":3490620.5, + "P100":3491592.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6969 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":246200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63826700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":62840400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":61830800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62089800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":66763100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":69832000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62758600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":63222900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":66141000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60748600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":65855300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69788800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":61830650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62089650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":66762950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":69831850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62758450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":63222750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":66140850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":60748450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":65855150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69788650 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6969, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2393270,2384530,2344660,2364210,2427890,2345855,2370015,2330370 + ], + "N":8, + "Min":2330370, + "LowerFence":2283818.125, + "Q1":2345556.25, + "Median":2367112.5, + "Mean":2370100, + "Q3":2386715, + "UpperFence":2448453.125, + "Max":2427890, + "InterquartileRange":41158.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":11126.660189126193, + "Variance":990420535.7142857, + "StandardDeviation":31470.947486758098, + "Skewness":0.460428271384976, + "Kurtosis":1.8785978317290457, + "ConfidenceInterval":{ + "N":8, + "Mean":2370100, + "StandardError":11126.660189126193, + "Level":12, + "Margin":60171.671119653096, + "Lower":2309928.328880347, + "Upper":2430271.671119653 + }, + "Percentiles":{ + "P0":2330370, + "P25":2345556.25, + "P50":2367112.5, + "P67":2380030.35, + "P80":2389774, + "P85":2392833, + "P90":2403656, + "P95":2415773, + "P100":2427890 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71241 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":183300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48386400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47541700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47865500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47690700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46893300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47284300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":52912500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":57097800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":48557900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46917200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":47400400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":46607500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47865400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47690600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46893200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47284200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":48557800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":46917100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47400300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46607400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71241, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2520325,2633130,2563785,1636895,1478420,1455600,1485630,1601750,1463785,1449250 + ], + "N":10, + "Min":1449250, + "LowerFence":219408.125, + "Q1":1467443.75, + "Median":1543690, + "Mean":1828857, + "Q3":2299467.5, + "UpperFence":3547503.125, + "Max":2633130, + "InterquartileRange":832023.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":163667.68193201735, + "Variance":267871101090, + "StandardDeviation":517562.65426516236, + "Skewness":0.7142161115073966, + "Kurtosis":1.4349849669675983, + "ConfidenceInterval":{ + "N":10, + "Mean":1828857, + "StandardError":163667.68193201735, + "Level":12, + "Margin":782480.880243936, + "Lower":1046376.119756064, + "Upper":2611337.880243936 + }, + "Percentiles":{ + "P0":1449250, + "P25":1467443.75, + "P50":1543690, + "P67":1663397.9000000004, + "P80":2529017, + "P85":2548574, + "P90":2570719.5, + "P95":2601924.75, + "P100":2633130 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":174768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":202400 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":56144300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":52551600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":50406600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":52662700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":51275800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32738000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29568500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29112100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":29712700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":32035100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":29275800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":28985100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":50406500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":52662600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":51275700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32737900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29568400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29112000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":29712600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":32035000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":29275700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":28985000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":174768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1862845,1815870,1809720,1809125,1820040,1152785,872410,824685,791550,823945 + ], + "N":10, + "Min":791550, + "LowerFence":-629958.125, + "Q1":836616.25, + "Median":1480955, + "Mean":1358297.5, + "Q3":1814332.5, + "UpperFence":3280906.875, + "Max":1862845, + "InterquartileRange":977716.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":158253.46373469292, + "Variance":250441587840.27777, + "StandardDeviation":500441.3930124863, + "Skewness":-0.08269093921656087, + "Kurtosis":0.8932154957827083, + "ConfidenceInterval":{ + "N":10, + "Mean":1358297.5, + "StandardError":158253.46373469292, + "Level":12, + "Margin":756595.9763284832, + "Lower":601701.5236715168, + "Upper":2114893.4763284833 + }, + "Percentiles":{ + "P0":791550, + "P25":836616.25, + "P50":1480955, + "P67":1809904.5, + "P80":1816704, + "P85":1818580.5, + "P90":1824320.5, + "P95":1843582.75, + "P100":1862845 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":239040 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":190100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":39116300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":36939800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37257000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36317500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36194500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36182600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":36400900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":23055800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17448300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16493800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":15831100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16479000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37256900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36317400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36194400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36182500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":36400800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":23055700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17448200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16493700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":15831000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16478900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":239040, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run1-small.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-small.json new file mode 100644 index 000000000..8e54d68c4 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run1-small.json @@ -0,0 +1,3623 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171615", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 38480,31602,40924,41396,37358,37578,40960,38068 + ], + "N":8, + "Min":31602, + "LowerFence":32408, + "Q1":37523, + "Median":38274, + "Mean":38295.75, + "Q3":40933, + "UpperFence":46048, + "Max":41396, + "InterquartileRange":3410, + "LowerOutliers":[ + 31602 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 31602 + ], + "StandardError":1117.2680607816806, + "Variance":9986303.357142856, + "StandardDeviation":3160.1112887274803, + "Skewness":-0.9278886973467897, + "Kurtosis":2.7564570540333695, + "ConfidenceInterval":{ + "N":8, + "Mean":38295.75, + "StandardError":1117.2680607816806, + "Level":12, + "Margin":6042.054413735759, + "Lower":32253.695586264243, + "Upper":44337.80441373576 + }, + "Percentiles":{ + "P0":31602, + "P25":37523, + "P50":38274, + "P67":40166.36, + "P80":40945.6, + "P85":40958.2, + "P90":41090.8, + "P95":41243.4, + "P100":41396 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":249400 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4416500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2011500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1924200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1580300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2046400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":2733200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":2832200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2070000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1868100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1879100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":2048200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1903600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1924000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1580100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2046200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":2069800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1867900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1878900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2048000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1903400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 31660,31508,31736,31738,31666,31476,31590,31688 + ], + "N":8, + "Min":31476, + "LowerFence":31373.75, + "Q1":31569.5, + "Median":31663, + "Mean":31632.75, + "Q3":31700, + "UpperFence":31895.75, + "Max":31738, + "InterquartileRange":130.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":34.99987244874717, + "Variance":9799.92857142857, + "StandardDeviation":98.99458859669336, + "Skewness":-0.43534033850843146, + "Kurtosis":1.4274178127960897, + "ConfidenceInterval":{ + "N":8, + "Mean":31632.75, + "StandardError":34.99987244874717, + "Level":12, + "Margin":189.27519834513902, + "Lower":31443.474801654862, + "Upper":31822.025198345138 + }, + "Percentiles":{ + "P0":31476, + "P25":31569.5, + "P50":31663, + "P67":31681.18, + "P80":31716.8, + "P85":31733.6, + "P90":31736.6, + "P95":31737.3, + "P100":31738 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2738800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1607900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1688000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1583200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1575600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1587000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1587100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1613500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1583500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1574000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1579700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1584600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1583000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1575400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1586800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1586900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1583300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1573800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1579500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1584400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14477,14899,14437,14625,14949,14381,15559,14541 + ], + "N":8, + "Min":14381, + "LowerFence":13800.25, + "Q1":14467, + "Median":14583, + "Mean":14733.5, + "Q3":14911.5, + "UpperFence":15578.25, + "Max":15559, + "InterquartileRange":444.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":139.00603789558411, + "Variance":154581.42857142858, + "StandardDeviation":393.168448087367, + "Skewness":0.9911832325227076, + "Kurtosis":2.5961562781058034, + "ConfidenceInterval":{ + "N":8, + "Mean":14733.5, + "StandardError":139.00603789558411, + "Level":12, + "Margin":751.7283222213681, + "Lower":13981.771677778632, + "Upper":15485.228322221368 + }, + "Percentiles":{ + "P0":14381, + "P25":14467, + "P50":14583, + "P67":14814.06, + "P80":14929, + "P85":14946.5, + "P90":15132, + "P95":15345.5, + "P100":15559 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":174300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1893400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":743100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":724000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":745100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":854800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":873400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":722000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":731400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":747600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":719200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":778100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":727200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":723850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":744950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":721850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":731250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":747450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":719050 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":777950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":727050 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14326,14338,17956,15936,17996,15062,14240,14376,17738,14368 + ], + "N":10, + "Min":14240, + "LowerFence":9932.5, + "Q1":14345.5, + "Median":14719, + "Mean":15633.6, + "Q3":17287.5, + "UpperFence":21700.5, + "Max":17996, + "InterquartileRange":2942, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":519.9889571477028, + "Variance":2703885.1555555556, + "StandardDeviation":1644.3494627224334, + "Skewness":0.5338885748663669, + "Kurtosis":1.2931711805961992, + "ConfidenceInterval":{ + "N":10, + "Mean":15633.6, + "StandardError":519.9889571477028, + "Level":12, + "Margin":2486.0217490895184, + "Lower":13147.578250910483, + "Upper":18119.621749089518 + }, + "Percentiles":{ + "P0":14240, + "P25":14345.5, + "P50":14719, + "P67":15990.060000000001, + "P80":17781.6, + "P85":17879.7, + "P90":17960, + "P95":17978, + "P100":17996 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":176100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2291600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":727100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":716500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":717100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":898000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":797000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":900000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":753300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":712200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":719000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":887100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":718600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":716300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":716900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":897800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":796800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":899800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":753100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":712000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":718800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":886900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":718400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 29000,28400,28634,28894,28238,28102,28146,28204,28272 + ], + "N":9, + "Min":28102, + "LowerFence":27559, + "Q1":28204, + "Median":28272, + "Mean":28432.222222222223, + "Q3":28634, + "UpperFence":29279, + "Max":29000, + "InterquartileRange":430, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":110.7933233269368, + "Variance":110476.44444444444, + "StandardDeviation":332.3799699808104, + "Skewness":0.6260612259443583, + "Kurtosis":1.588144635222105, + "ConfidenceInterval":{ + "N":9, + "Mean":28432.222222222223, + "StandardError":110.7933233269368, + "Level":12, + "Margin":558.5429825656777, + "Lower":27873.679239656543, + "Upper":28990.765204787902 + }, + "Percentiles":{ + "P0":28102, + "P25":28204, + "P50":28272, + "P67":28484.24, + "P80":28738, + "P85":28842, + "P90":28915.199999999997, + "P95":28957.6, + "P100":29000 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":177600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2611100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1499200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1450100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1420100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1431800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1520400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1444800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1412000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1405200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1407400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1410300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1413700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1450000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1420000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1431700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1444700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1411900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1405100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1407300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1410200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1413600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 28382,28374,28556,28606,28492,28440,28572,28598 + ], + "N":8, + "Min":28374, + "LowerFence":28196, + "Q1":28425.5, + "Median":28524, + "Mean":28502.5, + "Q3":28578.5, + "UpperFence":28808, + "Max":28606, + "InterquartileRange":153, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":33.42742672032738, + "Variance":8939.142857142857, + "StandardDeviation":94.54704044623955, + "Skewness":-0.24377920605351283, + "Kurtosis":1.139146812883298, + "ConfidenceInterval":{ + "N":8, + "Mean":28502.5, + "StandardError":33.42742672032738, + "Level":12, + "Margin":180.77159658003387, + "Lower":28321.728403419966, + "Upper":28683.271596580034 + }, + "Percentiles":{ + "P0":28374, + "P25":28425.5, + "P50":28524, + "P67":28567.04, + "P80":28587.6, + "P85":28596.7, + "P90":28600.4, + "P95":28603.199999999997, + "P100":28606 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":174300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2667000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1488900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1562900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1419300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1418900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1428000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1688100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1430500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1424800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1422200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1428800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1430100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1419100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1418700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1427800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1430300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1424600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1422000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1428600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1429900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11082,12134,12472,12240,11952,12310,12382,12496,12312 + ], + "N":9, + "Min":11082, + "LowerFence":11762, + "Q1":12134, + "Median":12310, + "Mean":12153.333333333334, + "Q3":12382, + "UpperFence":12754, + "Max":12496, + "InterquartileRange":248, + "LowerOutliers":[ + 11082 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 11082 + ], + "StandardError":145.16044762798012, + "Variance":189644, + "StandardDeviation":435.48134288394033, + "Skewness":-1.5401416154277363, + "Kurtosis":4.161815135888032, + "ConfidenceInterval":{ + "N":9, + "Mean":12153.333333333334, + "StandardError":145.16044762798012, + "Level":12, + "Margin":731.7981529396777, + "Lower":11421.535180393656, + "Upper":12885.131486273012 + }, + "Percentiles":{ + "P0":11082, + "P25":12134, + "P50":12310, + "P67":12337.2, + "P80":12418, + "P85":12454, + "P90":12476.800000000001, + "P95":12486.400000000001, + "P100":12496 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":191800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1886600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":576500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":554300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":606900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":623800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":745200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":612200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":597800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":615700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":619300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":625000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":615800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":554100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":606700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":623600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":612000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":597600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":615500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":619100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":624800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":615600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11900,12148,11656,12396,12026,12592,12414,12454,12942 + ], + "N":9, + "Min":11656, + "LowerFence":11384, + "Q1":12026, + "Median":12396, + "Mean":12280.888888888889, + "Q3":12454, + "UpperFence":13096, + "Max":12942, + "InterquartileRange":428, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":129.79604133285042, + "Variance":151623.1111111111, + "StandardDeviation":389.38812399855124, + "Skewness":0.018743509158980293, + "Kurtosis":1.8358256904443626, + "ConfidenceInterval":{ + "N":9, + "Mean":12280.888888888889, + "StandardError":129.79604133285042, + "Level":12, + "Margin":654.3414880456284, + "Lower":11626.547400843261, + "Upper":12935.230376934516 + }, + "Percentiles":{ + "P0":11656, + "P25":12026, + "P50":12396, + "P67":12428.400000000001, + "P80":12509.2, + "P85":12564.400000000001, + "P90":12662, + "P95":12802, + "P100":12942 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":180000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1853900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":609100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":595200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":607600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":583000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":620000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":601500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":629800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":620900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":622900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":647300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":681200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":595000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":607400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":582800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":619800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":601300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":629600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":620700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":622700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":647100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run2-bulk.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-bulk.json new file mode 100644 index 000000000..709faf6f1 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-bulk.json @@ -0,0 +1,3686 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171630", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 269039800,270470200,263603500,272239300,269861900,267207900,267497600,267175000,267153600,272087600 + ], + "N":10, + "Min":263603500, + "LowerFence":262480875, + "Q1":267183225, + "Median":268268700, + "Mean":268633640, + "Q3":270318125, + "UpperFence":275020475, + "Max":272239300, + "InterquartileRange":3134900, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":836134.9161734871, + "Variance":6991215980444.444, + "StandardDeviation":2644090.766302179, + "Skewness":-0.22605804532991863, + "Kurtosis":2.0057471223278274, + "ConfidenceInterval":{ + "N":10, + "Mean":268633640, + "StandardError":836134.9161734871, + "Level":12, + "Margin":3997487.9431718206, + "Lower":264636152.05682817, + "Upper":272631127.9431718 + }, + "Percentiles":{ + "P0":263603500, + "P25":267183225, + "P50":268268700, + "P67":269880149, + "P80":270793680, + "P85":271521510, + "P90":272102770, + "P95":272171035, + "P100":272239300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":182300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":278682700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":267361200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":269040000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270470400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":263603700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272239500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":269862100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267208100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":267497800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":267175200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":267153800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":272087800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":269039800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270470200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":263603500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272239300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":269861900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267207900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":267497600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":267175000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":267153600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":272087600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 273159600,270572200,264664200,272105900,271389700,267185000,266867500,272637900,272623400 + ], + "N":9, + "Min":264664200, + "LowerFence":259027400, + "Q1":267185000, + "Median":271389700, + "Mean":270133933.3333333, + "Q3":272623400, + "UpperFence":280781000, + "Max":273159600, + "InterquartileRange":5438400, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1031203.5142384736, + "Variance":9570426190000, + "StandardDeviation":3093610.542715421, + "Skewness":-0.5838671495309325, + "Kurtosis":1.5330154937412135, + "ConfidenceInterval":{ + "N":9, + "Mean":270133933.3333333, + "StandardError":1031203.5142384736, + "Level":12, + "Margin":5198611.876415583, + "Lower":264935321.45691773, + "Upper":275332545.2097489 + }, + "Percentiles":{ + "P0":264664200, + "P25":267185000, + "P50":271389700, + "P67":272292200, + "P80":272629200, + "P85":272635000, + "P90":272742240, + "P95":272950920, + "P100":273159600 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":295958800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":273546200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":273159800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270572400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":264664400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272106100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":271389900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267185200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266867700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":281308400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":272638100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":272623600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":273159600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":270572200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":264664200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272105900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":271389700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267185000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266867500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":272637900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":272623400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 80627200,82126300,79341300,80313900,79390800,79774600,78673400,79978000,81303200 + ], + "N":9, + "Min":78673400, + "LowerFence":77536200, + "Q1":79390800, + "Median":79978000, + "Mean":80169855.55555555, + "Q3":80627200, + "UpperFence":82481800, + "Max":82126300, + "InterquartileRange":1236400, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":354884.64170734846, + "Variance":1133487980277.7778, + "StandardDeviation":1064653.9251220454, + "Skewness":0.4218275056841356, + "Kurtosis":1.92208505642722, + "ConfidenceInterval":{ + "N":9, + "Mean":80169855.55555555, + "StandardError":354884.64170734846, + "Level":12, + "Margin":1789081.871486584, + "Lower":78380773.68406896, + "Upper":81958937.42704214 + }, + "Percentiles":{ + "P0":78673400, + "P25":79390800, + "P50":79978000, + "P67":80426688, + "P80":80897600, + "P85":81168000, + "P90":81467820, + "P95":81797060, + "P100":82126300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84445200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82140700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":80627300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":98305300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":82126400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":79341400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":80314000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":79390900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":79774700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":78673500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":79978100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":81303300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":80627200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":82126300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":79341300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80313900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":79390800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":79774600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":78673400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79978000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":81303200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 82471200,84296600,78466300,75139400,77698400,79410000,78829600,78916600,80184000 + ], + "N":9, + "Min":75139400, + "LowerFence":75889750, + "Q1":78466300, + "Median":78916600, + "Mean":79490233.33333333, + "Q3":80184000, + "UpperFence":82760550, + "Max":84296600, + "InterquartileRange":1717700, + "LowerOutliers":[ + 75139400 + ], + "UpperOutliers":[ + 84296600 + ], + "AllOutliers":[ + 75139400,84296600 + ], + "StandardError":885292.0174219977, + "Variance":7053677604999.998, + "StandardDeviation":2655876.0522659933, + "Skewness":0.28582854972536187, + "Kurtosis":2.1950077873739393, + "ConfidenceInterval":{ + "N":9, + "Mean":79490233.33333333, + "StandardError":885292.0174219977, + "Level":12, + "Margin":4463027.455123271, + "Lower":75027205.87821005, + "Upper":83953260.7884566 + }, + "Percentiles":{ + "P0":75139400, + "P25":78466300, + "P50":78916600, + "P67":79688640, + "P80":81098880, + "P85":82013760, + "P90":82836280, + "P95":83566440, + "P100":84296600 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":174700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84069800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":80973700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82471400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":94135100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":84296800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":78466500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":75139600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77698600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":79410200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":78829800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":78916800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":80184200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82471200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84296600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":78466300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":75139400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":77698400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":79410000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":78829600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":78916600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":80184000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 267905800,268427000,266915000,272852900,274414100,277628500,266321200,271763400,268966000,271692600 + ], + "N":10, + "Min":266321200, + "LowerFence":261219462.5, + "Q1":268036100, + "Median":270329300, + "Mean":270688650, + "Q3":272580525, + "UpperFence":279397162.5, + "Max":277628500, + "InterquartileRange":4544425, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1145180.0860078246, + "Variance":13114374293888.889, + "StandardDeviation":3621377.4028522475, + "Skewness":0.4696619879068277, + "Kurtosis":1.8594577943298045, + "ConfidenceInterval":{ + "N":10, + "Mean":270688650, + "StandardError":1145180.0860078246, + "Level":12, + "Margin":5475005.884848019, + "Lower":265213644.11515197, + "Upper":276163655.884848 + }, + "Percentiles":{ + "P0":266321200, + "P25":268036100, + "P50":270329300, + "P67":271796085, + "P80":273165140, + "P85":273867680, + "P90":274735540, + "P95":276182020, + "P100":277628500 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":183100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":289502100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":275288500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":267906000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":268427200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":266915200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272853100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":274414300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":277628700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266321400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271763600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268966200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":271692800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":267905800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":268427000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":266915000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":272852900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":274414100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":277628500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266321200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":271763400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268966000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":271692600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 271663000,271640100,267734700,270438900,268513700,275277800,269202400,267134300,269279600 + ], + "N":9, + "Min":267134300, + "LowerFence":263824100, + "Q1":268513700, + "Median":269279600, + "Mean":270098277.7777778, + "Q3":271640100, + "UpperFence":276329700, + "Max":275277800, + "InterquartileRange":3126400, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":834369.5770157147, + "Variance":6265553319444.443, + "StandardDeviation":2503108.731047144, + "Skewness":0.7226310110248135, + "Kurtosis":2.397742965286894, + "ConfidenceInterval":{ + "N":9, + "Mean":270098277.7777778, + "StandardError":834369.5770157147, + "Level":12, + "Margin":4206311.879762123, + "Lower":265891965.89801568, + "Upper":274304589.6575399 + }, + "Percentiles":{ + "P0":267134300, + "P25":268513700, + "P50":269279600, + "P67":270871332, + "P80":271649260, + "P85":271658420, + "P90":272385960, + "P95":273831880, + "P100":275277800 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":297671500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":272108800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":278744500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":271663200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271640300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":267734900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":270439100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":268513900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":275278000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":269202600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":267134500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":269279800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271663000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":271640100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":267734700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270438900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":268513700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":275277800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":269202400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":267134300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":269279600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 73572200,76434100,82566100,69147300,62858000,55903500,58089700,57235800,58676000,59433800 + ], + "N":10, + "Min":55903500, + "LowerFence":36891725, + "Q1":58236275, + "Median":61145900, + "Mean":65391650, + "Q3":72465975, + "UpperFence":93810525, + "Max":82566100, + "InterquartileRange":14229700, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2971719.3065911634, + "Variance":88311156371666.67, + "StandardDeviation":9397401.575524304, + "Skewness":0.5658631568327517, + "Kurtosis":1.6060722032517871, + "ConfidenceInterval":{ + "N":10, + "Mean":65391650, + "StandardError":2971719.3065911634, + "Level":12, + "Margin":14207530.23083212, + "Lower":51184119.76916788, + "Upper":79599180.23083211 + }, + "Percentiles":{ + "P0":55903500, + "P25":58236275, + "P50":61145900, + "P67":69280047, + "P80":74144580, + "P85":75432435, + "P90":77047300, + "P95":79806700, + "P100":82566100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":198500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":82607100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84789600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":73572400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":76434300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":82566300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":69147500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":62858200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55903700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":58089900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57236000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":58676200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":59434000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":73572200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":76434100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":82566100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":69147300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":62858000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55903500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":58089700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57235800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":58676000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":59433800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 78599800,83589300,80763000,64355200,57402900,56728200,57835500,57854600,55142800,55800800 + ], + "N":10, + "Min":55142800, + "LowerFence":29684212.5, + "Q1":56896875, + "Median":57845050, + "Mean":64807210, + "Q3":75038650, + "UpperFence":102251312.5, + "Max":83589300, + "InterquartileRange":18141775, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3635241.0408680066, + "Variance":132149774252111.11, + "StandardDeviation":11495641.532864144, + "Skewness":0.6628837276316479, + "Kurtosis":1.447110836038685, + "ConfidenceInterval":{ + "N":10, + "Mean":64807210, + "StandardError":3635241.0408680066, + "Level":12, + "Margin":17379769.640403427, + "Lower":47427440.35959657, + "Upper":82186979.64040342 + }, + "Percentiles":{ + "P0":55142800, + "P25":56896875, + "P50":57845050, + "P67":64782538.00000001, + "P80":79032440, + "P85":80005880, + "P90":81045630, + "P95":82317465, + "P100":83589300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":194800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":91225200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":93443200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":78600000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83589500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80763200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64355400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":57403100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":56728400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":57835700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57854800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55143000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55801000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":78599800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83589300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80763000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":64355200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":57402900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":56728200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":57835500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":57854600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":55142800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":55800800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run2-handshake.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-handshake.json new file mode 100644 index 000000000..155bca2c3 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-handshake.json @@ -0,0 +1,1845 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171651", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3255212.5,3320412.5,3568982.5,3461642.5,3068817.5,3293247.5,3239947.5,3054517.5,3612232.5,3413157.5 + ], + "N":10, + "Min":3054517.5, + "LowerFence":2935127.5, + "Q1":3243763.75, + "Median":3306830, + "Mean":3328817, + "Q3":3449521.25, + "UpperFence":3758157.5, + "Max":3612232.5, + "InterquartileRange":205757.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":59651.85454158152, + "Variance":35583437502.5, + "StandardDeviation":188635.72700445692, + "Skewness":0.0029889989262767546, + "Kurtosis":1.6162719614022487, + "ConfidenceInterval":{ + "N":10, + "Mean":3328817, + "StandardError":59651.85454158152, + "Level":12, + "Margin":285190.30207361234, + "Lower":3043626.6979263877, + "Upper":3614007.3020736123 + }, + "Percentiles":{ + "P0":3054517.5, + "P25":3243763.75, + "P50":3306830, + "P67":3414612.05, + "P80":3483110.5, + "P85":3531413.5, + "P90":3573307.5, + "P95":3592770, + "P100":3612232.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6945 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":248000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":108168100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63482800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":65104400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":66408400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":71379800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":69233000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61376500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":65865100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":64799100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":61090500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":72244800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":68263300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":65104250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":66408250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":71379650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":69232850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61376350 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":65864950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":64798950 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":61090350 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":72244650 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":68263150 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6945, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2371840,2381775,2388670,2380180,2505985,2548035,2389245,2348665,2542195 + ], + "N":9, + "Min":2348665, + "LowerFence":2191472.5, + "Q1":2380180, + "Median":2388670, + "Mean":2428510, + "Q3":2505985, + "UpperFence":2694692.5, + "Max":2548035, + "InterquartileRange":125805, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":26470.24229362726, + "Variance":6306063543.75, + "StandardDeviation":79410.72688088178, + "Skewness":0.5795818571253334, + "Kurtosis":1.3222808981404435, + "ConfidenceInterval":{ + "N":9, + "Mean":2428510, + "StandardError":26470.24229362726, + "Level":12, + "Margin":133444.57622496595, + "Lower":2295065.423775034, + "Upper":2561954.576224966 + }, + "Percentiles":{ + "P0":2348665, + "P25":2380180, + "P50":2388670, + "P67":2431271.4000000004, + "P80":2520469, + "P85":2534953, + "P90":2543363, + "P95":2545699, + "P100":2548035 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71241 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":202000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":69879800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47878000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47436900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47635600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47773500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47603700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":50119800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":58333900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":50960800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":47785000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":46973400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":50844000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47436800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47635500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47773400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47603600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":50119700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":50960700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47784900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46973300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":50843900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71241, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3785860,3771950,3837495,2938760,2742965,3050450,2816595,2719780,2700800,2768100 + ], + "N":10, + "Min":2700800, + "LowerFence":1485759.375, + "Q1":2749248.75, + "Median":2877677.5, + "Mean":3113275.5, + "Q3":3591575, + "UpperFence":4855064.375, + "Max":3837495, + "InterquartileRange":842326.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":153274.9400359621, + "Variance":234932072430.27777, + "StandardDeviation":484697.9187393709, + "Skewness":0.6280647810772905, + "Kurtosis":1.381644680542665, + "ConfidenceInterval":{ + "N":10, + "Mean":3113275.5, + "StandardError":153274.9400359621, + "Level":12, + "Margin":732794.0897244051, + "Lower":2380481.410275595, + "Upper":3846069.589724405 + }, + "Percentiles":{ + "P0":2700800, + "P25":2749248.75, + "P50":2877677.5, + "P67":3072095, + "P80":3774732, + "P85":3780991.5, + "P90":3791023.5, + "P95":3814259.25, + "P100":3837495 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":181023 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":189000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":129739100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":76447100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":75717400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":75439200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":76750100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":58775400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":54859500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":61009200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56332100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":54395800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":54016200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":55362200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":75717200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":75439000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":76749900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":58775200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":54859300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":61009000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":56331900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":54395600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":54016000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":55362000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":181023, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3111760,2951345,2750075,2004580,2002225,2059635,1996575,1952900,2007580,2059360 + ], + "N":10, + "Min":1952900, + "LowerFence":1140836.875, + "Q1":2002813.75, + "Median":2033470, + "Mean":2289603.5, + "Q3":2577465, + "UpperFence":3439441.875, + "Max":3111760, + "InterquartileRange":574651.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":144313.38226244916, + "Variance":208263523000.27777, + "StandardDeviation":456358.9847918826, + "Skewness":0.8271236703585395, + "Kurtosis":1.7042405497057285, + "ConfidenceInterval":{ + "N":10, + "Mean":2289603.5, + "StandardError":144313.38226244916, + "Level":12, + "Margin":689949.6653872414, + "Lower":1599653.8346127586, + "Upper":2979553.165387241 + }, + "Percentiles":{ + "P0":1952900, + "P25":2002813.75, + "P50":2033470, + "P67":2080348.2000000002, + "P80":2790329, + "P85":2880900.5, + "P90":2967386.5, + "P95":3039573.25, + "P100":3111760 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":245295 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":192100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":109402400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":60277400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":62235300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":59027000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":55001600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40091700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":40044600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41192800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":39931600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":39058100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":40151700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41187300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":62235200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":59026900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":55001500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40091600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":40044500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41192700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":39931500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":39058000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":40151600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41187200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":245295, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run2-resumed.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-resumed.json new file mode 100644 index 000000000..a29834e72 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-resumed.json @@ -0,0 +1,1831 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171658", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3081710,3112830,3291350,3615435,3142240,3109165,3615100,3318280,3065655,3353430 + ], + "N":10, + "Min":3065655, + "LowerFence":2758239.375, + "Q1":3110081.25, + "Median":3216795, + "Mean":3270519.5, + "Q3":3344642.5, + "UpperFence":3696484.375, + "Max":3615435, + "InterquartileRange":234561.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":66019.09850544934, + "Variance":43585213674.72222, + "StandardDeviation":208770.72034823807, + "Skewness":0.6272288257374306, + "Kurtosis":1.7320433326022713, + "ConfidenceInterval":{ + "N":10, + "Mean":3270519.5, + "StandardError":66019.09850544934, + "Level":12, + "Margin":315631.538869797, + "Lower":2954887.9611302027, + "Upper":3586151.0388697973 + }, + "Percentiles":{ + "P0":3065655, + "P25":3110081.25, + "P50":3216795, + "P67":3319334.5, + "P80":3405764, + "P85":3523515.4999999995, + "P90":3615133.5, + "P95":3615284.25, + "P100":3615435 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6945 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":176000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63716900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63105800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":61634400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62256800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":65827200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":72308900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62845000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":62183500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":72302200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":66365800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":61313300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":67068800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":61634200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62256600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":65827000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":72308700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":62844800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":62183300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":72302000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":66365600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":61313100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":67068600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6945, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2363075,2383710,2342640,2444875,2877310,2610250,2388850,2347585,2332045,2640995 + ], + "N":10, + "Min":2332045, + "LowerFence":2025284.375, + "Q1":2351457.5, + "Median":2386280, + "Mean":2473133.5, + "Q3":2568906.25, + "UpperFence":2895079.375, + "Max":2877310, + "InterquartileRange":217448.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":56866.871053022696, + "Variance":32338410233.61111, + "StandardDeviation":179828.83593464957, + "Skewness":1.0945889805357776, + "Kurtosis":2.7759311431287346, + "ConfidenceInterval":{ + "N":10, + "Mean":2473133.5, + "StandardError":56866.871053022696, + "Level":12, + "Margin":271875.5394652099, + "Lower":2201257.96053479, + "Upper":2745009.03946521 + }, + "Percentiles":{ + "P0":2332045, + "P25":2351457.5, + "P50":2386280, + "P67":2449836.25, + "P80":2616399, + "P85":2630234.25, + "P90":2664626.5, + "P95":2770968.25, + "P100":2877310 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71241 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":184100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48169600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47861800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47261700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47674400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46853000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":48897700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":57546400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":52205200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47777200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46951900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":46641100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":52820100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47261500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47674200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":46852800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":48897500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":57546200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":52205000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47777000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46951700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":46640900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":52819900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71241, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2682710,2703245,2665280,1631365,1442770,1489085,1445290,1511715,1571280,1431840 + ], + "N":10, + "Min":1431840, + "LowerFence":30395, + "Q1":1456238.75, + "Median":1541497.5, + "Mean":1857458, + "Q3":2406801.25, + "UpperFence":3832645, + "Max":2703245, + "InterquartileRange":950562.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":181359.83132252118, + "Variance":328913884173.3333, + "StandardDeviation":573510.1430431142, + "Skewness":0.7153952188103474, + "Kurtosis":1.418576896570582, + "ConfidenceInterval":{ + "N":10, + "Mean":1857458, + "StandardError":181359.83132252118, + "Level":12, + "Margin":867065.4999139264, + "Lower":990392.5000860736, + "Upper":2724523.4999139262 + }, + "Percentiles":{ + "P0":1431840, + "P25":1456238.75, + "P50":1541497.5, + "P67":1662382.4500000002, + "P80":2668766, + "P85":2676609.5, + "P90":2684763.5, + "P95":2694004.25, + "P100":2703245 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":174768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":232300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":54506800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":50604100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":53654300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":54065000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":53305700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32627400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28855500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29781800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":28905900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":30234400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":31425700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":28636900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":53654200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":54064900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":53305600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32627300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":28855400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29781700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":28905800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":30234300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":31425600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":28636800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":174768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1843925,1831735,1814670,1824650,1894100,1053355,805045,840620,817920,806320 + ], + "N":10, + "Min":805045, + "LowerFence":-685958.125, + "Q1":823595, + "Median":1434012.5, + "Mean":1353234, + "Q3":1829963.75, + "UpperFence":3339516.875, + "Max":1894100, + "InterquartileRange":1006368.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":164530.33597148245, + "Variance":270702314548.8889, + "StandardDeviation":520290.60586261685, + "Skewness":-0.03866107821432136, + "Kurtosis":0.8593504119617316, + "ConfidenceInterval":{ + "N":10, + "Mean":1353234, + "StandardError":164530.33597148245, + "Level":12, + "Margin":786605.1537973856, + "Lower":566628.8462026144, + "Upper":2139839.1537973857 + }, + "Percentiles":{ + "P0":805045, + "P25":823595, + "P50":1434012.5, + "P67":1824862.55, + "P80":1834173, + "P85":1839658.5, + "P90":1848942.5, + "P95":1871521.25, + "P100":1894100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":239024 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":190700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":38832000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":36934100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":36878700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36634900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36293600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36493200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":37882200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21067300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16101100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16812600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16358600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16126600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":36878500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36634700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36293400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36493000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":37882000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":21067100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16100900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16812400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16358400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16126400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":239024, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run2-small.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-small.json new file mode 100644 index 000000000..429df4ab9 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run2-small.json @@ -0,0 +1,3665 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171702", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 32094,31746,31784,31790,31664,31932,31478,31896,30360,30378 + ], + "N":10, + "Min":30360, + "LowerFence":31007, + "Q1":31524.5, + "Median":31765, + "Mean":31512.2, + "Q3":31869.5, + "UpperFence":32387, + "Max":32094, + "InterquartileRange":345, + "LowerOutliers":[ + 30360,30378 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 30360,30378 + ], + "StandardError":197.369467412431, + "Variance":389547.0666666667, + "StandardDeviation":624.1370575976615, + "Skewness":-1.07080609068108, + "Kurtosis":2.3720704406181223, + "ConfidenceInterval":{ + "N":10, + "Mean":31512.2, + "StandardError":197.369467412431, + "Level":12, + "Margin":943.6061705713207, + "Lower":30568.59382942868, + "Upper":32455.806170571323 + }, + "Percentiles":{ + "P0":30360, + "P25":31524.5, + "P50":31765, + "P67":31793.18, + "P80":31903.199999999997, + "P85":31919.4, + "P90":31948.199999999997, + "P95":32021.1, + "P100":32094 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":189900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2839000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2083000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1604900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1587500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1589400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1589700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1583400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1596800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1574100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1595000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1518200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1519100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1604700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1587300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1589200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1589500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1583200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1596600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1573900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1594800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1518000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1518900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 33330,33178,33372,31514,35736,33388,29760,31506,31982,31996 + ], + "N":10, + "Min":29760, + "LowerFence":29035.25, + "Q1":31631, + "Median":32587, + "Mean":32576.2, + "Q3":33361.5, + "UpperFence":35957.25, + "Max":35736, + "InterquartileRange":1730.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":506.63723160111755, + "Variance":2566812.8444444444, + "StandardDeviation":1602.1275993017673, + "Skewness":0.1962187503574616, + "Kurtosis":2.5301493027154627, + "ConfidenceInterval":{ + "N":10, + "Mean":32576.2, + "StandardError":506.63723160111755, + "Level":12, + "Margin":2422.1883163974917, + "Lower":30154.011683602508, + "Upper":34998.38831639749 + }, + "Percentiles":{ + "P0":29760, + "P25":31631, + "P50":32587, + "P67":33331.26, + "P80":33375.2, + "P85":33382.4, + "P90":33622.799999999996, + "P95":34679.399999999994, + "P100":35736 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":227100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2878400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1686100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1666700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1659100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1668800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1575900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1787000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1669600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1488200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1575500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1599300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1600000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1666500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1658900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1668600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1575700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1786800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1669400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1488000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1575300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1599100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1599800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 13654,13566,13588,13600,13722,13450,13546,13340,13520 + ], + "N":9, + "Min":13340, + "LowerFence":13400, + "Q1":13520, + "Median":13566, + "Mean":13554, + "Q3":13600, + "UpperFence":13720, + "Max":13722, + "InterquartileRange":80, + "LowerOutliers":[ + 13340 + ], + "UpperOutliers":[ + 13722 + ], + "AllOutliers":[ + 13340,13722 + ], + "StandardError":37.16928241916375, + "Variance":12434, + "StandardDeviation":111.50784725749125, + "Skewness":-0.4075061834269528, + "Kurtosis":2.2408658596340656, + "ConfidenceInterval":{ + "N":9, + "Mean":13554, + "StandardError":37.16928241916375, + "Level":12, + "Margin":187.38170531236574, + "Lower":13366.618294687634, + "Upper":13741.381705312366 + }, + "Percentiles":{ + "P0":13340, + "P25":13520, + "P50":13566, + "P67":13592.32, + "P80":13621.6, + "P85":13643.199999999999, + "P90":13667.6, + "P95":13694.8, + "P100":13722 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":175100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1793900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":685000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":682800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":678400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":679500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":680100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":686200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":793100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":672600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":677400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":667100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":676100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":682700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":678300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":679400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":680000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":686100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":672500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":677300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":667000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":676000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14476,18142,18594,16190,17470,14456,14386,14416,14460,14672 + ], + "N":10, + "Min":14386, + "LowerFence":10417.5, + "Q1":14457, + "Median":14574, + "Mean":15726.2, + "Q3":17150, + "UpperFence":21189.5, + "Max":18594, + "InterquartileRange":2693, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":544.8759654983671, + "Variance":2968898.177777778, + "StandardDeviation":1723.049093258163, + "Skewness":0.6104017203602131, + "Kurtosis":1.4296690123457179, + "ConfidenceInterval":{ + "N":10, + "Mean":15726.2, + "StandardError":544.8759654983671, + "Level":12, + "Margin":2605.004360506687, + "Lower":13121.195639493313, + "Upper":18331.204360506686 + }, + "Percentiles":{ + "P0":14386, + "P25":14457, + "P50":14574, + "P67":16228.4, + "P80":17604.4, + "P85":17906.8, + "P90":18187.2, + "P95":18390.6, + "P100":18594 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":174100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1837500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":732400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":723900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":907200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":929800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":809600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":873600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":722900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":719400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":720900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":723100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":733700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":723800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":907100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":929700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":809500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":873500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":722800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":719300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":720800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":723000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":733600 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 29158,29200,28530,28162,28126,28152,28316,28156,28164 + ], + "N":9, + "Min":28126, + "LowerFence":27595, + "Q1":28156, + "Median":28164, + "Mean":28440.444444444445, + "Q3":28530, + "UpperFence":29091, + "Max":29200, + "InterquartileRange":374, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 29158,29200 + ], + "AllOutliers":[ + 29158,29200 + ], + "StandardError":145.88114560139465, + "Variance":191531.77777777775, + "StandardDeviation":437.643436804184, + "Skewness":0.9088486943872581, + "Kurtosis":1.9183132849978106, + "ConfidenceInterval":{ + "N":9, + "Mean":28440.444444444445, + "StandardError":145.88114560139465, + "Level":12, + "Margin":735.4314115468968, + "Lower":27705.01303289755, + "Upper":29175.87585599134 + }, + "Percentiles":{ + "P0":28126, + "P25":28156, + "P50":28164, + "P67":28393.04, + "P80":28781.199999999997, + "P85":29032.4, + "P90":29166.399999999998, + "P95":29183.199999999997, + "P100":29200 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":178900 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2700500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1479700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1458100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1460200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1426700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1761200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1408300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1406500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1407800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1416000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1408000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1408400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1457900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1460000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1426500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1408100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1406300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1407600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1415800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1407800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1408200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 29700,29658,29860,28568,30024,29878,29898,29934,29934,29658 + ], + "N":10, + "Min":28568, + "LowerFence":29283.75, + "Q1":29668.5, + "Median":29869, + "Mean":29711.2, + "Q3":29925, + "UpperFence":30309.75, + "Max":30024, + "InterquartileRange":256.5, + "LowerOutliers":[ + 28568 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 28568 + ], + "StandardError":133.11121498790231, + "Variance":177185.95555555553, + "StandardDeviation":420.9346214741139, + "Skewness":-1.913526669101258, + "Kurtosis":5.494540739683033, + "ConfidenceInterval":{ + "N":10, + "Mean":29711.2, + "StandardError":133.11121498790231, + "Level":12, + "Margin":636.3930828893715, + "Lower":29074.80691711063, + "Upper":30347.593082889372 + }, + "Percentiles":{ + "P0":28568, + "P25":29668.5, + "P50":29869, + "P67":29899.08, + "P80":29934, + "P85":29934, + "P90":29943, + "P95":29983.5, + "P100":30024 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":174800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2663500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1500800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1485200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1483100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1493200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1428600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1501400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1494100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1495100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1496900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1496900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1483100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1485000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1482900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1493000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1428400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1501200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1493900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1494900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1496700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1496700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1482900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11462,11394,11512,11614,11602,11596,11592,13586,13832,14376 + ], + "N":10, + "Min":11394, + "LowerFence":9190.5, + "Q1":11532, + "Median":11599, + "Mean":12256.6, + "Q3":13093, + "UpperFence":15434.5, + "Max":14376, + "InterquartileRange":1561, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":371.04154304695675, + "Variance":1376718.2666666666, + "StandardDeviation":1173.3363825717954, + "Skewness":0.8106835243984164, + "Kurtosis":1.659809322547761, + "ConfidenceInterval":{ + "N":10, + "Mean":12256.6, + "StandardError":371.04154304695675, + "Level":12, + "Margin":1773.917182569046, + "Lower":10482.682817430954, + "Upper":14030.517182569047 + }, + "Percentiles":{ + "P0":11394, + "P25":11532, + "P50":11599, + "P67":11673.16, + "P80":13635.2, + "P85":13745.900000000001, + "P90":13886.4, + "P95":14131.2, + "P100":14376 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":189100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1886100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":579100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":573200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":569800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":575700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":580800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":580200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":579900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":579700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":679400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":691700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":718900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":573100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":569700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":575600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":580700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":580100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":579800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":579600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":679300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":691600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":718800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 11456,12280,12350,12422,12584,12392,12502,12458,12304,12422 + ], + "N":10, + "Min":11456, + "LowerFence":12115.25, + "Q1":12315.5, + "Median":12407, + "Mean":12317, + "Q3":12449, + "UpperFence":12649.25, + "Max":12584, + "InterquartileRange":133.5, + "LowerOutliers":[ + 11456 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 11456 + ], + "StandardError":99.83419587829945, + "Variance":99668.66666666667, + "StandardDeviation":315.7034473468205, + "Skewness":-1.9303157274343303, + "Kurtosis":5.60189420567244, + "ConfidenceInterval":{ + "N":10, + "Mean":12317, + "StandardError":99.83419587829945, + "Level":12, + "Margin":477.2985634497182, + "Lower":11839.701436550282, + "Upper":12794.298563449718 + }, + "Percentiles":{ + "P0":11456, + "P25":12315.5, + "P50":12407, + "P67":12423.08, + "P80":12466.8, + "P85":12486.599999999999, + "P90":12510.2, + "P95":12547.099999999999, + "P100":12584 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":178500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1833800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":617900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":572900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":614100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":617600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":621200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":629300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":619700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":625200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":623000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":615300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":621200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":572800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":614000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":617500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":621100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":629200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":619600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":625100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":622900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":615200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":621100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run3-bulk.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-bulk.json new file mode 100644 index 000000000..7304f8327 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-bulk.json @@ -0,0 +1,3658 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171716", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 261837800,268610500,271896600,271157600,270516300,268402300,268019900,263841900,269200600,270852900 + ], + "N":10, + "Min":261837800, + "LowerFence":264135625, + "Q1":268115500, + "Median":268905550, + "Mean":268433640, + "Q3":270768750, + "UpperFence":274748625, + "Max":271896600, + "InterquartileRange":2653250, + "LowerOutliers":[ + 261837800,263841900 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 261837800,263841900 + ], + "StandardError":1027311.4494965324, + "Variance":10553688142666.666, + "StandardDeviation":3248644.046778081, + "Skewness":-0.8704832349558168, + "Kurtosis":2.3249561920515904, + "ConfidenceInterval":{ + "N":10, + "Mean":268433640, + "StandardError":1027311.4494965324, + "Level":12, + "Margin":4911486.237219491, + "Lower":263522153.76278052, + "Upper":273345126.2372195 + }, + "Percentiles":{ + "P0":261837800, + "P25":268115500, + "P50":268905550, + "P67":270526398, + "P80":270913840, + "P85":271050955, + "P90":271231500, + "P95":271564050, + "P100":271896600 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":285957500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":271402500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":261838000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":268610700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271896800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":271157800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":270516500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":268402500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":268020100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":263842100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":269200800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":270853100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":261837800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":268610500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":271896600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":271157600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":270516300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":268402300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":268019900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":263841900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":269200600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":270852900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 269045900,269721100,268967000,261390700,266835900,267832800,266353900,267882500,268919800 + ], + "N":9, + "Min":261390700, + "LowerFence":263639250, + "Q1":266835900, + "Median":267882500, + "Mean":267438844.44444445, + "Q3":268967000, + "UpperFence":272163650, + "Max":269721100, + "InterquartileRange":2131100, + "LowerOutliers":[ + 261390700 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 261390700 + ], + "StandardError":839911.8310392782, + "Variance":6349066955277.777, + "StandardDeviation":2519735.4931178344, + "Skewness":-1.387221556576355, + "Kurtosis":3.8141141517916557, + "ConfidenceInterval":{ + "N":9, + "Mean":267438844.44444445, + "StandardError":839911.8310392782, + "Level":12, + "Margin":4234252.075069047, + "Lower":263204592.3693754, + "Upper":271673096.5195135 + }, + "Percentiles":{ + "P0":261390700, + "P25":266835900, + "P50":267882500, + "P67":268936792, + "P80":268998560, + "P85":269030120, + "P90":269180940, + "P95":269451020, + "P100":269721100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34416 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":175600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":284628800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":276060600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":269046100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":269721300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":268967200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":261390900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":266836100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267833000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266354100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":267882700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268920000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":275167400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":269045900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":269721100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":268967000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":261390700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":266835900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":267832800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":266353900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":267882500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":268919800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34416, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 81499000,81825300,79153400,80223400,79388100,81388000,78692500,77694800 + ], + "N":8, + "Min":77694800, + "LowerFence":75471812.5, + "Q1":79038175, + "Median":79805750, + "Mean":79983062.5, + "Q3":81415750, + "UpperFence":84982112.5, + "Max":81825300, + "InterquartileRange":2377575, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":528939.8777397983, + "Variance":2238219154107.143, + "StandardDeviation":1496067.8975591792, + "Skewness":-0.08921338395504357, + "Kurtosis":1.2847534508495786, + "ConfidenceInterval":{ + "N":8, + "Mean":79983062.5, + "StandardError":528939.8777397983, + "Level":12, + "Margin":2860444.717861752, + "Lower":77122617.78213824, + "Upper":82843507.21786176 + }, + "Percentiles":{ + "P0":77694800, + "P25":79038175, + "P50":79805750, + "P67":81026974, + "P80":81454600, + "P85":81493450, + "P90":81596890, + "P95":81711095, + "P100":81825300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":182400 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":86458900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":80733600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81499200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":90867100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":81825500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":85888400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":79153600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":80223600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":79388300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":81388200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":78692700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":77695000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81499000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":81825300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":79153400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80223400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":79388100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":81388000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":78692500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":77694800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 81780500,78899200,79911700,80985200,77796900,76739900,79513300,74730900,81801900 + ], + "N":9, + "Min":74730900, + "LowerFence":73014450, + "Q1":77796900, + "Median":79513300, + "Mean":79128833.33333333, + "Q3":80985200, + "UpperFence":85767650, + "Max":81801900, + "InterquartileRange":3188300, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":792841.3346593658, + "Variance":5657376437500, + "StandardDeviation":2378524.0039780973, + "Skewness":-0.46566087221610103, + "Kurtosis":1.814226341593007, + "ConfidenceInterval":{ + "N":9, + "Mean":79128833.33333333, + "StandardError":792841.3346593658, + "Level":12, + "Margin":3996955.3260465255, + "Lower":75131878.0072868, + "Upper":83125788.65937985 + }, + "Percentiles":{ + "P0":74730900, + "P25":77796900, + "P50":79513300, + "P67":80298160, + "P80":81303320, + "P85":81621440, + "P90":81784780, + "P95":81793340, + "P100":81801900 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":34752 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":87479700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81581200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81780600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":95610100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":78899300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":79911800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":80985300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":77797000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":76740000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":79513400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":74731000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":81802000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81780500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":78899200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":79911700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":80985200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":77796900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":76739900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":79513300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":74730900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":81801900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":34752, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 277554900,272773800,277170500,270710300,276573500,275884600,275004500,274512000,278216700,280294300 + ], + "N":10, + "Min":270710300, + "LowerFence":270399612.5, + "Q1":274635125, + "Median":276229050, + "Mean":275869510, + "Q3":277458800, + "UpperFence":281694312.5, + "Max":280294300, + "InterquartileRange":2823675, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":875017.1771583813, + "Variance":7656550603222.223, + "StandardDeviation":2767047.2715915465, + "Skewness":-0.29849728534353526, + "Kurtosis":2.0967041104880497, + "ConfidenceInterval":{ + "N":10, + "Mean":275869510, + "StandardError":875017.1771583813, + "Level":12, + "Margin":4183380.6340328786, + "Lower":271686129.3659671, + "Upper":280052890.6340329 + }, + "Percentiles":{ + "P0":270710300, + "P25":274635125, + "P50":276229050, + "P67":277182032, + "P80":277687260, + "P85":277985070, + "P90":278424460, + "P95":279359380, + "P100":280294300 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":299177500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":275534800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":277555100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":272774000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":277170700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270710500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":276573700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":275884800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":275004700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":274512200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":278216900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":280294500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":277554900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":272773800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":277170500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":270710300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":276573500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":275884600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":275004500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":274512000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":278216700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":280294300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 268884300,266560900,258670200,265403300,265764900,262099000,265540600,266439700,271199500 + ], + "N":9, + "Min":258670200, + "LowerFence":263666900, + "Q1":265403300, + "Median":265764900, + "Mean":265618044.44444445, + "Q3":266560900, + "UpperFence":268297300, + "Max":271199500, + "InterquartileRange":1157600, + "LowerOutliers":[ + 258670200,262099000 + ], + "UpperOutliers":[ + 268884300,271199500 + ], + "AllOutliers":[ + 258670200,262099000,268884300,271199500 + ], + "StandardError":1202515.081461341, + "Variance":13014382690277.777, + "StandardDeviation":3607545.2443840224, + "Skewness":-0.39962206232180003, + "Kurtosis":2.3413942422622345, + "ConfidenceInterval":{ + "N":9, + "Mean":265618044.44444445, + "StandardError":1202515.081461341, + "Level":12, + "Margin":6062245.810586031, + "Lower":259555798.6338584, + "Upper":271680290.25503045 + }, + "Percentiles":{ + "P0":258670200, + "P25":265403300, + "P50":265764900, + "P67":266483332, + "P80":267490260, + "P85":268419620, + "P90":269347340, + "P95":270273420, + "P100":271199500 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":282929800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":268218400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":268884500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":266561100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":258670400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":265403500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":265765100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":262099200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":265540800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":266439900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271199700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":278525200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":268884300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":266560900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":258670200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":265403300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":265764900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":262099000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":265540600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":266439700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":271199500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 73136800,74744200,80937100,68988500,60300400,55567700,57215000,56774100,59362700,60305800 + ], + "N":10, + "Min":55567700, + "LowerFence":36230225, + "Q1":57751925, + "Median":60303100, + "Mean":64733230, + "Q3":72099725, + "UpperFence":93621425, + "Max":80937100, + "InterquartileRange":14347800, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2835264.867895453, + "Variance":80387268711222.22, + "StandardDeviation":8965894.752406042, + "Skewness":0.5411728625053019, + "Kurtosis":1.5500642532675275, + "ConfidenceInterval":{ + "N":10, + "Mean":64733230, + "StandardError":2835264.867895453, + "Level":12, + "Margin":13555153.487644896, + "Lower":51178076.512355104, + "Upper":78288383.4876449 + }, + "Percentiles":{ + "P0":55567700, + "P25":57751925, + "P50":60303100, + "P67":69112949, + "P80":73458280, + "P85":74181610, + "P90":75363490, + "P95":78150295, + "P100":80937100 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":197000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":86262100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81893800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":73137000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":74744400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80937300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":68988700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":60300600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55567900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":57215200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":56774300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":59362900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":60306000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":73136800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":74744200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":80937100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":68988500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":60300400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55567700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":57215000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":56774100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":59362700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":60305800 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 81104300,70842900,82733900,66675600,59632000,55984500,56599900,56467200,54956000,54514100 + ], + "N":10, + "Min":54514100, + "LowerFence":35561325, + "Q1":56105175, + "Median":58115950, + "Mean":63951040, + "Q3":69801075, + "UpperFence":90344925, + "Max":82733900, + "InterquartileRange":13695900, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3438482.6879243637, + "Variance":118231631951555.56, + "StandardDeviation":10873436.988898937, + "Skewness":0.703989752986042, + "Kurtosis":1.7044506812739415, + "ConfidenceInterval":{ + "N":10, + "Mean":63951040, + "StandardError":3438482.6879243637, + "Level":12, + "Margin":16439085.154686576, + "Lower":47511954.84531342, + "Upper":80390125.15468657 + }, + "Percentiles":{ + "P0":54514100, + "P25":56105175, + "P50":58115950, + "P67":66800619, + "P80":72895180, + "P85":77512809.99999999, + "P90":81267260, + "P95":82000580, + "P100":82733900 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":199200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":90306700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":79063500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81104400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":70843000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":82734000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66675700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":59632100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55984600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":56600000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":56467300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":54956100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54514200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":81104300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":70842900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":82733900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":66675600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":59632000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":55984500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":56599900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":56467200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":54956000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":54514100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run3-handshake.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-handshake.json new file mode 100644 index 000000000..f9975f6c1 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-handshake.json @@ -0,0 +1,1859 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171737", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3182665,3125830,3459690,3252680,3081015,3388350,3555465,3143620,3225625,3497410 + ], + "N":10, + "Min":3081015, + "LowerFence":2720670.625, + "Q1":3153381.25, + "Median":3239152.5, + "Mean":3291235, + "Q3":3441855, + "UpperFence":3874565.625, + "Max":3555465, + "InterquartileRange":288473.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":53857.22787044362, + "Variance":29006009938.88889, + "StandardDeviation":170311.50853330168, + "Skewness":0.28859364358757666, + "Kurtosis":1.2969184777767075, + "ConfidenceInterval":{ + "N":10, + "Mean":3291235, + "StandardError":53857.22787044362, + "Level":12, + "Margin":257486.69849840965, + "Lower":3033748.3015015903, + "Upper":3548721.6984984097 + }, + "Percentiles":{ + "P0":3081015, + "P25":3153381.25, + "P50":3239152.5, + "P67":3390490.1999999997, + "P80":3467234, + "P85":3484208, + "P90":3503215.5, + "P95":3529340.25, + "P100":3555465 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6945 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":197000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":99200700 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":64690500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63653400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62516700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":69193900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":65053700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61620400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":67767100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71109400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":62872500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":64512600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69948300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63653300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":62516600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":69193800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":65053600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":61620300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":67767000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":71109300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":62872400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":64512500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":69948200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6945, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2375420,2392480,2389545,2399140,2456505,2397725,2372230,2434265,2372115 + ], + "N":9, + "Min":2372115, + "LowerFence":2339840, + "Q1":2375420, + "Median":2392480, + "Mean":2398825, + "Q3":2399140, + "UpperFence":2434720, + "Max":2456505, + "InterquartileRange":23720, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 2456505 + ], + "AllOutliers":[ + 2456505 + ], + "StandardError":9631.527224000702, + "Variance":834896850, + "StandardDeviation":28894.581672002107, + "Skewness":0.8505578176462198, + "Kurtosis":2.225989278157666, + "ConfidenceInterval":{ + "N":9, + "Mean":2398825, + "StandardError":9631.527224000702, + "Level":12, + "Margin":48555.4704996194, + "Lower":2350269.5295003806, + "Upper":2447380.4704996194 + }, + "Percentiles":{ + "P0":2372115, + "P25":2375420, + "P50":2392480, + "P67":2398234.4, + "P80":2413190, + "P85":2427240, + "P90":2438713, + "P95":2447609, + "P100":2456505 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71208 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":195100 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":71145300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47052300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47508500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47849700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47791000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47982900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":49130200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":55470300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47954600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":47444700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":48685400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":47442400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47508400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47849600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47790900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47982800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":49130100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":47954500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47444600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":48685300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":47442300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71208, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 4235690,3820715,3737420,2902835,2786040,2963270,2793965,2662825,2751805,2698570 + ], + "N":10, + "Min":2662825, + "LowerFence":1585085.625, + "Q1":2760363.75, + "Median":2848400, + "Mean":3135313.5, + "Q3":3543882.5, + "UpperFence":4719160.625, + "Max":4235690, + "InterquartileRange":783518.75, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":180319.49815697505, + "Variance":325151214155.8333, + "StandardDeviation":570220.3207145755, + "Skewness":0.8238068553529085, + "Kurtosis":1.8523198901175824, + "ConfidenceInterval":{ + "N":10, + "Mean":3135313.5, + "StandardError":180319.49815697505, + "Level":12, + "Margin":862091.757990572, + "Lower":2273221.742009428, + "Upper":3997405.257990572 + }, + "Percentiles":{ + "P0":2662825, + "P25":2760363.75, + "P50":2848400, + "P67":2986494.5000000005, + "P80":3754079, + "P85":3791561.75, + "P90":3862212.5, + "P95":4048951.249999999, + "P100":4235690 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":181039 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":191600 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":131544100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":78042600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":84713900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":76414400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":74748500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":58056800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":55720900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":59265500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":55879400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":53256600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":55036200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":53971500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":84713800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":76414300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":74748400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":58056700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":55720800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":59265400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":55879300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":53256500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":55036100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":53971400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":181039, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3011565,3029480,3365855,2020520,1993230,2042930,1985205,1968560,2005085,1980315 + ], + "N":10, + "Min":1968560, + "LowerFence":813918.75, + "Q1":1987211.25, + "Median":2012802.5, + "Mean":2340274.5, + "Q3":2769406.25, + "UpperFence":3942698.75, + "Max":3365855, + "InterquartileRange":782195, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":176216.9104453845, + "Variance":310523995269.1667, + "StandardDeviation":557246.7992453314, + "Skewness":0.8249008595581577, + "Kurtosis":1.6926983067771886, + "ConfidenceInterval":{ + "N":10, + "Mean":2340274.5, + "StandardError":176216.9104453845, + "Level":12, + "Margin":842477.6447707321, + "Lower":1497796.8552292679, + "Upper":3182752.144770732 + }, + "Percentiles":{ + "P0":1968560, + "P25":1987211.25, + "P50":2012802.5, + "P67":2071989.05, + "P80":3015148, + "P85":3023209.75, + "P90":3063117.4999999995, + "P95":3214486.25, + "P100":3365855 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":245235 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":193500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":110283400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":60946500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":60231400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":60589700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":67317200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40410500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":39864700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":40858700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":39704200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":39371300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":40101800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":39606400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":60231300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":60589600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":67317100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":40410400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":39864600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":40858600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":39704100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":39371200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":40101700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":39606300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":245235, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run3-resumed.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-resumed.json new file mode 100644 index 000000000..092b90633 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-resumed.json @@ -0,0 +1,1845 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171744", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 3176625,3180960,3430410,3701755,3036735,3158530,3493915,3083590,3279305,3663195 + ], + "N":10, + "Min":3036735, + "LowerFence":2690576.25, + "Q1":3163053.75, + "Median":3230132.5, + "Mean":3320502, + "Q3":3478038.75, + "UpperFence":3950516.25, + "Max":3701755, + "InterquartileRange":314985, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":75255.11188321731, + "Variance":56633318645.55556, + "StandardDeviation":237977.55912177006, + "Skewness":0.4158243064015684, + "Kurtosis":1.4686020997793758, + "ConfidenceInterval":{ + "N":10, + "Mean":3320502, + "StandardError":75255.11188321731, + "Level":12, + "Margin":359788.1114592624, + "Lower":2960713.888540738, + "Upper":3680290.111459262 + }, + "Percentiles":{ + "P0":3036735, + "P25":3163053.75, + "P50":3230132.5, + "P67":3432315.15, + "P80":3527771, + "P85":3603947, + "P90":3667051, + "P95":3684403, + "P100":3701755 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":6969 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":179300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":65305000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63068800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63532700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":63619400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":68608400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":74035300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":60734900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":63170800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":69878500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":61672000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":65586300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":73264100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":63532500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":63619200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":68608200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":74035100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":60734700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":63170600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":69878300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":61671800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":65586100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":73263900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":6969, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2374280,2393570,2369655,2388910,2605620,2379250,2325145,2486175,2416620 + ], + "N":9, + "Min":2325145, + "LowerFence":2310770, + "Q1":2374280, + "Median":2388910, + "Mean":2415469.4444444445, + "Q3":2416620, + "UpperFence":2480130, + "Max":2605620, + "InterquartileRange":42340, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 2486175,2605620 + ], + "AllOutliers":[ + 2486175,2605620 + ], + "StandardError":27791.06320489812, + "Variance":6951088746.527779, + "StandardDeviation":83373.18961469436, + "Skewness":1.1981049775182835, + "Kurtosis":3.2392867383276682, + "ConfidenceInterval":{ + "N":9, + "Mean":2415469.4444444445, + "StandardError":27791.06320489812, + "Level":12, + "Margin":140103.23785784593, + "Lower":2275366.2065865984, + "Upper":2555572.6823022906 + }, + "Percentiles":{ + "P0":2325145, + "P25":2374280, + "P50":2388910, + "P67":2401868, + "P80":2444442, + "P85":2472264, + "P90":2510064, + "P95":2557842, + "P100":2605620 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":71241 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":183800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":48283100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47772900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47485800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47871600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47393300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47778400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":53680800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":52112600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":47585200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":46503100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":49723700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":48332600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":47485600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":47871400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":47393100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":47778200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":52112400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":47585000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":46502900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":49723500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":48332400 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":71241, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 2661727.5,2575717.5,2674152.5,1701172.5,1494617.5,1481387.5,1522457.5,1605892.5,1486907.5,1473307.5 + ], + "N":10, + "Min":1473307.5, + "LowerFence":186465.625, + "Q1":1488835, + "Median":1564175, + "Mean":1867734, + "Q3":2357081.25, + "UpperFence":3659450.625, + "Max":2674152.5, + "InterquartileRange":868246.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":169528.0148907712, + "Variance":287397478328.05554, + "StandardDeviation":536094.6542617782, + "Skewness":0.7074001610068046, + "Kurtosis":1.4263930789800083, + "ConfidenceInterval":{ + "N":10, + "Mean":1867734, + "StandardError":169528.0148907712, + "Level":12, + "Margin":810498.6198364903, + "Lower":1057235.3801635099, + "Upper":2678232.61983649 + }, + "Percentiles":{ + "P0":1473307.5, + "P25":1488835, + "P50":1564175, + "P67":1727408.85, + "P80":2592919.5, + "P85":2631624, + "P90":2662970, + "P95":2668561.25, + "P100":2674152.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":174768 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":189500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":55677100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":51160000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":53234700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":51514500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":53483200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":34023600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29892500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29627900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":30449300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":32118000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":29738300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":29466300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":53234550 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":51514350 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":53483050 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":34023450 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":29892350 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":29627750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":30449150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":32117850 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":29738150 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":29466150 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":174768, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 1851340,1808860,1804875,1837330,1804275,1374190,851490,834175,810150,791175 + ], + "N":10, + "Min":791175, + "LowerFence":-615536.25, + "Q1":838503.75, + "Median":1589232.5, + "Mean":1376786, + "Q3":1807863.75, + "UpperFence":3261903.75, + "Max":1851340, + "InterquartileRange":969360, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":157211.2229998581, + "Variance":247153686371.1111, + "StandardDeviation":497145.5384202006, + "Skewness":-0.19994998062085848, + "Kurtosis":0.9512348476172182, + "ConfidenceInterval":{ + "N":10, + "Mean":1376786, + "StandardError":157211.2229998581, + "Level":12, + "Margin":751613.1144831104, + "Lower":625172.8855168896, + "Upper":2128399.1144831106 + }, + "Percentiles":{ + "P0":791175, + "P25":838503.75, + "P50":1589232.5, + "P67":1804994.55, + "P80":1814554, + "P85":1827365.5, + "P90":1838731, + "P95":1845035.5, + "P100":1851340 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":239032 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":191500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":39004300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":36969400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37026900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36177300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36097600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36746700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":36085600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27483900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17029900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16683600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16203100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":15823600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":37026800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":36177200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":36097500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":36746600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":36085500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":27483800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":17029800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16683500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16203000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":15823500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":239032, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/local-windows/run3-small.json b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-small.json new file mode 100644 index 000000000..165314034 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/local-windows/run3-small.json @@ -0,0 +1,3651 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171748", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"Windows 11 (10.0.26300.10075)", + "ProcessorName":"Unknown processor", + "PhysicalProcessorCount":null, + "PhysicalCoreCount":null, + "LogicalCoreCount":null, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"X64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":10000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 36482,38486,29620,29260,29164,29128,29280,37674,32404,45104 + ], + "N":10, + "Min":29128, + "LowerFence":17098.5, + "Q1":29265, + "Median":31012, + "Mean":33660.2, + "Q3":37376, + "UpperFence":49542.5, + "Max":45104, + "InterquartileRange":8111, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1749.6916160029778, + "Variance":30614207.511111114, + "StandardDeviation":5533.010709470127, + "Skewness":0.7539161479281189, + "Kurtosis":2.1188506070673565, + "ConfidenceInterval":{ + "N":10, + "Mean":33660.2, + "StandardError":1749.6916160029778, + "Level":12, + "Margin":8365.122666148152, + "Lower":25295.077333851845, + "Upper":42025.322666148146 + }, + "Percentiles":{ + "P0":29128, + "P25":29265, + "P50":31012, + "P67":36517.76, + "P80":37836.4, + "P85":38201.8, + "P90":39147.8, + "P95":42125.899999999994, + "P100":45104 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":195000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":3022200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1672900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1824300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1924500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1481200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1463200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1458400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1456600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1464200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1883900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1620400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2255400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1824100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1924300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1481000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1463000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1458200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1456400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1464000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1883700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1620200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2255200 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 33354,33572,33646,33516,32430,30206,32310,31672,31536,31526 + ], + "N":10, + "Min":30206, + "LowerFence":28711.75, + "Q1":31570, + "Median":32370, + "Mean":32376.8, + "Q3":33475.5, + "UpperFence":36333.75, + "Max":33646, + "InterquartileRange":1905.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":364.22339908968564, + "Variance":1326586.8444444444, + "StandardDeviation":1151.775518251905, + "Skewness":-0.3682559519964884, + "Kurtosis":1.7449725764927004, + "ConfidenceInterval":{ + "N":10, + "Mean":32376.8, + "StandardError":364.22339908968564, + "Level":12, + "Margin":1741.3202323199955, + "Lower":30635.479767680004, + "Upper":34118.12023232 + }, + "Percentiles":{ + "P0":30206, + "P25":31570, + "P50":32370, + "P67":33358.86, + "P80":33527.2, + "P85":33552.4, + "P90":33579.4, + "P95":33612.7, + "P100":33646 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":185300 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2860300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1723100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1667900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1678800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1682500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1676000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1621700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1510500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1615700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1583800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1577000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1576500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1667700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1678600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1682300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1675800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1621500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1510300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1615500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1583600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1576800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1576300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14068,14786,14704,14694,14916,14892,16180,16082,16068,16030 + ], + "N":10, + "Min":14068, + "LowerFence":12723.5, + "Q1":14724.5, + "Median":14904, + "Mean":15242, + "Q3":16058.5, + "UpperFence":18059.5, + "Max":16180, + "InterquartileRange":1334, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":242.51918595351492, + "Variance":588155.5555555555, + "StandardDeviation":766.9130039030213, + "Skewness":0.07984191270612517, + "Kurtosis":1.2332696237665612, + "ConfidenceInterval":{ + "N":10, + "Mean":15242, + "StandardError":242.51918595351492, + "Level":12, + "Margin":1159.4630281363213, + "Lower":14082.53697186368, + "Upper":16401.46302813632 + }, + "Percentiles":{ + "P0":14068, + "P25":14724.5, + "P50":14904, + "P67":16031.140000000001, + "P80":16070.8, + "P85":16077.1, + "P90":16091.800000000001, + "P95":16135.900000000001, + "P100":16180 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":173700 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1799600 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":680000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":703500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":739400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":735300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":734800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":745900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":744700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":809100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":804200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":803500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":801600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":703400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":739300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":735200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":734700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":745800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":744600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":809000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":804100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":803400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":801500 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14174,14128,14076,14236,14164,14308,14062,14102 + ], + "N":8, + "Min":14062, + "LowerFence":13954.5, + "Q1":14095.5, + "Median":14146, + "Mean":14156.25, + "Q3":14189.5, + "UpperFence":14330.5, + "Max":14308, + "InterquartileRange":94, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":29.528285471004622, + "Variance":6975.357142857143, + "StandardDeviation":83.51860357343831, + "Skewness":0.5303058842245101, + "Kurtosis":1.799706893269789, + "ConfidenceInterval":{ + "N":8, + "Mean":14156.25, + "StandardError":29.528285471004622, + "Level":12, + "Margin":159.68549878290617, + "Lower":13996.564501217093, + "Upper":14315.935498782907 + }, + "Percentiles":{ + "P0":14062, + "P25":14095.5, + "P50":14146, + "P67":14170.9, + "P80":14211.2, + "P85":14232.9, + "P90":14257.6, + "P95":14282.8, + "P100":14308 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":173800 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1810800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":719500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":708800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":739600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":706500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":703900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":711900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":708300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":896600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":715500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":703200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":705200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":708700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":706400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":703800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":711800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":708200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":715400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":703100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":705100 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 27930,27854,27814,26984,28184,28126,27828,27946,27780 + ], + "N":9, + "Min":26984, + "LowerFence":27616, + "Q1":27814, + "Median":27854, + "Mean":27827.333333333332, + "Q3":27946, + "UpperFence":28144, + "Max":28184, + "InterquartileRange":132, + "LowerOutliers":[ + 26984 + ], + "UpperOutliers":[ + 28184 + ], + "AllOutliers":[ + 26984,28184 + ], + "StandardError":115.19162778219219, + "Variance":119422, + "StandardDeviation":345.57488334657654, + "Skewness":-1.4137801584922838, + "Kurtosis":4.131337134955205, + "ConfidenceInterval":{ + "N":9, + "Mean":27827.333333333332, + "StandardError":115.19162778219219, + "Level":12, + "Margin":580.7161787015226, + "Lower":27246.61715463181, + "Upper":28408.049512034853 + }, + "Percentiles":{ + "P0":26984, + "P25":27814, + "P50":27854, + "P67":27935.76, + "P80":28018, + "P85":28090, + "P90":28137.600000000002, + "P95":28160.800000000003, + "P100":28184 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":177200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2761900 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1418800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1396700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1392900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1390900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1349400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1409400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1406500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1897700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1391600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1397500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1389200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1396500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1392700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1390700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1349200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1409200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1406300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1391400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1397300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1389000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 30292,50248,43392,29396,28858,53440,41374,48750,38206,41218 + ], + "N":10, + "Min":28858, + "LowerFence":9560.5, + "Q1":32270.5, + "Median":41296, + "Mean":40517.4, + "Q3":47410.5, + "UpperFence":70120.5, + "Max":53440, + "InterquartileRange":15140, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":2805.689300134441, + "Variance":78718924.48888889, + "StandardDeviation":8872.368595188598, + "Skewness":-0.054412961477808185, + "Kurtosis":1.391940655187182, + "ConfidenceInterval":{ + "N":10, + "Mean":40517.4, + "StandardError":2805.689300134441, + "Level":12, + "Margin":13413.75528353907, + "Lower":27103.64471646093, + "Upper":53931.155283539076 + }, + "Percentiles":{ + "P0":28858, + "P25":32270.5, + "P50":41296, + "P67":43552.740000000005, + "P80":49049.6, + "P85":49723.7, + "P90":50567.2, + "P95":52003.59999999999, + "P100":53440 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":184500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2766100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2238000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1514700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":2512500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2169700 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1469900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1443000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2672100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2068800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2437600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1910400 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2061000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1514600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":2512400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":2169600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1469800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1442900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":2672000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":2068700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":2437500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1910300 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":2060900 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 14168,13304,12124,11118,11208,13516,11450,11584,11458,11534 + ], + "N":10, + "Min":11118, + "LowerFence":9116.5, + "Q1":11452, + "Median":11559, + "Mean":12146.4, + "Q3":13009, + "UpperFence":15344.5, + "Max":14168, + "InterquartileRange":1557, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":347.87619764635934, + "Variance":1210178.4888888889, + "StandardDeviation":1100.081128321402, + "Skewness":0.7058405312998803, + "Kurtosis":1.6804867835652988, + "ConfidenceInterval":{ + "N":10, + "Mean":12146.4, + "StandardError":347.87619764635934, + "Level":12, + "Margin":1663.1656912163214, + "Lower":10483.234308783678, + "Upper":13809.565691216321 + }, + "Percentiles":{ + "P0":11118, + "P25":11452, + "P50":11559, + "P67":12159.4, + "P80":13346.4, + "P85":13441.8, + "P90":13581.2, + "P95":13874.599999999999, + "P100":14168 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":230200 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2068400 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":585100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":708500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":665300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":606300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":556000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":560500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":675900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":572600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":579300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":573000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":576800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":708400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":665200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":606200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":555900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":560400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":675800 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":572500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":579200 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":572900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":576700 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AVX-512F+CD+BW+DQ+VL+VBMI,AES,BMI1,BMI2,FMA,LZCNT,PCLMUL,POPCNT VectorSize=256", + "Statistics":{ + "OriginalValues":[ + 12740,15848,13792,15272,13278,15440,12382,13514,13262,12366 + ], + "N":10, + "Min":12366, + "LowerFence":9823.25, + "Q1":12870.5, + "Median":13396, + "Mean":13789.4, + "Q3":14902, + "UpperFence":17949.25, + "Max":15848, + "InterquartileRange":2031.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":406.6671092893766, + "Variance":1653781.377777778, + "StandardDeviation":1285.9943148310485, + "Skewness":0.4396992964736184, + "Kurtosis":1.4481336836073195, + "ConfidenceInterval":{ + "N":10, + "Mean":13789.4, + "StandardError":406.6671092893766, + "Level":12, + "Margin":1944.2399005515508, + "Lower":11845.160099448449, + "Upper":15733.63990055155 + }, + "Percentiles":{ + "P0":12366, + "P25":12870.5, + "P50":13396, + "P67":13836.4, + "P80":15305.6, + "P85":15381.2, + "P90":15480.8, + "P95":15664.4, + "P100":15848 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":196000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1957800 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":300 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":100 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":200 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":652500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":637200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":792600 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":689800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":763800 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":664100 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":772200 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":619300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":675900 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":663300 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":618500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":637000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":792400 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":689600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":763600 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":663900 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":772000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":619100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":675700 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":663100 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":618300 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/README.md b/src/Titanium.Tls/design/perf-baselines/macmini/README.md new file mode 100644 index 000000000..ea3671667 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/README.md @@ -0,0 +1,44 @@ +macmini, 2026-11-29. macOS 26.6.2 (25G83), Darwin 25.6.0, Apple M1 (8 cores, 8 logical), 16 GB RAM, .NET SDK 10.0.404, runtime 10.0.15, Arm64. BenchmarkDotNet 0.14.0, one warmup, ten iterations, one invocation, one launch, three separate Release runs. + +**The platform TLS cells failed, so this folder has managed medians only.** Every `SslStream` platform cell — handshake, resumed handshake, bulk, and small exchange — threw before the first iteration: + +``` +System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception. + ---> System.PlatformNotSupportedException: The requested security protocol is not supported. + at System.Net.SslProtocolsValidation.ValidateContiguous(...) + at System.Net.Security.SslStream.AuthenticateAsClient(...) +``` + +The harness asks `SslStream` for `SslProtocols.Tls13` because that is the only protocol the managed stack speaks. The TLS provider on this machine cannot honour that request. A standalone probe on the same machine and runtime confirmed the boundary: + +| Client request | Server request | Result | +| --- | --- | --- | +| `Tls13` | `Tls13` | `PlatformNotSupportedException`, protocol not supported | +| `Tls13` | `None` | `PlatformNotSupportedException`, protocol not supported | +| `None` | `Tls13` | `SslException`, bad protocol version | +| `None` | `None` | connects with TLS 1.2 | +| `Tls12 \| Tls13` | `Tls12 \| Tls13` | connects with TLS 1.2 | +| `Tls12` | `Tls12` | connects with TLS 1.2 | + +The same probe connected to an OpenSSL 3.5.9 `s_server` started with `-tls1_3` failed the same way, so this is not a peer-implementation problem: the platform TLS stack on this machine cannot complete a TLS 1.3 handshake at all. It is not a certificate problem, not a transport problem, and not a harness problem on our side. + +A TLS 1.2 platform cell would not be a fair peer either: the managed stack does not speak TLS 1.2, so the two halves would not be running the same protocol. The platform TLS comparison therefore stays on Windows and linuxmini, and this machine contributes managed-only TLS numbers. + +Medians below are the median of the three run medians. + +| Cell | Managed median | Platform | +| --- | ---: | --- | +| Full handshake, loopback | 8.00 ms | not measured | +| Full handshake, in-memory | 7.70 ms | not measured | +| Resumed handshake, loopback | 0.833 ms | not measured | +| Resumed handshake, in-memory | 1.013 ms | not measured | +| 256 MiB, loopback, 16 KiB writes | 179.0 ms | not measured | +| 256 MiB, loopback, 64 KiB writes | 180.4 ms | not measured | +| 256 MiB, in-memory, 16 KiB writes | 150.8 ms | not measured | +| 256 MiB, in-memory, 64 KiB writes | 151.0 ms | not measured | +| 100-byte exchange, loopback | 88.46 µs | not measured | +| 1 KiB exchange, loopback | 89.21 µs | not measured | +| 100-byte exchange, in-memory | 23.09 µs | not measured | +| 1 KiB exchange, in-memory | 24.68 µs | not measured | + +`run1` to `run3` agree on every managed row except the in-memory handshakes, where the resumed in-memory cell spans 0.719 to 1.156 ms and the full in-memory cell spans 7.63 to 9.03 ms. The managed side of this machine is stable elsewhere, but neither handshake row should be read as a tight number. diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run1-bulk.json b/src/Titanium.Tls/design/perf-baselines/macmini/run1-bulk.json new file mode 100644 index 000000000..ece1c5034 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run1-bulk.json @@ -0,0 +1,1911 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171850", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 179598708,179259374,179071041,178824083,178473583,178930541,179055583,178777958,178771833 + ], + "N":9, + "Min":178473583, + "LowerFence":178338333.5, + "Q1":178777958, + "Median":178930541, + "Mean":178973633.7777778, + "Q3":179071041, + "UpperFence":179510665.5, + "Max":179598708, + "InterquartileRange":293083, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 179598708 + ], + "AllOutliers":[ + 179598708 + ], + "StandardError":108131.53427613286, + "Variance":105231858344.19444, + "StandardDeviation":324394.6028283986, + "Skewness":0.4064025643686234, + "Kurtosis":2.2637664536393434, + "ConfidenceInterval":{ + "N":9, + "Mean":178973633.7777778, + "StandardError":108131.53427613286, + "Level":12, + "Margin":545124.0909686672, + "Lower":178428509.68680912, + "Upper":179518757.86874646 + }, + "Percentiles":{ + "P0":178473583, + "P25":178777958, + "P50":178930541, + "P67":179061147.88, + "P80":179146374.2, + "P85":179221707.39999998, + "P90":179327240.8, + "P95":179462974.4, + "P100":179598708 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114375 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":202191958 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":166 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179634708 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179927584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":179598750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179259416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":179071083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":178824125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":178473625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":178930583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":179055625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":178778000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":178771875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179598708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":179259374 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179071041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":178824083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":178473583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":178930541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":179055583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":178777958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":178771833 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 181761166,181351416,181634958,181503749,181419874,180389250,180910875,180913292,180673542 + ], + "N":9, + "Min":180389250, + "LowerFence":180021564, + "Q1":180910875, + "Median":181351416, + "Mean":181173124.66666666, + "Q3":181503749, + "UpperFence":182393060, + "Max":181761166, + "InterquartileRange":592874, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":156409.29020654963, + "Variance":220174794566.24997, + "StandardDeviation":469227.8706196489, + "Skewness":-0.30462991351310137, + "Kurtosis":1.4459839751869388, + "ConfidenceInterval":{ + "N":9, + "Mean":181173124.66666666, + "StandardError":156409.29020654963, + "Level":12, + "Margin":788507.0041193268, + "Lower":180384617.66254732, + "Upper":181961631.670786 + }, + "Percentiles":{ + "P0":180389250, + "P25":180910875, + "P50":181351416, + "P67":181450069, + "P80":181556232.6, + "P85":181608716.20000002, + "P90":181660199.6, + "P95":181710682.8, + "P100":181761166 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":109459 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":202066000 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181521292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":183984583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":181761208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":181351458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":181635000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181503791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":181419916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":180389292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":180910917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":180913334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":180673584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181761166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":181351416 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":181634958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":181503749 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181419874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":180389250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":180910875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":180913292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":180673542 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 149113083,150990583,148121208,148170375,152262874,152929917,151358250,150861500,150457958,150720624 + ], + "N":10, + "Min":148121208, + "LowerFence":146723754.5, + "Q1":149449301.75, + "Median":150791062, + "Mean":150498637.2, + "Q3":151266333.25, + "UpperFence":153991880.5, + "Max":152929917, + "InterquartileRange":1817031.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":507498.60482384684, + "Variance":2575548338981.5107, + "StandardDeviation":1604851.5006010714, + "Skewness":-0.19458406247703236, + "Kurtosis":1.6623508031087877, + "ConfidenceInterval":{ + "N":10, + "Mean":150498637.2, + "StandardError":507498.60482384684, + "Level":12, + "Margin":2426306.4664780907, + "Lower":148072330.7335219, + "Upper":152924943.66647807 + }, + "Percentiles":{ + "P0":148121208, + "P25":149449301.75, + "P50":150791062, + "P67":151001613.01, + "P80":151539174.8, + "P85":151946255.6, + "P90":152329578.3, + "P95":152629747.64999998, + "P100":152929917 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114000 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":176845375 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":149973916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":149113125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150990625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":148121250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":148170417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":152262916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":152929959 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":151358292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150861542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150458000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":150720666 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":149113083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150990583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":148121208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":148170375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":152262874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":152929917 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":151358250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150861500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150457958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":150720624 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 151748499.5,151413875.5,150021792.5,150941542.5,151064667.5,149800208.5,150695583.5,151009333.5,151424916.5 + ], + "N":9, + "Min":149800208.5, + "LowerFence":149618145.5, + "Q1":150695583.5, + "Median":151009333.5, + "Mean":150902268.83333334, + "Q3":151413875.5, + "UpperFence":152491313.5, + "Max":151748499.5, + "InterquartileRange":718292, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":214828.13788700957, + "Variance":415360159452, + "StandardDeviation":644484.4136610287, + "Skewness":-0.4738693641620079, + "Kurtosis":1.7612246587816476, + "ConfidenceInterval":{ + "N":9, + "Mean":150902268.83333334, + "StandardError":214828.13788700957, + "Level":12, + "Margin":1083014.2581820004, + "Lower":149819254.57515135, + "Upper":151985283.09151533 + }, + "Percentiles":{ + "P0":149800208.5, + "P25":150695583.5, + "P50":151009333.5, + "P67":151190382.38, + "P80":151418291.9, + "P85":151422708.3, + "P90":151489633.1, + "P95":151619066.3, + "P100":151748499.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":113750 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":170391500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":174166583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":155540833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151748541 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":151413917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150021834 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150941584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":151064709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":149800250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150695625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":151009375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":151424958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":151748499.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151413875.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150021792.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150941542.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":151064667.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":149800208.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150695583.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":151009333.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":151424916.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run1-handshake.json b/src/Titanium.Tls/design/perf-baselines/macmini/run1-handshake.json new file mode 100644 index 000000000..9f284a23d --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run1-handshake.json @@ -0,0 +1,1010 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171902", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":136584 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171667 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 8553456.25,8179800,7720960.4,8070754.15,9095175,7756485.4,8085856.25,7964227.05,7591020.8 + ], + "N":9, + "Min":7591020.8, + "LowerFence":7121513.500000001, + "Q1":7756485.4, + "Median":8070754.15, + "Mean":8113081.699999999, + "Q3":8179800, + "UpperFence":8814771.899999999, + "Max":9095175, + "InterquartileRange":423314.5999999996, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 9095175 + ], + "AllOutliers":[ + 9095175 + ], + "StandardError":155503.0589904102, + "Variance":217630812198.37494, + "StandardDeviation":466509.1769712306, + "Skewness":0.8554030097486078, + "Kurtosis":2.5394590097507703, + "ConfidenceInterval":{ + "N":9, + "Mean":8113081.699999999, + "StandardError":155503.0589904102, + "Level":12, + "Margin":783938.4157679963, + "Lower":7329143.284232003, + "Upper":8897020.115767995 + }, + "Percentiles":{ + "P0":7591020.8, + "P25":7756485.4, + "P50":8070754.15, + "P67":8119676, + "P80":8329262.5, + "P85":8478725, + "P90":8661800, + "P95":8878487.5, + "P100":9095175 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":191093 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":160417 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":246924416 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":709 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":218309083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171069167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":163596042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":154419250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":161415125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":181903542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":195489250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":155129750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":161717167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":159284583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":151820458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":171069125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":163596000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":154419208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":161415083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":181903500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":155129708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":161717125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":159284541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":151820416 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":191093, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 11797881.2,10013287.5,8553881.25,8662383.3,9794745.8,7635110.4,9387787.45,10071241.65,7604135.4,7291754.15 + ], + "N":10, + "Min":7291754.15, + "LowerFence":4724029.668750003, + "Q1":7864803.112500001, + "Median":9025085.375, + "Mean":9081220.81, + "Q3":9958652.075, + "UpperFence":13099425.518749997, + "Max":11797881.2, + "InterquartileRange":2093848.9624999985, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":444234.09361723013, + "Variance":1973439299319.22, + "StandardDeviation":1404791.5501309154, + "Skewness":0.36160314323597476, + "Kurtosis":1.9501277944116258, + "ConfidenceInterval":{ + "N":10, + "Mean":9081220.81, + "StandardError":444234.09361723013, + "Level":12, + "Margin":2123844.3686907096, + "Lower":6957376.441309291, + "Upper":11205065.17869071 + }, + "Percentiles":{ + "P0":7291754.15, + "P25":7864803.112500001, + "P50":9025085.375, + "P67":9801302.051, + "P80":10024878.33, + "P85":10050957.6975, + "P90":10243905.604999999, + "P95":11020893.402499998, + "P100":11797881.2 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":254509 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":145500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":229872333 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":416 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":193787416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":235957666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200265792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":171077667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":173247708 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":195894958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":152702250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":187755791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":201424875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":152082750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":145835125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":235957624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":200265750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":171077625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":173247666 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":195894916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":152702208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":187755749 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":201424833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":152082708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":145835083 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":254509, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run1-resumed.json b/src/Titanium.Tls/design/perf-baselines/macmini/run1-resumed.json new file mode 100644 index 000000000..5cc9e9a57 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run1-resumed.json @@ -0,0 +1,961 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171910", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2050325,2066285.4,2039793.7,1243550,763470.85,725564.55,806816.65,849845.8,816847.9,816022.9 + ], + "N":10, + "Min":725564.55, + "LowerFence":-738303.6312499997, + "Q1":809118.2125, + "Median":833346.8500000001, + "Mean":1217852.2750000001, + "Q3":1840732.775, + "UpperFence":3388154.6187499994, + "Max":2066285.4, + "InterquartileRange":1031614.5624999999, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":187514.6742192965, + "Variance":351617530475.68896, + "StandardDeviation":592973.4652374329, + "Skewness":0.6144810756083934, + "Kurtosis":1.3386389493511757, + "ConfidenceInterval":{ + "N":10, + "Mean":1217852.2750000001, + "StandardError":187514.6742192965, + "Level":12, + "Margin":896491.2657754623, + "Lower":321361.0092245379, + "Upper":2114343.5407754625 + }, + "Percentiles":{ + "P0":725564.55, + "P25":809118.2125, + "P50":833346.8500000001, + "P67":1267437.3110000002, + "P80":2041899.96, + "P85":2046639.045, + "P90":2051921.04, + "P95":2059103.2199999997, + "P100":2066285.4 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172448 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":117375 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":43230292 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":166 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41720958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41006542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41325750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":40795916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":24871042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":15269459 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":14511333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16136375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16996958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16337000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16320500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41006500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41325708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":40795874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":24871000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":15269417 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":14511291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16136333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16996916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16336958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16320458 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172448, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2884002.05,1745991.65,1677656.25,1628568.75,1690395.85,684164.55,471314.55,475350,453862.5,481987.5 + ], + "N":10, + "Min":453862.5, + "LowerFence":-1338292.9875000003, + "Q1":477009.375, + "Median":1156366.65, + "Mean":1219329.365, + "Q3":1687210.9500000002, + "UpperFence":3502513.3125000005, + "Max":2884002.05, + "InterquartileRange":1210201.5750000002, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":261979.59498954282, + "Variance":686333081908.8491, + "StandardDeviation":828452.2206553912, + "Skewness":0.56199481727472, + "Kurtosis":1.9568730530855993, + "ConfidenceInterval":{ + "N":10, + "Mean":1219329.365, + "StandardError":261979.59498954282, + "Level":12, + "Margin":1252501.542598469, + "Lower":-33172.17759846896, + "Upper":2471830.907598469 + }, + "Percentiles":{ + "P0":453862.5, + "P25":477009.375, + "P50":1156366.65, + "P67":1678038.4379999998, + "P80":1701515.01, + "P85":1726533.1199999999, + "P90":1859792.6899999995, + "P95":2371897.3699999987, + "P100":2884002.05 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235864 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":118250 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":33569125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":57813959 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":57680083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":34919875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":33553167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32571417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":33807959 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":13683333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":9426333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":9507042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":9077292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":9639792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":57680041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":34919833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":33553125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":32571375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":33807917 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":13683291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":9426291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":9507000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":9077250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":9639750 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235864, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run1-small.json b/src/Titanium.Tls/design/perf-baselines/macmini/run1-small.json new file mode 100644 index 000000000..8a9734a79 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run1-small.json @@ -0,0 +1,1995 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171913", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 116912.48,115234.98,111159.16,88836.66,89203.34,88082.5,87964.16,86692.5,86755.84,87986.66 + ], + "N":10, + "Min":86692.5, + "LowerFence":61419.15500000003, + "Q1":87969.785, + "Median":88459.58, + "Mean":95882.82800000001, + "Q3":105670.20499999999, + "UpperFence":132220.83499999996, + "Max":116912.48, + "InterquartileRange":17700.419999999984, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4079.8234447890827, + "Variance":166449593.40650663, + "StandardDeviation":12901.534536887719, + "Skewness":0.7667173867795352, + "Kurtosis":1.5171962188511796, + "ConfidenceInterval":{ + "N":10, + "Mean":95882.82800000001, + "StandardError":4079.8234447890827, + "Level":12, + "Margin":19505.279250209147, + "Lower":76377.54874979086, + "Upper":115388.10725020916 + }, + "Percentiles":{ + "P0":86692.5, + "P25":87969.785, + "P50":88459.58, + "P67":89862.01460000001, + "P80":111974.324, + "P85":113808.443, + "P90":115402.73, + "P95":116157.60499999998, + "P100":116912.48 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":110417 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6919500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5101208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5845666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5761791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5558000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4441875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4460209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4404167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4398250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4334667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4337834 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4399375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5845624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5761749 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5557958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4441833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4460167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4404125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4398208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4334625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4337792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4399333 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 104763.34,110320,110571.66,110941.66,89471.66,89710,89678.32,88696.66,89395.82,87455.84 + ], + "N":10, + "Min":87455.84, + "LowerFence":60140.69750000001, + "Q1":89414.78, + "Median":89694.16, + "Mean":97100.49600000001, + "Q3":108930.83499999999, + "UpperFence":138204.91749999998, + "Max":110941.66, + "InterquartileRange":19516.054999999993, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3329.0600810943615, + "Variance":110826410.23536, + "StandardDeviation":10527.412323803033, + "Skewness":0.39871600707763644, + "Kurtosis":1.0599725199398544, + "ConfidenceInterval":{ + "N":10, + "Mean":97100.49600000001, + "StandardError":3329.0600810943615, + "Level":12, + "Margin":15915.94523665138, + "Lower":81184.55076334864, + "Upper":113016.44123665139 + }, + "Percentiles":{ + "P0":87455.84, + "P25":89414.78, + "P50":89694.16, + "P67":104930.0398, + "P80":110370.332, + "P85":110483.57900000001, + "P90":110608.66, + "P95":110775.16, + "P100":110941.66 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":112875 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5689709 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4711917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5238209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5516042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5528625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5547125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4473625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4485542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4483958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4434875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4469833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4372834 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5238167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5516000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5528583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5547083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4473583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4485500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4483916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4434833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4469791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4372792 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 23425.82,23145,23271.66,23429.16,23334.16,23349.98,23398.32,22530.84,23745,22900.82 + ], + "N":10, + "Min":22530.84, + "LowerFence":22813.245000000003, + "Q1":23176.665, + "Median":23342.07, + "Mean":23253.076, + "Q3":23418.945, + "UpperFence":23782.364999999998, + "Max":23745, + "InterquartileRange":242.27999999999884, + "LowerOutliers":[ + 22530.84 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 22530.84 + ], + "StandardError":105.284325215105, + "Variance":110847.89135999995, + "StandardDeviation":332.93826959362895, + "Skewness":-0.7791245962396978, + "Kurtosis":2.8371915268717496, + "ConfidenceInterval":{ + "N":10, + "Mean":23253.076, + "StandardError":105.284325215105, + "Level":12, + "Margin":503.3551553838442, + "Lower":22749.720844616157, + "Upper":23756.431155383845 + }, + "Percentiles":{ + "P0":22530.84, + "P25":23176.665, + "P50":23342.07, + "P67":23399.144999999997, + "P80":23426.488, + "P85":23427.991, + "P90":23460.744000000002, + "P95":23602.872, + "P100":23745 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":116333 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2047583 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1261417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1171333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1157292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1163625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1171500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1166750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1167541 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1169958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1126584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1187292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1145083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1171291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1157250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1163583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1171458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1166708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1167499 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1169916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1126542 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1187250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1145041 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 24945.01,24258.33,25301.67,24714.17,24679.17,24850.83,24370.85,24677.51,24397.51,24296.67 + ], + "N":10, + "Min":24258.33, + "LowerFence":23718.789999999986, + "Q1":24377.514999999996, + "Median":24678.339999999997, + "Mean":24649.172000000002, + "Q3":24816.665, + "UpperFence":25475.390000000007, + "Max":25301.67, + "InterquartileRange":439.1500000000051, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":104.2262176635247, + "Variance":108631.04448444428, + "StandardDeviation":329.5922397212111, + "Skewness":0.4782060091306145, + "Kurtosis":2.028569422861971, + "ConfidenceInterval":{ + "N":10, + "Mean":24649.172000000002, + "StandardError":104.2262176635247, + "Level":12, + "Margin":498.2964356746152, + "Lower":24150.875564325386, + "Upper":25147.46843567462 + }, + "Percentiles":{ + "P0":24258.33, + "P25":24377.514999999996, + "P50":24678.339999999997, + "P67":24718.2698, + "P80":24869.666, + "P85":24912.047, + "P90":24980.676, + "P95":25141.173, + "P100":25301.67 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":111791 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2125416 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1289667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1247292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1212958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1265125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1235750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1234000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1242583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1218584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1233917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1219917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1214875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1247250.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1212916.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1265083.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1235708.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1233958.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1242541.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1218542.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1233875.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1219875.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1214833.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run2-bulk.json b/src/Titanium.Tls/design/perf-baselines/macmini/run2-bulk.json new file mode 100644 index 000000000..977dc4b24 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run2-bulk.json @@ -0,0 +1,1939 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171923", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 180611375,179978125,179890333,179663083,179996124,179163708,180090292,178751750,179493624,180084583 + ], + "N":10, + "Min":178751750, + "LowerFence":178746269.5, + "Q1":179535988.75, + "Median":179934229, + "Mean":179772299.7, + "Q3":180062468.25, + "UpperFence":180852187.5, + "Max":180611375, + "InterquartileRange":526479.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":167018.7791668982, + "Variance":278952725944.0111, + "StandardDeviation":528159.7541880781, + "Skewness":-0.4319147721134353, + "Kurtosis":2.2464179180578374, + "ConfidenceInterval":{ + "N":10, + "Mean":179772299.7, + "StandardError":167018.7791668982, + "Level":12, + "Margin":798502.1831864542, + "Lower":178973797.51681355, + "Upper":180570801.88318643 + }, + "Percentiles":{ + "P0":178751750, + "P25":179535988.75, + "P50":179934229, + "P67":179998777.76999998, + "P80":180085724.8, + "P85":180088293.85, + "P90":180142400.3, + "P95":180376887.64999998, + "P100":180611375 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":108833 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":202982167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":209 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179712125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180611417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":179978167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179890375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":179663125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":179996166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179163750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":180090334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":178751792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":179493666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":180084625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180611375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":179978125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179890333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":179663083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":179996124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179163708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":180090292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":178751750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":179493624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":180084583 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 180587020.5,180013812.5,180857062.5,181955979.5,179929353.5,179562521.5,179394271.5,180024937.5,179914604.5 + ], + "N":9, + "Min":179394271.5, + "LowerFence":178905980.5, + "Q1":179914604.5, + "Median":180013812.5, + "Mean":180248840.3888889, + "Q3":180587020.5, + "UpperFence":181595644.5, + "Max":181955979.5, + "InterquartileRange":672416, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 181955979.5 + ], + "AllOutliers":[ + 181955979.5 + ], + "StandardError":261382.58426174012, + "Variance":614887698198.1111, + "StandardDeviation":784147.7527852204, + "Skewness":0.9672430111361676, + "Kurtosis":2.770342434390435, + "ConfidenceInterval":{ + "N":9, + "Mean":180248840.3888889, + "StandardError":261382.58426174012, + "Level":12, + "Margin":1317709.4415109218, + "Lower":178931130.94737798, + "Upper":181566549.8303998 + }, + "Percentiles":{ + "P0":179394271.5, + "P25":179914604.5, + "P50":180013812.5, + "P67":180227287.38, + "P80":180695037.3, + "P85":180803054.1, + "P90":181076845.89999998, + "P95":181516412.7, + "P100":181955979.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":116083 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":194714333 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":334 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":417 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":181135791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":183982666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180587083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180013875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":180857125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":181956042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179929416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":179562584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":179394334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":180025000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":179914667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180587020.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180013812.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180857062.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":181955979.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":179929353.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179562521.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":179394271.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":180024937.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":179914604.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 152145333,152025667,150891166,150298416,150421083,150526791,150078208,150798042,151188541,151648583 + ], + "N":10, + "Min":150078208, + "LowerFence":148818416.25, + "Q1":150447510, + "Median":150844604, + "Mean":151002183, + "Q3":151533572.5, + "UpperFence":153162666.25, + "Max":152145333, + "InterquartileRange":1086062.5, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":230303.29185827012, + "Variance":530396062407.55554, + "StandardDeviation":728282.9549066458, + "Skewness":0.3602604673242286, + "Kurtosis":1.4652165244805158, + "ConfidenceInterval":{ + "N":10, + "Mean":151002183, + "StandardError":230303.29185827012, + "Level":12, + "Margin":1101059.9063240124, + "Lower":149901123.093676, + "Upper":152103242.906324 + }, + "Percentiles":{ + "P0":150078208, + "P25":150447510, + "P50":150844604, + "P67":151202342.26, + "P80":151723999.8, + "P85":151893687.6, + "P90":152037633.6, + "P95":152091483.3, + "P100":152145333 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":117209 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":171354917 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":176247500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":152145375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":152025709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150891208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150298458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150421125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150526833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150078250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150798084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":151188583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":151648625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":152145333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":152025667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150891166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150298416 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150421083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":150526791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150078208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150798042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":151188541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":151648583 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 150944708,149347458,148889166,148693500,149331208,149838291,150536166,150346291 + ], + "N":8, + "Min":148693500, + "LowerFence":147461104.125, + "Q1":149220697.5, + "Median":149592874.5, + "Mean":149740848.5, + "Q3":150393759.75, + "UpperFence":152153353.125, + "Max":150944708, + "InterquartileRange":1173062.25, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":286690.6829029453, + "Variance":657532381306.8572, + "StandardDeviation":810883.7039346994, + "Skewness":0.1346560262603157, + "Kurtosis":1.276888892602479, + "ConfidenceInterval":{ + "N":8, + "Mean":149740848.5, + "StandardError":286690.6829029453, + "Level":12, + "Margin":1550389.532122444, + "Lower":148190458.96787757, + "Upper":151291238.03212243 + }, + "Percentiles":{ + "P0":148693500, + "P25":149220697.5, + "P50":149592874.5, + "P67":150188811, + "P80":150460216, + "P85":150526672.25, + "P90":150658728.60000002, + "P95":150801718.3, + "P100":150944708 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":115917 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":177026625 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":149622292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":150944750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":153382208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":154169667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":149347500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":148889208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":148693542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":149331250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":149838333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150536208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":150346333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":150944708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":149347458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":148889166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":148693500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":149331208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":149838291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150536166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150346291 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run2-handshake.json b/src/Titanium.Tls/design/perf-baselines/macmini/run2-handshake.json new file mode 100644 index 000000000..87d296c4f --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run2-handshake.json @@ -0,0 +1,1003 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-171935", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":136583 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":148833 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 8442108.3,8096400,7653345.8,7995639.55,9034993.7,7999022.9,8137285.4,7757308.3,7673106.25 + ], + "N":9, + "Min":7653345.8, + "LowerFence":7187342.6499999985, + "Q1":7757308.3, + "Median":7999022.9, + "Mean":8087690.022222221, + "Q3":8137285.4, + "UpperFence":8707251.05, + "Max":9034993.7, + "InterquartileRange":379977.10000000056, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 9034993.7 + ], + "AllOutliers":[ + 9034993.7 + ], + "StandardError":144892.39190544994, + "Variance":188944247088.7425, + "StandardDeviation":434677.17571634986, + "Skewness":0.9524207861374758, + "Kurtosis":2.7957233201888214, + "ConfidenceInterval":{ + "N":9, + "Mean":8087690.022222221, + "StandardError":144892.39190544994, + "Level":12, + "Margin":730446.8021699748, + "Lower":7357243.220052246, + "Upper":8818136.824392196 + }, + "Percentiles":{ + "P0":7653345.8, + "P25":7757308.3, + "P50":7999022.9, + "P67":8111118.744, + "P80":8259214.5600000005, + "P85":8381143.720000001, + "P90":8560685.379999999, + "P95":8797839.54, + "P100":9034993.7 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":191093 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":148458 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":248631875 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":206034750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":168842208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":161928042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":153066958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":159912833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180699916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":185241834 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":159980500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":162745750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":155146208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":153462167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":168842166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":161928000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":153066916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":159912791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":180699874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":159980458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":162745708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":155146166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":153462125 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":191093, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 7863337.5,8063166.65,7257291.65,7430400,8685354.15,7834750,7282443.75,7387706.2,7097502.05,8320158.3 + ], + "N":10, + "Min":7097502.05, + "LowerFence":6252084.362499999, + "Q1":7308759.3625, + "Median":7632575, + "Mean":7722211.025, + "Q3":8013209.362500001, + "UpperFence":9069884.362500003, + "Max":8685354.15, + "InterquartileRange":704450.0000000009, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":164346.24023318393, + "Variance":270096866787.8341, + "StandardDeviation":519708.4440220633, + "Skewness":0.46982358130311447, + "Kurtosis":1.7252765567889201, + "ConfidenceInterval":{ + "N":10, + "Mean":7722211.025, + "StandardError":164346.24023318393, + "Level":12, + "Margin":785725.0081653798, + "Lower":6936486.01683462, + "Upper":8507936.03316538 + }, + "Percentiles":{ + "P0":7097502.05, + "P25":7308759.3625, + "P50":7632575, + "P67":7869332.3745, + "P80":8114564.98, + "P85":8230211.2225, + "P90":8356677.885, + "P95":8521016.0175, + "P100":8685354.15 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":254509 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":147708 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":230884542 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":583 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":202126708 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":157266792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":161263375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":145145875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":148608042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":173707125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":156695042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":145648917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":147754166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":141950083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":166403208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":157266750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":161263333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":145145833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":148608000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":173707083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":156695000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":145648875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":147754124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":141950041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":166403166 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":254509, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run2-resumed.json b/src/Titanium.Tls/design/perf-baselines/macmini/run2-resumed.json new file mode 100644 index 000000000..596b693a1 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run2-resumed.json @@ -0,0 +1,996 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-171943", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2080437.5,2071579.2,1874935.45,942352.1,875100.05,938539.6,931718.75,918964.6,828622.95,838720.9 + ], + "N":10, + "Min":828622.95, + "LowerFence":-247518.94999999937, + "Q1":886066.1875000001, + "Median":935129.175, + "Mean":1230097.1099999999, + "Q3":1641789.6124999998, + "UpperFence":2775374.749999999, + "Max":2080437.5, + "InterquartileRange":755723.4249999997, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":171302.30522587444, + "Variance":293444797756.9866, + "StandardDeviation":541705.4529511278, + "Skewness":0.7575179316080692, + "Kurtosis":1.5025495791645462, + "ConfidenceInterval":{ + "N":10, + "Mean":1230097.1099999999, + "StandardError":171302.30522587444, + "Level":12, + "Margin":818981.3468283502, + "Lower":411115.76317164965, + "Upper":2049078.4568283502 + }, + "Percentiles":{ + "P0":828622.95, + "P25":886066.1875000001, + "P50":935129.175, + "P67":970329.6005000003, + "P80":1914264.1999999997, + "P85":2002753.8874999997, + "P90":2072465.03, + "P95":2076451.265, + "P100":2080437.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172432 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":117458 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42590375 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41913542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41608791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41431625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":37498750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":18847083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17502042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":18770833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":18634416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18379333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16572500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16774459 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41608750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41431584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":37498709 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":18847042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":17502001 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":18770792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":18634375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":18379292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16572459 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16774418 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172432, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 1592639.55,1597837.5,1596239.55,1586477.05,1008904.15,429152.1,421206.25,413968.75,411610.4,399297.9 + ], + "N":10, + "Min":399297.9, + "LowerFence":-1347203.0750000002, + "Q1":415778.125, + "Median":719028.125, + "Mean":945733.32, + "Q3":1591098.925, + "UpperFence":3354080.125, + "Max":1597837.5, + "InterquartileRange":1175320.8, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":185294.54907072088, + "Variance":343340699153.2179, + "StandardDeviation":585952.8130773142, + "Skewness":0.1682696680477069, + "Kurtosis":0.9339848756984124, + "ConfidenceInterval":{ + "N":10, + "Mean":945733.32, + "StandardError":185294.54907072088, + "Level":12, + "Margin":885877.0415132117, + "Lower":59856.27848678827, + "Upper":1831610.3615132116 + }, + "Percentiles":{ + "P0":399297.9, + "P25":415778.125, + "P50":719028.125, + "P67":1586661.925, + "P80":1593359.5499999998, + "P85":1594979.55, + "P90":1596399.3450000002, + "P95":1597118.4224999999, + "P100":1597837.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235864 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":114166 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":33755458 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":32255625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":31852833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":31956792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31924833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":31729583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":20178125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":8583084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":8424167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":8279417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":8232250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":7986000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":31852791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":31956750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31924791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":31729541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":20178083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":8583042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":8424125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":8279375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":8232208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":7985958 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235864, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run2-small.json b/src/Titanium.Tls/design/perf-baselines/macmini/run2-small.json new file mode 100644 index 000000000..f93d2c27e --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run2-small.json @@ -0,0 +1,1869 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-171945", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 90925.82,88603.34,87786.66,83342.5,84597.5,78512.48,75741.66,79750.82 + ], + "N":8, + "Min":75741.66, + "LowerFence":66616.84250000003, + "Q1":79441.235, + "Median":83970, + "Mean":83657.5975, + "Q3":87990.82999999999, + "UpperFence":100815.22249999997, + "Max":90925.82, + "InterquartileRange":8549.594999999987, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":1888.482471295925, + "Variance":28530928.35513572, + "StandardDeviation":5341.435046421113, + "Skewness":-0.09492612982041355, + "Kurtosis":1.3115166481392901, + "ConfidenceInterval":{ + "N":8, + "Mean":83657.5975, + "StandardError":1888.482471295925, + "Level":12, + "Margin":10212.691341926571, + "Lower":73444.90615807343, + "Upper":93870.28884192658 + }, + "Percentiles":{ + "P0":75741.66, + "P25":79441.235, + "P50":83970, + "P67":86798.02040000001, + "P80":88276.668, + "P85":88562.506, + "P90":89300.084, + "P95":90112.952, + "P100":90925.82 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":112500 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6324500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5780208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5487458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4546333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4430209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4389375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4167167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4229917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":3925666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":3787125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":3987583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":5397792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4546291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":4430167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4389333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4167125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4229875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":3925624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":3787083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":3987541 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 110769.16,111911.66,110656.66,109584.16,88994.16,89880.82,88882.48,89137.5,87338.32,89183.34 + ], + "N":10, + "Min":87338.32, + "LowerFence":56992.18499999998, + "Q1":89029.995, + "Median":89532.08, + "Mean":97633.82600000002, + "Q3":110388.535, + "UpperFence":142426.34500000003, + "Max":111911.66, + "InterquartileRange":21358.540000000008, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3574.1866697132646, + "Variance":127748103.49956001, + "StandardDeviation":11302.570658905875, + "Skewness":0.34649331831928365, + "Kurtosis":0.9625233949001217, + "ConfidenceInterval":{ + "N":10, + "Mean":97633.82600000002, + "StandardError":3574.1866697132646, + "Level":12, + "Margin":17087.874029003822, + "Lower":80545.95197099619, + "Upper":114721.70002900384 + }, + "Percentiles":{ + "P0":87338.32, + "P25":89029.995, + "P50":89532.08, + "P67":109616.335, + "P80":110679.16, + "P85":110729.785, + "P90":110883.41, + "P95":111397.535, + "P100":111911.66 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":110209 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6817500 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5682208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5538500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5595625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5532875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5479250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4449750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4494083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4444166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4456917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4366958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4459209 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5538458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5595583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5532833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":5479208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4449708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4494041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4444124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4456875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4366916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4459167 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 23234.16,22221.66,22087.5,22631.66,22398.32,23511.66,24165.82,22343.34,24974.16,23341.66 + ], + "N":10, + "Min":22087.5, + "LowerFence":20688.972499999996, + "Q1":22357.085, + "Median":22932.91, + "Mean":23090.994000000002, + "Q3":23469.16, + "UpperFence":25137.2725, + "Max":24974.16, + "InterquartileRange":1112.0750000000007, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":297.66439442283166, + "Variance":886040.917071111, + "StandardDeviation":941.2974647108697, + "Skewness":0.6592609878941009, + "Kurtosis":2.053198383673525, + "ConfidenceInterval":{ + "N":10, + "Mean":23090.994000000002, + "StandardError":297.66439442283166, + "Level":12, + "Margin":1423.1074492886266, + "Lower":21667.886550711377, + "Upper":24514.101449288628 + }, + "Percentiles":{ + "P0":22087.5, + "P25":22357.085, + "P50":22932.91, + "P67":23346.760000000002, + "P80":23642.492, + "P85":23936.863999999998, + "P90":24246.654, + "P95":24610.407, + "P100":24974.16 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":115625 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2077250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1239166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1161750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1111125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1104417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1131625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1119958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1175625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1208333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1117209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1248750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1167125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1161708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1111083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1104375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1131583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1119916 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1175583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1208291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1117167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1248708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1167083 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 24834.16,24386.66,24347.5,25326.66,25785,24657.5,24505,24617.5,25377.48,24280 + ], + "N":10, + "Min":24280, + "LowerFence":23235.309999999998, + "Q1":24416.245, + "Median":24637.5, + "Mean":24811.746000000003, + "Q3":25203.535, + "UpperFence":26384.47, + "Max":25785, + "InterquartileRange":787.2900000000009, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":162.19021178987478, + "Variance":263056.64800444443, + "StandardDeviation":512.8904834410991, + "Skewness":0.6466128163511108, + "Kurtosis":1.7917367396829609, + "ConfidenceInterval":{ + "N":10, + "Mean":24811.746000000003, + "StandardError":162.19021178987478, + "Level":12, + "Margin":775.4172246479701, + "Lower":24036.328775352034, + "Upper":25587.16322464797 + }, + "Percentiles":{ + "P0":24280, + "P25":24416.245, + "P50":24637.5, + "P67":24848.935, + "P80":25336.824, + "P85":25359.693, + "P90":25418.231999999996, + "P95":25601.616, + "P100":25785 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":117708 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2189625 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1306292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1241750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1219375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1217417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1266375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1289292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1232917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1225292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1230917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1268916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1214042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1241708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1219333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1217375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1266333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1289250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1232875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1225250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1230875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1268874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1214000 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run3-bulk.json b/src/Titanium.Tls/design/perf-baselines/macmini/run3-bulk.json new file mode 100644 index 000000000..f67038ea1 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run3-bulk.json @@ -0,0 +1,1932 @@ +{ + "Title":"Titanium.Managed.Benchmarks.BulkBenchmarks-20261129-171955", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Platform&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Platform, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 180216500,178905833,179719625,179006542,178780750,179032874,178888708,178910624,179335708 + ], + "N":9, + "Min":178780750, + "LowerFence":178261020.5, + "Q1":178905833, + "Median":179006542, + "Mean":179199684.8888889, + "Q3":179335708, + "UpperFence":179980520.5, + "Max":180216500, + "InterquartileRange":429875, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + 180216500 + ], + "AllOutliers":[ + 180216500 + ], + "StandardError":159426.10709557967, + "Variance":228750152612.86118, + "StandardDeviation":478278.321286739, + "Skewness":1.0454429962294547, + "Kurtosis":2.5463115753728935, + "ConfidenceInterval":{ + "N":9, + "Mean":179199684.8888889, + "StandardError":159426.10709557967, + "Level":12, + "Margin":803715.6994852115, + "Lower":178395969.18940368, + "Upper":180003400.5883741 + }, + "Percentiles":{ + "P0":178780750, + "P25":178905833, + "P50":179006542, + "P67":179141894.24, + "P80":179489274.8, + "P85":179642841.6, + "P90":179819000, + "P95":180017750, + "P100":180216500 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":113250 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":202566666 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":209 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":208 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":179678709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180216542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":178905875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179719667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":179006584 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":178780792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179032916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":178888750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":178910666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":179335750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":181141375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180216500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":178905833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":179719625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":179006542 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":178780750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":179032874 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":178888708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":178910624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":179335708 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Loopback&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Loopback, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 180499375,181128375,180819541,180734541,179760791,180005041,180248374,180143041 + ], + "N":8, + "Min":179760791, + "LowerFence":179137666, + "Q1":180108541, + "Median":180373874.5, + "Mean":180417384.875, + "Q3":180755791, + "UpperFence":181726666, + "Max":181128375, + "InterquartileRange":647250, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":162542.25387467246, + "Variance":211359874357.26785, + "StandardDeviation":459738.91977650515, + "Skewness":0.10066154522228149, + "Kurtosis":1.4357316894331447, + "ConfidenceInterval":{ + "N":8, + "Mean":180417384.875, + "StandardError":162542.25387467246, + "Level":12, + "Margin":879009.4131527563, + "Lower":179538375.46184725, + "Upper":181296394.28815275 + }, + "Percentiles":{ + "P0":179760791, + "P25":180108541, + "P50":180373874.5, + "P67":180661639.54, + "P80":180785541, + "P85":180815291, + "P90":180912191.2, + "P95":181020283.10000002, + "P100":181128375 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":110916 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":206314458 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":250 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180755833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":183675541 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":180499417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":181128417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":180819583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":185180250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":180734583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":179760833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":180005083 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":180248416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":180143083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":180499375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":181128375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":180819541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":180734541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":179760791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":180005041 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":180248374 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":180143041 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=16384]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=16384", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 16384)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 150834416,150089375,149953833,149519833,148922791,149683875,150020750,150275667,148537916 + ], + "N":9, + "Min":148537916, + "LowerFence":148665520, + "Q1":149519833, + "Median":149953833, + "Mean":149759828.44444445, + "Q3":150089375, + "UpperFence":150943688, + "Max":150834416, + "InterquartileRange":569542, + "LowerOutliers":[ + 148537916 + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + 148537916 + ], + "StandardError":232504.92922875797, + "Variance":486526879041.0278, + "StandardDeviation":697514.7876862739, + "Skewness":-0.3228747064092898, + "Kurtosis":1.94593085157388, + "ConfidenceInterval":{ + "N":9, + "Mean":149759828.44444445, + "StandardError":232504.92922875797, + "Level":12, + "Margin":1172128.3623692773, + "Lower":148587700.08207518, + "Upper":150931956.80681372 + }, + "Percentiles":{ + "P0":148537916, + "P25":149519833, + "P50":149953833, + "P67":150045455, + "P80":150163891.8, + "P85":150238408.6, + "P90":150387416.8, + "P95":150610916.4, + "P100":150834416 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":124208 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":167218167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173525709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":153307792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150834458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":150089417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":149953875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":149519875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":148922833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":149683917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150020792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150275709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":148537958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":150834416 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":150089375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":149953833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":149519833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":148922791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":149683875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":150020750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150275667 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":148537916 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"BulkBenchmarks.Bulk256MiB: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory, Chunk=65536]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"BulkBenchmarks", + "Method":"Bulk256MiB", + "MethodTitle":"Bulk256MiB", + "Parameters":"Stack=Managed&Transport=Memory&Chunk=65536", + "FullName":"Titanium.Managed.Benchmarks.BulkBenchmarks.Bulk256MiB(Stack: Managed, Transport: Memory, Chunk: 65536)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 151427376,152462584,151354709,150977292,152162334,151675792,152032750,150555876,150933042 + ], + "N":9, + "Min":150555876, + "LowerFence":149394105, + "Q1":150977292, + "Median":151427376, + "Mean":151509083.8888889, + "Q3":152032750, + "UpperFence":153615937, + "Max":152462584, + "InterquartileRange":1055458, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":210543.4731930178, + "Variance":398956986937.6111, + "StandardDeviation":631630.4195790534, + "Skewness":0.03617232761311179, + "Kurtosis":1.46660573137015, + "ConfidenceInterval":{ + "N":9, + "Mean":151509083.8888889, + "StandardError":210543.4731930178, + "Level":12, + "Margin":1061413.9547917494, + "Lower":150447669.93409714, + "Upper":152570497.84368065 + }, + "Percentiles":{ + "P0":150555876, + "P25":150977292, + "P50":151427376, + "P67":151804296.88, + "P80":152084583.6, + "P85":152136417.2, + "P90":152222384, + "P95":152342484, + "P100":152462584 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":1, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":114209 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":174800417 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":1, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":1, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":1, + "Nanoseconds":41 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":173476667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":154273208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":151427417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":152462625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":151354750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":150977333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":152162375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":151675833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":152032791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150555917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":1, + "Nanoseconds":150933083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":1, + "Nanoseconds":151427376 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":1, + "Nanoseconds":152462584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":1, + "Nanoseconds":151354709 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":1, + "Nanoseconds":150977292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":1, + "Nanoseconds":152162334 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":1, + "Nanoseconds":151675792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":1, + "Nanoseconds":152032750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":1, + "Nanoseconds":150555876 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":1, + "Nanoseconds":150933042 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run3-handshake.json b/src/Titanium.Tls/design/perf-baselines/macmini/run3-handshake.json new file mode 100644 index 000000000..972348dd0 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run3-handshake.json @@ -0,0 +1,1017 @@ +{ + "Title":"Titanium.Managed.Benchmarks.HandshakeBenchmarks-20261129-172007", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":136584 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Platform, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Platform&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Platform, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":141458 + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 8222118.75,8236906.25,7728789.6,7838743.75,8471479.2,7883675,7824758.35,8085179.15,7602822.9,7925762.55 + ], + "N":10, + "Min":7602822.9, + "LowerFence":7288810.974999999, + "Q1":7828254.699999999, + "Median":7904718.775, + "Mean":7982023.55, + "Q3":8187883.85, + "UpperFence":8727327.575, + "Max":8471479.2, + "InterquartileRange":359629.1500000004, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":84250.8526149287, + "Variance":70982061663.42438, + "StandardDeviation":266424.5890743277, + "Skewness":0.3702958139771616, + "Kurtosis":1.8056038795695306, + "ConfidenceInterval":{ + "N":10, + "Mean":7982023.55, + "StandardError":84250.8526149287, + "Level":12, + "Margin":402795.96153145656, + "Lower":7579227.588468543, + "Upper":8384819.511531456 + }, + "Percentiles":{ + "P0":7602822.9, + "P25":7828254.699999999, + "P50":7904718.775, + "P67":8089287.338, + "P80":8225076.25, + "P85":8231730.625, + "P90":8260363.545, + "P95":8365921.372499999, + "P100":8471479.2 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":191093 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":150208 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":243922667 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":917 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":209 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":206481209 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":164442458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":164738208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":154575875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":156774958 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":169429667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":157673583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":156495250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":161703666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":152056541 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":158515334 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":164442375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":164738125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":154575792 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":156774875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":169429584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":157673500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":156495167 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":161703583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":152056458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":158515251 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":191093, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"HandshakeBenchmarks.FullHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [stack=Managed, transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"HandshakeBenchmarks", + "Method":"FullHandshake", + "MethodTitle":"FullHandshake", + "Parameters":"stack=Managed&transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.HandshakeBenchmarks.FullHandshake(stack: Managed, transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 7714191.65,9415958.3,9308039.55,7595733.3,8287104.1,7615389.55,8493916.6,7679243.75,7225631.25,7072852.05 + ], + "N":10, + "Min":7072852.05, + "LowerFence":6338298.19375, + "Q1":7600647.3625, + "Median":7696717.7, + "Mean":8040806.010000001, + "Q3":8442213.475, + "UpperFence":9704562.643749999, + "Max":9415958.3, + "InterquartileRange":841566.1124999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":257785.75232506348, + "Variance":664534941017.9897, + "StandardDeviation":815190.1256872471, + "Skewness":0.5625765200292966, + "Kurtosis":1.7256565610488723, + "ConfidenceInterval":{ + "N":10, + "Mean":8040806.010000001, + "StandardError":257785.75232506348, + "Level":12, + "Margin":1232451.1474259545, + "Lower":6808354.8625740465, + "Upper":9273257.157425955 + }, + "Percentiles":{ + "P0":7072852.05, + "P25":7600647.3625, + "P50":7696717.7, + "P67":8293308.475, + "P80":8656741.19, + "P85":9023096.5175, + "P90":9318831.425, + "P95":9367394.8625, + "P100":9415958.3 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":254552 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":148875 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":227233875 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":292 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":208 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":196547916 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":154283917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":188319250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":186160875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":151914750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":165742166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":152307875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":169878416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":153584959 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":144512709 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":141457125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":154283833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":188319166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":186160791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":151914666 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":165742082 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":152307791 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":169878332 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":153584875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":144512625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":141457041 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":254552, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run3-resumed.json b/src/Titanium.Tls/design/perf-baselines/macmini/run3-resumed.json new file mode 100644 index 000000000..0754d0c4c --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run3-resumed.json @@ -0,0 +1,989 @@ +{ + "Title":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks-20261129-172015", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 2003537.5,2001460.4,2008612.5,1188793.75,832625,798804.15,812456.2,817568.75,810231.25,804908.35 + ], + "N":10, + "Min":798804.15, + "LowerFence":-670471.8874999995, + "Q1":810787.4875, + "Median":825096.875, + "Mean":1207899.785, + "Q3":1798293.7374999998, + "UpperFence":3279553.1124999993, + "Max":2008612.5, + "InterquartileRange":987506.2499999998, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":177693.56972023402, + "Variance":315750047199.1968, + "StandardDeviation":561916.4058818684, + "Skewness":0.6457991493900591, + "Kurtosis":1.359366831429215, + "ConfidenceInterval":{ + "N":10, + "Mean":1207899.785, + "StandardError":177693.56972023402, + "Level":12, + "Margin":849537.4236810522, + "Lower":358362.36131894775, + "Upper":2057437.208681052 + }, + "Percentiles":{ + "P0":798804.15, + "P25":810787.4875, + "P50":825096.875, + "P67":1213173.7495000002, + "P80":2001875.82, + "P85":2002810.5150000001, + "P90":2004045, + "P95":2006328.75, + "P100":2008612.5 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":172448 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":117209 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42991084 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41162042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":40070792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":40029250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":40172292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":23775917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":16652542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":15976125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16249166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16351417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16204667 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16098209 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":40070750 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":40029208 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":40172250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":23775875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":16652500 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":15976083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":16249124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":16351375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":16204625 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":16098167 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":172448, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"ResumedHandshakeBenchmarks.ResumedHandshake: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"ResumedHandshakeBenchmarks", + "Method":"ResumedHandshake", + "MethodTitle":"ResumedHandshake", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.ResumedHandshakeBenchmarks.ResumedHandshake(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 1589166.65,1588554.15,1583512.45,1580812.5,1583514.55,444443.75,424099.95,417916.65,415956.2,413695.8 + ], + "N":10, + "Min":413695.8, + "LowerFence":-1326614.85, + "Q1":419462.47500000003, + "Median":1012628.125, + "Mean":1004167.265, + "Q3":1583514.0250000001, + "UpperFence":3329591.3500000006, + "Max":1589166.65, + "InterquartileRange":1164051.55, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":193667.6205831058, + "Variance":375071472623.2183, + "StandardDeviation":612430.7900679213, + "Skewness":-0.00042962303456025544, + "Kurtosis":0.8106341387936926, + "ConfidenceInterval":{ + "N":10, + "Mean":1004167.265, + "StandardError":193667.6205831058, + "Level":12, + "Margin":925907.964478674, + "Lower":78259.30052132602, + "Upper":1930075.229478674 + }, + "Percentiles":{ + "P0":413695.8, + "P25":419462.47500000003, + "P50":1012628.125, + "P67":1583512.5129999998, + "P80":1584522.47, + "P85":1586790.29, + "P90":1588615.4, + "P95":1588891.025, + "P100":1589166.65 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":20, + "BytesAllocatedPerOperation":235864 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":113083 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":33669833 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":20, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":20, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":20, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":20, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":32352833 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":31783375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":31771125 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31670291 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":31616292 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":31670333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":8888917 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":8482041 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":8358375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":8319166 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":8273958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":20, + "Nanoseconds":31783333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":20, + "Nanoseconds":31771083 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":20, + "Nanoseconds":31670249 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":20, + "Nanoseconds":31616250 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":20, + "Nanoseconds":31670291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":20, + "Nanoseconds":8888875 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":20, + "Nanoseconds":8481999 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":20, + "Nanoseconds":8358333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":20, + "Nanoseconds":8319124 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":20, + "Nanoseconds":8273916 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":235864, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Tls/design/perf-baselines/macmini/run3-small.json b/src/Titanium.Tls/design/perf-baselines/macmini/run3-small.json new file mode 100644 index 000000000..bf85cff00 --- /dev/null +++ b/src/Titanium.Tls/design/perf-baselines/macmini/run3-small.json @@ -0,0 +1,1918 @@ +{ + "Title":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks-20261129-172017", + "HostEnvironmentInfo":{ + "BenchmarkDotNetCaption":"BenchmarkDotNet", + "BenchmarkDotNetVersion":"0.14.0", + "OsVersion":"macOS 26.6.2 (25G83) [Darwin 25.6.0]", + "ProcessorName":"Apple M1", + "PhysicalProcessorCount":1, + "PhysicalCoreCount":8, + "LogicalCoreCount":8, + "RuntimeVersion":".NET 10.0.15 (10.0.1526.53008)", + "Architecture":"Arm64", + "HasAttachedDebugger":false, + "HasRyuJit":true, + "Configuration":"RELEASE", + "DotNetCliVersion":"10.0.404", + "ChronometerFrequency":{ + "Hertz":1000000000 + }, + "HardwareTimerKind":"Unknown" + }, + "Benchmarks":[ + { + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Platform, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Platform&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Platform, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":null, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":0, + "BytesAllocatedPerOperation":null + }, + "Measurements":[ + + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 115099.16,117836.66,88280.84,88502.5,88826.66,105118.34,107643.32,87711.66,86726.66,86690.84 + ], + "N":10, + "Min":86690.84, + "LowerFence":59116.77499999995, + "Q1":87853.95499999999, + "Median":88664.58, + "Mean":97243.664, + "Q3":107012.07500000001, + "UpperFence":135749.25500000006, + "Max":117836.66, + "InterquartileRange":19158.120000000024, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":4018.662401731646, + "Variance":161496474.99091563, + "StandardDeviation":12708.126336754589, + "Skewness":0.5286663969828294, + "Kurtosis":1.331330631733937, + "ConfidenceInterval":{ + "N":10, + "Mean":97243.664, + "StandardError":4018.662401731646, + "Level":12, + "Margin":19212.87364976752, + "Lower":78030.79035023248, + "Upper":116456.53764976753 + }, + "Percentiles":{ + "P0":86690.84, + "P25":87853.95499999999, + "P50":88664.58, + "P67":105194.0894, + "P80":109134.488, + "P85":112489.616, + "P90":115372.91, + "P95":116604.785, + "P100":117836.66 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":110666 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6921917 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5474500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5755000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5891875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4414084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4425167 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4441375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5255959 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5382208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4385625 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4336375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4334584 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5754958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5891833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":4414042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4425125 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4441333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":5255917 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":5382166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4385583 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4336333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4334542 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Loopback]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Loopback", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Loopback)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 113759.17,111734.99,109070.83,89510.01,88900.85,89828.33,88264.17,87780.01,86839.17,87479.17 + ], + "N":10, + "Min":86839.17, + "LowerFence":63362.31749999997, + "Q1":87901.04999999999, + "Median":89205.43, + "Mean":95316.67000000001, + "Q3":104260.205, + "UpperFence":128798.93750000003, + "Max":113759.17, + "InterquartileRange":16359.155000000013, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":3564.7959119814986, + "Variance":127077698.94080006, + "StandardDeviation":11272.874475518658, + "Skewness":0.7543102578125092, + "Kurtosis":1.5017499756472952, + "ConfidenceInterval":{ + "N":10, + "Mean":95316.67000000001, + "StandardError":3564.7959119814986, + "Level":12, + "Margin":17042.97763718493, + "Lower":78273.69236281508, + "Upper":112359.64763718494 + }, + "Percentiles":{ + "P0":86839.17, + "P25":87901.04999999999, + "P50":89205.43, + "P67":90405.60500000001, + "P80":109603.662, + "P85":110802.53400000001, + "P90":111937.408, + "P95":112848.28899999999, + "P100":113759.17 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":111125 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":6856875 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":4487000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5688000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5586791 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5453583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4475542 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4445084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4491458 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4413250 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4389042 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4342000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4374000 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":5687958.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":5586749.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":5453541.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":4475500.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":4445042.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":4491416.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":4413208.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":4389000.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":4341958.5 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":4373958.5 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small100: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small100", + "MethodTitle":"Small100", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small100(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 23150.82,23896.66,22863.32,23366.66,22887.5,23104.98,23727.5,23066.66,22644.98,22283.34 + ], + "N":10, + "Min":22283.34, + "LowerFence":22204.3625, + "Q1":22869.364999999998, + "Median":23085.82, + "Mean":23099.242000000002, + "Q3":23312.699999999997, + "UpperFence":23977.702499999996, + "Max":23896.66, + "InterquartileRange":443.3349999999991, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":151.96471346116283, + "Variance":230932.7413733333, + "StandardDeviation":480.55461851212425, + "Skewness":0.10340764096988674, + "Kurtosis":1.9803056662429261, + "ConfidenceInterval":{ + "N":10, + "Mean":23099.242000000002, + "StandardError":151.96471346116283, + "Level":12, + "Margin":726.5300110042472, + "Lower":22372.711988995754, + "Upper":23825.77201100425 + }, + "Percentiles":{ + "P0":22283.34, + "P25":22869.364999999998, + "P50":23085.82, + "P67":23157.2952, + "P80":23438.827999999998, + "P85":23601.206, + "P90":23744.415999999997, + "P95":23820.538, + "P100":23896.66 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":114291 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2073667 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1182792 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1157583 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1194875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1143208 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1168375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1144417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1155291 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1186417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1153375 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1132291 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1114209 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1157541 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1194833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1143166 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1168333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1144375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1155249 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1186375 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1153333 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1132249 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1114167 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + },{ + "DisplayInfo":"SmallExchangeBenchmarks.Small1024: local(InvocationCount=1, IterationCount=10, LaunchCount=1, UnrollFactor=1, WarmupCount=1) [Stack=Managed, Transport=Memory]", + "Namespace":"Titanium.Managed.Benchmarks", + "Type":"SmallExchangeBenchmarks", + "Method":"Small1024", + "MethodTitle":"Small1024", + "Parameters":"Stack=Managed&Transport=Memory", + "FullName":"Titanium.Managed.Benchmarks.SmallExchangeBenchmarks.Small1024(Stack: Managed, Transport: Memory)", + "HardwareIntrinsics":"AdvSIMD,AES,CRC32,DP,RDM,SHA1,SHA256 VectorSize=128", + "Statistics":{ + "OriginalValues":[ + 24940.84,24849.16,24652.48,24705.84,24899.16,24796.66,24734.16,24805.82,24537.5 + ], + "N":9, + "Min":24537.5, + "LowerFence":24490.86, + "Q1":24705.84, + "Median":24796.66, + "Mean":24769.068888888887, + "Q3":24849.16, + "UpperFence":25064.14, + "Max":24940.84, + "InterquartileRange":143.3199999999997, + "LowerOutliers":[ + + ], + "UpperOutliers":[ + + ], + "AllOutliers":[ + + ], + "StandardError":42.0629742319129, + "Variance":15923.644211111117, + "StandardDeviation":126.1889226957387, + "Skewness":-0.35630652213098235, + "Kurtosis":1.8747572588256392, + "ConfidenceInterval":{ + "N":9, + "Mean":24769.068888888887, + "StandardError":42.0629742319129, + "Level":12, + "Margin":212.05230042380958, + "Lower":24557.016588465078, + "Upper":24981.121189312697 + }, + "Percentiles":{ + "P0":24537.5, + "P25":24705.84, + "P50":24796.66, + "P67":24821.422400000003, + "P80":24869.16, + "P85":24889.159999999996, + "P90":24907.496, + "P95":24924.167999999998, + "P100":24940.84 + } + }, + "Memory":{ + "Gen0Collections":0, + "Gen1Collections":0, + "Gen2Collections":0, + "TotalOperations":50, + "BytesAllocatedPerOperation":0 + }, + "Measurements":[ + { + "IterationMode":"Overhead", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":115666 + },{ + "IterationMode":"Workload", + "IterationStage":"Jitting", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":2142916 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":0 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":11, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":12, + "Operations":50, + "Nanoseconds":125 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":13, + "Operations":50, + "Nanoseconds":167 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":14, + "Operations":50, + "Nanoseconds":84 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":15, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":16, + "Operations":50, + "Nanoseconds":41 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":17, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":18, + "Operations":50, + "Nanoseconds":42 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":19, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Overhead", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":20, + "Operations":50, + "Nanoseconds":83 + },{ + "IterationMode":"Workload", + "IterationStage":"Warmup", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1355416 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1247084 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1242500 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1232666 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1235334 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1245000 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1271417 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1239875 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1236750 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1240333 + },{ + "IterationMode":"Workload", + "IterationStage":"Actual", + "LaunchIndex":1, + "IterationIndex":10, + "Operations":50, + "Nanoseconds":1226917 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":1, + "Operations":50, + "Nanoseconds":1247042 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":2, + "Operations":50, + "Nanoseconds":1242458 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":3, + "Operations":50, + "Nanoseconds":1232624 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":4, + "Operations":50, + "Nanoseconds":1235292 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":5, + "Operations":50, + "Nanoseconds":1244958 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":6, + "Operations":50, + "Nanoseconds":1239833 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":7, + "Operations":50, + "Nanoseconds":1236708 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":8, + "Operations":50, + "Nanoseconds":1240291 + },{ + "IterationMode":"Workload", + "IterationStage":"Result", + "LaunchIndex":1, + "IterationIndex":9, + "Operations":50, + "Nanoseconds":1226875 + } + ], + "Metrics":[ + { + "Value":0, + "Descriptor":{ + "Id":"Gen0Collects", + "DisplayName":"Gen0", + "Legend":"GC Generation 0 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":0 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen1Collects", + "DisplayName":"Gen1", + "Legend":"GC Generation 1 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":1 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Gen2Collects", + "DisplayName":"Gen2", + "Legend":"GC Generation 2 collects per 1000 operations", + "NumberFormat":"#0.0000", + "UnitType":0, + "Unit":"Count", + "TheGreaterTheBetter":false, + "PriorityInCategory":2 + } + },{ + "Value":0, + "Descriptor":{ + "Id":"Allocated Memory", + "DisplayName":"Allocated", + "Legend":"Allocated memory per single operation (managed only, inclusive, 1KB = 1024B)", + "NumberFormat":"0.##", + "UnitType":2, + "Unit":"B", + "TheGreaterTheBetter":false, + "PriorityInCategory":3 + } + } + ] + } + ] +} diff --git a/src/Titanium.Web.Proxy.Abstractions/Clusters/ClusterConfig.cs b/src/Titanium.Web.Proxy.Abstractions/Clusters/ClusterConfig.cs index 873497c86..40b10d950 100644 --- a/src/Titanium.Web.Proxy.Abstractions/Clusters/ClusterConfig.cs +++ b/src/Titanium.Web.Proxy.Abstractions/Clusters/ClusterConfig.cs @@ -196,6 +196,13 @@ public sealed class ClusterHttpClientConfig /// Overrides the TLS SNI value and the name checked against the upstream certificate. public string? ServerName { get; init; } + /// + /// Browser ClientHello profile for this cluster's upstream handshake. chrome is the only name. + /// It needs the managed TLS stack. The proxy refuses the handshake while that stack is off, + /// and also while the managed ClientHello is still the built-in one. + /// + public string? Fingerprint { get; init; } + /// /// When false, only a certificate name mismatch is tolerated. Chain, expiry, and revocation /// errors still fail the handshake. @@ -227,13 +234,19 @@ public sealed class ClusterHttpClientConfig private string BuildConnectionKey() { if (SslProtocols is null && !AcceptAnyServerCertificate && MaxConnectionsPerServer is null && - ConnectTimeout is null && RequestTimeout is null && !HasTlsMaterial) + ConnectTimeout is null && RequestTimeout is null && !HasTlsMaterial && + string.IsNullOrEmpty(Fingerprint)) { return string.Empty; } var key = (SslProtocols ?? string.Empty) + "|" + AcceptAnyServerCertificate + "|" + MaxConnectionsPerServer + "|" + ConnectTimeout?.TotalMilliseconds + "|" + RequestTimeout?.TotalMilliseconds; + if (!string.IsNullOrEmpty(Fingerprint)) + { + key += "|fp:" + Fingerprint; + } + if (!HasTlsFiles && VerifyHostname && string.IsNullOrEmpty(ServerName)) { return key; diff --git a/src/Titanium.Web.Proxy.Abstractions/ManagedStackRequiredException.cs b/src/Titanium.Web.Proxy.Abstractions/ManagedStackRequiredException.cs new file mode 100644 index 000000000..7a2da9504 --- /dev/null +++ b/src/Titanium.Web.Proxy.Abstractions/ManagedStackRequiredException.cs @@ -0,0 +1,31 @@ +using System; + +namespace Titanium.Web.Proxy.Abstractions; + +/// +/// A feature was requested that the platform TLS and QUIC stacks cannot perform. +/// +public sealed class ManagedStackRequiredException : NotSupportedException +{ + /// + /// Why the feature needs the managed stack. + /// + public const string Reason = + "The platform TLS and QUIC APIs do not let a program choose the exact ClientHello, extension order or QUIC Initial layout, and do not expose raw UDP datagrams to a QUIC connection, so these features can only be built on a TLS and QUIC implementation we own."; + + /// Creates an error that names the feature, the flag, and . + /// The feature that was requested. + /// The proxy flag that has to be on. + public ManagedStackRequiredException(string feature, string flag) + : base(feature + " needs " + flag + " or TITANIUM_MANAGED_STACK. " + Reason) + { + Feature = feature; + Flag = flag; + } + + /// The feature that was requested. + public string Feature { get; } + + /// The flag that has to be on. + public string Flag { get; } +} diff --git a/src/Titanium.Web.Proxy.Abstractions/PublicAPI.Unshipped.txt b/src/Titanium.Web.Proxy.Abstractions/PublicAPI.Unshipped.txt index 1cd62bd50..366dd5e6a 100644 --- a/src/Titanium.Web.Proxy.Abstractions/PublicAPI.Unshipped.txt +++ b/src/Titanium.Web.Proxy.Abstractions/PublicAPI.Unshipped.txt @@ -504,6 +504,11 @@ Titanium.Web.Proxy.Abstractions.Clusters.LoadBalanceAlgorithm.FirstAlphabetical Titanium.Web.Proxy.Abstractions.Clusters.LoadBalanceAlgorithm.PowerOfTwoChoices = 4 -> Titanium.Web.Proxy.Abstractions.Clusters.LoadBalanceAlgorithm Titanium.Web.Proxy.Abstractions.Clusters.ClusterConfig.HttpClient.get -> Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig? Titanium.Web.Proxy.Abstractions.Clusters.ClusterConfig.HttpClient.init -> void +Titanium.Web.Proxy.Abstractions.ManagedStackRequiredException +Titanium.Web.Proxy.Abstractions.ManagedStackRequiredException.ManagedStackRequiredException(string! feature, string! flag) -> void +Titanium.Web.Proxy.Abstractions.ManagedStackRequiredException.Feature.get -> string! +Titanium.Web.Proxy.Abstractions.ManagedStackRequiredException.Flag.get -> string! +const Titanium.Web.Proxy.Abstractions.ManagedStackRequiredException.Reason = "The platform TLS and QUIC APIs do not let a program choose the exact ClientHello, extension order or QUIC Initial layout, and do not expose raw UDP datagrams to a QUIC connection, so these features can only be built on a TLS and QUIC implementation we own." -> string! Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.AcceptAnyServerCertificate.get -> bool Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.AcceptAnyServerCertificate.init -> void @@ -682,6 +687,8 @@ Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.ClientCertifica Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.ClientCertificateKeyPath.init -> void Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.ClientCertificatePasswordEnv.get -> string? Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.ClientCertificatePasswordEnv.init -> void +Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.Fingerprint.get -> string? +Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.Fingerprint.init -> void Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.CaBundlePath.get -> string? Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.CaBundlePath.init -> void Titanium.Web.Proxy.Abstractions.Clusters.ClusterHttpClientConfig.ServerName.get -> string? diff --git a/src/Titanium.Web.Proxy.Configuration/Models/ServerConfig.cs b/src/Titanium.Web.Proxy.Configuration/Models/ServerConfig.cs index 57803c68a..a63869753 100644 --- a/src/Titanium.Web.Proxy.Configuration/Models/ServerConfig.cs +++ b/src/Titanium.Web.Proxy.Configuration/Models/ServerConfig.cs @@ -41,6 +41,26 @@ public sealed class ServerConfig public bool? EnableHttp3 { get; set; } + /// + /// When true, sets both UseManagedTlsStack and UseManagedQuicStack. + /// and override this per protocol. + /// Null leaves the library default, which is off. + /// + public bool? ManagedStack { get; set; } + + /// Overrides for TLS. Null inherits the umbrella, then the library default. + public bool? ManagedTls { get; set; } + + /// Overrides for QUIC. Null inherits the umbrella, then the library default. + public bool? ManagedQuic { get; set; } + + /// + /// Allows the managed stacks to start while FIPS mode is on. The managed stack then uses only FIPS-approved + /// algorithms, so a browser fingerprint will not match, and it is not a FIPS-validated module. + /// TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1 is the same switch for library callers. + /// + public bool? ManagedStackFipsOverride { get; set; } + public bool? EnableRfc8441 { get; set; } /// diff --git a/src/Titanium.Web.Proxy.Configuration/PublicAPI.Unshipped.txt b/src/Titanium.Web.Proxy.Configuration/PublicAPI.Unshipped.txt index 47c2b849e..1a601790a 100644 --- a/src/Titanium.Web.Proxy.Configuration/PublicAPI.Unshipped.txt +++ b/src/Titanium.Web.Proxy.Configuration/PublicAPI.Unshipped.txt @@ -319,6 +319,14 @@ Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttp2.get -> bool? Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttp2.set -> void Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttp3.get -> bool? Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttp3.set -> void +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedQuic.get -> bool? +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedQuic.set -> void +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedStack.get -> bool? +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedStack.set -> void +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedStackFipsOverride.get -> bool? +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedStackFipsOverride.set -> void +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedTls.get -> bool? +Titanium.Web.Proxy.Configuration.Models.ServerConfig.ManagedTls.set -> void Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttpsSvcbDnsDiscovery.get -> bool? Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableHttpsSvcbDnsDiscovery.set -> void Titanium.Web.Proxy.Configuration.Models.ServerConfig.EnableQpackDynamicTable.get -> bool? diff --git a/src/Titanium.Web.Proxy.Configuration/Titanium.Web.Proxy.Configuration.csproj b/src/Titanium.Web.Proxy.Configuration/Titanium.Web.Proxy.Configuration.csproj index 5fb0e151a..75fb8298d 100644 --- a/src/Titanium.Web.Proxy.Configuration/Titanium.Web.Proxy.Configuration.csproj +++ b/src/Titanium.Web.Proxy.Configuration/Titanium.Web.Proxy.Configuration.csproj @@ -24,6 +24,7 @@ + diff --git a/src/Titanium.Web.Proxy.Configuration/TwpConfigValidator.cs b/src/Titanium.Web.Proxy.Configuration/TwpConfigValidator.cs index ba6aa2625..7eae8cb94 100644 --- a/src/Titanium.Web.Proxy.Configuration/TwpConfigValidator.cs +++ b/src/Titanium.Web.Proxy.Configuration/TwpConfigValidator.cs @@ -3,6 +3,7 @@ using System.Security.Authentication; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; +using Titanium.Web.Proxy.Abstractions; using Titanium.Web.Proxy.Abstractions.Clusters; using Titanium.Web.Proxy.Abstractions.Network; using Titanium.Web.Proxy.Abstractions.Plugins; @@ -59,6 +60,7 @@ public static IReadOnlyList Validate(TwpConfig config) ValidateListenerOverlaps(config, errors); ValidateScriptWiring(config, errors); ValidateServer(config.Server, errors); + ValidateManagedOnlyFeatures(config, errors); ValidateZoneAware(config, errors); ValidateTcpTlsListeners(config, errors); ValidateOverload(config.Server?.Overload, errors); @@ -2691,6 +2693,36 @@ private static void ValidateTemplate(RouteConfig route, List errors) } } + private static void ValidateManagedOnlyFeatures(TwpConfig config, List errors) + { + bool managedTls = config.Server?.ManagedTls ?? config.Server?.ManagedStack ?? false; + foreach (ClusterConfig cluster in config.Clusters ?? []) + { + string? profile = cluster.HttpClient?.Fingerprint; + if (string.IsNullOrWhiteSpace(profile)) + { + continue; + } + + if (!profile.Equals("chrome", StringComparison.OrdinalIgnoreCase)) + { + errors.Add($"Cluster '{cluster.Id}' httpClient.fingerprint '{profile}' is unknown. The known profile is chrome."); + continue; + } + + if (!managedTls) + { + errors.Add(new ManagedStackRequiredException("Upstream fingerprint evasion", "UseManagedTlsStack").Message); + } + + string? fips = Titanium.Tls.FipsEnvironment.ManagedStackRefusal(true, config.Server?.ManagedStackFipsOverride == true); + if (fips is not null) + { + errors.Add(fips + " Upstream fingerprint evasion will not match a browser under the FIPS-approved algorithm set."); + } + } + } + private static void ValidateServer(ServerConfig? server, List errors) { if (server is null) @@ -2698,6 +2730,14 @@ private static void ValidateServer(ServerConfig? server, List errors) return; } + bool managedRequested = server.ManagedStack == true || server.ManagedTls == true || server.ManagedQuic == true; + string? fipsRefusal = Titanium.Tls.FipsEnvironment.ManagedStackRefusal( + managedRequested, server.ManagedStackFipsOverride == true); + if (fipsRefusal is not null) + { + errors.Add(fipsRefusal); + } + if (!string.IsNullOrWhiteSpace(server.Profile) && !KnownProfiles.Contains(server.Profile)) { errors.Add($"server.profile '{server.Profile}' is unknown (Balanced, LegacyCompatible, PublicFacing)."); diff --git a/src/Titanium.Web.Proxy.Configuration/twp.schema.json b/src/Titanium.Web.Proxy.Configuration/twp.schema.json index 8bf25defd..fbcff54d4 100644 --- a/src/Titanium.Web.Proxy.Configuration/twp.schema.json +++ b/src/Titanium.Web.Proxy.Configuration/twp.schema.json @@ -252,6 +252,9 @@ "connectionKey": { "type": "string" }, + "fingerprint": { + "type": "string" + }, "maxConnectionsPerServer": { "type": "integer", "description": "Hard cap on open upstream connections per destination, including idle pooled sockets. Waiters time out after the connect timeout with 503 and Retry-After." @@ -1805,6 +1808,18 @@ "localZone": { "type": "string" }, + "managedQuic": { + "type": "boolean" + }, + "managedStack": { + "type": "boolean" + }, + "managedStackFipsOverride": { + "type": "boolean" + }, + "managedTls": { + "type": "boolean" + }, "metrics": { "type": "object", "additionalProperties": false, diff --git a/src/Titanium.Web.Proxy.sln b/src/Titanium.Web.Proxy.sln index 9cc3265c2..39d38c36f 100644 --- a/src/Titanium.Web.Proxy.sln +++ b/src/Titanium.Web.Proxy.sln @@ -88,6 +88,36 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Xds", "Titanium.Xd EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Inspector.ClearProxy", "Titanium.Inspector.ClearProxy\Titanium.Inspector.ClearProxy.csproj", "{B1178C07-48FF-4267-A13D-BF5D2F782C06}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ManagedStack", "ManagedStack", "{7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Tls", "Titanium.Tls\Titanium.Tls.csproj", "{455CBA53-2469-4606-A07F-24255301F6AB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Quic", "Titanium.Quic\Titanium.Quic.csproj", "{16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Net.Compatibility", "Titanium.Net.Compatibility\Titanium.Net.Compatibility.csproj", "{AC8DC0B7-9323-4637-8A6B-576A22C7201B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Tls.Tests", "..\tests\Titanium.Tls.Tests\Titanium.Tls.Tests.csproj", "{F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Quic.Tests", "..\tests\Titanium.Quic.Tests\Titanium.Quic.Tests.csproj", "{C6CA7F34-C377-4A41-A6FC-51592194F478}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Net.Compatibility.Tests", "..\tests\Titanium.Net.Compatibility.Tests\Titanium.Net.Compatibility.Tests.csproj", "{BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Managed.Benchmarks", "..\benchmarks\Titanium.Managed.Benchmarks\Titanium.Managed.Benchmarks.csproj", "{84C93745-1378-4D3F-91C0-0DF0A1E5D34B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Quic.UdpOffload", "Titanium.Quic.UdpOffload\Titanium.Quic.UdpOffload.csproj", "{D8CD5F33-8B30-4363-AE37-98530E1D7BFA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Http3", "Titanium.Http3\Titanium.Http3.csproj", "{B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Net.Http", "Titanium.Net.Http\Titanium.Net.Http.csproj", "{A728E437-C98E-4F3E-8E0B-86B003D67C4E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Titanium.Net.Http.Tests", "..\tests\Titanium.Net.Http.Tests\Titanium.Net.Http.Tests.csproj", "{51AA46CC-AE6B-4A71-862E-61562DC2E2BA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClientManagedStack", "..\samples\HttpClientManagedStack\HttpClientManagedStack.csproj", "{C7742379-7EF0-4942-9A37-33EF1873E9D1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TlsStreamEcho", "..\samples\TlsStreamEcho\TlsStreamEcho.csproj", "{E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuicEcho", "..\samples\QuicEcho\QuicEcho.csproj", "{9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -494,6 +524,174 @@ Global {B1178C07-48FF-4267-A13D-BF5D2F782C06}.Release|x64.Build.0 = Release|Any CPU {B1178C07-48FF-4267-A13D-BF5D2F782C06}.Release|x86.ActiveCfg = Release|Any CPU {B1178C07-48FF-4267-A13D-BF5D2F782C06}.Release|x86.Build.0 = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|x64.ActiveCfg = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|x64.Build.0 = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|x86.ActiveCfg = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Debug|x86.Build.0 = Debug|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|Any CPU.Build.0 = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|x64.ActiveCfg = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|x64.Build.0 = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|x86.ActiveCfg = Release|Any CPU + {455CBA53-2469-4606-A07F-24255301F6AB}.Release|x86.Build.0 = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|x64.ActiveCfg = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|x64.Build.0 = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|x86.ActiveCfg = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Debug|x86.Build.0 = Debug|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|Any CPU.Build.0 = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|x64.ActiveCfg = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|x64.Build.0 = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|x86.ActiveCfg = Release|Any CPU + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0}.Release|x86.Build.0 = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|x64.ActiveCfg = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|x64.Build.0 = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|x86.ActiveCfg = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Debug|x86.Build.0 = Debug|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|Any CPU.Build.0 = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|x64.ActiveCfg = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|x64.Build.0 = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|x86.ActiveCfg = Release|Any CPU + {AC8DC0B7-9323-4637-8A6B-576A22C7201B}.Release|x86.Build.0 = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|x64.ActiveCfg = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|x64.Build.0 = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|x86.ActiveCfg = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Debug|x86.Build.0 = Debug|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|Any CPU.Build.0 = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|x64.ActiveCfg = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|x64.Build.0 = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|x86.ActiveCfg = Release|Any CPU + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634}.Release|x86.Build.0 = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|x64.ActiveCfg = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|x64.Build.0 = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|x86.ActiveCfg = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Debug|x86.Build.0 = Debug|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|Any CPU.Build.0 = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|x64.ActiveCfg = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|x64.Build.0 = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|x86.ActiveCfg = Release|Any CPU + {C6CA7F34-C377-4A41-A6FC-51592194F478}.Release|x86.Build.0 = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|x64.ActiveCfg = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|x64.Build.0 = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Debug|x86.Build.0 = Debug|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|Any CPU.Build.0 = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|x64.ActiveCfg = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|x64.Build.0 = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|x86.ActiveCfg = Release|Any CPU + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B}.Release|x86.Build.0 = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|x64.ActiveCfg = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|x64.Build.0 = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|x86.ActiveCfg = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Debug|x86.Build.0 = Debug|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|Any CPU.Build.0 = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|x64.ActiveCfg = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|x64.Build.0 = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|x86.ActiveCfg = Release|Any CPU + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B}.Release|x86.Build.0 = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|x64.ActiveCfg = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|x64.Build.0 = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|x86.ActiveCfg = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Debug|x86.Build.0 = Debug|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|Any CPU.Build.0 = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|x64.ActiveCfg = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|x64.Build.0 = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|x86.ActiveCfg = Release|Any CPU + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA}.Release|x86.Build.0 = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|x64.ActiveCfg = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|x64.Build.0 = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|x86.ActiveCfg = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Debug|x86.Build.0 = Debug|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|Any CPU.Build.0 = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|x64.ActiveCfg = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|x64.Build.0 = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|x86.ActiveCfg = Release|Any CPU + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D}.Release|x86.Build.0 = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|x64.ActiveCfg = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|x64.Build.0 = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|x86.ActiveCfg = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Debug|x86.Build.0 = Debug|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|Any CPU.Build.0 = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|x64.ActiveCfg = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|x64.Build.0 = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|x86.ActiveCfg = Release|Any CPU + {A728E437-C98E-4F3E-8E0B-86B003D67C4E}.Release|x86.Build.0 = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|x64.ActiveCfg = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|x64.Build.0 = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|x86.ActiveCfg = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Debug|x86.Build.0 = Debug|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|Any CPU.Build.0 = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|x64.ActiveCfg = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|x64.Build.0 = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|x86.ActiveCfg = Release|Any CPU + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA}.Release|x86.Build.0 = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|x64.ActiveCfg = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|x64.Build.0 = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|x86.ActiveCfg = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Debug|x86.Build.0 = Debug|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|Any CPU.Build.0 = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|x64.ActiveCfg = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|x64.Build.0 = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|x86.ActiveCfg = Release|Any CPU + {C7742379-7EF0-4942-9A37-33EF1873E9D1}.Release|x86.Build.0 = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|x64.ActiveCfg = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|x64.Build.0 = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|x86.ActiveCfg = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Debug|x86.Build.0 = Debug|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|Any CPU.Build.0 = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|x64.ActiveCfg = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|x64.Build.0 = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|x86.ActiveCfg = Release|Any CPU + {E4A1C0B2-7D55-4C1A-9F10-6B2E8A91C4D7}.Release|x86.Build.0 = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|x64.ActiveCfg = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|x64.Build.0 = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|x86.ActiveCfg = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Debug|x86.Build.0 = Debug|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|Any CPU.Build.0 = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|x64.ActiveCfg = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|x64.Build.0 = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|x86.ActiveCfg = Release|Any CPU + {9C3F2A18-5E64-4B77-A1D2-0F8E6C4B91A5}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -509,6 +707,17 @@ Global {3B3B18AF-B5F5-4569-BC65-0F9583ECAB96} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64} {CD7C64F0-3769-4CC4-9E51-B57CD71D4DC9} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64} {0784B662-C7C4-4D0A-A03E-EEA962D4DA1A} = {BC1E0789-D348-49CF-8B67-5E99D50EDF64} + {455CBA53-2469-4606-A07F-24255301F6AB} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {16ACEA21-9CF1-4B06-AFC1-0CB65177BAD0} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {AC8DC0B7-9323-4637-8A6B-576A22C7201B} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {F0C31DB7-F492-4D5E-9C7B-09EC4A07E634} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {C6CA7F34-C377-4A41-A6FC-51592194F478} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {BA074B8A-9FCC-44D8-A56F-2BA153D04B7B} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {84C93745-1378-4D3F-91C0-0DF0A1E5D34B} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {D8CD5F33-8B30-4363-AE37-98530E1D7BFA} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {B355CF9D-4E9C-4D56-BBC2-00F3D1B9BE0D} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {A728E437-C98E-4F3E-8E0B-86B003D67C4E} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} + {51AA46CC-AE6B-4A71-862E-61562DC2E2BA} = {7A67E07A-EDE8-3E29-6CA7-8FB9511FC0F2} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {625C1EB5-44CF-47DE-A85A-B4C8C40ED90A} diff --git a/src/Titanium.Web.Proxy/Certificates/ClientCertificateHandshake.cs b/src/Titanium.Web.Proxy/Certificates/ClientCertificateHandshake.cs index 4d221298a..f1dc9656a 100644 --- a/src/Titanium.Web.Proxy/Certificates/ClientCertificateHandshake.cs +++ b/src/Titanium.Web.Proxy/Certificates/ClientCertificateHandshake.cs @@ -42,9 +42,12 @@ internal static void Apply(SslServerAuthenticationOptions options, ClientCertifi } } - internal static void Capture(TcpClientConnection connection, SslStream stream, ClientCertificateMode mode) + internal static void Capture(TcpClientConnection connection, SslStream stream, ClientCertificateMode mode) => + Capture(connection, stream.RemoteCertificate, mode); + + internal static void Capture(TcpClientConnection connection, X509Certificate? remoteCertificate, ClientCertificateMode mode) { - if (mode == ClientCertificateMode.None || stream.RemoteCertificate is not X509Certificate remote) + if (mode == ClientCertificateMode.None || remoteCertificate is not X509Certificate remote) { return; } diff --git a/src/Titanium.Web.Proxy/Handlers/ConnectUdpOnListener.cs b/src/Titanium.Web.Proxy/Handlers/ConnectUdpOnListener.cs index c60be44a4..0c0dd7f76 100644 --- a/src/Titanium.Web.Proxy/Handlers/ConnectUdpOnListener.cs +++ b/src/Titanium.Web.Proxy/Handlers/ConnectUdpOnListener.cs @@ -65,7 +65,7 @@ void ReleaseOnce() try { await MasqueTunnel.RelayAsync(admission.Host, streamState.InboundTunnelChannel.Reader, body, - admission.Open.Socket, logger, token).ConfigureAwait(false); + admission.Open.Socket, logger, token, ConnectUdpQuicOrNull()).ConfigureAwait(false); } finally { diff --git a/src/Titanium.Web.Proxy/Handlers/ExplicitClientHandler.cs b/src/Titanium.Web.Proxy/Handlers/ExplicitClientHandler.cs index aedb2d4f3..4d2e645b5 100644 --- a/src/Titanium.Web.Proxy/Handlers/ExplicitClientHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/ExplicitClientHandler.cs @@ -7,6 +7,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.Diagnostics; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Exceptions; @@ -347,6 +348,62 @@ await HeaderParser.ReadHeaders(clientStream, connectRequest.Headers, cancellatio { try { + if (UseManagedTlsStack) + { + var managed = CreateManagedTlsStream(clientStream, leaveInnerStreamOpen: false); + try + { + if (prefetchConnectionTask == null && EnableTcpServerConnectionPrefetch + && !requiresHttp11Bridge && !requiresH3Bridge && deferredHttp2Negotiation == null) + prefetchConnectionTask = TcpConnectionFactory.GetServerConnection(this, connectArgs, + true, http2Supported ? SslExtensions.Http2ProtocolAsList : null, false, true, + CancellationToken.None); + + var managedOptions = new SslServerAuthenticationOptions + { + ApplicationProtocols = http2Supported + ? SslExtensions.Http2AndHttp11ProtocolAsList + : SslExtensions.Http11ProtocolAsList, + ClientCertificateRequired = false, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + }; + CertificateManager.ConfigureServerCertificate(managedOptions, certificate); + ApplyListenerTlsPolicy(managedOptions); + + ClientTlsTiming? managedTiming = null; + if (EnableRequestTimingCapture) + { + managedTiming = new ClientTlsTiming(DateTime.UtcNow); + connectArgs.ClientTlsTiming = managedTiming; + connectTiming?.MarkBrowserTlsStarted(); + } + + ProxyLog.BrowserHandshakeStarting(logger, connectHostname, managedOptions.EnabledSslProtocols, + managedOptions.ApplicationProtocols); + await managed.AuthenticateAsServerAsync(managedOptions, cancellationToken); + managedTiming?.MarkCompleted(); + connectTiming?.MarkBrowserTlsCompleted(); + ProxyLog.BrowserHandshakeSucceeded(logger, connectHostname, + managed.NegotiatedApplicationProtocol); + + clientStream.Connection.NegotiatedApplicationProtocol = + managed.NegotiatedApplicationProtocol; + clientStream.Connection.SslProtocol = managed.SslProtocol; + clientStream = new HttpClientStream(this, clientStream.Connection, managed, BufferPool, + cancellationToken); + clientStream.DataRead += (o, args) => + connectArgs.OnDecryptedDataSent(args.Buffer, args.Offset, args.Count); + clientStream.DataWrite += (o, args) => + connectArgs.OnDecryptedDataReceived(args.Buffer, args.Offset, args.Count); + } + catch + { + await managed.DisposeAsync(); + throw; + } + } + else + { sslStream = new SslStream(clientStream, false); if (prefetchConnectionTask == null && EnableTcpServerConnectionPrefetch @@ -401,6 +458,7 @@ await HeaderParser.ReadHeaders(clientStream, connectRequest.Headers, cancellatio connectArgs.OnDecryptedDataSent(args.Buffer, args.Offset, args.Count); clientStream.DataWrite += (o, args) => connectArgs.OnDecryptedDataReceived(args.Buffer, args.Offset, args.Count); + } } catch (Exception e) { diff --git a/src/Titanium.Web.Proxy/Handlers/MasqueClientHandler.cs b/src/Titanium.Web.Proxy/Handlers/MasqueClientHandler.cs index b502721a4..23f7ae4a2 100644 --- a/src/Titanium.Web.Proxy/Handlers/MasqueClientHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/MasqueClientHandler.cs @@ -10,6 +10,7 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Helpers; @@ -42,6 +43,13 @@ private async Task HandleMasqueClient(MasqueProxyEndPoint endPoint, TcpClientCon } var networkStream = clientConnection.GetStream(); + if (UseManagedTlsStack) + { + await HandleMasqueManagedClientAsync(endPoint, clientConnection, networkStream, certificate, cancellationTokenSource) + .ConfigureAwait(false); + return; + } + var sslStream = new SslStream(networkStream, leaveInnerStreamOpen: false); try { @@ -87,6 +95,56 @@ private async Task HandleMasqueClient(MasqueProxyEndPoint endPoint, TcpClientCon await HandleMasqueHttp11Async(endPoint, clientConnection, clientStream, cancellationTokenSource).ConfigureAwait(false); } + private async Task HandleMasqueManagedClientAsync( + MasqueProxyEndPoint endPoint, + TcpClientConnection clientConnection, + Stream networkStream, + X509Certificate2 certificate, + CancellationTokenSource cancellationTokenSource) + { + var managed = CreateManagedTlsStream(networkStream, leaveInnerStreamOpen: false); + try + { + var options = new SslServerAuthenticationOptions + { + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + ApplicationProtocols = endPoint.Options.AllowHttp11Upgrade + ? SslExtensions.Http2AndHttp11ProtocolAsList + : SslExtensions.Http2ProtocolAsList, + }; + ApplyListenerTlsPolicy(options); + CertificateManager.ConfigureServerCertificate(options, certificate); + + await AwaitPendingClientHelloAsync(clientConnection).ConfigureAwait(false); + await managed.AuthenticateAsServerAsync(options, cancellationTokenSource.Token).ConfigureAwait(false); + } + catch (Exception ex) + { + ProxyDiagnostics.ReportBenign(logger, "MASQUE client handshake failed", ex); + await managed.DisposeAsync().ConfigureAwait(false); + return; + } + + var negotiated = managed.NegotiatedApplicationProtocol; + var http11Upgrade = endPoint.Options.AllowHttp11Upgrade + && (negotiated == SslApplicationProtocol.Http11 || negotiated.Protocol.Length == 0); + if (negotiated != SslApplicationProtocol.Http2 && !http11Upgrade) + { + await managed.DisposeAsync().ConfigureAwait(false); + return; + } + + clientConnection.NegotiatedApplicationProtocol = negotiated; + var clientStream = new HttpClientStream(this, clientConnection, managed, BufferPool, cancellationTokenSource.Token); + if (negotiated == SslApplicationProtocol.Http2) + { + await SendMasqueAsync(clientStream, endPoint, cancellationTokenSource).ConfigureAwait(false); + return; + } + + await HandleMasqueHttp11Async(endPoint, clientConnection, clientStream, cancellationTokenSource).ConfigureAwait(false); + } + private async Task HandleMasqueHttp11Async(MasqueProxyEndPoint endPoint, TcpClientConnection clientConnection, HttpClientStream clientStream, CancellationTokenSource cancellationTokenSource) { @@ -182,7 +240,7 @@ await WriteHttp11Async(clientStream, 101, "Switching Protocols", null, cancellat try { await MasqueTunnel.RelayAsync(endPoint, inbound.Reader, clientStream, opened.Socket, logger, - relayStop.Token).ConfigureAwait(false); + relayStop.Token, ConnectUdpQuicOrNull()).ConfigureAwait(false); } finally { @@ -476,7 +534,7 @@ void ReleaseOnce() { try { - await MasqueTunnel.RelayAsync(endPoint, inbound.Reader, body, udp, logger, token).ConfigureAwait(false); + await MasqueTunnel.RelayAsync(endPoint, inbound.Reader, body, udp, logger, token, ConnectUdpQuicOrNull()).ConfigureAwait(false); } finally { diff --git a/src/Titanium.Web.Proxy/Handlers/QuicClientHandler.cs b/src/Titanium.Web.Proxy/Handlers/QuicClientHandler.cs index a8243ad2d..8583cc03b 100644 --- a/src/Titanium.Web.Proxy/Handlers/QuicClientHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/QuicClientHandler.cs @@ -8,6 +8,8 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Titanium.Net.Compatibility; +using Titanium.Quic; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Http3; @@ -41,7 +43,7 @@ private void ListenQuic(IQuicInboundEndPoint endPoint) QuicListenPolicy.EnsureAllowed(); - if (!QuicListener.IsSupported) + if (!UseManagedQuicStack && !QuicListener.IsSupported) throw new PlatformNotSupportedException( "HTTP/3 (QUIC) requires the MsQuic native library and a supported OS. " + "CLI/Inspector: use the matching RID zip (natives are bundled) or run `titanium http3-deps install`. " + @@ -79,6 +81,14 @@ private void ListenQuic(IQuicInboundEndPoint endPoint) private void ListenSingleQuic(IQuicInboundEndPoint endPoint, CancellationTokenSource cts) { var address = IsWildcard(endPoint.IpAddress) ? IPAddress.IPv6Any : endPoint.IpAddress; + if (UseManagedQuicStack) + { + var managed = BindManagedQuicListener(endPoint, new IPEndPoint(address, endPoint.Port), cts.Token); + endPoint.ManagedQuicListener = managed; + endPoint.AssignPort(managed.LocalEndPoint.Port); + return; + } + var listener = BindQuicListener(endPoint, new IPEndPoint(address, endPoint.Port), cts.Token); endPoint.QuicListener = listener; endPoint.AssignPort(listener.LocalEndPoint.Port); @@ -93,6 +103,12 @@ private void ListenSingleQuic(IQuicInboundEndPoint endPoint, CancellationTokenSo /// private void ListenLoopbackQuic(IQuicInboundEndPoint endPoint, CancellationTokenSource cts) { + if (UseManagedQuicStack) + { + ListenLoopbackManagedQuic(endPoint, cts); + return; + } + var ephemeral = endPoint.Port == 0; const int maxAttempts = 20; for (var attempt = 1; attempt <= maxAttempts; attempt++) @@ -145,6 +161,62 @@ private QuicListener BindQuicListener( .GetAwaiter().GetResult(); } + private void ListenLoopbackManagedQuic(IQuicInboundEndPoint endPoint, CancellationTokenSource cts) + { + var ephemeral = endPoint.Port == 0; + const int maxAttempts = 20; + for (var attempt = 1; attempt <= maxAttempts; attempt++) + { + var v6 = BindManagedQuicListener( + endPoint, new IPEndPoint(IPAddress.IPv6Loopback, endPoint.Port), cts.Token); + endPoint.ManagedQuicListener = v6; + var port = v6.LocalEndPoint.Port; + endPoint.AssignPort(port); + try + { + endPoint.LoopbackV4ManagedQuicListener = BindManagedQuicListener( + endPoint, new IPEndPoint(IPAddress.Loopback, port), cts.Token); + return; + } + catch (Exception ex) when (ephemeral && attempt < maxAttempts && IsAddressAlreadyInUse(ex)) + { + DisposeManagedQuicListener(v6); + endPoint.ManagedQuicListener = null; + endPoint.LoopbackV4ManagedQuicListener = null; + endPoint.AssignPort(0); + } + catch (Exception) + { + DisposeManagedQuicListener(v6); + endPoint.ManagedQuicListener = null; + endPoint.LoopbackV4ManagedQuicListener = null; + throw; + } + } + } + + private ManagedQuicListener BindManagedQuicListener( + IQuicInboundEndPoint endPoint, IPEndPoint listenEndPoint, CancellationToken cancellationToken) + { + var listenerOptions = new QuicListenerOptions { ListenEndPoint = listenEndPoint }; + ManagedQuicListenerOptions managed = QuicListenerOptionsAdapter.ToManaged( + listenerOptions, + (connection, clientHello, callbackToken) => + GetManagedQuicServerConnectionOptionsAsync(endPoint, connection, clientHello, callbackToken)); + if (endPoint.HandshakeTimeout > TimeSpan.Zero) + { + managed.HandshakeTimeout = endPoint.HandshakeTimeout; + } + + if (AllowManagedStackUnderFips) + { + managed.AllowManagedStackUnderFips = true; + } + + return ManagedQuicListener.ListenAsync(managed, cancellationToken).AsTask() + .GetAwaiter().GetResult(); + } + /// /// Stops every for the given endpoint. /// @@ -152,18 +224,35 @@ private static void QuitListenQuic(IQuicInboundEndPoint endPoint) { var primary = endPoint.QuicListener; var v4 = endPoint.LoopbackV4QuicListener; + var managedPrimary = endPoint.ManagedQuicListener; + var managedV4 = endPoint.LoopbackV4ManagedQuicListener; endPoint.QuicListener = null; endPoint.LoopbackV4QuicListener = null; + endPoint.ManagedQuicListener = null; + endPoint.LoopbackV4ManagedQuicListener = null; try { DisposeQuicListener(primary); } finally { - DisposeQuicListener(v4); + try + { + DisposeQuicListener(v4); + } + finally + { + DisposeManagedQuicListener(managedPrimary); + DisposeManagedQuicListener(managedV4); + } } } + private static void DisposeManagedQuicListener(ManagedQuicListener? listener) + { + listener?.DisposeAsync().AsTask().GetAwaiter().GetResult(); + } + private static void DisposeQuicListener(QuicListener? listener) { listener?.DisposeAsync().AsTask().GetAwaiter().GetResult(); @@ -274,6 +363,90 @@ private async ValueTask GetQuicServerConnectionOpti }; } + private async ValueTask GetManagedQuicServerConnectionOptionsAsync( + IQuicInboundEndPoint endPoint, + ManagedQuicConnection connection, + SslClientHelloInfo clientHello, + CancellationToken cancellationToken) + { + var sniHostName = clientHello.ServerName; + var remoteEndPoint = connection.RemoteEndPoint; + var localEndPoint = connection.LocalEndPoint; + + string destHost; + int destPort; + + if (endPoint.OriginalDestinationResolver != null) + { + var resolved = await endPoint.OriginalDestinationResolver.ResolveAsync( + localEndPoint, remoteEndPoint, sniHostName, cancellationToken); + + if (resolved.HasValue) + { + (destHost, destPort) = resolved.Value; + } + else if (endPoint.ForwardHost != null) + { + destHost = endPoint.ForwardHost; + destPort = endPoint.ForwardPort ?? 443; + } + else + { + throw new InvalidOperationException( + $"IOriginalDestinationResolver returned null and no ForwardHost fallback is configured " + + $"on endpoint {endPoint.IpAddress}:{endPoint.Port}. " + + "Configure ForwardHost/ForwardPort or provide an IOriginalDestinationResolver."); + } + } + else if (endPoint.ForwardHost != null) + { + destHost = endPoint.ForwardHost; + destPort = endPoint.ForwardPort ?? 443; + } + else + { + destHost = sniHostName ?? endPoint.GenericCertificateName; + destPort = 443; + } + + var connectionCts = new CancellationTokenSource(); + using var linked = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, connectionCts.Token); + + var eventArgs = new BeforeQuicAuthenticateEventArgs( + this, connectionCts, sniHostName, destHost, destPort, remoteEndPoint, localEndPoint); + + await endPoint.InvokeBeforeQuicAuthenticate(this, eventArgs, Logger); + + if (linked.IsCancellationRequested) + throw new OperationCanceledException(linked.Token); + + var certHost = !string.IsNullOrEmpty(eventArgs.SniHostName) + ? eventArgs.SniHostName + : endPoint.GenericCertificateName; + + endPoint.PendingManagedQuicAuthArgs.AddOrUpdate(connection, eventArgs); + + var cert = await CertificateManager.CreateServerCertificate(certHost) + ?? throw new InvalidOperationException( + $"CertificateManager could not produce a certificate for '{certHost}'."); + + return new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = AllowManagedStackUnderFips, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = cert, + ClientCertificateRequired = false, + EnabledSslProtocols = SupportedServerSslProtocols, + CertificateRevocationCheckMode = CheckCertificateRevocation, + ApplicationProtocols = new List + { + SslApplicationProtocol.Http3 + } + } + }; + } + /// /// Accept loops for every listener on the endpoint (one, or both loopback families). /// @@ -281,6 +454,22 @@ private Task AcceptQuicConnectionsAsync( IQuicInboundEndPoint endPoint, CancellationToken cancellationToken) { + if (UseManagedQuicStack) + { + var managedPrimary = endPoint.ManagedQuicListener; + var managedV4 = endPoint.LoopbackV4ManagedQuicListener; + if (managedPrimary == null) + return managedV4 == null + ? Task.CompletedTask + : AcceptManagedQuicListenerAsync(endPoint, managedV4, cancellationToken); + + return managedV4 == null + ? AcceptManagedQuicListenerAsync(endPoint, managedPrimary, cancellationToken) + : Task.WhenAll( + AcceptManagedQuicListenerAsync(endPoint, managedPrimary, cancellationToken), + AcceptManagedQuicListenerAsync(endPoint, managedV4, cancellationToken)); + } + var primary = endPoint.QuicListener; var v4 = endPoint.LoopbackV4QuicListener; if (primary == null) @@ -336,6 +525,56 @@ private async Task AcceptQuicListenerAsync( } } + private async Task AcceptManagedQuicListenerAsync( + IQuicInboundEndPoint endPoint, + ManagedQuicListener listener, + CancellationToken cancellationToken) + { + while (!cancellationToken.IsCancellationRequested) + { + ManagedQuicConnection connection; + try + { + connection = await listener.AcceptConnectionAsync(cancellationToken); + } + catch (OperationCanceledException) + { + break; + } + catch (ObjectDisposedException) + { + break; + } + catch (Exception ex) + { + Logger.LogError(ex, "Error accepting QUIC connection on {EndPoint}", endPoint.ProxyEndPoint); + continue; + } + + if (!endPoint.PendingManagedQuicAuthArgs.TryGetValue(connection, out var authArgs)) + { + _ = connection.CloseAsync(0x100, cancellationToken).AsTask(); + continue; + } + + endPoint.PendingManagedQuicAuthArgs.Remove(connection); + _ = CloseManagedQuicConnectionAsync(connection, authArgs, cancellationToken); + } + } + + private async Task CloseManagedQuicConnectionAsync( + ManagedQuicConnection connection, + BeforeQuicAuthenticateEventArgs authArgs, + CancellationToken cancellationToken) + { + await using (connection) + { + using var connectionCts = authArgs.TaskCancellationSource; + Logger.LogDebug("HTTP/3 framing still uses the platform QUIC stream."); + await connection.CloseAsync(0x100, cancellationToken); + } + } + /// /// Handles a single accepted QUIC connection. /// diff --git a/src/Titanium.Web.Proxy/Handlers/SocksUdpAssociate.cs b/src/Titanium.Web.Proxy/Handlers/SocksUdpAssociate.cs index 6ee2c73c5..fd9b79a06 100644 --- a/src/Titanium.Web.Proxy/Handlers/SocksUdpAssociate.cs +++ b/src/Titanium.Web.Proxy/Handlers/SocksUdpAssociate.cs @@ -1,10 +1,14 @@ using System; using System.Buffers; +using System.Collections.Generic; using System.Net; +using System.Net.Security; using System.Net.Sockets; using System.Text; using System.Threading; using System.Threading.Tasks; +using Titanium.Quic; +using Titanium.Web.Proxy.Masque; using Titanium.Web.Proxy.Network.Tcp; namespace Titanium.Web.Proxy; @@ -107,6 +111,9 @@ private async Task RelaySocksUdpAsync(Socket relay, IPAddress? expectedClient, C { var buffer = ArrayPool.Shared.Rent(65535); var outbound = ArrayPool.Shared.Rent(65535); + Dictionary? quic = UseManagedQuicStack + ? new Dictionary(StringComparer.Ordinal) + : null; IPEndPoint? client = null; try { @@ -119,12 +126,20 @@ private async Task RelaySocksUdpAsync(Socket relay, IPAddress? expectedClient, C } client = await DispatchSocksDatagramAsync( - relay, expectedClient, client, buffer, outbound, received.Value, cancellationToken) + relay, expectedClient, client, buffer, outbound, quic, received.Value, cancellationToken) .ConfigureAwait(false); } } finally { + if (quic is not null) + { + foreach (ManagedQuicListener listener in quic.Values) + { + await listener.DisposeAsync().ConfigureAwait(false); + } + } + ArrayPool.Shared.Return(buffer); ArrayPool.Shared.Return(outbound); } @@ -149,7 +164,7 @@ private async Task RelaySocksUdpAsync(Socket relay, IPAddress? expectedClient, C private async Task DispatchSocksDatagramAsync( Socket relay, IPAddress? expectedClient, IPEndPoint? client, byte[] buffer, byte[] outbound, - SocketReceiveFromResult received, CancellationToken cancellationToken) + Dictionary? quic, SocketReceiveFromResult received, CancellationToken cancellationToken) { if (received.RemoteEndPoint is not IPEndPoint from) { @@ -168,7 +183,7 @@ private async Task RelaySocksUdpAsync(Socket relay, IPAddress? expectedClient, C if (from.Equals(client)) { - await SendClientSocksDatagramAsync(relay, buffer, received.ReceivedBytes, cancellationToken) + await SendClientSocksDatagramAsync(relay, from, buffer, outbound, quic, received.ReceivedBytes, cancellationToken) .ConfigureAwait(false); } else @@ -181,7 +196,8 @@ await SendTargetSocksReplyAsync(relay, outbound, buffer, received.ReceivedBytes, } private async Task SendClientSocksDatagramAsync( - Socket relay, byte[] buffer, int receivedBytes, CancellationToken cancellationToken) + Socket relay, IPEndPoint client, byte[] buffer, byte[] outbound, Dictionary? quic, + int receivedBytes, CancellationToken cancellationToken) { if (!TryParseSocksUdp(buffer.AsSpan(0, receivedBytes), out var host, out var port, out var headerLength)) { @@ -207,8 +223,81 @@ private async Task SendClientSocksDatagramAsync( return; } + var target = new IPEndPoint(targetAddress, port); + if (quic is not null && (quic.ContainsKey(target.ToString()) || IsQuicDatagram(buffer.AsSpan(headerLength, payloadLength)))) + { + await InjectSocksQuicAsync(relay, client, target, host, buffer, outbound, quic, headerLength, payloadLength, cancellationToken) + .ConfigureAwait(false); + return; + } + await relay.SendToAsync(buffer.AsMemory(headerLength, payloadLength), SocketFlags.None, - new IPEndPoint(targetAddress, port), cancellationToken).ConfigureAwait(false); + target, cancellationToken).ConfigureAwait(false); + } + + private async Task InjectSocksQuicAsync( + Socket relay, IPEndPoint client, IPEndPoint target, string host, byte[] buffer, byte[] outbound, + Dictionary quic, int headerLength, int payloadLength, CancellationToken cancellationToken) + { + string key = target.ToString(); + if (!quic.TryGetValue(key, out ManagedQuicListener? listener)) + { + listener = ManagedQuicListener.CreateInjected( + new ManagedQuicListenerOptions + { + ListenEndPoint = target, + AllowManagedStackUnderFips = AllowManagedStackUnderFips, + ConnectionOptionsCallback = (_, hello, token) => SocksQuicOptionsAsync(host, hello, token), + }, + target, + (datagram, _, token) => SendSocksQuicReplyAsync(relay, outbound, datagram, target, client, token)); + quic.Add(key, listener); + } + + await listener.HandleDatagramAsync(buffer.AsMemory(headerLength, payloadLength), client, cancellationToken) + .ConfigureAwait(false); + await listener.DriveAsync(cancellationToken).ConfigureAwait(false); + } + + internal ConnectUdpQuicSetup? ConnectUdpQuicOrNull() => + UseManagedQuicStack ? new ConnectUdpQuicSetup(AllowManagedStackUnderFips, SocksQuicOptionsAsync) : null; + + internal async ValueTask SocksQuicOptionsAsync( + string host, SslClientHelloInfo hello, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + string certHost = string.IsNullOrEmpty(hello.ServerName) ? host : hello.ServerName; + var cert = await CertificateManager.CreateServerCertificate(certHost).ConfigureAwait(false) + ?? throw new InvalidOperationException($"CertificateManager could not produce a certificate for '{certHost}'."); + return new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = AllowManagedStackUnderFips, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = cert, + ClientCertificateRequired = false, + EnabledSslProtocols = SupportedServerSslProtocols, + CertificateRevocationCheckMode = CheckCertificateRevocation, + ApplicationProtocols = new List { SslApplicationProtocol.Http3 }, + }, + }; + } + + private static bool IsQuicDatagram(ReadOnlySpan payload) => + payload.Length >= 1200 && (payload[0] & 0x80) != 0; + + private static async ValueTask SendSocksQuicReplyAsync( + Socket relay, byte[] outbound, ReadOnlyMemory datagram, IPEndPoint target, IPEndPoint client, + CancellationToken cancellationToken) + { + int wrapped = WriteSocksUdp(outbound, target, datagram.Span); + if (wrapped <= 0) + { + return; + } + + await relay.SendToAsync(outbound.AsMemory(0, wrapped), SocketFlags.None, client, cancellationToken) + .ConfigureAwait(false); } private static async Task SendTargetSocksReplyAsync( diff --git a/src/Titanium.Web.Proxy/Handlers/TcpTlsTerminateHandler.cs b/src/Titanium.Web.Proxy/Handlers/TcpTlsTerminateHandler.cs index 7dc13c8ce..1a30a6fe7 100644 --- a/src/Titanium.Web.Proxy/Handlers/TcpTlsTerminateHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/TcpTlsTerminateHandler.cs @@ -10,6 +10,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.Abstractions.Clusters; using Titanium.Web.Proxy.Abstractions.Routing; using Titanium.Web.Proxy.Abstractions.Scripting; @@ -44,6 +45,61 @@ private async Task HandleTlsTerminateClientAsync( try { await using var networkStream = new NetworkStream(client, ownsSocket: false); + if (UseManagedTlsStack) + { + await using var managed = CreateManagedTlsStream(networkStream, leaveInnerStreamOpen: false); + if (!await TryAuthenticateInboundManagedTlsAsync(managed, endPoint, cancellationToken).ConfigureAwait(false)) + { + result = "handshake_failed"; + return; + } + + var serverName = managed.TargetHostName; + string? clusterId = null; + if (endPoint.PassthroughTable?.Match(serverName) is { } matched) + { + clusterId = matched.ClusterId; + route = matched.ServerName; + } + else if (!string.IsNullOrEmpty(endPoint.PassthroughDefaultClusterId)) + { + clusterId = endPoint.PassthroughDefaultClusterId; + route = "default"; + } + + if (endPoint.StreamFilters is { } streamFilters) + { + filters = StreamFilterChain.Create(streamFilters, client, serverName, clusterId); + var accepted = await filters.OnNewConnectionAsync(cancellationToken).ConfigureAwait(false); + if (accepted.Action == ScriptAction.Deny) + { + route = "filter"; + result = "denied"; + return; + } + + if (accepted.ClusterId is { } chosenCluster) + { + clusterId = chosenCluster; + route = "script"; + } + } + + if (clusterId is null) + { + route = "none"; + result = "no_route"; + return; + } + + var relayOptions = CreatePassthroughOptions(client, endPoint); + relayOptions.Filters = filters; + relayOptions.HalfCloseGrace = TimeSpan.FromSeconds(5); + (bytesIn, bytesOut, result) = await RelayTlsTerminateToClusterAsync( + client, managed, clusterId, relayOptions, cancellationToken).ConfigureAwait(false); + } + else + { await using var clientTls = new SslStream(networkStream, leaveInnerStreamOpen: false); if (!await TryAuthenticateInboundTlsAsync(clientTls, endPoint, cancellationToken).ConfigureAwait(false)) { @@ -94,6 +150,7 @@ private async Task HandleTlsTerminateClientAsync( relayOptions.HalfCloseGrace = TimeSpan.FromSeconds(5); (bytesIn, bytesOut, result) = await RelayTlsTerminateToClusterAsync( client, clientTls, clusterId, relayOptions, cancellationToken).ConfigureAwait(false); + } } catch (OperationCanceledException) { @@ -200,6 +257,78 @@ await clientTls.AuthenticateAsServerAsync(BuildOptions(certificate!), handshakeC } } + private async Task TryAuthenticateInboundManagedTlsAsync( + TlsStream clientTls, + TransparentBaseProxyEndPoint endPoint, + CancellationToken cancellationToken) + { + using var handshakeCts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + if (endPoint.TlsHandshakeTimeout > TimeSpan.Zero) + { + handshakeCts.CancelAfter(endPoint.TlsHandshakeTimeout); + } + + try + { + var certificate = endPoint.GenericCertificate; + if (certificate is null && endPoint.SniCertificates is not { Count: > 0 }) + { + return false; + } + + var clientCertMode = endPoint.ClientCertificateMode; + var requestsClientCert = ClientCertificateHandshake.RequestsCertificate(clientCertMode); + var clientCertificateTrustedRoots = endPoint.ClientCertificateTrustedRoots; + + SslServerAuthenticationOptions BuildOptions(X509Certificate2 serverCertificate) + { + var built = new SslServerAuthenticationOptions + { + ServerCertificate = serverCertificate, + ClientCertificateRequired = requestsClientCert, + EnabledSslProtocols = SupportedSslProtocols, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + AllowRenegotiation = false, + }; + if (endPoint.TerminateTlsAlpn is { Count: > 0 }) + { + built.ApplicationProtocols = endPoint.TerminateTlsAlpn + .Select(static p => new System.Net.Security.SslApplicationProtocol(p)) + .ToList(); + } + + CertificateManager.ConfigureServerCertificate(built, serverCertificate); + ClientCertificateHandshake.Apply(built, clientCertMode, clientCertificateTrustedRoots); + return built; + } + + if (endPoint.SniCertificates is { Count: > 0 } bindings) + { + var fallback = certificate ?? bindings[0].Certificate; + await clientTls.AuthenticateAsServerAsync( + (_, hello, _, _) => new ValueTask( + BuildOptions(SniCertificateSelector.Select(hello.ServerName, bindings) ?? fallback)), + null, + handshakeCts.Token).ConfigureAwait(false); + } + else + { + await clientTls.AuthenticateAsServerAsync(BuildOptions(certificate!), handshakeCts.Token) + .ConfigureAwait(false); + } + + return true; + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + return false; + } + catch (AuthenticationException) + { + return false; + } + } + private async Task<(long BytesIn, long BytesOut, string Result)> RelayTlsTerminateToClusterAsync( Socket clientSocket, Stream clientPlaintext, @@ -300,6 +429,31 @@ private async Task OpenTlsTerminateUpstreamAsync( return stream; } + RejectUpstreamFingerprint(cluster.HttpClient); + if (UseManagedTlsStack) + { + var managedMaterial = UpstreamTlsMaterial.For(cluster.HttpClient); + managedMaterial?.ThrowIfFaulted(); + var managed = CreateManagedTlsStream(stream, leaveInnerStreamOpen: false); + var managedHost = managedMaterial?.ServerName ?? host; + var managedAuth = new SslClientAuthenticationOptions + { + TargetHost = managedHost, + EnabledSslProtocols = SupportedSslProtocols, + CertificateRevocationCheckMode = CheckCertificateRevocation, + RemoteCertificateValidationCallback = (_, certificate, chain, errors) => + ValidateUpstreamCertificate(managedMaterial, certificate, chain, errors), + LocalCertificateSelectionCallback = (_, _, _, _, _) => managedMaterial?.ClientCertificate!, + }; + if (managedMaterial?.ClientCertificate is { } managedCert) + { + managedAuth.ClientCertificates = new X509CertificateCollection { managedCert }; + } + + await managed.AuthenticateAsClientAsync(managedAuth, cancellationToken).ConfigureAwait(false); + return managed; + } + var material = UpstreamTlsMaterial.For(cluster.HttpClient); material?.ThrowIfFaulted(); var ssl = new SslStream(stream, leaveInnerStreamOpen: false, @@ -472,6 +626,12 @@ private static async Task TryHalfCloseWriteAsync(Stream sink) return; } + if (sink is TlsStream managed) + { + await managed.ShutdownAsync().ConfigureAwait(false); + return; + } + if (sink is NetworkStream network) { network.Socket.Shutdown(SocketShutdown.Send); diff --git a/src/Titanium.Web.Proxy/Handlers/TransparentClientHandler.cs b/src/Titanium.Web.Proxy/Handlers/TransparentClientHandler.cs index 08593f55a..096a33b2c 100644 --- a/src/Titanium.Web.Proxy/Handlers/TransparentClientHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/TransparentClientHandler.cs @@ -6,6 +6,7 @@ using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Exceptions; using Titanium.Web.Proxy.Extensions; @@ -104,6 +105,74 @@ private Task HandleClient(TransparentProxyEndPoint endPoint, TcpClientConnection X509Certificate2? certificate = endPoint.GenericCertificate; try { + if (UseManagedTlsStack) + { + var managed = CreateManagedTlsStream(networkStream, leaveInnerStreamOpen: false); + try + { + var managedBindings = endPoint.SniCertificates; + var managedCertMode = endPoint.ClientCertificateMode; + var managedRequestsClientCert = Certificates.ClientCertificateHandshake.RequestsCertificate(managedCertMode); + var managedHasSniBindings = managedBindings is { Count: > 0 }; + var managedTrustedRoots = endPoint.ClientCertificateTrustedRoots; + + SslServerAuthenticationOptions BuildManagedOptions(X509Certificate2 serverCertificate) + { + var built = new SslServerAuthenticationOptions + { + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + ApplicationProtocols = SslExtensions.Http11ProtocolAsList, + AllowRenegotiation = false + }; + ApplyListenerTlsPolicy(built); + CertificateManager.ConfigureServerCertificate(built, serverCertificate); + Certificates.ClientCertificateHandshake.Apply(built, managedCertMode, managedTrustedRoots); + return built; + } + + if (managedHasSniBindings) + { + var bindings = managedBindings!; + var fallback = certificate ?? bindings[0].Certificate; + await AwaitPendingClientHelloAsync(clientConnection); + await managed.AuthenticateAsServerAsync( + (_, hello, _, _) => new ValueTask( + BuildManagedOptions(Certificates.SniCertificateSelector.Select(hello.ServerName, bindings) + ?? fallback)), + null, cancellationToken); + } + else + { + var options = managedRequestsClientCert ? null : endPoint.CachedServerAuthOptions; + if (options == null) + { + options = BuildManagedOptions(certificate!); + if (!managedRequestsClientCert) + { + endPoint.CachedServerAuthOptions = options; + } + } + + await AwaitPendingClientHelloAsync(clientConnection); + await managed.AuthenticateAsServerAsync(options, cancellationToken); + } + + Certificates.ClientCertificateHandshake.Capture(clientConnection, managed.RemoteCertificate, managedCertMode); + RecordClientHandshakeSuccess(httpsHostName); + clientConnection.NegotiatedApplicationProtocol = managed.NegotiatedApplicationProtocol; + clientConnection.SslProtocol = managed.SslProtocol; + clientStream = new HttpClientStream(this, clientConnection, managed, BufferPool, + cancellationToken); + isHttps = !endPoint.ForwardCleartext; + } + catch + { + await managed.DisposeAsync(); + throw; + } + } + else + { // Construct SslStream before WaitForData completes so construction overlaps // ClientHello arrival (Kestrel: Start WaitForData, then middleware builds SslStream). sslStream = new SslStream(networkStream, leaveInnerStreamOpen: false); @@ -168,6 +237,7 @@ await sslStream.AuthenticateAsServerAsync( cancellationToken); sslStream = null; isHttps = !endPoint.ForwardCleartext; + } } catch (Exception e) { @@ -334,6 +404,59 @@ await sslStream.AuthenticateAsServerAsync( { try { + if (UseManagedTlsStack) + { + var managed = CreateManagedTlsStream(clientStream, leaveInnerStreamOpen: false); + try + { + var managedCertMode = endPoint.ClientCertificateMode; + var managedTrustedRoots = endPoint.ClientCertificateTrustedRoots; + var offerHttp2 = http2Supported; + + SslServerAuthenticationOptions BuildManagedOptions(X509Certificate2 serverCertificate) + { + var built = new SslServerAuthenticationOptions + { + CertificateRevocationCheckMode = X509RevocationMode.NoCheck + }; + ApplyListenerTlsPolicy(built); + CertificateManager.ConfigureServerCertificate(built, serverCertificate); + Certificates.ClientCertificateHandshake.Apply(built, managedCertMode, managedTrustedRoots); + built.ApplicationProtocols = offerHttp2 + ? SslExtensions.Http2AndHttp11ProtocolAsList + : SslExtensions.Http11ProtocolAsList; + return built; + } + + if (endPoint.SniCertificates is { Count: > 0 } handshakeBindings) + { + var fallbackCert = certificate; + await managed.AuthenticateAsServerAsync( + (_, hello, _, _) => new ValueTask( + BuildManagedOptions(Certificates.SniCertificateSelector.Select(hello.ServerName, + handshakeBindings) ?? fallbackCert)), + null, cancellationToken); + } + else + { + await managed.AuthenticateAsServerAsync(BuildManagedOptions(certificate), cancellationToken); + } + + Certificates.ClientCertificateHandshake.Capture(clientStream.Connection, managed.RemoteCertificate, managedCertMode); + RecordClientHandshakeSuccess(httpsHostName); + clientStream.Connection.NegotiatedApplicationProtocol = managed.NegotiatedApplicationProtocol; + clientStream = new HttpClientStream(this, clientStream.Connection, managed, BufferPool, + cancellationToken); + isHttps = !endPoint.ForwardCleartext; + } + catch + { + await managed.DisposeAsync(); + throw; + } + } + else + { sslStream = new SslStream(clientStream, false); var peekClientCertMode = endPoint.ClientCertificateMode; @@ -379,6 +502,7 @@ await sslStream.AuthenticateAsServerAsync( cancellationToken); sslStream = null; isHttps = !endPoint.ForwardCleartext; + } } catch (Exception e) { diff --git a/src/Titanium.Web.Proxy/Handlers/TransparentQuicInject.cs b/src/Titanium.Web.Proxy/Handlers/TransparentQuicInject.cs new file mode 100644 index 000000000..c95094e96 --- /dev/null +++ b/src/Titanium.Web.Proxy/Handlers/TransparentQuicInject.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Quic; +using Titanium.Web.Proxy.Abstractions; + +namespace Titanium.Web.Proxy; + +public partial class ProxyServer +{ + private readonly Dictionary _transparentQuic = new(StringComparer.Ordinal); + + private readonly object _transparentQuicGate = new(); + + /// + /// Feeds one redirected datagram to an injected listener. The local address is the origin the client addressed. + /// The reply is handed to . The listener does not open a socket. + /// + internal async ValueTask HandleTransparentQuicDatagramAsync( + ReadOnlyMemory datagram, + IPEndPoint client, + IPEndPoint originalDestination, + Func, IPEndPoint, CancellationToken, ValueTask> send, + CancellationToken cancellationToken = default) + { + if (!UseManagedQuicStack) + { + throw new ManagedStackRequiredException("Transparent UDP interception", nameof(UseManagedQuicStack)); + } + + ArgumentNullException.ThrowIfNull(client); + ArgumentNullException.ThrowIfNull(originalDestination); + ArgumentNullException.ThrowIfNull(send); + ManagedQuicListener listener = TransparentListener(originalDestination, send); + await listener.HandleDatagramAsync(datagram, client, cancellationToken).ConfigureAwait(false); + await listener.DriveAsync(cancellationToken).ConfigureAwait(false); + } + + private ManagedQuicListener TransparentListener( + IPEndPoint originalDestination, + Func, IPEndPoint, CancellationToken, ValueTask> send) + { + string key = originalDestination.ToString(); + lock (_transparentQuicGate) + { + if (_transparentQuic.TryGetValue(key, out ManagedQuicListener? existing)) + { + return existing; + } + + ManagedQuicListener created = ManagedQuicListener.CreateInjected( + new ManagedQuicListenerOptions + { + ListenEndPoint = originalDestination, + AllowManagedStackUnderFips = AllowManagedStackUnderFips, + ConnectionOptionsCallback = (_, hello, token) => SocksQuicOptionsAsync(originalDestination.Address.ToString(), hello, token), + }, + originalDestination, + send, + maximumDatagramSize: 2000); + _transparentQuic.Add(key, created); + return created; + } + } + + private void DisposeTransparentQuic() + { + ManagedQuicListener[] listeners; + lock (_transparentQuicGate) + { + listeners = new ManagedQuicListener[_transparentQuic.Count]; + _transparentQuic.Values.CopyTo(listeners, 0); + _transparentQuic.Clear(); + } + + foreach (ManagedQuicListener listener in listeners) + { + listener.DisposeAsync().AsTask().GetAwaiter().GetResult(); + } + } +} diff --git a/src/Titanium.Web.Proxy/Handlers/WebTransportClientHandler.cs b/src/Titanium.Web.Proxy/Handlers/WebTransportClientHandler.cs index c877e6114..c1bdcc3c6 100644 --- a/src/Titanium.Web.Proxy/Handlers/WebTransportClientHandler.cs +++ b/src/Titanium.Web.Proxy/Handlers/WebTransportClientHandler.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Helpers; @@ -40,7 +41,15 @@ private async Task HandleWebTransportClient(WebTransportProxyEndPoint endPoint, certificate = endPoint.GenericCertificate; } - var sslStream = new SslStream(clientConnection.GetStream(), leaveInnerStreamOpen: false); + var networkStream = clientConnection.GetStream(); + if (UseManagedTlsStack) + { + await HandleWebTransportManagedClientAsync(endPoint, clientConnection, networkStream, certificate, cancellationTokenSource) + .ConfigureAwait(false); + return; + } + + var sslStream = new SslStream(networkStream, leaveInnerStreamOpen: false); try { var options = new SslServerAuthenticationOptions @@ -82,6 +91,55 @@ private async Task HandleWebTransportClient(WebTransportProxyEndPoint endPoint, await HandleWebTransportHttp11Async(endPoint, clientStream, cancellationTokenSource.Token).ConfigureAwait(false); } + private async Task HandleWebTransportManagedClientAsync( + WebTransportProxyEndPoint endPoint, + TcpClientConnection clientConnection, + Stream networkStream, + X509Certificate2 certificate, + CancellationTokenSource cancellationTokenSource) + { + var managed = CreateManagedTlsStream(networkStream, leaveInnerStreamOpen: false); + try + { + var options = new SslServerAuthenticationOptions + { + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + ApplicationProtocols = endPoint.Options.AllowHttp11Upgrade + ? SslExtensions.Http2AndHttp11ProtocolAsList + : SslExtensions.Http2ProtocolAsList, + }; + ApplyListenerTlsPolicy(options); + CertificateManager.ConfigureServerCertificate(options, certificate); + await AwaitPendingClientHelloAsync(clientConnection).ConfigureAwait(false); + await managed.AuthenticateAsServerAsync(options, cancellationTokenSource.Token).ConfigureAwait(false); + } + catch (Exception ex) + { + ProxyDiagnostics.ReportBenign(logger, "WebTransport client handshake failed", ex); + await managed.DisposeAsync().ConfigureAwait(false); + return; + } + + var negotiated = managed.NegotiatedApplicationProtocol; + var http11 = endPoint.Options.AllowHttp11Upgrade + && (negotiated == SslApplicationProtocol.Http11 || negotiated.Protocol.Length == 0); + if (negotiated != SslApplicationProtocol.Http2 && !http11) + { + await managed.DisposeAsync().ConfigureAwait(false); + return; + } + + clientConnection.NegotiatedApplicationProtocol = negotiated; + var clientStream = new HttpClientStream(this, clientConnection, managed, BufferPool, cancellationTokenSource.Token); + if (negotiated == SslApplicationProtocol.Http2) + { + await SendWebTransportAsync(clientStream, endPoint, cancellationTokenSource).ConfigureAwait(false); + return; + } + + await HandleWebTransportHttp11Async(endPoint, clientStream, cancellationTokenSource.Token).ConfigureAwait(false); + } + private async Task SendWebTransportAsync(HttpClientStream clientStream, WebTransportProxyEndPoint endPoint, CancellationTokenSource cancellationTokenSource) { @@ -155,7 +213,7 @@ private async Task WebTransportOnBeforeRequestAsync(SessionEventArgs session, Ht var opened = await WebTransportOrigin.OpenHttp11Async( endPoint.Options.OriginHost, endPoint.Options.OriginPort, endPoint.Options.OriginHttps, - path, ctx.CancellationToken).ConfigureAwait(false); + path, ctx.CancellationToken, UseManagedTlsStack, ManagedTlsOptions()).ConfigureAwait(false); if (opened is null) { session.GenericResponse("webtransport origin upgrade failed", HttpStatusCode.BadGateway); @@ -273,7 +331,7 @@ await WriteHttp11StatusAsync(clientStream, 407, "Proxy Authentication Required", var opened = await WebTransportOrigin.OpenHttp11Async( endPoint.Options.OriginHost, endPoint.Options.OriginPort, endPoint.Options.OriginHttps, - path, cancellationToken).ConfigureAwait(false); + path, cancellationToken, UseManagedTlsStack, ManagedTlsOptions()).ConfigureAwait(false); if (opened is null) { await WriteHttp11StatusAsync(clientStream, 502, "Bad Gateway", cancellationToken).ConfigureAwait(false); diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs b/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs index 6ff3b8206..2acd13bc2 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/HpackUtil.cs @@ -26,290 +26,4 @@ public enum IndexType None, // Section 6.2.2. Literal Header Field without Indexing Never // Section 6.2.3. Literal Header Field never Indexed } - - public const int HuffmanEos = 256; - - // Appendix B: Huffman Codes - // http://tools.ietf.org/html/rfc7541#appendix-B - public static readonly int[] HuffmanCodes = - { - 0x1ff8, - 0x7fffd8, - 0xfffffe2, - 0xfffffe3, - 0xfffffe4, - 0xfffffe5, - 0xfffffe6, - 0xfffffe7, - 0xfffffe8, - 0xffffea, - 0x3ffffffc, - 0xfffffe9, - 0xfffffea, - 0x3ffffffd, - 0xfffffeb, - 0xfffffec, - 0xfffffed, - 0xfffffee, - 0xfffffef, - 0xffffff0, - 0xffffff1, - 0xffffff2, - 0x3ffffffe, - 0xffffff3, - 0xffffff4, - 0xffffff5, - 0xffffff6, - 0xffffff7, - 0xffffff8, - 0xffffff9, - 0xffffffa, - 0xffffffb, - 0x14, - 0x3f8, - 0x3f9, - 0xffa, - 0x1ff9, - 0x15, - 0xf8, - 0x7fa, - 0x3fa, - 0x3fb, - 0xf9, - 0x7fb, - 0xfa, - 0x16, - 0x17, - 0x18, - 0x0, - 0x1, - 0x2, - 0x19, - 0x1a, - 0x1b, - 0x1c, - 0x1d, - 0x1e, - 0x1f, - 0x5c, - 0xfb, - 0x7ffc, - 0x20, - 0xffb, - 0x3fc, - 0x1ffa, - 0x21, - 0x5d, - 0x5e, - 0x5f, - 0x60, - 0x61, - 0x62, - 0x63, - 0x64, - 0x65, - 0x66, - 0x67, - 0x68, - 0x69, - 0x6a, - 0x6b, - 0x6c, - 0x6d, - 0x6e, - 0x6f, - 0x70, - 0x71, - 0x72, - 0xfc, - 0x73, - 0xfd, - 0x1ffb, - 0x7fff0, - 0x1ffc, - 0x3ffc, - 0x22, - 0x7ffd, - 0x3, - 0x23, - 0x4, - 0x24, - 0x5, - 0x25, - 0x26, - 0x27, - 0x6, - 0x74, - 0x75, - 0x28, - 0x29, - 0x2a, - 0x7, - 0x2b, - 0x76, - 0x2c, - 0x8, - 0x9, - 0x2d, - 0x77, - 0x78, - 0x79, - 0x7a, - 0x7b, - 0x7ffe, - 0x7fc, - 0x3ffd, - 0x1ffd, - 0xffffffc, - 0xfffe6, - 0x3fffd2, - 0xfffe7, - 0xfffe8, - 0x3fffd3, - 0x3fffd4, - 0x3fffd5, - 0x7fffd9, - 0x3fffd6, - 0x7fffda, - 0x7fffdb, - 0x7fffdc, - 0x7fffdd, - 0x7fffde, - 0xffffeb, - 0x7fffdf, - 0xffffec, - 0xffffed, - 0x3fffd7, - 0x7fffe0, - 0xffffee, - 0x7fffe1, - 0x7fffe2, - 0x7fffe3, - 0x7fffe4, - 0x1fffdc, - 0x3fffd8, - 0x7fffe5, - 0x3fffd9, - 0x7fffe6, - 0x7fffe7, - 0xffffef, - 0x3fffda, - 0x1fffdd, - 0xfffe9, - 0x3fffdb, - 0x3fffdc, - 0x7fffe8, - 0x7fffe9, - 0x1fffde, - 0x7fffea, - 0x3fffdd, - 0x3fffde, - 0xfffff0, - 0x1fffdf, - 0x3fffdf, - 0x7fffeb, - 0x7fffec, - 0x1fffe0, - 0x1fffe1, - 0x3fffe0, - 0x1fffe2, - 0x7fffed, - 0x3fffe1, - 0x7fffee, - 0x7fffef, - 0xfffea, - 0x3fffe2, - 0x3fffe3, - 0x3fffe4, - 0x7ffff0, - 0x3fffe5, - 0x3fffe6, - 0x7ffff1, - 0x3ffffe0, - 0x3ffffe1, - 0xfffeb, - 0x7fff1, - 0x3fffe7, - 0x7ffff2, - 0x3fffe8, - 0x1ffffec, - 0x3ffffe2, - 0x3ffffe3, - 0x3ffffe4, - 0x7ffffde, - 0x7ffffdf, - 0x3ffffe5, - 0xfffff1, - 0x1ffffed, - 0x7fff2, - 0x1fffe3, - 0x3ffffe6, - 0x7ffffe0, - 0x7ffffe1, - 0x3ffffe7, - 0x7ffffe2, - 0xfffff2, - 0x1fffe4, - 0x1fffe5, - 0x3ffffe8, - 0x3ffffe9, - 0xffffffd, - 0x7ffffe3, - 0x7ffffe4, - 0x7ffffe5, - 0xfffec, - 0xfffff3, - 0xfffed, - 0x1fffe6, - 0x3fffe9, - 0x1fffe7, - 0x1fffe8, - 0x7ffff3, - 0x3fffea, - 0x3fffeb, - 0x1ffffee, - 0x1ffffef, - 0xfffff4, - 0xfffff5, - 0x3ffffea, - 0x7ffff4, - 0x3ffffeb, - 0x7ffffe6, - 0x3ffffec, - 0x3ffffed, - 0x7ffffe7, - 0x7ffffe8, - 0x7ffffe9, - 0x7ffffea, - 0x7ffffeb, - 0xffffffe, - 0x7ffffec, - 0x7ffffed, - 0x7ffffee, - 0x7ffffef, - 0x7fffff0, - 0x3ffffee, - 0x3fffffff // EOS - }; - - public static readonly byte[] HuffmanCodeLengths = - { - 13, 23, 28, 28, 28, 28, 28, 28, 28, 24, 30, 28, 28, 30, 28, 28, - 28, 28, 28, 28, 28, 28, 30, 28, 28, 28, 28, 28, 28, 28, 28, 28, - 6, 10, 10, 12, 13, 6, 8, 11, 10, 10, 8, 11, 8, 6, 6, 6, - 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 8, 15, 6, 12, 10, - 13, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 8, 7, 8, 13, 19, 13, 14, 6, - 15, 5, 6, 5, 6, 5, 6, 6, 6, 5, 7, 7, 6, 6, 6, 5, - 6, 7, 6, 5, 5, 6, 7, 7, 7, 7, 7, 15, 11, 14, 13, 28, - 20, 22, 20, 20, 22, 22, 22, 23, 22, 23, 23, 23, 23, 23, 24, 23, - 24, 24, 22, 23, 24, 23, 23, 23, 23, 21, 22, 23, 22, 23, 23, 24, - 22, 21, 20, 22, 22, 23, 23, 21, 23, 22, 22, 24, 21, 22, 23, 23, - 21, 21, 22, 21, 23, 22, 23, 23, 20, 22, 22, 22, 23, 22, 22, 23, - 26, 26, 20, 19, 22, 23, 22, 25, 26, 26, 26, 27, 27, 26, 24, 25, - 19, 21, 26, 27, 27, 26, 27, 24, 21, 21, 26, 26, 28, 27, 27, 27, - 20, 24, 20, 21, 22, 21, 21, 23, 22, 22, 25, 25, 24, 24, 26, 23, - 26, 27, 26, 26, 27, 27, 27, 27, 27, 28, 27, 27, 27, 27, 27, 26, - 30 // EOS - }; -} \ No newline at end of file +} diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanDecoder.cs b/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanDecoder.cs index 810026fa0..682076153 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanDecoder.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanDecoder.cs @@ -1,193 +1,15 @@ -/* - * Copyright 2014 Twitter, Inc - * This file is a derivative work modified by Ringo Leese - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using System.IO; +using System; namespace Titanium.Web.Proxy.Http2.Hpack; -internal class HuffmanDecoder +/// HTTP/2 calls the Huffman decoder that lives in Titanium.Http3. +internal sealed class HuffmanDecoder { - /// - /// Huffman Decoder - /// + /// The shared decoder. public static readonly HuffmanDecoder Instance = new(); - private readonly Node root; - - /// - /// Creates a new Huffman decoder with the specified Huffman coding. - /// - private HuffmanDecoder() - { - // the Huffman codes indexed by symbol - var codes = HpackUtil.HuffmanCodes; - - // the length of each Huffman code - var lengths = HpackUtil.HuffmanCodeLengths; - if (codes.Length != 257 || codes.Length != lengths.Length) - throw new ArgumentException("invalid Huffman coding"); - - root = BuildTree(codes, lengths); - } - - /// - /// Decompresses the given Huffman coded string literal. - /// - /// the string literal to be decoded - /// the output stream for the compressed data - /// - /// throws IOException if an I/O error occurs. In particular, an IOException may - /// be thrown if the output stream has been closed. - /// - public ReadOnlyMemory Decode(byte[] buf) - { - var resultBuf = new byte[buf.Length * 2]; - var resultSize = 0; - var node = root; - var current = 0; - var bits = 0; - for (var i = 0; i < buf.Length; i++) - { - int b = buf[i]; - current = (current << 8) | b; - bits += 8; - DecodeCompleteBytes(current, ref bits, ref node, resultBuf, ref resultSize); - } - - DecodeTrailingBits(current, ref bits, ref node, resultBuf, ref resultSize); - - var mask = (1 << bits) - 1; - if ((current & mask) != mask) throw new IOException("Invalid Padding"); - - return resultBuf.AsMemory(0, resultSize); - } - - private void DecodeCompleteBytes(int current, ref int bits, ref Node node, byte[] result, - ref int resultSize) - { - while (bits >= 8) - { - var c = (current >> (bits - 8)) & 0xFF; - node = GetChild(node, c); - bits -= node.Bits; - if (!node.IsTerminal) continue; - - if (node.Symbol == HpackUtil.HuffmanEos) throw new IOException("EOS Decoded"); - - result[resultSize++] = (byte)node.Symbol; - node = root; - } - } - - private void DecodeTrailingBits(int current, ref int bits, ref Node node, byte[] result, - ref int resultSize) - { - while (bits > 0) - { - var c = (current << (8 - bits)) & 0xFF; - node = GetChild(node, c); - if (node.IsTerminal && node.Bits <= bits) - { - bits -= node.Bits; - result[resultSize++] = (byte)node.Symbol; - node = root; - } - else - { - break; - } - } - } - - private static Node GetChild(Node node, int index) - { - var children = node.Children ?? - throw new IOException("Invalid Huffman code: terminal node has trailing bits."); - return children[index] ?? throw new IOException("Invalid Huffman code."); - } - - private static Node BuildTree(int[] codes, byte[] lengths) - { - var root = new Node(); - for (var i = 0; i < codes.Length; i++) Insert(root, i, codes[i], lengths[i]); - - return root; - } - - private static void Insert(Node root, int symbol, int code, byte length) - { - // traverse tree using the most significant bytes of code - var current = root; - while (length > 8) - { - if (current.IsTerminal) throw new InvalidDataException("invalid Huffman code: prefix not unique"); - - length -= 8; - var i = (code >> length) & 0xFF; - var children = current.Children ?? - throw new InvalidDataException("invalid Huffman code: terminal node has trailing bits"); - children[i] ??= new Node(); - - current = children[i]!; - } - - var terminal = new Node(symbol, length); - var shift = 8 - length; - var start = (code << shift) & 0xFF; - var end = 1 << shift; - var currentChildren = current.Children ?? - throw new InvalidDataException("invalid Huffman code: prefix not unique"); - for (var i = start; i < start + end; i++) currentChildren[i] = terminal; - } - - private sealed class Node - { - /// - /// Initializes a new instance of the class. - /// - public Node() - { - Symbol = 0; - Bits = 8; - Children = new Node?[256]; - } - - /// - /// Initializes a new instance of the class. - /// - /// the symbol the node represents - /// the number of bits matched by this node - public Node(int symbol, int bits) - { - Symbol = symbol; - Bits = bits; - Children = null; - } - - // terminal nodes have a symbol - public int Symbol { get; } - - // number of bits matched by the node - public int Bits { get; } - - // internal nodes have children - public Node?[]? Children { get; } - - public bool IsTerminal => Children == null; - } -} \ No newline at end of file + /// Decompresses one Huffman-coded string literal. + /// The compressed bytes. + /// The decoded bytes. + public ReadOnlyMemory Decode(byte[] buf) => Titanium.Http3.HuffmanDecoder.Instance.Decode(buf); +} diff --git a/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanEncoder.cs b/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanEncoder.cs index 80fbd0ab3..e7a1d7e7a 100644 --- a/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanEncoder.cs +++ b/src/Titanium.Web.Proxy/Http2/Hpack/HuffmanEncoder.cs @@ -1,96 +1,24 @@ -/* - * Copyright 2014 Twitter, Inc - * This file is a derivative work modified by Ringo Leese - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; +using System; using System.IO; using Titanium.Web.Proxy.Models; namespace Titanium.Web.Proxy.Http2.Hpack; -internal class HuffmanEncoder +/// HTTP/2 calls the Huffman encoder that lives in Titanium.Http3. +internal sealed class HuffmanEncoder { - /// - /// Huffman Encoder - /// + /// The shared encoder. public static readonly HuffmanEncoder Instance = new(); - /// - /// the Huffman codes indexed by symbol - /// - private readonly int[] codes = HpackUtil.HuffmanCodes; - - /// - /// the length of each Huffman code - /// - private readonly byte[] lengths = HpackUtil.HuffmanCodeLengths; - - /// - /// Compresses the input string literal using the Huffman coding. - /// - /// the output stream for the compressed data - /// the string literal to be Huffman encoded - /// - /// if an I/O error occurs. In particular, an IOException may be thrown if the - /// output stream has been closed. - /// - public void Encode(BinaryWriter output, ByteString data) - { - ArgumentNullException.ThrowIfNull(output); - - if (data.Length == 0) return; - - var current = 0L; - var n = 0; - - for (var i = 0; i < data.Length; i++) - { - var b = data.Span[i] & 0xFF; - var code = (uint)codes[b]; - int nbits = lengths[b]; - - current <<= nbits; - current |= code; - n += nbits; - - while (n >= 8) - { - n -= 8; - output.Write((byte)(current >> n)); - } - } - - if (n > 0) - { - current <<= 8 - n; - current |= (uint)(0xFF >> n); // this should be EOS symbol - output.Write((byte)current); - } - } - - /// - /// Returns the number of bytes required to Huffman encode the input string literal. - /// - /// the number of bytes required to Huffman encode data - /// the string literal to be Huffman encoded - public int GetEncodedLength(ByteString data) - { - var len = 0L; - foreach (var b in data.Span) len += lengths[b]; - - return (int)((len + 7) >> 3); - } -} \ No newline at end of file + /// Compresses one string literal. + /// The output stream for the compressed data. + /// The string literal to encode. + public void Encode(BinaryWriter output, ByteString data) => + Titanium.Http3.HuffmanEncoder.Instance.Encode(output, data.Span); + + /// Returns the number of bytes required to Huffman-encode the input. + /// The string literal to encode. + /// The encoded length in bytes. + public int GetEncodedLength(ByteString data) => + Titanium.Http3.HuffmanEncoder.Instance.GetEncodedLength(data.Span); +} diff --git a/src/Titanium.Web.Proxy/Http3/H3H1QpackResponseReader.cs b/src/Titanium.Web.Proxy/Http3/H3H1QpackResponseReader.cs index 4143884f4..cd60fd558 100644 --- a/src/Titanium.Web.Proxy/Http3/H3H1QpackResponseReader.cs +++ b/src/Titanium.Web.Proxy/Http3/H3H1QpackResponseReader.cs @@ -74,7 +74,7 @@ internal readonly struct Result private static bool TryFinishFromBuffer( HttpStream reader, - QpackEncoder.ResponseBlockBuilder builder, + Titanium.Http3.QpackEncoder.ResponseBlockBuilder builder, ref long contentLength, ref bool isChunked, ref bool connectionClose, @@ -98,7 +98,7 @@ private static bool TryFinishFromBuffer( } private static Result Finish( - QpackEncoder.ResponseBlockBuilder builder, + Titanium.Http3.QpackEncoder.ResponseBlockBuilder builder, long contentLength, bool isChunked, bool connectionClose) => @@ -112,7 +112,7 @@ private static Result Finish( private static void ConsumeLine( ReadOnlySpan tmpLine, - QpackEncoder.ResponseBlockBuilder builder, + Titanium.Http3.QpackEncoder.ResponseBlockBuilder builder, ref long contentLength, ref bool isChunked, ref bool connectionClose, @@ -154,7 +154,7 @@ private static void ConsumeLine( private static void ConsumeLine( string tmpLine, - QpackEncoder.ResponseBlockBuilder builder, + Titanium.Http3.QpackEncoder.ResponseBlockBuilder builder, ref long contentLength, ref bool isChunked, ref bool connectionClose, diff --git a/src/Titanium.Web.Proxy/Http3/Http3CodecUsings.cs b/src/Titanium.Web.Proxy/Http3/Http3CodecUsings.cs new file mode 100644 index 000000000..0265113f5 --- /dev/null +++ b/src/Titanium.Web.Proxy/Http3/Http3CodecUsings.cs @@ -0,0 +1,13 @@ +global using Http3VarInt = Titanium.Http3.Http3VarInt; +global using CapsuleReader = Titanium.Http3.CapsuleReader; +global using Http3Settings = Titanium.Http3.Http3Settings; +global using Http3SettingsId = Titanium.Http3.Http3SettingsId; +global using QpackStaticTable = Titanium.Http3.QpackStaticTable; +global using QpackDynamicTable = Titanium.Http3.QpackDynamicTable; +global using QpackContext = Titanium.Http3.QpackContext; +global using QpackDecoder = Titanium.Http3.QpackDecoder; +global using QpackEncoderStreamReader = Titanium.Http3.QpackEncoderStreamReader; +global using QpackDecoderStreamWriter = Titanium.Http3.QpackDecoderStreamWriter; +global using Http3ConnectionException = Titanium.Http3.Http3ConnectionException; +global using Http3StreamException = Titanium.Http3.Http3StreamException; +global using Http3ErrorCode = Titanium.Http3.Http3ErrorCode; diff --git a/src/Titanium.Web.Proxy/Http3/Http3ConnectUdp.cs b/src/Titanium.Web.Proxy/Http3/Http3ConnectUdp.cs index b1e71ed97..0dcb36d33 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3ConnectUdp.cs +++ b/src/Titanium.Web.Proxy/Http3/Http3ConnectUdp.cs @@ -54,7 +54,7 @@ await SendResponseAsync(stream, session.HttpClient.Response, qpackContext, cance try { await MasqueTunnel.RelayAsync(admission.Host, inbound.Reader, new FlushingWriteStream(body), - admission.Open.Socket, server.Logger, token).ConfigureAwait(false); + admission.Open.Socket, server.Logger, token, server.ConnectUdpQuicOrNull()).ConfigureAwait(false); } finally { diff --git a/src/Titanium.Web.Proxy/Http3/Http3ErrorCode.cs b/src/Titanium.Web.Proxy/Http3/Http3ErrorCode.cs deleted file mode 100644 index 5a1f2db9b..000000000 --- a/src/Titanium.Web.Proxy/Http3/Http3ErrorCode.cs +++ /dev/null @@ -1,67 +0,0 @@ -namespace Titanium.Web.Proxy.Http3; - -/// -/// HTTP/3 application error codes (RFC 9114 §8.1). -/// -internal enum Http3ErrorCode : long -{ - /// No error. This is used when the connection or stream needs to be closed, but there is no error to signal. - NoError = 0x100, - - /// Peer violated protocol requirements in a way which doesn't match a more specific error code, or endpoint declines to use the more specific error code. - GeneralProtocolError = 0x101, - - /// An internal error has occurred in the HTTP stack. - InternalError = 0x102, - - /// The endpoint detected that its peer created a stream that it will not accept. - StreamCreationError = 0x103, - - /// A stream required by the HTTP/3 connection was closed or reset. - ClosedCriticalStream = 0x104, - - /// A frame was received which was not permitted in the current state or on the current stream type. - FrameUnexpected = 0x105, - - /// A frame that fails to satisfy layout requirements or with an invalid size was received. - FrameError = 0x106, - - /// The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load. - ExcessiveLoad = 0x107, - - /// A Stream ID or Push ID was used incorrectly, such as exceeding a limit, reducing a limit, or being reused. - IdError = 0x108, - - /// An endpoint detected an error in the payload of a SETTINGS frame. - SettingsError = 0x109, - - /// No SETTINGS frame was received at the beginning of the control stream. - MissingSettings = 0x10a, - - /// A server rejected a request without performing any application processing. - RequestRejected = 0x10b, - - /// The request or its response (including pushed response) is cancelled. - RequestCancelled = 0x10c, - - /// The client's stream terminated without containing a fully-formed request. - RequestIncomplete = 0x10d, - - /// An HTTP message was well-formed but is not supported by this implementation. - MessageError = 0x10e, - - /// The TCP connection established in response to a CONNECT request was reset or abnormally closed. - ConnectError = 0x10f, - - /// The requested operation cannot be served over HTTP/3. The peer should retry over HTTP/1.1. - VersionFallback = 0x110, - - /// QPACK header block decompression failure. - QpackDecompressionFailed = 0x200, - - /// An error on the QPACK encoder stream. - QpackEncoderStreamError = 0x201, - - /// An error on the QPACK decoder stream. - QpackDecoderStreamError = 0x202 -} diff --git a/src/Titanium.Web.Proxy/Http3/Http3Frame.cs b/src/Titanium.Web.Proxy/Http3/Http3Frame.cs index d351494dc..10a7d87b6 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3Frame.cs +++ b/src/Titanium.Web.Proxy/Http3/Http3Frame.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using Titanium.Web.Proxy.Logging; using Titanium.Web.Proxy.Options; +using FrameCodec = Titanium.Http3.Http3FrameCodec; namespace Titanium.Web.Proxy.Http3; @@ -26,13 +27,13 @@ internal sealed class Http3Frame /// buffering, not a single HTTP/3 DATA frame. 4 MiB covers legitimate frames without /// renting an attacker-chosen length. /// - internal const long DefaultMaxPayloadBytes = 4 * 1024 * 1024; + internal const long DefaultMaxPayloadBytes = FrameCodec.DefaultMaxPayloadBytes; /// /// Declared lengths above this are rented as data arrives, starting at this size, so a peer /// that advertises a huge length and sends nothing cannot reserve the full cap up front. /// - internal const int ProgressiveRentChunkBytes = 256 * 1024; + internal const int ProgressiveRentChunkBytes = FrameCodec.ProgressiveRentChunkBytes; /// Last payload rent size on the progressive path. Tests read this; production does not branch on it. internal static int TestLastRentBytes { get; set; } @@ -42,7 +43,7 @@ internal sealed class Http3Frame /// A payload no larger than this is forwarded in one step. Only a larger payload is sliced. /// This is not the HEADERS+DATA coalesce threshold (that stays 16 KiB). /// - internal const int RelayUnitBytes = 16 * 1024; + internal const int RelayUnitBytes = FrameCodec.RelayUnitBytes; /// /// Payload byte cap for one frame. HEADERS (including trailers) use @@ -52,7 +53,7 @@ internal sealed class Http3Frame /// QPACK the compressed size bounds expansion for compliant peers. /// internal static long PayloadLimitForFrameType(ulong frameType, long fieldSectionLimit, long dataFrameLimit) => - frameType == Http3FrameType.Headers ? fieldSectionLimit : dataFrameLimit; + FrameCodec.PayloadLimitForFrameType(frameType, fieldSectionLimit, dataFrameLimit); public ulong Type { get; } public ReadOnlyMemory Payload { get; } @@ -133,9 +134,7 @@ internal static ValueTask ReadPayloadAfterHeaderAsync( /// trailers and hooks stay under the frame cap. /// internal static bool StreamsPastFrameCap(ulong frameType, long length, long frameCap, bool captureWholeFrame) - => !captureWholeFrame - && frameType == Http3FrameType.Data - && length > (frameCap > 0 ? frameCap : DefaultMaxPayloadBytes); + => FrameCodec.StreamsPastFrameCap(frameType, length, frameCap, captureWholeFrame); /// /// Copies a DATA payload in slices without renting the declared length. Used by the no-hook @@ -247,12 +246,7 @@ public static ValueTask WriteAsync( if (payload.Length <= 256) { var rented = ArrayPool.Shared.Rent(headerCap + payload.Length); - var typeLen = Http3VarInt.Write(rented, frameType); - var lengthLen = Http3VarInt.Write(rented.AsSpan(typeLen), (ulong)payload.Length); - var headerLen = typeLen + lengthLen; - if (!payload.IsEmpty) - payload.Span.CopyTo(rented.AsSpan(headerLen)); - var total = headerLen + payload.Length; + var total = FrameCodec.Write(rented, frameType, payload.Span); // Always await before ArrayPool.Return. Returning on IsCompletedSuccessfully without // consuming the ValueTask let QuicStream/MsQuic keep the Memory while the next frame // Rent reused the same array — H3_FRAME_ERROR on streamed H3 bodies (≥16 KiB chunks / @@ -294,12 +288,7 @@ private static ValueTask WriteScratchAsync( try { var span = scratch.Buffer.AsSpan(); - var typeLen = Http3VarInt.Write(span, frameType); - var lengthLen = Http3VarInt.Write(span.Slice(typeLen), (ulong)payload.Length); - var headerLen = typeLen + lengthLen; - if (!payload.IsEmpty) - payload.Span.CopyTo(span.Slice(headerLen)); - total = headerLen + payload.Length; + total = FrameCodec.Write(span, frameType, payload.Span); } catch { @@ -358,9 +347,8 @@ private static async ValueTask WriteLargeAsync( var headerBytes = ArrayPool.Shared.Rent(headerCap); try { - var typeLen = Http3VarInt.Write(headerBytes, frameType); - var lengthLen = Http3VarInt.Write(headerBytes.AsSpan(typeLen), (ulong)payload.Length); - await stream.WriteAsync(headerBytes.AsMemory(0, typeLen + lengthLen), cancellationToken) + var headerLen = FrameCodec.WriteHeader(headerBytes, frameType, (ulong)payload.Length); + await stream.WriteAsync(headerBytes.AsMemory(0, headerLen), cancellationToken) .ConfigureAwait(false); await WriteBufferAsync(stream, payload, completeWrites, cancellationToken) .ConfigureAwait(false); @@ -399,22 +387,8 @@ public static ValueTask WriteHeadersAndDataAsync( const int headerCap = 16; var total = headerCap + headersPayload.Length + headerCap + dataPayload.Length; var rented = ArrayPool.Shared.Rent(total); - var o = 0; - o += Http3VarInt.Write(rented.AsSpan(o), Http3FrameType.Headers); - o += Http3VarInt.Write(rented.AsSpan(o), (ulong)headersPayload.Length); - if (!headersPayload.IsEmpty) - { - headersPayload.Span.CopyTo(rented.AsSpan(o)); - o += headersPayload.Length; - } - - o += Http3VarInt.Write(rented.AsSpan(o), Http3FrameType.Data); - o += Http3VarInt.Write(rented.AsSpan(o), (ulong)dataPayload.Length); - if (!dataPayload.IsEmpty) - { - dataPayload.Span.CopyTo(rented.AsSpan(o)); - o += dataPayload.Length; - } + var o = FrameCodec.Write(rented, Http3FrameType.Headers, headersPayload.Span); + o += FrameCodec.Write(rented.AsSpan(o), Http3FrameType.Data, dataPayload.Span); // Same ValueTask-consume-before-Return rule as WriteAsync (see comment there). return AwaitWriteAndReturnAsync( diff --git a/src/Titanium.Web.Proxy/Http3/Http3FrameType.cs b/src/Titanium.Web.Proxy/Http3/Http3FrameType.cs index 73de93190..c8230ac41 100644 --- a/src/Titanium.Web.Proxy/Http3/Http3FrameType.cs +++ b/src/Titanium.Web.Proxy/Http3/Http3FrameType.cs @@ -1,46 +1,42 @@ namespace Titanium.Web.Proxy.Http3; -/// -/// HTTP/3 frame type values (RFC 9114 §7.2). -/// +/// HTTP/3 frame type values. The numbers live in . internal static class Http3FrameType { - /// DATA frame. Carries arbitrary, variable-length sequences of octets associated with an HTTP request or response payload. - public const ulong Data = 0x0; + /// DATA frame. + public const ulong Data = Titanium.Http3.Http3FrameType.Data; - /// HEADERS frame. Used to carry an HTTP field section, encoded using QPACK. - public const ulong Headers = 0x1; + /// HEADERS frame. + public const ulong Headers = Titanium.Http3.Http3FrameType.Headers; - /// CANCEL_PUSH frame. Requests cancellation of a server push prior to the push stream being received. - public const ulong CancelPush = 0x3; + /// CANCEL_PUSH frame. + public const ulong CancelPush = Titanium.Http3.Http3FrameType.CancelPush; - /// SETTINGS frame. Conveys configuration parameters that affect how endpoints communicate. - public const ulong Settings = 0x4; + /// SETTINGS frame. + public const ulong Settings = Titanium.Http3.Http3FrameType.Settings; - /// PUSH_PROMISE frame. Used to carry a promised request header section from server to client. - public const ulong PushPromise = 0x5; + /// PUSH_PROMISE frame. + public const ulong PushPromise = Titanium.Http3.Http3FrameType.PushPromise; - /// GOAWAY frame. Initiates graceful shutdown of a connection by either endpoint. - public const ulong GoAway = 0x7; + /// GOAWAY frame. + public const ulong GoAway = Titanium.Http3.Http3FrameType.GoAway; - /// MAX_PUSH_ID frame. Used by clients to control the number of server pushes that the server can initiate. - public const ulong MaxPushId = 0xD; + /// MAX_PUSH_ID frame. + public const ulong MaxPushId = Titanium.Http3.Http3FrameType.MaxPushId; } -/// -/// HTTP/3 unidirectional stream type codes (RFC 9114 §6.2). -/// +/// HTTP/3 unidirectional stream types. The numbers live in . internal static class Http3StreamType { - /// Control stream. Carries control messages for the connection. - public const ulong Control = 0x0; + /// Control stream. + public const ulong Control = Titanium.Http3.Http3StreamType.Control; - /// Push stream. Carries server push data. - public const ulong Push = 0x1; + /// Push stream. + public const ulong Push = Titanium.Http3.Http3StreamType.Push; /// QPACK encoder stream. - public const ulong QpackEncoder = 0x2; + public const ulong QpackEncoder = Titanium.Http3.Http3StreamType.QpackEncoder; /// QPACK decoder stream. - public const ulong QpackDecoder = 0x3; + public const ulong QpackDecoder = Titanium.Http3.Http3StreamType.QpackDecoder; } diff --git a/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoder.cs b/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoder.cs index 47d47c100..6a3cd6503 100644 --- a/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoder.cs +++ b/src/Titanium.Web.Proxy/Http3/Qpack/QpackEncoder.cs @@ -1,68 +1,42 @@ using System; using System.Collections.Generic; -using System.IO; -using System.Text; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Http; +using Codec = Titanium.Http3.QpackEncoder; namespace Titanium.Web.Proxy.Http3.Qpack; /// -/// QPACK encoder (RFC 9204). Supports both static-table-only mode and dynamic-table mode. -/// When is provided and not disabled, the encoder will attempt to -/// reference dynamic-table entries for repeated headers; otherwise all blocks use static-table -/// references or literals. The 2-byte prefix (Required Insert Count + Base) is computed per -/// RFC 9204 §4.5.1 and emitted at the front of every HEADERS block. +/// Proxy entry points for QPACK. Field encoding lives in Titanium.Http3. +/// Request and response encoding stays here because it reads proxy header objects. /// internal static class QpackEncoder { - [ThreadStatic] - private static MemoryStream? reusableBuffer; - - /// - /// Encodes a list of header fields into a QPACK header block using static-table-only mode. - /// Equivalent to calling - /// with a null context. - /// public static byte[] Encode(IEnumerable<(string Name, string Value)> headers) => - Encode(headers, context: null); + Codec.Encode(headers); - /// - /// Encodes a list of header fields into a QPACK header block. - /// When is non-null and the outbound table is not disabled, the - /// encoder will reference dynamic-table entries. The Required Insert Count prefix is encoded per - /// RFC 9204 §4.5.1.1. - /// - public static byte[] Encode(IEnumerable<(string Name, string Value)> headers, QpackContext? context) // NOSONAR S3776 -- This protocol/state-machine path shares mutable parsing or transport state; splitting it further would create disproportionate regression risk. - { - var body = reusableBuffer ??= new MemoryStream(); - body.SetLength(0); - var outboundTable = context != null && !context.OutboundTableDisabled && context.MaxTableCapacityFromPeer > 0 - ? context.OutboundEncoderTable - : null; + public static byte[] Encode(IEnumerable<(string Name, string Value)> headers, QpackContext? context) => + Codec.Encode(headers, context); - ulong maxRequiredInsertCount = 0; + internal static ulong EncodeRequiredInsertCount(ulong requiredInsertCount, uint maxTableCapacity) => + Codec.EncodeRequiredInsertCount(requiredInsertCount, maxTableCapacity); - foreach (var (name, value) in headers) - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, value); + internal static byte[] AppendLiteralHeader(byte[] block, string lowerName, string value) => + Codec.AppendLiteralHeader(block, lowerName, value); - return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); - } + internal static Codec.ResponseBlockBuilder RentResponseBlockBuilder(int statusCode, QpackContext? context) => + Codec.RentResponseBlockBuilder(statusCode, context); /// /// Encodes an HTTP response without building an intermediate header list (hot H3→client path). /// public static byte[] EncodeResponse(Response response, QpackContext? context) { - var body = reusableBuffer ??= new MemoryStream(); - body.SetLength(0); - var outboundTable = context != null && !context.OutboundTableDisabled && context.MaxTableCapacityFromPeer > 0 - ? context.OutboundEncoderTable - : null; - + var body = Codec.RentBuffer(); + var outboundTable = Codec.SelectOutboundTable(context); ulong maxRequiredInsertCount = 0; - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":status", - StatusCodeToString(response.StatusCode)); + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":status", + Codec.StatusCodeToString(response.StatusCode)); foreach (var header in response.Headers) { @@ -72,10 +46,10 @@ public static byte[] EncodeResponse(Response response, QpackContext? context) if (name is "connection" or "keep-alive" or "proxy-connection" or "transfer-encoding" or "upgrade") continue; - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, header.Value); + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, header.Value); } - return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); + return Codec.FinishBlock(body, maxRequiredInsertCount, outboundTable, context); } /// @@ -83,12 +57,8 @@ public static byte[] EncodeResponse(Response response, QpackContext? context) /// public static byte[] EncodeRequest(Request request, string authorityHost, QpackContext? context = null) // NOSONAR S3776 -- This protocol/state-machine path shares mutable parsing or transport state; splitting it further would create disproportionate regression risk. { - var body = reusableBuffer ??= new MemoryStream(); - body.SetLength(0); - var outboundTable = context != null && !context.OutboundTableDisabled && context.MaxTableCapacityFromPeer > 0 - ? context.OutboundEncoderTable - : null; - + var body = Codec.RentBuffer(); + var outboundTable = Codec.SelectOutboundTable(context); ulong maxRequiredInsertCount = 0; string authority; @@ -115,16 +85,16 @@ public static byte[] EncodeResponse(Response response, QpackContext? context) } } - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":method", request.Method); - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":scheme", + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":method", request.Method); + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":scheme", request.IsHttps ? "https" : "http"); - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":authority", authority); - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":path", + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":authority", authority); + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":path", path.Length > 0 ? path : "/"); if (request.ExtendedConnectProtocol != null) { - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":protocol", + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":protocol", request.ExtendedConnectProtocol); } @@ -137,129 +107,12 @@ public static byte[] EncodeResponse(Response response, QpackContext? context) or "transfer-encoding" or "upgrade" or "te" or "host" or "http2-settings" or "proxy-authorization" or "proxy-authenticate") continue; - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, header.Value); + Codec.EncodeOne(body, outboundTable, ref maxRequiredInsertCount, name, header.Value); } - return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); + return Codec.FinishBlock(body, maxRequiredInsertCount, outboundTable, context); } - /// - /// Incremental QPACK response builder for the H3→H1 one-pass header parse. - /// Thread-local rent (like HeaderBuilder): TLS slot is empty while rented, so awaits - /// on the same thread allocate a fresh builder rather than sharing the active one. - /// - internal sealed class ResponseBlockBuilder : IDisposable - { - [ThreadStatic] - private static ResponseBlockBuilder? cached; - - private readonly MemoryStream body = new(128); - private QpackDynamicTable? outboundTable; - private QpackContext? context; - private ulong maxRequiredInsertCount; - private bool returned; - - private ResponseBlockBuilder() - { - } - - internal static ResponseBlockBuilder Rent(int statusCode, QpackContext? context) - { - var builder = cached; - if (builder != null) - { - cached = null; - builder.Reset(statusCode, context); - return builder; - } - - builder = new ResponseBlockBuilder(); - builder.Reset(statusCode, context); - return builder; - } - - private void Reset(int statusCode, QpackContext? ctx) - { - returned = false; - context = ctx; - outboundTable = ctx != null && !ctx.OutboundTableDisabled && ctx.MaxTableCapacityFromPeer > 0 - ? ctx.OutboundEncoderTable - : null; - maxRequiredInsertCount = 0; - body.SetLength(0); - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, ":status", - StatusCodeToString(statusCode)); - } - - internal void AddHeader(string lowerName, string value) => - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, lowerName, value); - - /// Encode a header value from the H1 window without Latin-1 string round-trip. - internal void AddHeader(string lowerName, ReadOnlySpan value) => - EncodeOne(body, outboundTable, ref maxRequiredInsertCount, lowerName, value); - - internal byte[] Finish() - { - ObjectDisposedException.ThrowIf(returned, nameof(ResponseBlockBuilder)); - return FinishBlock(body, maxRequiredInsertCount, outboundTable, context); - } - - public void Dispose() => Return(this); - - internal static void Return(ResponseBlockBuilder builder) - { - if (builder.returned) - return; - builder.returned = true; - builder.outboundTable = null; - builder.context = null; - builder.maxRequiredInsertCount = 0; - builder.body.SetLength(0); - if (cached == null) - cached = builder; - } - } - - internal static ResponseBlockBuilder RentResponseBlockBuilder(int statusCode, QpackContext? context) => - ResponseBlockBuilder.Rent(statusCode, context); - - /// - /// Appends one literal header to an existing static-table QPACK block (append-only MITM patch). - /// Caller must ensure used no dynamic-table inserts (RIC prefix 0x00 0x00). - /// - internal static byte[] AppendLiteralHeader(byte[] block, string lowerName, string value) - { - if (block.Length < 2) - throw new ArgumentException("QPACK block too short.", nameof(block)); - - var body = reusableBuffer ??= new MemoryStream(); - body.SetLength(0); - body.Write(block, 2, block.Length - 2); - - var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); - if (nameOnlyStaticIndex >= 0) - WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); - else - WriteLiteralNewName(body, lowerName, value); - - return FinishBlock(body, 0, null, null); - } - - private static string StatusCodeToString(int statusCode) => statusCode switch - { - 200 => "200", - 204 => "204", - 301 => "301", - 302 => "302", - 304 => "304", - 400 => "400", - 404 => "404", - 500 => "500", - 502 => "502", - 503 => "503", - _ => statusCode.ToString() - }; - private static bool HasUpperAscii(string s) { for (var i = 0; i < s.Length; i++) @@ -270,188 +123,4 @@ private static bool HasUpperAscii(string s) return false; } - - private static void EncodeOne(MemoryStream body, QpackDynamicTable? outboundTable, - ref ulong maxRequiredInsertCount, string lowerName, string value) - { - var exact = QpackStaticTable.FindExact(lowerName, value); - if (exact >= 0) - { - WriteIndexed(body, (ulong)exact); - return; - } - - var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); - - if (outboundTable != null && outboundTable.TryFind(lowerName, value, out ulong dynAbsIdx, out bool dynExact)) - { - if (dynExact) - { - WriteDynamicIndexed(body, dynAbsIdx); - maxRequiredInsertCount = Math.Max(maxRequiredInsertCount, dynAbsIdx + 1); - } - else - { - WriteLiteralWithDynamicNameRef(body, dynAbsIdx, value); - maxRequiredInsertCount = Math.Max(maxRequiredInsertCount, dynAbsIdx + 1); - } - - return; - } - - if (nameOnlyStaticIndex >= 0) - { - WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); - return; - } - - WriteLiteralNewName(body, lowerName, value); - } - - /// - /// Span value path: name-only static / literal encode (skips FindExact string alloc). - /// Fine for reverse tiny-GET where values are almost never static-exact hits. - /// - private static void EncodeOne(MemoryStream body, QpackDynamicTable? outboundTable, - ref ulong maxRequiredInsertCount, string lowerName, ReadOnlySpan value) - { - _ = outboundTable; - _ = maxRequiredInsertCount; - var nameOnlyStaticIndex = QpackStaticTable.FindName(lowerName); - if (nameOnlyStaticIndex >= 0) - { - WriteLiteralWithStaticNameRef(body, (ulong)nameOnlyStaticIndex, value); - return; - } - - WriteLiteralNewName(body, lowerName, value); - } - - private static byte[] FinishBlock(MemoryStream body, ulong maxRequiredInsertCount, - QpackDynamicTable? outboundTable, QpackContext? context) - { - byte ricByte, sByte; - if (maxRequiredInsertCount == 0 || outboundTable == null) - { - ricByte = 0x00; - sByte = 0x00; - } - else - { - // Encode RIC on the wire. Pair with S=1, DeltaBase = RIC−1 so Base = 0. - // WriteDynamicIndexed / WriteLiteralWithDynamicNameRef emit post-base instructions - // whose wire index is the absolute dynamic-table index; with Base=0 those resolve - // as abs = Base + wireIndex = absoluteIndex (RFC 9204 §4.5.3 / §4.5.5). - var encodedRic = EncodeRequiredInsertCount(maxRequiredInsertCount, context!.MaxTableCapacityFromPeer); - ricByte = (byte)(encodedRic & 0xFF); - var deltaBase = maxRequiredInsertCount - 1; - sByte = (byte)(0x80 | (deltaBase & 0x7F)); - } - - var result = new byte[2 + body.Length]; - result[0] = ricByte; - result[1] = sByte; - body.GetBuffer().AsSpan(0, (int)body.Length).CopyTo(result.AsSpan(2)); - return result; - } - - /// - /// Encodes the Required Insert Count per RFC 9204 §4.5.1.1. - /// Encoded = (count % (2 * MaxEntries)) + 1, where MaxEntries = floor(MaxTableCapacity / 32). - /// - internal static ulong EncodeRequiredInsertCount(ulong requiredInsertCount, uint maxTableCapacity) - { - var maxEntries = (ulong)(maxTableCapacity / 32); - if (maxEntries == 0) maxEntries = 1; - return (requiredInsertCount % (2 * maxEntries)) + 1; - } - - // Indexed Header Field (static): 1 1 S=1 Index(6) — pattern 0xC0 - private static void WriteIndexed(MemoryStream buf, ulong index) - { - WritePrefixedInt(buf, 0xC0, 6, index); - } - - // Indexed Header Field (dynamic, post-base): 0 0 0 1 Index(4) — pattern 0x10 - private static void WriteDynamicIndexed(MemoryStream buf, ulong absoluteIndex) - { - WritePrefixedInt(buf, 0x10, 4, absoluteIndex); - } - - // Literal Header Field With Name Reference (static): 0 1 N=0 S=1 Index(4) — pattern 0x50 - private static void WriteLiteralWithStaticNameRef(MemoryStream buf, ulong nameIndex, string value) - { - WritePrefixedInt(buf, 0x50, 4, nameIndex); - WriteStringLiteral(buf, value); - } - - private static void WriteLiteralWithStaticNameRef(MemoryStream buf, ulong nameIndex, ReadOnlySpan value) - { - WritePrefixedInt(buf, 0x50, 4, nameIndex); - WriteStringLiteral(buf, value); - } - - // Literal Header Field With Name Reference (dynamic, post-base): 0 0 0 0 N=0 Index(3) — pattern 0x00 - private static void WriteLiteralWithDynamicNameRef(MemoryStream buf, ulong absoluteIndex, string value) - { - WritePrefixedInt(buf, 0x00, 3, absoluteIndex); - WriteStringLiteral(buf, value); - } - - // Literal Field Line With Literal Name (RFC 9204 §4.5.6): - // 0 0 1 N H NameLen(3+) | Name | H ValueLen(7+) | Value - // Name length occupies the 3-bit prefix of the first byte — it is NOT a separate string literal. - private static void WriteLiteralNewName(MemoryStream buf, string name, string value) - { - var nameBytes = Encoding.Latin1.GetBytes(name); - // pattern 0x20 => 001 N=0 H=0, then 3-bit-prefixed name length - WritePrefixedInt(buf, 0x20, 3, (ulong)nameBytes.Length); - buf.Write(nameBytes, 0, nameBytes.Length); - WriteStringLiteral(buf, value); - } - - private static void WriteLiteralNewName(MemoryStream buf, string name, ReadOnlySpan value) - { - var nameBytes = Encoding.Latin1.GetBytes(name); - WritePrefixedInt(buf, 0x20, 3, (ulong)nameBytes.Length); - buf.Write(nameBytes, 0, nameBytes.Length); - WriteStringLiteral(buf, value); - } - - /// Writes an RFC 7541 §5.1 prefixed integer into the stream. - private static void WritePrefixedInt(MemoryStream buf, byte patternByte, int prefixBits, ulong value) - { - var mask = (uint)((1 << prefixBits) - 1); - if (value < mask) - { - buf.WriteByte((byte)(patternByte | (byte)value)); - return; - } - - buf.WriteByte((byte)(patternByte | (byte)mask)); - value -= mask; - while (value >= 0x80) - { - buf.WriteByte((byte)((value & 0x7F) | 0x80)); - value >>= 7; - } - buf.WriteByte((byte)value); - } - - /// - /// Writes an RFC 7541 §5.2 string literal (length-prefixed, no Huffman encoding). - /// We always emit raw bytes (H=0) to keep the implementation simple. - /// - private static void WriteStringLiteral(MemoryStream buf, string s) - { - var bytes = Encoding.Latin1.GetBytes(s); - WritePrefixedInt(buf, 0x00, 7, (ulong)bytes.Length); - buf.Write(bytes, 0, bytes.Length); - } - - private static void WriteStringLiteral(MemoryStream buf, ReadOnlySpan bytes) - { - WritePrefixedInt(buf, 0x00, 7, (ulong)bytes.Length); - buf.Write(bytes); - } } diff --git a/src/Titanium.Web.Proxy/Masque/CapsuleDatagramChannel.cs b/src/Titanium.Web.Proxy/Masque/CapsuleDatagramChannel.cs index 25e1432b1..3d53f4298 100644 --- a/src/Titanium.Web.Proxy/Masque/CapsuleDatagramChannel.cs +++ b/src/Titanium.Web.Proxy/Masque/CapsuleDatagramChannel.cs @@ -1,5 +1,6 @@ using System; using System.Buffers; +using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Channels; @@ -44,6 +45,29 @@ public async ValueTask RunClientToTargetAsync(DatagramSend send, CancellationTok } } + public async ValueTask RunClientToTargetAsync( + Func, CancellationToken, ValueTask> send, CancellationToken cancellationToken) + { + var pending = new List(); + while (await inbound.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) + { + while (inbound.TryRead(out var chunk)) + { + pending.Clear(); + reader.Feed(chunk.Span, payload => + { + var copy = new byte[payload.Length]; + payload.CopyTo(copy); + pending.Add(copy); + }); + foreach (var payload in pending) + { + await send(payload, cancellationToken).ConfigureAwait(false); + } + } + } + } + public bool TryQueueToClient(ReadOnlySpan payload) { var rented = ArrayPool.Shared.Rent(payload.Length); diff --git a/src/Titanium.Web.Proxy/Masque/ConnectUdpQuic.cs b/src/Titanium.Web.Proxy/Masque/ConnectUdpQuic.cs new file mode 100644 index 000000000..dea165f10 --- /dev/null +++ b/src/Titanium.Web.Proxy/Masque/ConnectUdpQuic.cs @@ -0,0 +1,78 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Quic; + +namespace Titanium.Web.Proxy.Masque; + +/// Builds the certificate options for one terminated CONNECT-UDP target. +internal delegate ValueTask ConnectUdpQuicOptions( + string host, SslClientHelloInfo hello, CancellationToken cancellationToken); + +/// The managed-stack switch for one CONNECT-UDP relay. Null keeps the datagram on the socket. +internal sealed class ConnectUdpQuicSetup +{ + internal ConnectUdpQuicSetup(bool allowManagedStackUnderFips, ConnectUdpQuicOptions options) + { + AllowManagedStackUnderFips = allowManagedStackUnderFips; + Options = options; + } + + internal bool AllowManagedStackUnderFips { get; } + + internal ConnectUdpQuicOptions Options { get; } +} + +/// One injected listener for the target of a CONNECT-UDP tunnel. +internal sealed class ConnectUdpQuic : IAsyncDisposable +{ + private readonly IPEndPoint _target; + private readonly string _host; + private readonly ConnectUdpQuicSetup _setup; + private readonly IPEndPoint _remote = new(IPAddress.Loopback, 1); + private ManagedQuicListener? _listener; + + internal ConnectUdpQuic(IPEndPoint target, ConnectUdpQuicSetup setup) + { + _target = target; + _host = target.Address.ToString(); + _setup = setup; + } + + internal bool Owns(ReadOnlySpan payload) => + _listener is not null || (payload.Length >= 1200 && (payload[0] & 0x80) != 0); + + internal async ValueTask HandleAsync(ReadOnlyMemory payload, Action> reply, CancellationToken cancellationToken) + { + if (_listener is null) + { + _listener = ManagedQuicListener.CreateInjected( + new ManagedQuicListenerOptions + { + ListenEndPoint = _target, + AllowManagedStackUnderFips = _setup.AllowManagedStackUnderFips, + ConnectionOptionsCallback = (_, hello, token) => _setup.Options(_host, hello, token), + }, + _target, + (datagram, _, _) => + { + reply(datagram); + return ValueTask.CompletedTask; + }, + maximumDatagramSize: 2000); + } + + await _listener.HandleDatagramAsync(payload, _remote, cancellationToken).ConfigureAwait(false); + await _listener.DriveAsync(cancellationToken).ConfigureAwait(false); + } + + public async ValueTask DisposeAsync() + { + if (_listener is not null) + { + await _listener.DisposeAsync().ConfigureAwait(false); + } + } +} diff --git a/src/Titanium.Web.Proxy/Masque/MasqueTunnel.cs b/src/Titanium.Web.Proxy/Masque/MasqueTunnel.cs index 95053671a..18aff91b0 100644 --- a/src/Titanium.Web.Proxy/Masque/MasqueTunnel.cs +++ b/src/Titanium.Web.Proxy/Masque/MasqueTunnel.cs @@ -96,34 +96,39 @@ internal static class MasqueTunnel } public static async Task RelayAsync(MasqueProxyEndPoint endPoint, ChannelReader> inbound, - Stream body, Socket udp, ILogger logger, CancellationToken cancellationToken) + Stream body, Socket udp, ILogger logger, CancellationToken cancellationToken, ConnectUdpQuicSetup? quic = null) { using var relay = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); var channel = new CapsuleDatagramChannel(inbound, body); var budget = new DatagramBudget(endPoint.Options.MaxDatagramsPerSecond, endPoint.Options.MaxBytesPerSecond); var idle = new IdleClock(); var idleMs = (long)endPoint.Options.IdleTimeout.TotalMilliseconds; - var toTarget = StartClientToTarget(channel, payload => - { - if (!budget.TryTake(payload.Length)) + ConnectUdpQuic? terminated = quic is not null && udp.RemoteEndPoint is IPEndPoint target + ? new ConnectUdpQuic(target, quic) + : null; + var toTarget = terminated is null + ? StartClientToTarget(channel, payload => { - endPoint.CountDrop(); - return; - } + if (!budget.TryTake(payload.Length)) + { + endPoint.CountDrop(); + return; + } - idle.Touch(); - try - { - udp.Send(payload); - } - catch (Exception ex) when (ex is SocketException or ObjectDisposedException) - { - endPoint.CountDrop(); - return; - } + idle.Touch(); + try + { + udp.Send(payload); + } + catch (Exception ex) when (ex is SocketException or ObjectDisposedException) + { + endPoint.CountDrop(); + return; + } - endPoint.CountDatagram(fromClient: true); - }, relay.Token); + endPoint.CountDatagram(fromClient: true); + }, relay.Token) + : StartTerminating(channel, udp, endPoint, terminated, budget, idle, relay.Token); var toClient = ReceiveTargetAsync(endPoint, channel, udp, budget, idle, relay.Token); var writer = StartWriter(channel, relay.Token); var idleWatch = WatchIdleAsync(endPoint, idle, idleMs, relay); @@ -138,12 +143,61 @@ public static async Task RelayAsync(MasqueProxyEndPoint endPoint, ChannelReader< // Closing the socket unblocks the receive loop. } - await Task.WhenAll( - ObserveRelayAsync(toTarget, logger), - ObserveRelayAsync(toClient, logger), - ObserveRelayAsync(writer, logger)).ConfigureAwait(false); + try + { + await Task.WhenAll( + ObserveRelayAsync(toTarget, logger), + ObserveRelayAsync(toClient, logger), + ObserveRelayAsync(writer, logger)).ConfigureAwait(false); + } + finally + { + if (terminated is not null) + { + await terminated.DisposeAsync().ConfigureAwait(false); + } + } } + private static Task StartTerminating(CapsuleDatagramChannel channel, Socket udp, MasqueProxyEndPoint endPoint, + ConnectUdpQuic quic, DatagramBudget budget, IdleClock idle, CancellationToken cancellationToken) => + channel.RunClientToTargetAsync(async (payload, token) => + { + if (!budget.TryTake(payload.Length)) + { + endPoint.CountDrop(); + return; + } + + idle.Touch(); + if (quic.Owns(payload.Span)) + { + await quic.HandleAsync(payload, reply => + { + if (!channel.TryQueueToClient(reply.Span)) + { + endPoint.CountDrop(); + return; + } + + endPoint.CountDatagram(fromClient: false); + }, token).ConfigureAwait(false); + return; + } + + try + { + udp.Send(payload.Span); + } + catch (Exception ex) when (ex is SocketException or ObjectDisposedException) + { + endPoint.CountDrop(); + return; + } + + endPoint.CountDatagram(fromClient: true); + }, cancellationToken).AsTask(); + private static async Task ResolveHostAsync(MasqueProxyEndPoint endPoint, string host, ILogger logger, CancellationToken cancellationToken) { diff --git a/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs index 98835250a..771304b5e 100644 --- a/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs +++ b/src/Titanium.Web.Proxy/Models/TransparentProxyEndPoint.cs @@ -8,6 +8,7 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Titanium.Quic; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Network.Quic; @@ -160,9 +161,16 @@ public int MaxInboundUnidirectionalStreams internal QuicListener? LoopbackV4QuicListener { get; set; } + internal ManagedQuicListener? ManagedQuicListener { get; set; } + + internal ManagedQuicListener? LoopbackV4ManagedQuicListener { get; set; } + internal ConditionalWeakTable PendingQuicAuthArgs { get; } = new(); + internal ConditionalWeakTable PendingManagedQuicAuthArgs { get; } = + new(); + QuicListener? IQuicInboundEndPoint.QuicListener { get => QuicListener; @@ -175,9 +183,24 @@ public int MaxInboundUnidirectionalStreams set => LoopbackV4QuicListener = value; } + ManagedQuicListener? IQuicInboundEndPoint.ManagedQuicListener + { + get => ManagedQuicListener; + set => ManagedQuicListener = value; + } + + ManagedQuicListener? IQuicInboundEndPoint.LoopbackV4ManagedQuicListener + { + get => LoopbackV4ManagedQuicListener; + set => LoopbackV4ManagedQuicListener = value; + } + ConditionalWeakTable IQuicInboundEndPoint.PendingQuicAuthArgs => PendingQuicAuthArgs; + ConditionalWeakTable IQuicInboundEndPoint.PendingManagedQuicAuthArgs => + PendingManagedQuicAuthArgs; + IOriginalDestinationResolver? IQuicInboundEndPoint.OriginalDestinationResolver => null; ProxyEndPoint IQuicInboundEndPoint.ProxyEndPoint => this; diff --git a/src/Titanium.Web.Proxy/Models/TransparentQuicProxyEndPoint.cs b/src/Titanium.Web.Proxy/Models/TransparentQuicProxyEndPoint.cs index c9eda7db1..86664978a 100644 --- a/src/Titanium.Web.Proxy/Models/TransparentQuicProxyEndPoint.cs +++ b/src/Titanium.Web.Proxy/Models/TransparentQuicProxyEndPoint.cs @@ -7,6 +7,7 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Titanium.Quic; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Network.Quic; @@ -134,6 +135,10 @@ public int MaxInboundUnidirectionalStreams /// internal QuicListener? LoopbackV4QuicListener { get; set; } + internal ManagedQuicListener? ManagedQuicListener { get; set; } + + internal ManagedQuicListener? LoopbackV4ManagedQuicListener { get; set; } + /// /// Transient per-connection created in the /// ConnectionOptionsCallback and consumed by the accept loop. Uses a @@ -144,6 +149,9 @@ public int MaxInboundUnidirectionalStreams internal ConditionalWeakTable PendingQuicAuthArgs { get; } = new(); + internal ConditionalWeakTable + PendingManagedQuicAuthArgs { get; } = new(); + QuicListener? IQuicInboundEndPoint.QuicListener { get => QuicListener; @@ -156,9 +164,24 @@ internal ConditionalWeakTable set => LoopbackV4QuicListener = value; } + ManagedQuicListener? IQuicInboundEndPoint.ManagedQuicListener + { + get => ManagedQuicListener; + set => ManagedQuicListener = value; + } + + ManagedQuicListener? IQuicInboundEndPoint.LoopbackV4ManagedQuicListener + { + get => LoopbackV4ManagedQuicListener; + set => LoopbackV4ManagedQuicListener = value; + } + ConditionalWeakTable IQuicInboundEndPoint.PendingQuicAuthArgs => PendingQuicAuthArgs; + ConditionalWeakTable IQuicInboundEndPoint.PendingManagedQuicAuthArgs => + PendingManagedQuicAuthArgs; + IOriginalDestinationResolver? IQuicInboundEndPoint.OriginalDestinationResolver => OriginalDestinationResolver; diff --git a/src/Titanium.Web.Proxy/Network/Quic/IQuicInboundEndPoint.cs b/src/Titanium.Web.Proxy/Network/Quic/IQuicInboundEndPoint.cs index 6ce83c3a5..bf9a5ecf4 100644 --- a/src/Titanium.Web.Proxy/Network/Quic/IQuicInboundEndPoint.cs +++ b/src/Titanium.Web.Proxy/Network/Quic/IQuicInboundEndPoint.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.Extensions.Logging; +using Titanium.Quic; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Models; @@ -50,8 +51,17 @@ internal interface IQuicInboundEndPoint /// QuicListener? LoopbackV4QuicListener { get; set; } + /// Primary managed listener. Set only when UseManagedQuicStack is on. + ManagedQuicListener? ManagedQuicListener { get; set; } + + /// Paired 127.0.0.1 managed listener. for a single-address listen. + ManagedQuicListener? LoopbackV4ManagedQuicListener { get; set; } + ConditionalWeakTable PendingQuicAuthArgs { get; } + /// Auth args for a managed connection, released if that connection is collected first. + ConditionalWeakTable PendingManagedQuicAuthArgs { get; } + /// /// Optional NAT original-destination resolver. Dual-listen reverse endpoints return null and /// rely on . diff --git a/src/Titanium.Web.Proxy/Network/Quic/QuicConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/Quic/QuicConnectionFactory.cs index 96f10a6d8..7d8795c14 100644 --- a/src/Titanium.Web.Proxy/Network/Quic/QuicConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/Quic/QuicConnectionFactory.cs @@ -1,12 +1,15 @@ #pragma warning disable CA1416 using System; using System.Collections.Generic; +using System.IO; using System.Net; using System.Net.Quic; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; +using Titanium.Net.Compatibility; +using Titanium.Quic; using Titanium.Web.Proxy.Diagnostics; using Titanium.Web.Proxy.Exceptions; using Titanium.Web.Proxy.Models; @@ -81,8 +84,8 @@ public async Task CreateAsync( RemoteCertificateValidationCallback = remoteCertificateValidationCallback ?? DefaultValidationCallback }, - DefaultStreamErrorCode = (long)Http3.Http3ErrorCode.RequestCancelled, - DefaultCloseErrorCode = (long)Http3.Http3ErrorCode.NoError, + DefaultStreamErrorCode = (long)Titanium.Http3.Http3ErrorCode.RequestCancelled, + DefaultCloseErrorCode = (long)Titanium.Http3.Http3ErrorCode.NoError, HandshakeTimeout = TimeSpan.FromSeconds(handshakeSeconds), // Keep idle pooled connections from being silently closed by MsQuic before our pool // TTL notices (see QuicConnectionPool.IdleConnectionTimeout / stale-retry path). @@ -109,6 +112,12 @@ public async Task CreateAsync( } var connectStartedAt = DateTime.UtcNow; + if (_proxyServer.UseManagedQuicStack) + { + return await CreateManagedAsync( + clientOptions, sniHost, port, upStreamProxy, upStreamEndPoint, cacheKey, connectStartedAt, cancellationToken); + } + var connection = await QuicConnection.ConnectAsync(clientOptions, cancellationToken); // Store the SNI host as the canonical HostName so Alt-Svc / capability cache keying is @@ -133,6 +142,84 @@ public async Task CreateAsync( return serverConnection; } + private async Task CreateManagedAsync( + QuicClientConnectionOptions clientOptions, + string sniHost, + int port, + IExternalProxy? upStreamProxy, + IPEndPoint? upStreamEndPoint, + string cacheKey, + DateTime connectStartedAt, + CancellationToken cancellationToken) + { + IPEndPoint resolved = await ResolveRemoteAsync(clientOptions.RemoteEndPoint!, cancellationToken).ConfigureAwait(false); + var translated = new QuicClientConnectionOptions + { + RemoteEndPoint = resolved, + LocalEndPoint = clientOptions.LocalEndPoint ?? WildcardLocal(resolved), + ClientAuthenticationOptions = clientOptions.ClientAuthenticationOptions, + DefaultStreamErrorCode = clientOptions.DefaultStreamErrorCode, + HandshakeTimeout = clientOptions.HandshakeTimeout, + KeepAliveInterval = clientOptions.KeepAliveInterval, + IdleTimeout = clientOptions.IdleTimeout, + MaxInboundBidirectionalStreams = clientOptions.MaxInboundBidirectionalStreams, + MaxInboundUnidirectionalStreams = clientOptions.MaxInboundUnidirectionalStreams, + }; + ManagedQuicClientConnectionOptions managedOptions = QuicClientOptionsAdapter.ToManaged(translated); + if (_proxyServer.AllowManagedStackUnderFips) + { + managedOptions.AllowManagedStackUnderFips = true; + } + + ManagedQuicConnection managed = await ManagedQuicConnection.ConnectAsync( + managedOptions, cancellationToken).ConfigureAwait(false); + var serverConnection = new QuicServerConnection( + _proxyServer, managed, sniHost, port, upStreamProxy, upStreamEndPoint, cacheKey); + await serverConnection.StartHttp3ClientSessionAsync(cancellationToken).ConfigureAwait(false); + if (_proxyServer.EnableRequestTimingCapture) + { + var timing = new UpstreamConnectionTiming(connectStartedAt); + timing.MarkTlsHandshakeCompleted(); + timing.MarkEstablished(); + serverConnection.Timing = timing; + } + + return serverConnection; + } + + /// + /// The managed client takes an IP endpoint. An address literal is parsed. Any other host uses + /// the first address from DNS. The platform dial keeps its own name resolution. + /// + internal static async Task ResolveRemoteAsync(EndPoint remote, CancellationToken cancellationToken) + { + if (remote is IPEndPoint ip) + { + return ip; + } + + if (remote is DnsEndPoint dns) + { + if (IPAddress.TryParse(dns.Host, out IPAddress? literal)) + { + return new IPEndPoint(literal, dns.Port); + } + + IPAddress[] addresses = await Dns.GetHostAddressesAsync(dns.Host, cancellationToken).ConfigureAwait(false); + if (addresses is null || addresses.Length == 0) + { + throw new IOException($"Could not resolve the hostname {dns.Host}"); + } + + return new IPEndPoint(addresses[0], dns.Port); + } + + throw new ArgumentException("The managed client takes an IP endpoint. Resolve the name first.", nameof(remote)); + } + + private static IPEndPoint WildcardLocal(IPEndPoint remote) => + new(remote.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6 ? IPAddress.IPv6Any : IPAddress.Any, 0); + /// /// Loopback QUIC must bind the client socket to 127.0.0.1 or ::1 before connect. /// An unbound UDP socket is an inbound listen on 0.0.0.0 or ::, which prompts the firewall. diff --git a/src/Titanium.Web.Proxy/Network/Quic/QuicServerConnection.cs b/src/Titanium.Web.Proxy/Network/Quic/QuicServerConnection.cs index c1e3804da..52d891739 100644 --- a/src/Titanium.Web.Proxy/Network/Quic/QuicServerConnection.cs +++ b/src/Titanium.Web.Proxy/Network/Quic/QuicServerConnection.cs @@ -5,6 +5,7 @@ using System.Net.Security; using System.Threading; using System.Threading.Tasks; +using Titanium.Quic; using Titanium.Web.Proxy.Diagnostics; using Titanium.Web.Proxy.Http3; using Titanium.Web.Proxy.Models; @@ -26,6 +27,7 @@ internal sealed class QuicServerConnection : IAsyncDisposable private long lastResponseTicks; private Func? clock; private Http3OriginClientSession? _http3ClientSession; + private readonly ManagedQuicConnection? _managed; internal QuicServerConnection( ProxyServer proxyServer, @@ -85,13 +87,35 @@ private QuicServerConnection(ProxyServer proxyServer, string hostName, int port, NegotiatedApplicationProtocol = SslApplicationProtocol.Http3; } + internal QuicServerConnection( + ProxyServer proxyServer, + ManagedQuicConnection connection, + string hostName, + int port, + IExternalProxy? upStreamProxy, + IPEndPoint? upStreamEndPoint, + string cacheKey) + { + _managed = connection; + LastAccess = DateTime.UtcNow; + ProxyServer = proxyServer; + ProxyServer.UpdateServerConnectionCount(true); + ProxyServer.UpdateHttp3ServerConnectionCount(true); + HostName = hostName; + Port = port; + UpStreamProxy = upStreamProxy; + UpStreamEndPoint = upStreamEndPoint; + CacheKey = cacheKey; + NegotiatedApplicationProtocol = SslApplicationProtocol.Http3; + } + public long Id { get; } = ConnectionId.Next(); private ProxyServer ProxyServer { get; } /// - /// Underlying MsQuic connection. only for - /// instances used by pool unit tests. + /// Underlying MsQuic connection. for a detached test double and for a + /// connection that holds instead. /// internal QuicConnection? Connection { get; } @@ -126,6 +150,18 @@ internal IPEndPoint? RemoteEndPoint { get { + if (_managed is not null) + { + try + { + return _managed.RemoteEndPoint; + } + catch (ObjectDisposedException) + { + return null; + } + } + if (Connection is null) return null; try { @@ -150,6 +186,8 @@ internal IPEndPoint? RemoteEndPoint internal System.Threading.Tasks.ValueTask OpenRequestStreamAsync( System.Threading.CancellationToken cancellationToken) { + if (_managed is not null) + throw new NotSupportedException("HTTP/3 framing still uses the platform QUIC stream."); if (Connection is null) throw new InvalidOperationException("Detached QuicServerConnection cannot open streams."); LastAccess = DateTime.UtcNow; @@ -178,7 +216,7 @@ internal System.Threading.Tasks.ValueTask OpenRequestStreamAsync( /// internal async Task StartHttp3ClientSessionAsync(CancellationToken cancellationToken) { - if (Connection is null || _http3ClientSession != null) return; + if (_managed is not null || Connection is null || _http3ClientSession != null) return; _http3ClientSession = new Http3OriginClientSession(Connection, ProxyServer); await _http3ClientSession.StartAsync(cancellationToken); } @@ -235,10 +273,26 @@ public async ValueTask DisposeAsync() try { await _http3ClientSession.DisposeAsync(); } catch { /* best effort */ } _http3ClientSession = null; } + if (_managed is not null) + { + try + { + await _managed.CloseAsync((long)Titanium.Http3.Http3ErrorCode.NoError).AsTask() + .WaitAsync(TimeSpan.FromSeconds(2)); + } + catch { /* best effort */ } + finally + { + await _managed.DisposeAsync(); + } + + return; + } + if (Connection is null) return; try { - await Connection.CloseAsync((long)Http3.Http3ErrorCode.NoError).AsTask() + await Connection.CloseAsync((long)Titanium.Http3.Http3ErrorCode.NoError).AsTask() .WaitAsync(TimeSpan.FromSeconds(2)); } catch { /* best effort */ } diff --git a/src/Titanium.Web.Proxy/Network/Streams/HttpStream.cs b/src/Titanium.Web.Proxy/Network/Streams/HttpStream.cs index 8820df4ab..25642fdc2 100644 --- a/src/Titanium.Web.Proxy/Network/Streams/HttpStream.cs +++ b/src/Titanium.Web.Proxy/Network/Streams/HttpStream.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Http; using Titanium.Web.Proxy.Logging; @@ -103,10 +104,10 @@ internal HttpStream(ProxyServer server, Stream baseStream, IBufferPool bufferPoo { this.server = server; - if (baseStream is NetworkStream or SslStream) + if (baseStream is NetworkStream or SslStream or TlsStream) IsNetworkStream = true; - SupportsBodyWriteHook = baseStream is NetworkStream || baseStream is SslStream; + SupportsBodyWriteHook = baseStream is NetworkStream or SslStream or TlsStream; BaseStream = baseStream; this.leaveOpen = leaveOpen; diff --git a/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.ManagedTls.cs b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.ManagedTls.cs new file mode 100644 index 000000000..317adb66c --- /dev/null +++ b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.ManagedTls.cs @@ -0,0 +1,57 @@ +using System.Collections.Generic; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Tls; +using Titanium.Web.Proxy.Diagnostics; +using Titanium.Web.Proxy.EventArguments; +using Titanium.Web.Proxy.Logging; + +namespace Titanium.Web.Proxy.Network.Tcp; + +internal partial class TcpConnectionFactory +{ + private static async Task<(SslApplicationProtocol Protocol, bool UsedClientCertificate)> AuthenticateManagedClientAsync( + ProxyServer proxyServer, + TlsStream managed, + SessionEventArgsBase? sessionArgs, + string remoteHostName, + int remotePort, + List? applicationProtocols, + SslProtocols enabledSslProtocols, + UpstreamConnectionTiming? timing, + CancellationToken cancellationToken) + { + var usedClientCertificate = false; + var options = new SslClientAuthenticationOptions + { + ApplicationProtocols = applicationProtocols, + TargetHost = ClusterTargetHost(sessionArgs, remoteHostName), + ClientCertificates = null, + EnabledSslProtocols = ClusterSslProtocols(sessionArgs, enabledSslProtocols), + CertificateRevocationCheckMode = proxyServer.CheckCertificateRevocation, + RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => + proxyServer.ValidateServerCertificate(sender, sessionArgs, certificate, chain, sslPolicyErrors), + LocalCertificateSelectionCallback = (sender, targetHost, localCertificates, remoteCertificate, acceptableIssuers) => + { + X509Certificate? clientCertificate = proxyServer.SelectClientCertificate( + sender, sessionArgs, targetHost, localCertificates, remoteCertificate, acceptableIssuers); + if (clientCertificate != null) + { + usedClientCertificate = true; + } + + return clientCertificate!; + }, + }; + + ProxyLog.OriginHandshakeStarting(proxyServer.Logger, remoteHostName, remotePort, applicationProtocols); + await managed.AuthenticateAsClientAsync(options, cancellationToken).ConfigureAwait(false); + SslApplicationProtocol negotiated = managed.NegotiatedApplicationProtocol; + ProxyLog.OriginHandshakeSucceeded(proxyServer.Logger, remoteHostName, remotePort, negotiated); + timing?.MarkTlsHandshakeCompleted(); + return (negotiated, usedClientCertificate); + } +} diff --git a/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs index b08035b19..d92718227 100644 --- a/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs +++ b/src/Titanium.Web.Proxy/Network/TcpConnection/TcpConnectionFactory.cs @@ -13,6 +13,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.Diagnostics; using Titanium.Web.Proxy.EventArguments; using Titanium.Web.Proxy.Exceptions; @@ -29,7 +30,7 @@ namespace Titanium.Web.Proxy.Network.Tcp; /// /// A class that manages Tcp Connection to server used by this proxy server. /// -internal class TcpConnectionFactory : IDisposable +internal partial class TcpConnectionFactory : IDisposable { /// @@ -1386,9 +1387,21 @@ internal bool TryRentPooled(ProxyServer proxyServer, string cacheKey, if (isHttps) { + proxyServer.RejectUpstreamFingerprint(sessionArgs?.UpstreamHttpClient); // CONNECT tunnel: wrap TLS on the existing HttpServerStream (may hold buffered // bytes from the CONNECT response). leaveInnerOpen:false — disposing the outer // HttpServerStream tears down the chain. + if (proxyServer.UseManagedTlsStack) + { + var managed = proxyServer.CreateManagedTlsStream(stream, leaveInnerStreamOpen: false); + stream = new HttpServerStream(proxyServer, managed, proxyServer.BufferPool, cancellationToken); + (negotiatedApplicationProtocol, bool usedManagedCertificate) = await AuthenticateManagedClientAsync( + proxyServer, managed, sessionArgs, remoteHostName, remotePort, applicationProtocols, + enabledSslProtocols, timing, cancellationToken); + usedClientCertificate |= usedManagedCertificate; + } + else + { var sslStream = new SslStream(stream, leaveInnerStreamOpen: false, (sender, certificate, chain, sslPolicyErrors) => proxyServer.ValidateServerCertificate(sender, sessionArgs, certificate, chain, @@ -1418,10 +1431,23 @@ internal bool TryRentPooled(ProxyServer proxyServer, string cacheKey, ProxyLog.OriginHandshakeSucceeded(proxyServer.Logger, remoteHostName, remotePort, negotiatedApplicationProtocol); timing?.MarkTlsHandshakeCompleted(); + } } } else if (isHttps) { + proxyServer.RejectUpstreamFingerprint(sessionArgs?.UpstreamHttpClient); + if (proxyServer.UseManagedTlsStack) + { + var managed = proxyServer.CreateManagedTlsStream(networkStream, leaveInnerStreamOpen: false); + stream = new HttpServerStream(proxyServer, managed, proxyServer.BufferPool, cancellationToken); + (negotiatedApplicationProtocol, bool usedManagedCertificate) = await AuthenticateManagedClientAsync( + proxyServer, managed, sessionArgs, remoteHostName, remotePort, applicationProtocols, + enabledSslProtocols, timing, cancellationToken); + usedClientCertificate |= usedManagedCertificate; + } + else + { var sslStream = new SslStream(networkStream, leaveInnerStreamOpen: false, (sender, certificate, chain, sslPolicyErrors) => proxyServer.ValidateServerCertificate(sender, sessionArgs, certificate, chain, @@ -1450,6 +1476,7 @@ internal bool TryRentPooled(ProxyServer proxyServer, string cacheKey, ProxyLog.OriginHandshakeSucceeded(proxyServer.Logger, remoteHostName, remotePort, negotiatedApplicationProtocol); timing?.MarkTlsHandshakeCompleted(); + } } else { diff --git a/src/Titanium.Web.Proxy/ProxyServer.Lifecycle.cs b/src/Titanium.Web.Proxy/ProxyServer.Lifecycle.cs index 96322753f..a67139f1b 100644 --- a/src/Titanium.Web.Proxy/ProxyServer.Lifecycle.cs +++ b/src/Titanium.Web.Proxy/ProxyServer.Lifecycle.cs @@ -47,6 +47,7 @@ public partial class ProxyServer : IDisposable // Freeze the active logging configuration for the duration of this run. ApplyLoggingConfiguration(); + EnsureManagedStackAllowedUnderFips(); SetThreadPoolMinThread(ThreadPoolWorkerThread); @@ -393,6 +394,7 @@ public async Task StopAsync(TimeSpan? drainTimeout = null) QuitListenQuic(dual); quicListenerCts?.Dispose(); quicListenerCts = null; + DisposeTransparentQuic(); // Keep ProxyEndPoints so Start() can re-bind the same listeners (issue #799). diff --git a/src/Titanium.Web.Proxy/ProxyServer.ManagedStack.cs b/src/Titanium.Web.Proxy/ProxyServer.ManagedStack.cs new file mode 100644 index 000000000..a0c828cfe --- /dev/null +++ b/src/Titanium.Web.Proxy/ProxyServer.ManagedStack.cs @@ -0,0 +1,112 @@ +using System; +using Microsoft.Extensions.Logging; +using Titanium.Tls; +using Titanium.Web.Proxy.Abstractions; +using Titanium.Web.Proxy.Abstractions.Clusters; + +namespace Titanium.Web.Proxy; + +public partial class ProxyServer +{ + private bool _useManagedTlsStack; + + private bool _useManagedQuicStack; + + private bool _allowManagedStackUnderFips; + + private static int _fipsOverrideWarned; + + /// + /// Gets or sets whether handshakes use the managed TLS stack. + /// The default is , so the proxy keeps SslStream. + /// Reading this after is allowed. + /// Assigning a different value after throws . + /// + public bool UseManagedTlsStack + { + get => _useManagedTlsStack; + set => AssignManagedStack(ref _useManagedTlsStack, value, nameof(UseManagedTlsStack)); + } + + /// + /// Gets or sets whether QUIC connections use the managed QUIC stack. + /// The default is , so the proxy keeps System.Net.Quic. + /// Reading this after is allowed. + /// Assigning a different value after throws . + /// + public bool UseManagedQuicStack + { + get => _useManagedQuicStack; + set => AssignManagedStack(ref _useManagedQuicStack, value, nameof(UseManagedQuicStack)); + } + + /// + /// Allows the managed stacks to start while FIPS mode is on. + /// The handshake then uses only FIPS-approved algorithms, so a browser fingerprint will not match, + /// and the managed stack is not a FIPS-validated module. + /// TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1 is the same switch without this property. + /// + public bool AllowManagedStackUnderFips + { + get => _allowManagedStackUnderFips; + set => AssignManagedStack(ref _allowManagedStackUnderFips, value, nameof(AllowManagedStackUnderFips)); + } + + private void ApplyManagedStackSuiteSwitch() + { + if (string.Equals(Environment.GetEnvironmentVariable("TWP_MANAGED_TLS"), "1", StringComparison.Ordinal)) + { + _useManagedTlsStack = true; + _useManagedQuicStack = true; + } + } + + private void AssignManagedStack(ref bool field, bool value, string name) + { + if (ProxyRunning && value != field) + { + throw new System.InvalidOperationException(name + " cannot be changed while the proxy is running."); + } + + field = value; + } + + internal void RejectUpstreamFingerprint(ClusterHttpClientConfig? http) + { + if (string.IsNullOrWhiteSpace(http?.Fingerprint)) + { + return; + } + + if (!_useManagedTlsStack) + { + throw new ManagedStackRequiredException("Upstream fingerprint evasion", nameof(UseManagedTlsStack)); + } + + throw new NotSupportedException( + "httpClient.fingerprint requests a browser ClientHello. The managed stack still sends its built-in hello, so the handshake is refused."); + } + + internal TlsStream CreateManagedTlsStream(System.IO.Stream inner, bool leaveInnerStreamOpen) => + new(inner, leaveInnerStreamOpen, ManagedTlsOptions()); + + internal TlsStreamOptions? ManagedTlsOptions() => + _allowManagedStackUnderFips ? new TlsStreamOptions { AllowManagedStackUnderFips = true } : null; + + private void EnsureManagedStackAllowedUnderFips() + { + string? refusal = FipsEnvironment.ManagedStackRefusal( + _useManagedTlsStack || _useManagedQuicStack, _allowManagedStackUnderFips); + if (refusal is not null) + { + throw new System.NotSupportedException(refusal); + } + + if ((_useManagedTlsStack || _useManagedQuicStack) && FipsEnvironment.IsEnabled() + && System.Threading.Interlocked.Exchange(ref _fipsOverrideWarned, 1) == 0) + { + logger.LogWarning( + "FIPS mode is on and the managed stack override is set. Fingerprint fidelity is reduced and the managed stack is not FIPS-validated."); + } + } +} diff --git a/src/Titanium.Web.Proxy/ProxyServer.cs b/src/Titanium.Web.Proxy/ProxyServer.cs index 3a422fce1..35cc31ae2 100644 --- a/src/Titanium.Web.Proxy/ProxyServer.cs +++ b/src/Titanium.Web.Proxy/ProxyServer.cs @@ -193,6 +193,7 @@ public ProxyServer(string? rootCertificateName, string? rootCertificateIssuerNam userTrustRootCertificate, machineTrustRootCertificate, trustRootCertificateAsAdmin, logger, () => ResourceLimits.MaxCertificateCacheEntries, () => ResourceLimits.MaxCertificateDiskCacheEntries); + ApplyManagedStackSuiteSwitch(); } /// @@ -216,7 +217,11 @@ internal Routing.MirrorDispatcher Mirror return existing; } - var created = new Routing.MirrorDispatcher(); + var created = new Routing.MirrorDispatcher + { + ManagedTls = () => UseManagedTlsStack, + ManagedTlsOptions = ManagedTlsOptions, + }; var raced = Interlocked.CompareExchange(ref mirrorDispatcher, created, null); if (raced is not null) { diff --git a/src/Titanium.Web.Proxy/PublicAPI.Unshipped.txt b/src/Titanium.Web.Proxy/PublicAPI.Unshipped.txt index e176fd936..139c9dc08 100644 --- a/src/Titanium.Web.Proxy/PublicAPI.Unshipped.txt +++ b/src/Titanium.Web.Proxy/PublicAPI.Unshipped.txt @@ -101,6 +101,12 @@ Titanium.Web.Proxy.ProxyServer.BlockLoopbackDestinations.get -> bool Titanium.Web.Proxy.ProxyServer.BlockLoopbackDestinations.set -> void Titanium.Web.Proxy.ProxyServer.EnableHttpInterception.get -> bool Titanium.Web.Proxy.ProxyServer.EnableHttpInterception.set -> void +Titanium.Web.Proxy.ProxyServer.AllowManagedStackUnderFips.get -> bool +Titanium.Web.Proxy.ProxyServer.AllowManagedStackUnderFips.set -> void +Titanium.Web.Proxy.ProxyServer.UseManagedQuicStack.get -> bool +Titanium.Web.Proxy.ProxyServer.UseManagedQuicStack.set -> void +Titanium.Web.Proxy.ProxyServer.UseManagedTlsStack.get -> bool +Titanium.Web.Proxy.ProxyServer.UseManagedTlsStack.set -> void Titanium.Web.Proxy.ProxyServer.IgnoreServerCertificateErrors.get -> bool Titanium.Web.Proxy.ProxyServer.IgnoreServerCertificateErrors.set -> void Titanium.Web.Proxy.ProxyServer.TryEnableHttp3IfSupported() -> bool diff --git a/src/Titanium.Web.Proxy/Routing/MirrorDispatcher.cs b/src/Titanium.Web.Proxy/Routing/MirrorDispatcher.cs index e34eca7a8..fdf45a885 100644 --- a/src/Titanium.Web.Proxy/Routing/MirrorDispatcher.cs +++ b/src/Titanium.Web.Proxy/Routing/MirrorDispatcher.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Channels; using System.Threading.Tasks; +using Titanium.Tls; using Titanium.Web.Proxy.Extensions; using Titanium.Web.Proxy.Abstractions.Clusters; using Titanium.Web.Proxy.Abstractions.Routing; @@ -48,6 +49,11 @@ internal sealed class MirrorDispatcher : IDisposable public MirrorDispatcher() => shutdownToken = shutdown.Token; + /// Read when a copy opens TLS. Unset keeps the platform handshake. + internal Func? ManagedTls { get; set; } + + internal Func? ManagedTlsOptions { get; set; } + /// Test sink. When set, nothing is queued. internal Action? Observed { get; set; } @@ -314,7 +320,7 @@ private async Task DeliverAsync(MirrorWork work) } else { - await SendAsync(work, shutdownToken).ConfigureAwait(false); + await SendAsync(work, shutdownToken, ManagedTls?.Invoke() == true, ManagedTlsOptions?.Invoke()).ConfigureAwait(false); } Interlocked.Increment(ref sent); @@ -331,7 +337,7 @@ private async Task DeliverAsync(MirrorWork work) } } - private static async Task SendAsync(MirrorWork work, CancellationToken stopping) + private static async Task SendAsync(MirrorWork work, CancellationToken stopping, bool useManagedTls, TlsStreamOptions? tlsOptions) { using var client = new TcpClient(); using var timeout = CancellationTokenSource.CreateLinkedTokenSource(stopping); @@ -340,10 +346,20 @@ private static async Task SendAsync(MirrorWork work, CancellationToken stopping) Stream stream = client.GetStream(); if (work.UseHttps) { + if (useManagedTls) + { + var managed = new TlsStream(stream, leaveInnerStreamOpen: false, tlsOptions); + stream = managed; + await managed.AuthenticateAsClientAsync( + new SslClientAuthenticationOptions { TargetHost = work.Host }, timeout.Token).ConfigureAwait(false); + } + else + { var secure = new SslStream(stream, false); stream = secure; await secure.AuthenticateAsClientAsync( new SslClientAuthenticationOptions { TargetHost = work.Host }, timeout.Token).ConfigureAwait(false); + } } await using var closer = stream.ConfigureAwait(false); diff --git a/src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj b/src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj index 80ad20888..def5be7a1 100644 --- a/src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj +++ b/src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj @@ -30,6 +30,10 @@ + + + + diff --git a/src/Titanium.Web.Proxy/WebTransport/WebTransportOrigin.cs b/src/Titanium.Web.Proxy/WebTransport/WebTransportOrigin.cs index 4338c5c72..cd0c1cbc3 100644 --- a/src/Titanium.Web.Proxy/WebTransport/WebTransportOrigin.cs +++ b/src/Titanium.Web.Proxy/WebTransport/WebTransportOrigin.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Net.Security; +using Titanium.Tls; using System.Net.Sockets; using System.Security.Authentication; using System.Text; @@ -14,7 +15,7 @@ namespace Titanium.Web.Proxy.WebTransport; internal static class WebTransportOrigin { public static async Task OpenHttp11Async( - string host, int port, bool https, string path, CancellationToken cancellationToken) + string host, int port, bool https, string path, CancellationToken cancellationToken, bool useManagedTls = false, TlsStreamOptions? tlsOptions = null) { if (HttpHeaderHasDelimiter(path) || HttpHeaderHasDelimiter(host)) { @@ -28,6 +29,19 @@ internal static class WebTransportOrigin Stream stream = tcp.GetStream(); if (https) { + if (useManagedTls) + { + var managed = new TlsStream(stream, leaveInnerStreamOpen: false, tlsOptions); + await managed.AuthenticateAsClientAsync(new SslClientAuthenticationOptions + { + TargetHost = host, + EnabledSslProtocols = SslProtocols.None, + CertificateRevocationCheckMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck, + }, cancellationToken).ConfigureAwait(false); + stream = managed; + } + else + { var ssl = new SslStream(stream, leaveInnerStreamOpen: false); await ssl.AuthenticateAsClientAsync(new SslClientAuthenticationOptions { @@ -36,6 +50,7 @@ await ssl.AuthenticateAsClientAsync(new SslClientAuthenticationOptions CertificateRevocationCheckMode = System.Security.Cryptography.X509Certificates.X509RevocationMode.NoCheck, }, cancellationToken).ConfigureAwait(false); stream = ssl; + } } var request = Encoding.ASCII.GetBytes( diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 0e5c35224..86245cbf5 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,4 +1,8 @@ + + + true + $(MSBuildThisFileDirectory)test.runsettings @@ -6,7 +10,7 @@ - + diff --git a/tests/Titanium.Cli.Tests/HelmChartTests.cs b/tests/Titanium.Cli.Tests/HelmChartTests.cs index 2ce8db582..dc117deb2 100644 --- a/tests/Titanium.Cli.Tests/HelmChartTests.cs +++ b/tests/Titanium.Cli.Tests/HelmChartTests.cs @@ -39,6 +39,16 @@ public void ValuesSchema_CoversTheThreeCharts() Assert.IsTrue(doc.RootElement.GetProperty("properties").TryGetProperty("controller", out _)); } + [TestMethod] + public void ManagedStack_DefaultsOff() + { + var stream = new YamlStream(); + using var reader = new StreamReader(Path.Combine(ChartDir, "values.yaml")); + stream.Load(reader); + var enabled = ((YamlScalarNode)((YamlMappingNode)((YamlMappingNode)stream.Documents[0].RootNode)["managedStack"])["enabled"]).Value; + Assert.AreEqual("false", enabled, "the proxy chart must keep the platform stack unless the operator turns managedStack.enabled on"); + } + [TestMethod] public void RenderedSnapshots_ContainADeployment() { diff --git a/tests/Titanium.Cli.Tests/RunCommandExecuteCoreBehaviorTests.cs b/tests/Titanium.Cli.Tests/RunCommandExecuteCoreBehaviorTests.cs index f8766defc..9453bd3dc 100644 --- a/tests/Titanium.Cli.Tests/RunCommandExecuteCoreBehaviorTests.cs +++ b/tests/Titanium.Cli.Tests/RunCommandExecuteCoreBehaviorTests.cs @@ -327,6 +327,35 @@ await WaitForPredicateAsync( } } + [TestMethod] + public void ResolveManagedStack_PrefersTheFlagThenTheEnvironment() + { + Assert.AreEqual(true, RunCommand.ParseManagedStack(["run", "--managed-stack"])); + Assert.AreEqual(false, RunCommand.ParseManagedStack(["run", "--managed-stack=false"])); + Assert.AreEqual(true, RunCommand.ParseManagedStack(["run", "--managed-stack", "1"])); + Assert.IsNull(RunCommand.ParseManagedStack(["run", "-c", "twp.yaml"])); + + var previous = Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK"); + try + { + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", "true"); + Assert.AreEqual(false, RunCommand.ResolveManagedStack(false)); + Assert.AreEqual(true, RunCommand.ResolveManagedStack(null)); + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", "0"); + Assert.AreEqual(false, RunCommand.ResolveManagedStack(null)); + } + finally + { + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", previous); + } + + using var proxy = new ProxyServer(userTrustRootCertificate: false); + ServerConfigApplier.Apply(proxy, new ServerConfig { ManagedTls = true }); + RunCommand.ApplyManagedStackOverride(proxy, false); + Assert.IsFalse(proxy.UseManagedTlsStack); + Assert.IsFalse(proxy.UseManagedQuicStack); + } + [TestMethod] public void ResolveLocalZone_PrefersOverrideThenServerThenNull() { diff --git a/tests/Titanium.Cli.Tests/ServerConfigApplierTests.cs b/tests/Titanium.Cli.Tests/ServerConfigApplierTests.cs index 6cf0b4121..dc40cd3f4 100644 --- a/tests/Titanium.Cli.Tests/ServerConfigApplierTests.cs +++ b/tests/Titanium.Cli.Tests/ServerConfigApplierTests.cs @@ -122,6 +122,36 @@ public void Apply_TimeoutOverlays_AfterProfile() Assert.IsTrue(proxy.BlockPrivateNetworkDestinations); } + [TestMethod] + public void Apply_ManagedStack_UmbrellaAndPerProtocolOverride() + { + using var untouched = new ProxyServer(userTrustRootCertificate: false); + untouched.UseManagedTlsStack = true; + ServerConfigApplier.Apply(untouched, new ServerConfig()); + Assert.IsTrue(untouched.UseManagedTlsStack); + Assert.IsFalse(untouched.UseManagedQuicStack); + + using var both = new ProxyServer(userTrustRootCertificate: false); + ServerConfigApplier.Apply(both, new ServerConfig { ManagedStack = true }); + Assert.IsTrue(both.UseManagedTlsStack); + Assert.IsTrue(both.UseManagedQuicStack); + + using var tlsOff = new ProxyServer(userTrustRootCertificate: false); + ServerConfigApplier.Apply(tlsOff, new ServerConfig { ManagedStack = true, ManagedTls = false }); + Assert.IsFalse(tlsOff.UseManagedTlsStack); + Assert.IsTrue(tlsOff.UseManagedQuicStack); + + using var quicOnly = new ProxyServer(userTrustRootCertificate: false); + ServerConfigApplier.Apply(quicOnly, new ServerConfig { ManagedQuic = true }); + Assert.IsFalse(quicOnly.UseManagedTlsStack); + Assert.IsTrue(quicOnly.UseManagedQuicStack); + + using var fips = new ProxyServer(userTrustRootCertificate: false); + ServerConfigApplier.Apply(fips, new ServerConfig { ManagedStackFipsOverride = true }); + Assert.IsTrue(fips.AllowManagedStackUnderFips); + Assert.IsFalse(fips.UseManagedTlsStack); + } + [TestMethod] public void Apply_EnableHttp2False() { diff --git a/tests/Titanium.Gateway.Tests/GatewayChartTests.cs b/tests/Titanium.Gateway.Tests/GatewayChartTests.cs index 35bf914f0..ea70d1016 100644 --- a/tests/Titanium.Gateway.Tests/GatewayChartTests.cs +++ b/tests/Titanium.Gateway.Tests/GatewayChartTests.cs @@ -50,6 +50,13 @@ public void BootstrapConfig_IsWhatTheControllerRendersForAnEmptyCluster_AndValid var config = TwpConfigLoader.LoadYaml(bootstrap); Assert.AreEqual(0, TwpConfigValidator.Validate(config).Count); Assert.AreEqual(0, config.Listeners.Count, "the pods start with no listeners; the controller adds them"); + Assert.IsTrue(config.Server?.ManagedStack == false, "an empty cluster publishes the platform stack"); + } + + [TestMethod] + public void ManagedStack_DefaultsOff() + { + Assert.AreEqual("false", ((YamlScalarNode)Path_(Values(), "dataPlane", "managedStack", "enabled")).Value); } [TestMethod] diff --git a/tests/Titanium.Inspector.Tests/NetworkSettingsTests.cs b/tests/Titanium.Inspector.Tests/NetworkSettingsTests.cs index a68bbb468..4b4a5314d 100644 --- a/tests/Titanium.Inspector.Tests/NetworkSettingsTests.cs +++ b/tests/Titanium.Inspector.Tests/NetworkSettingsTests.cs @@ -47,6 +47,7 @@ public void SettingsFile_WithoutNewFields_KeepsTodayBehavior_AndResetClearsUpstr Assert.AreEqual(InspectorNetworkSettings.DefaultUpstreamPort, settings.Current.UpstreamProxyPort); Assert.IsTrue(settings.Current.EnableHttp2); Assert.IsTrue(settings.Current.EnableHttp3); + Assert.IsFalse(settings.Current.UseManagedStack); Assert.IsTrue(settings.Current.ReuseServerConnections); Assert.AreEqual(InspectorNetworkSettings.TlsDefault, settings.Current.OutboundTlsPreset); Assert.AreEqual(string.Empty, settings.Current.WinAuthHosts); @@ -70,6 +71,56 @@ public void SettingsFile_WithoutNewFields_KeepsTodayBehavior_AndResetClearsUpstr Assert.IsFalse(doc.RootElement.GetProperty("upstreamProxyEnabled").GetBoolean()); } + [TestMethod] + public async Task ManagedStack_IsOffUntilRequested_AndKillSwitchOrFipsKeepsPlatform() + { + string? previous = Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK"); + Func savedFips = InterceptionService.FipsEnabled; + try + { + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", null); + using var off = new InterceptionService(new RecordingSystemProxyController()); + await off.StartAsync(IPAddress.Loopback, 0); + var offProxy = ProxyOf(off); + Assert.IsFalse(offProxy.UseManagedTlsStack); + Assert.IsFalse(offProxy.UseManagedQuicStack); + Assert.IsNull(off.ManagedStackReason); + off.Stop(); + + using var on = new InterceptionService(new RecordingSystemProxyController()) { PreferManagedStack = true }; + await on.StartAsync(IPAddress.Loopback, 0); + var onProxy = ProxyOf(on); + Assert.IsTrue(onProxy.UseManagedTlsStack); + Assert.IsTrue(onProxy.UseManagedQuicStack); + Assert.IsNull(on.ManagedStackReason); + on.Stop(); + + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", "0"); + using var killed = new InterceptionService(new RecordingSystemProxyController()) { PreferManagedStack = true }; + await killed.StartAsync(IPAddress.Loopback, 0); + var killedProxy = ProxyOf(killed); + Assert.IsFalse(killedProxy.UseManagedTlsStack); + Assert.IsFalse(killedProxy.UseManagedQuicStack); + Assert.AreEqual("TITANIUM_MANAGED_STACK=0", killed.ManagedStackReason); + killed.Stop(); + + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", null); + InterceptionService.FipsEnabled = static () => true; + using var fips = new InterceptionService(new RecordingSystemProxyController()) { PreferManagedStack = true }; + await fips.StartAsync(IPAddress.Loopback, 0); + var fipsProxy = ProxyOf(fips); + Assert.IsFalse(fipsProxy.UseManagedTlsStack); + Assert.IsFalse(fipsProxy.UseManagedQuicStack); + Assert.AreEqual("FIPS", fips.ManagedStackReason); + fips.Stop(); + } + finally + { + InterceptionService.FipsEnabled = savedFips; + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK", previous); + } + } + [TestMethod] public void TlsPreset_MapsOutboundOnly() { diff --git a/tests/Titanium.Inspector.Tests/Titanium.Inspector.Tests.csproj b/tests/Titanium.Inspector.Tests/Titanium.Inspector.Tests.csproj index 9772a4ace..5de46ab51 100644 --- a/tests/Titanium.Inspector.Tests/Titanium.Inspector.Tests.csproj +++ b/tests/Titanium.Inspector.Tests/Titanium.Inspector.Tests.csproj @@ -22,10 +22,12 @@ + + diff --git a/tests/Titanium.Net.Compatibility.Tests/ArchitectureTests.cs b/tests/Titanium.Net.Compatibility.Tests/ArchitectureTests.cs new file mode 100644 index 000000000..19c3dfd1b --- /dev/null +++ b/tests/Titanium.Net.Compatibility.Tests/ArchitectureTests.cs @@ -0,0 +1,38 @@ +using System; +using System.Reflection; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Net.Compatibility.Tests; + +[TestClass] +public sealed class ArchitectureTests +{ + [TestMethod] + public void HostRuns() + { + Assert.AreEqual("Titanium.Net.Compatibility", AssemblyMarker.Name); + } + + [TestMethod] + public void LibraryDoesNotReferenceTheProxyAndDoesNotPInvoke() + { + Assembly assembly = typeof(AssemblyMarker).Assembly; + foreach (AssemblyName referenced in assembly.GetReferencedAssemblies()) + { + string name = referenced.Name ?? string.Empty; + Assert.IsFalse(name.StartsWith("Titanium.Web.Proxy", StringComparison.Ordinal), name); + } + + byte[]? token = assembly.GetName().GetPublicKeyToken(); + Assert.IsNotNull(token); + Assert.IsTrue(token!.Length > 0); + + foreach (Type type in assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)) + { + Assert.IsFalse(method.Attributes.HasFlag(MethodAttributes.PinvokeImpl), method.Name); + } + } + } +} diff --git a/tests/Titanium.Net.Compatibility.Tests/QuicOptionsAdapterTests.cs b/tests/Titanium.Net.Compatibility.Tests/QuicOptionsAdapterTests.cs new file mode 100644 index 000000000..47bc0ea19 --- /dev/null +++ b/tests/Titanium.Net.Compatibility.Tests/QuicOptionsAdapterTests.cs @@ -0,0 +1,174 @@ +#pragma warning disable CA1416 // The tests build platform option objects. They do not listen or connect. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Net.Compatibility; + +namespace Titanium.Net.Compatibility.Tests; + +[TestClass] +public sealed class QuicOptionsAdapterTests +{ + [TestMethod] + public void AnIpEndpointCopiesTheHostTheProtocolsAndTheTimeout() + { + var remote = new IPEndPoint(IPAddress.Loopback, 443); + var local = new IPEndPoint(IPAddress.Loopback, 0); + var authentication = new SslClientAuthenticationOptions + { + TargetHost = "origin.example", + ApplicationProtocols = new List { SslApplicationProtocol.Http3 }, + }; + var source = new QuicClientConnectionOptions + { + RemoteEndPoint = remote, + LocalEndPoint = local, + ClientAuthenticationOptions = authentication, + HandshakeTimeout = TimeSpan.FromSeconds(3), + }; + + var managed = QuicClientOptionsAdapter.ToManaged(source); + + Assert.AreSame(remote, managed.RemoteEndPoint); + Assert.AreSame(local, managed.LocalEndPoint); + Assert.AreSame(authentication, managed.ClientAuthenticationOptions); + Assert.AreEqual(TimeSpan.FromSeconds(3), managed.HandshakeTimeout); + Assert.AreEqual(0, managed.MaxInboundBidirectionalStreams); + Assert.AreEqual(0, managed.MaxInboundUnidirectionalStreams); + Assert.AreEqual(Timeout.InfiniteTimeSpan, managed.KeepAliveInterval); + Assert.AreEqual(0, QuicClientOptionsAdapter.UnsupportedSettings(source).Count); + } + + [TestMethod] + public void AHostNameIsRefusedUntilTheCallerResolvesIt() + { + var source = new QuicClientConnectionOptions + { + RemoteEndPoint = new DnsEndPoint("origin.example", 443), + }; + + IReadOnlyList unsupported = QuicClientOptionsAdapter.UnsupportedSettings(source); + Assert.AreEqual(1, unsupported.Count); + Assert.AreEqual(nameof(QuicClientConnectionOptions.RemoteEndPoint), unsupported[0]); + + var error = Assert.ThrowsExactly(() => QuicClientOptionsAdapter.ToManaged(source)); + StringAssert.Contains(error.Message, nameof(QuicClientConnectionOptions.RemoteEndPoint)); + } + + [TestMethod] + public void KeepaliveIdleLimitsAndTheStreamErrorAreCopied() + { + var source = new QuicClientConnectionOptions + { + RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, 443), + KeepAliveInterval = TimeSpan.FromSeconds(5), + IdleTimeout = TimeSpan.FromSeconds(30), + MaxInboundBidirectionalStreams = 0, + MaxInboundUnidirectionalStreams = 3, + DefaultStreamErrorCode = 0x10c, + }; + + var managed = QuicClientOptionsAdapter.ToManaged(source); + + Assert.AreEqual(TimeSpan.FromSeconds(5), managed.KeepAliveInterval); + Assert.AreEqual(TimeSpan.FromSeconds(30), managed.IdleTimeout); + Assert.AreEqual(0, managed.MaxInboundBidirectionalStreams); + Assert.AreEqual(3, managed.MaxInboundUnidirectionalStreams); + Assert.AreEqual(0x10c, managed.DefaultStreamErrorCode); + Assert.AreEqual(0, QuicClientOptionsAdapter.UnsupportedSettings(source).Count); + } + + [TestMethod] + public void ACloseCodeACallbackAndAWindowStayRefused() + { + var source = new QuicClientConnectionOptions + { + RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, 443), + DefaultCloseErrorCode = 1, + StreamCapacityCallback = (_, _) => { }, + InitialReceiveWindowSizes = new QuicReceiveWindowSizes { Connection = 64 * 1024 }, + }; + + IReadOnlyList unsupported = QuicClientOptionsAdapter.UnsupportedSettings(source); + CollectionAssert.AreEquivalent( + new[] + { + nameof(QuicClientConnectionOptions.DefaultCloseErrorCode), + nameof(QuicClientConnectionOptions.StreamCapacityCallback), + nameof(QuicClientConnectionOptions.InitialReceiveWindowSizes), + }, + (System.Collections.ICollection)unsupported); + Assert.ThrowsExactly(() => QuicClientOptionsAdapter.ToManaged(source)); + } + + [TestMethod] + public void ANullClientOptionsThrows() + { + Assert.ThrowsExactly(() => QuicClientOptionsAdapter.ToManaged(null!)); + Assert.ThrowsExactly(() => QuicClientOptionsAdapter.UnsupportedSettings(null!)); + } + + [TestMethod] + public void AListenerCopiesTheEndpointAndKeepsTheManagedHandshakeTimeout() + { + var listen = new IPEndPoint(IPAddress.Loopback, 443); + var source = new QuicListenerOptions + { + ListenEndPoint = listen, + }; + + var managed = QuicListenerOptionsAdapter.ToManaged(source, static (_, _, _) => + throw new InvalidOperationException("The callback is stored, not called.")); + + Assert.AreSame(listen, managed.ListenEndPoint); + Assert.AreEqual(TimeSpan.FromSeconds(10), managed.HandshakeTimeout); + Assert.IsNotNull(managed.ConnectionOptionsCallback); + Assert.AreEqual(0, QuicListenerOptionsAdapter.UnsupportedSettings(source).Count); + } + + [TestMethod] + public void AListenerBacklogOtherThanThePlatformDefaultIsRefused() + { + var defaults = new QuicListenerOptions(); + var source = new QuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 443), + ListenBacklog = defaults.ListenBacklog + 1, + }; + + IReadOnlyList unsupported = QuicListenerOptionsAdapter.UnsupportedSettings(source); + Assert.AreEqual(nameof(QuicListenerOptions.ListenBacklog), unsupported[0]); + } + + [TestMethod] + public void ListenerApplicationProtocolsAreRefused() + { + var source = new QuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 443), + ApplicationProtocols = new List { SslApplicationProtocol.Http3 }, + }; + + IReadOnlyList unsupported = QuicListenerOptionsAdapter.UnsupportedSettings(source); + Assert.AreEqual(nameof(QuicListenerOptions.ApplicationProtocols), unsupported[0]); + Assert.ThrowsExactly(() => + QuicListenerOptionsAdapter.ToManaged(source, static (_, _, _) => + throw new InvalidOperationException("The callback is stored, not called."))); + } + + [TestMethod] + public void ANullListenerOptionsThrows() + { + Assert.ThrowsExactly(() => + QuicListenerOptionsAdapter.ToManaged(null!, static (_, _, _) => + throw new InvalidOperationException("The callback is stored, not called."))); + Assert.ThrowsExactly(() => + QuicListenerOptionsAdapter.ToManaged(new QuicListenerOptions(), null!)); + Assert.ThrowsExactly(() => QuicListenerOptionsAdapter.UnsupportedSettings(null!)); + } +} +#pragma warning restore CA1416 diff --git a/tests/Titanium.Net.Compatibility.Tests/StrongNameKey.snk b/tests/Titanium.Net.Compatibility.Tests/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/tests/Titanium.Net.Compatibility.Tests/StrongNameKey.snk differ diff --git a/tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj b/tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj new file mode 100644 index 000000000..2fdfca7bc --- /dev/null +++ b/tests/Titanium.Net.Compatibility.Tests/Titanium.Net.Compatibility.Tests.csproj @@ -0,0 +1,21 @@ + + + net10.0 + enable + disable + false + true + StrongNameKey.snk + true + true + Titanium.Net.Compatibility.Tests + + + + + + + + + + diff --git a/tests/Titanium.Net.Http.Tests/HandlerJa4.cs b/tests/Titanium.Net.Http.Tests/HandlerJa4.cs new file mode 100644 index 000000000..ec34b3ff8 --- /dev/null +++ b/tests/Titanium.Net.Http.Tests/HandlerJa4.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; + +namespace Titanium.Net.Http.Tests; + +internal static class HandlerJa4 +{ + internal static string Fingerprint(ReadOnlySpan record) + { + ReadOnlySpan handshake = Handshake(record); + int version = ReadU16(handshake, 4); + int sessionLength = handshake[38]; + int pos = 39 + sessionLength; + int cipherBytes = ReadU16(handshake, pos); + ReadOnlySpan ciphers = handshake.Slice(pos + 2, cipherBytes); + pos += 2 + cipherBytes; + pos += 1 + handshake[pos]; + int extensionBytes = ReadU16(handshake, pos); + ReadOnlySpan extensions = handshake.Slice(pos + 2, extensionBytes); + var cipherList = new List(); + for (int i = 0; i + 1 < ciphers.Length; i += 2) + { + ushort cipher = ReadU16(ciphers, i); + if (!IsGrease(cipher)) + { + cipherList.Add(cipher); + } + } + + var extensionList = new List(); + var signatures = new List(); + bool sni = false; + string alpn = "00"; + int offset = 0; + while (offset + 4 <= extensions.Length) + { + ushort type = ReadU16(extensions, offset); + int bodyLength = ReadU16(extensions, offset + 2); + ReadOnlySpan body = extensions.Slice(offset + 4, bodyLength); + offset += 4 + bodyLength; + if (IsGrease(type)) + { + continue; + } + + extensionList.Add(type); + if (type == 0) + { + sni = true; + } + else if (type == 16) + { + alpn = Alpn(body); + } + else if (type == 43) + { + version = HighestVersion(body, version); + } + else if (type == 13) + { + signatures.AddRange(ReadList16(body)); + } + } + + string versionText = version switch + { + 0x0304 => "13", + 0x0303 => "12", + 0x0302 => "11", + 0x0301 => "10", + 0x0300 => "s3", + 0x0002 => "s2", + _ => "00", + }; + return "t" + versionText + (sni ? "d" : "i") + Math.Min(cipherList.Count, 99).ToString("00") + Math.Min(extensionList.Count, 99).ToString("00") + alpn + + "_" + HashCiphers(cipherList) + "_" + HashExtensions(extensionList, signatures); + } + + private static ReadOnlySpan Handshake(ReadOnlySpan record) + { + if (record.Length < 5 || record[0] != 22) + { + throw new InvalidOperationException("The record is not a ClientHello."); + } + + int length = ReadU16(record, 3); + if (record.Length < 5 + length || length < 44 || record[5] != 1) + { + throw new InvalidOperationException("The record is not a ClientHello."); + } + + return record.Slice(5, length); + } + + private static string HashCiphers(List ciphers) + { + ciphers.Sort(); + return Truncate(HexList(ciphers)); + } + + private static string HashExtensions(List extensions, List signatures) + { + extensions.RemoveAll(type => type is 0 or 16); + extensions.Sort(); + if (extensions.Count == 0 && signatures.Count == 0) + { + return "000000000000"; + } + + string text = HexList(extensions); + if (signatures.Count > 0) + { + text = text.Length == 0 ? HexList(signatures) : text + "_" + HexList(signatures); + } + + return Truncate(text); + } + + private static string Truncate(string text) + { + if (text.Length == 0) + { + return "000000000000"; + } + + byte[] hash = SHA256.HashData(Encoding.ASCII.GetBytes(text)); + return Convert.ToHexString(hash)[..12].ToLowerInvariant(); + } + + private static string HexList(List values) + { + var text = new StringBuilder(); + for (int i = 0; i < values.Count; i++) + { + if (i > 0) + { + text.Append(','); + } + + text.Append(values[i].ToString("x4")); + } + + return text.ToString(); + } + + private static int HighestVersion(ReadOnlySpan body, int fallback) + { + if (body.IsEmpty) + { + return fallback; + } + + int count = body[0]; + int best = 0; + for (int i = 0; i < count && 1 + (i * 2) + 1 < body.Length; i++) + { + ushort version = ReadU16(body, 1 + (i * 2)); + if (!IsGrease(version) && version > best) + { + best = version; + } + } + + return best == 0 ? fallback : best; + } + + private static string Alpn(ReadOnlySpan body) + { + if (body.Length < 3) + { + return "00"; + } + + int list = ReadU16(body, 0); + if (list < 1 || body.Length < 2 + list) + { + return "00"; + } + + int nameLength = body[2]; + if (nameLength == 0 || 3 + nameLength > body.Length) + { + return "00"; + } + + ReadOnlySpan name = body.Slice(3, nameLength); + if (name.Length == 1 && IsAlphaNumeric(name[0])) + { + return string.Concat((char)name[0], (char)name[0]); + } + + if (IsAlphaNumeric(name[0]) && IsAlphaNumeric(name[^1])) + { + return string.Concat((char)name[0], (char)name[^1]); + } + + string hex = Convert.ToHexString(name).ToLowerInvariant(); + return string.Concat(hex[0], hex[^1]); + } + + private static List ReadList16(ReadOnlySpan body) + { + var values = new List(); + if (body.Length < 2) + { + return values; + } + + int count = ReadU16(body, 0); + for (int i = 0; i + 1 < count && 2 + i + 1 < body.Length; i += 2) + { + ushort value = ReadU16(body, 2 + i); + if (!IsGrease(value)) + { + values.Add(value); + } + } + + return values; + } + + private static bool IsAlphaNumeric(byte value) + { + return value is (>= 0x30 and <= 0x39) or (>= 0x41 and <= 0x5A) or (>= 0x61 and <= 0x7A); + } + + private static bool IsGrease(ushort value) + { + return (value & 0x0F0F) == 0x0A0A; + } + + private static ushort ReadU16(ReadOnlySpan bytes, int offset) + { + return (ushort)((bytes[offset] << 8) | bytes[offset + 1]); + } +} diff --git a/tests/Titanium.Net.Http.Tests/StrongNameKey.snk b/tests/Titanium.Net.Http.Tests/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/tests/Titanium.Net.Http.Tests/StrongNameKey.snk differ diff --git a/tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj b/tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj new file mode 100644 index 000000000..02d2d492b --- /dev/null +++ b/tests/Titanium.Net.Http.Tests/Titanium.Net.Http.Tests.csproj @@ -0,0 +1,26 @@ + + + net10.0 + enable + disable + false + true + StrongNameKey.snk + true + true + Titanium.Net.Http.Tests + + + + + + + + + + + + + + + diff --git a/tests/Titanium.Net.Http.Tests/TitaniumHttpHandlerTests.cs b/tests/Titanium.Net.Http.Tests/TitaniumHttpHandlerTests.cs new file mode 100644 index 000000000..3f5a3de3d --- /dev/null +++ b/tests/Titanium.Net.Http.Tests/TitaniumHttpHandlerTests.cs @@ -0,0 +1,18430 @@ +#pragma warning disable CA1416 // QuicStreamType is the BCL name. The platform listener starts only off Windows, and only when TITANIUM_QUIC_PLATFORM_LISTENER is 1. +using System; +using System.Buffers; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Sockets; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.IO; +using System.IO.Compression; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Hosting.Server; +using Microsoft.AspNetCore.Hosting.Server.Features; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Server.Kestrel.Core; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Http3; +using Titanium.Tls; +using Titanium.Quic; + +namespace Titanium.Net.Http.Tests; + +[TestClass] +public sealed class TitaniumHttpHandlerTests +{ + [TestMethod] + public void HttpsDefaultPortStays443() + { + using HttpRequestMessage request = new(HttpMethod.Get, "https://example.com/a?b=1"); + using HttpRequestMessage inner = TitaniumHttpHandler.CreateInnerRequest( + request, + HttpVersion.Version11, + HttpVersionPolicy.RequestVersionExact); + + Assert.AreEqual("https", request.RequestUri!.Scheme); + Assert.AreEqual("http", inner.RequestUri!.Scheme); + Assert.AreEqual(443, inner.RequestUri.Port); + Assert.AreEqual("/a", inner.RequestUri.AbsolutePath); + Assert.AreEqual("?b=1", inner.RequestUri.Query); + Assert.AreEqual("example.com", inner.Headers.Host); + Assert.IsTrue(inner.Options.TryGetValue(TitaniumHttpHandler.ManagedTlsOption, out bool tls) && tls); + } + + [TestMethod] + public void ExplicitHttpsPortIsKept() + { + using HttpRequestMessage request = new(HttpMethod.Get, "https://example.com:8443/a"); + request.Headers.Host = "example.com:8443"; + using HttpRequestMessage inner = TitaniumHttpHandler.CreateInnerRequest( + request, + HttpVersion.Version11, + HttpVersionPolicy.RequestVersionExact); + + Assert.AreEqual("http", inner.RequestUri!.Scheme); + Assert.AreEqual(8443, inner.RequestUri.Port); + Assert.AreEqual("example.com:8443", inner.Headers.Host); + } + + [TestMethod] + public void HttpUriIsNotRewritten() + { + using HttpRequestMessage request = new(HttpMethod.Get, "http://example.com/a"); + using HttpRequestMessage inner = TitaniumHttpHandler.CreateInnerRequest( + request, + HttpVersion.Version11, + HttpVersionPolicy.RequestVersionExact); + + Assert.AreEqual("http", inner.RequestUri!.Scheme); + Assert.AreEqual(80, inner.RequestUri.Port); + Assert.IsFalse(inner.Options.TryGetValue(TitaniumHttpHandler.ManagedTlsOption, out _)); + } + + [TestMethod] + public void HttpsIpv6DefaultPortHostIsBracketed() + { + using HttpRequestMessage request = new(HttpMethod.Get, "https://[::1]/hello"); + using HttpRequestMessage inner = TitaniumHttpHandler.CreateInnerRequest( + request, + HttpVersion.Version11, + HttpVersionPolicy.RequestVersionExact); + + Assert.AreEqual("http", inner.RequestUri!.Scheme); + Assert.AreEqual(443, inner.RequestUri.Port); + Assert.AreEqual("[::1]", inner.Headers.Host); + Assert.AreEqual("https", request.RequestUri!.Scheme); + } + + [TestMethod] + public void HttpsIdnHostIsPunycode() + { + using HttpRequestMessage request = new(HttpMethod.Get, "https://b\u00fccher.example/hello"); + using HttpRequestMessage inner = TitaniumHttpHandler.CreateInnerRequest( + request, + HttpVersion.Version11, + HttpVersionPolicy.RequestVersionExact); + + Assert.AreEqual("http", inner.RequestUri!.Scheme); + Assert.AreEqual(443, inner.RequestUri.Port); + Assert.AreEqual("xn--bcher-kva.example", inner.Headers.Host); + Assert.AreEqual("https", request.RequestUri!.Scheme); + } + + [TestMethod] + public void Http3Ipv6AuthorityUsesBrackets() + { + Assert.AreEqual("[::1]", Http3Client.Authority(new Uri("https://[::1]/hello"))); + Assert.AreEqual("[::1]:9", Http3Client.Authority(new Uri("https://user:secret@[::1]:9/hello"))); + Assert.AreEqual("127.0.0.1:9", Http3Client.Authority(new Uri("https://127.0.0.1:9/hello"))); + Assert.AreEqual("example.com", Http3Client.Authority(new Uri("https://example.com/hello"))); + } + + [TestMethod] + public void AssemblyReferencesTheManagedStackOnly() + { + string[] names = typeof(TitaniumHttpHandler).Assembly.GetReferencedAssemblies() + .Select(static reference => reference.Name ?? string.Empty) + .ToArray(); + Assert.IsTrue(names.Contains("Titanium.Tls")); + Assert.IsTrue(names.Contains("Titanium.Quic")); + Assert.IsTrue(names.Contains("Titanium.Http3")); + foreach (string name in names) + { + Assert.IsFalse(name.Contains("Titanium.Web.Proxy", StringComparison.Ordinal), name); + Assert.IsFalse(string.Equals(name, "Titanium.Net.Compatibility", StringComparison.Ordinal), name); + } + } + + [TestMethod] + public void PropertiesRoundTripToTheInnerHandler() + { + using TitaniumHttpHandler handler = new() + { + UseProxy = false, + MaxConnectionsPerServer = 4, + AllowAutoRedirect = false, + MaxAutomaticRedirections = 2, + AutomaticDecompression = DecompressionMethods.GZip, + PooledConnectionLifetime = TimeSpan.FromMinutes(1), + PooledConnectionIdleTimeout = TimeSpan.FromSeconds(30), + ConnectTimeout = TimeSpan.FromSeconds(3), + UseCookies = false, + EnableAltSvc = true, + AllowManagedStackUnderFips = true, + Proxy = null, + }; + CookieContainer cookies = new(); + handler.CookieContainer = cookies; + + Assert.IsFalse(handler.UseProxy); + Assert.IsNull(handler.Proxy); + Assert.AreEqual(4, handler.MaxConnectionsPerServer); + Assert.IsFalse(handler.AllowAutoRedirect); + Assert.AreEqual(2, handler.MaxAutomaticRedirections); + Assert.AreEqual(DecompressionMethods.GZip, handler.AutomaticDecompression); + Assert.AreEqual(TimeSpan.FromMinutes(1), handler.PooledConnectionLifetime); + Assert.AreEqual(TimeSpan.FromSeconds(30), handler.PooledConnectionIdleTimeout); + Assert.AreEqual(TimeSpan.FromSeconds(3), handler.ConnectTimeout); + Assert.IsFalse(handler.UseCookies); + Assert.IsTrue(handler.EnableAltSvc); + Assert.IsTrue(handler.AllowManagedStackUnderFips); + Assert.AreSame(cookies, handler.CookieContainer); + } + + [TestMethod] + public void SslOptionsRejectsNull() + { + using TitaniumHttpHandler handler = Handler(); + ArgumentNullException ex = Assert.ThrowsExactly(() => handler.SslOptions = null!); + Assert.AreEqual("value", ex.ParamName); + } + + [TestMethod] + public void AltSvcMissingMaLasts24Hours() + { + AltSvcCache cache = new(); + Uri uri = new("https://127.0.0.1:1234/tcp"); + DateTimeOffset now = DateTimeOffset.UtcNow; + cache.Note(uri, "h3=\":443\"", now); + Assert.IsTrue(cache.TryGet(uri, now.AddSeconds(AltSvcCache.DefaultMaxAgeSeconds).AddTicks(-1), out int port)); + Assert.AreEqual(443, port); + Assert.IsFalse(cache.TryGet(uri, now.AddSeconds(AltSvcCache.DefaultMaxAgeSeconds), out _)); + } + + [TestMethod] + public void AltSvcCacheHolds256Origins() + { + DateTimeOffset now = DateTimeOffset.UtcNow; + AltSvcCache full = new(); + for (int port = 1; port <= AltSvcCache.MaxEntries; port++) + { + full.Note(Origin(port), "h3=\":443\"; ma=60", now); + } + + full.Note(Origin(1), "h3=\":7\"; ma=60", now); + Assert.IsTrue(full.TryGet(Origin(1), now, out int refreshed)); + Assert.AreEqual(7, refreshed); + Assert.IsTrue(full.TryGet(Origin(2), now, out _)); + + full.Note(Origin(AltSvcCache.MaxEntries + 1), "h3=\":9\"; ma=60", now); + Assert.IsTrue(full.TryGet(Origin(AltSvcCache.MaxEntries + 1), now, out int replaced)); + Assert.AreEqual(9, replaced); + Assert.IsFalse(full.TryGet(Origin(1), now, out _)); + Assert.IsFalse(full.TryGet(Origin(2), now, out _)); + + AltSvcCache mixed = new(); + for (int port = 1; port < AltSvcCache.MaxEntries; port++) + { + mixed.Note(Origin(port), "h3=\":443\"; ma=60", now); + } + + mixed.Note(Origin(AltSvcCache.MaxEntries), "h3=\":443\"; ma=60", now.AddMinutes(-2)); + mixed.Note(Origin(AltSvcCache.MaxEntries + 1), "h3=\":9\"; ma=60", now); + Assert.IsTrue(mixed.TryGet(Origin(AltSvcCache.MaxEntries + 1), now, out int kept)); + Assert.AreEqual(9, kept); + Assert.IsTrue(mixed.TryGet(Origin(1), now, out _)); + Assert.IsFalse(mixed.TryGet(Origin(AltSvcCache.MaxEntries), now, out _)); + } + + [TestMethod] + public void AltSvcLastTokenWins() + { + AltSvcCache cache = new(); + Uri uri = new("https://127.0.0.1:1234/tcp"); + DateTimeOffset now = DateTimeOffset.UtcNow; + cache.Note(uri, "clear, h3=\":9\"; ma=60", now); + Assert.IsTrue(cache.TryGet(uri, now, out int port)); + Assert.AreEqual(9, port); + cache.Note(uri, "h3=\":9\"; ma=60, clear", now); + Assert.IsFalse(cache.TryGet(uri, now, out _)); + } + + [TestMethod] + public void AltSvcAuthorityChoosesThePort() + { + AltSvcCache cache = new(); + DateTimeOffset now = DateTimeOffset.UtcNow; + Uri v4 = new("https://127.0.0.1:1234/tcp"); + cache.Note(v4, "h3=\"127.0.0.1\"; ma=60", now); + Assert.IsTrue(cache.TryGet(v4, now, out int omitted)); + Assert.AreEqual(443, omitted); + + Uri v6 = new("https://[::1]:1234/tcp"); + cache.Note(v6, "h3=\"[::1]:9\"; ma=60", now); + Assert.IsTrue(cache.TryGet(v6, now, out int matched)); + Assert.AreEqual(9, matched); + cache.Note(v6, "h3=\"[::2]:8\"; ma=60", now); + Assert.IsTrue(cache.TryGet(v6, now, out int kept)); + Assert.AreEqual(9, kept); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11DisposedHandlerRejectsTheNextRequest() + { + int hits = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hello", () => + { + Interlocked.Increment(ref hits); + return Results.Text("ok"); + }), + null, + HttpProtocols.Http1); + TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using (HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }) + { + using HttpResponseMessage response = await client.SendAsync(first); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync()); + Assert.AreSame(first, response.RequestMessage); + } + + handler.Dispose(); + handler.Dispose(); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(second)); + Assert.AreEqual(1, hits); + } + + private static Uri Origin(int port) => + new("https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/"); + + [TestMethod] + [Timeout(60000)] + public async Task Http3AgainstLoopbackReturnsTheBody() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending; + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestWithAProxyReachesTheOrigin() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending; + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool proxyAccepted = false; + try + { + using TcpClient proxyClient = await proxy.AcceptTcpClientAsync(extraLimit.Token); + proxyAccepted = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(proxyAccepted); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ClientHelloMatchesTheProfileJa4() + { + await AssertProfileJa4Async(HttpVersion.Version11, ["http/1.1"]); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ClientHelloMatchesTheProfileJa4() + { + await AssertProfileJa4Async(HttpVersion.Version20, ["h2", "http/1.1"]); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11GetSucceedsWithTheChromeProfile() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.Text("ok")), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.FingerprintProfile = TlsFingerprintProfiles.Chrome; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + private static async Task AssertProfileJa4Async(Version version, string[] alpn) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Assert.AreNotEqual(0, port); + Assert.IsFalse(port is 8000 or 8866 or 9080 or 9464); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + ChromeFingerprintProfile profile = TlsFingerprintProfiles.Chrome; + handler.FingerprintProfile = profile; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = version, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request); + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using NetworkStream stream = accepted.GetStream(); + byte[] flight = new byte[16384]; + int got = 0; + while (got < 5) + { + int count = await stream.ReadAsync(flight.AsMemory(got)); + Assert.IsTrue(count > 0); + got += count; + } + + int record = 5 + ((flight[3] << 8) | flight[4]); + Assert.IsTrue(record <= flight.Length); + while (got < record) + { + int count = await stream.ReadAsync(flight.AsMemory(got, record - got)); + Assert.IsTrue(count > 0); + got += count; + } + + var reference = new ArrayBufferWriter(); + var shares = new Dictionary { [0x001D] = new byte[32] }; + if (profile.Fidelity == TlsFingerprintFidelity.Full) + { + shares[0x11EC] = new byte[1216]; + } + + profile.BuildClientHello(new ClientHelloContext + { + ServerName = "127.0.0.1", + ApplicationProtocols = alpn, + KeyShares = shares, + }, reference); + Assert.AreEqual(HandlerJa4.Fingerprint(reference.WrittenSpan), HandlerJa4.Fingerprint(flight.AsSpan(0, record))); + accepted.Close(); + await Assert.ThrowsExactlyAsync(async () => await pending); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ReachesAPlatformQuicServer() + { + // QuicListener opens a wildcard UDP socket. This PC must not start it. + bool allowed = !OperatingSystem.IsWindows() + && string.Equals(Environment.GetEnvironmentVariable("TITANIUM_QUIC_PLATFORM_LISTENER"), "1", StringComparison.Ordinal); + if (!allowed) + { + return; + } + + Assert.IsTrue(QuicListener.IsSupported, "Platform QUIC is not supported on this machine."); + + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.Text("ok")), + null, + HttpProtocols.Http3); + Assert.AreNotEqual(0, server.Port); + Assert.IsFalse(server.Port is 8000 or 8866 or 9080 or 9464); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync()); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3PostReachesAPlatformQuicServer() + { + bool allowed = !OperatingSystem.IsWindows() + && string.Equals(Environment.GetEnvironmentVariable("TITANIUM_QUIC_PLATFORM_LISTENER"), "1", StringComparison.Ordinal); + if (!allowed) + { + return; + } + + Assert.IsTrue(QuicListener.IsSupported, "Platform QUIC is not supported on this machine."); + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapPost("/echo", async (HttpRequest incoming) => + { + using StreamReader reader = new(incoming.Body, System.Text.Encoding.ASCII, detectEncodingFromByteOrderMarks: false, leaveOpen: true); + string body = await reader.ReadToEndAsync(); + return Results.Text(body); + }), + null, + HttpProtocols.Http3); + Assert.AreNotEqual(0, server.Port); + Assert.IsFalse(server.Port is 8000 or 8866 or 9080 or 9464); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/echo") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload", System.Text.Encoding.ASCII), + }; + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("payload", await response.Content.ReadAsStringAsync()); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3LeavesGzipEncoded() + { + byte[] payload; + using (MemoryStream encoded = new()) + { + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.GZip; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/gzip") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + bool askedForGzip = false; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (string.Equals(name, "accept-encoding", StringComparison.OrdinalIgnoreCase) + && value.Contains("gzip", StringComparison.OrdinalIgnoreCase)) + { + askedForGzip = true; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + byte[] block = QpackEncoder.Encode([(":status", "200"), ("content-encoding", "gzip")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, block, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, payload, cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + byte[] body = await response.Content.ReadAsByteArrayAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.IsTrue(body.AsSpan().SequenceEqual(payload)); + Assert.IsFalse(askedForGzip); + Assert.AreEqual(3, response.Version.Major); + Assert.IsTrue(response.Content.Headers.ContentEncoding.Contains("gzip")); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DirectRequestLeavesTheCookieContainerUnchanged() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + Uri uri = new("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + CookieContainer cookies = new(); + cookies.Add(uri, new Cookie("session", "one")); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + (string path, string cookie) = await ReadPathAndCookieAsync(inbound, cancel.Token); + Assert.IsTrue(path.EndsWith("/hello", StringComparison.Ordinal), path); + Assert.AreEqual(string.Empty, cookie); + byte[] block = QpackEncoder.Encode([(":status", "200"), ("set-cookie", "next=two")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, block, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + CookieCollection stored = cookies.GetCookies(uri); + Assert.AreEqual(1, stored.Count); + Assert.AreEqual("session", stored[0]!.Name); + Assert.AreEqual("one", stored[0]!.Value); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DirectRequestSendsACookieHeader() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + (string path, string cookie) = await ReadPathAndCookieAsync(inbound, cancel.Token); + Assert.IsTrue(path.EndsWith("/hello", StringComparison.Ordinal), path); + Assert.AreEqual("sid=manual", cookie); + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3Ipv6AuthorityIsBracketed() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate, IPAddress.IPv6Loopback); + string port = listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://user:secret@[::1]:" + port + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + string authority = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":authority") + { + authority = value; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("[::1]:" + port, authority); + Assert.IsFalse(authority.Contains("user", StringComparison.Ordinal), authority); + Assert.IsFalse(authority.Contains("secret", StringComparison.Ordinal), authority); + Assert.AreEqual("user:secret", request.RequestUri!.UserInfo); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DirectRequestSendsAuthorization() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + (string path, string authorization) = await ReadPathAndAuthorizationAsync(inbound, cancel.Token); + Assert.IsTrue(path.EndsWith("/hello", StringComparison.Ordinal), path); + Assert.AreEqual("Bearer secret", authorization); + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DirectRequestUsesTheUriAsAuthority() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + string port = listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Host = "app.example"; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + string authority = string.Empty; + bool sawHost = false; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":authority") + { + authority = value; + } + else if (name == "host") + { + sawHost = true; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("127.0.0.1:" + port, authority); + Assert.IsFalse(sawHost); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestSendsTheHttpsScheme() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + string port = listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + string scheme = string.Empty; + string method = string.Empty; + string path = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":scheme") + { + scheme = value; + } + else if (name == ":method") + { + method = value; + } + else if (name == ":path") + { + path = value; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("https", scheme); + Assert.AreEqual("GET", method); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DirectRequestSendsACallerHeaderAndLeavesConnectionOff() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("X-Trace", "one"); + request.Headers.TryAddWithoutValidation("Connection", "close"); + request.Headers.TryAddWithoutValidation("Upgrade", "websocket"); + request.Headers.TryAddWithoutValidation("Keep-Alive", "timeout=5"); + request.Headers.TryAddWithoutValidation("Proxy-Connection", "keep-alive"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + string trace = string.Empty; + bool sawConnectionHeader = false; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == "x-trace") + { + trace = value; + } + else if (name is "connection" or "upgrade" or "keep-alive" or "proxy-connection") + { + sawConnectionHeader = true; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("one", trace); + Assert.IsFalse(sawConnectionHeader); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestSendsEveryValueOfARepeatedHeader() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", new[] { "one", "two" })); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + var traces = new List(); + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == "x-trace") + { + traces.Add(value); + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + CollectionAssert.AreEqual(new[] { "one", "two" }, traces); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3PostSendsTheContentType() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + using var posted = new MemoryStream(); + while (await ReadFrameAsync(inbound, cancel.Token) is byte[] frame) + { + posted.Write(frame); + } + + string contentType = string.Empty; + string method = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == "content-type") + { + contentType = value; + } + else if (name == ":method") + { + method = value; + } + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("POST", method); + Assert.IsTrue(contentType.Contains("text/plain", StringComparison.OrdinalIgnoreCase), contentType); + Assert.AreEqual("payload", System.Text.Encoding.UTF8.GetString(posted.ToArray())); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestLeavesTransferEncodingOff() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Transfer-Encoding", "chunked")); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + bool sawTransferEncoding = false; + foreach ((string name, _) in QpackDecoder.Decode(headers)) + { + if (name == "transfer-encoding") + { + sawTransferEncoding = true; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(sawTransferEncoding); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3EmptyPostSendsNoDataFrame() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent(string.Empty), + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(headers); + int extraFrames = 0; + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + extraFrames++; + } + + string method = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":method") + { + method = value; + } + } + + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("POST", method); + Assert.AreEqual(0, extraFrames); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestKeepsTheQueryOnThePath() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello?x=1") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("/hello?x=1", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DataBeforeHeadersFailsTheRequest() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "early"u8.ToArray(), cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(HasMessage(ex, "The HTTP/3 response sent a body before headers.")); + Assert.AreEqual("/hello", path); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3TruncatedFrameFailsTheRequest() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] header = new byte[16]; + int written = Http3VarInt.Write(header, Http3FrameType.Headers); + written += Http3VarInt.Write(header.AsSpan(written), 8); + await inbound.WriteAsync(header.AsMemory(0, written), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(HasMessage(ex, "The HTTP/3 frame ended early.")); + Assert.AreEqual("/hello", path); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3UnknownFrameBeforeHeadersIsSkipped() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + await WriteFrameAsync(inbound, 0x21, "skip"u8.ToArray(), cancel.Token); + await ReplyTextAsync(inbound, "ok", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ResponseWithNoHeadersFailsTheRequest() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(HasMessage(ex, "The HTTP/3 response had no headers.")); + Assert.AreEqual("/hello", path); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3UsesTargetHostAsTheServerName() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + TaskCompletionSource serverName = new(TaskCreationOptions.RunContinuationsAsynchronously); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, hello, _) => + { + serverName.TrySetResult(hello.ServerName); + return ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }); + }, + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.TargetHost = "app.example"; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("app.example", await serverName.Task); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3UsesQuicOptionsLocalEndPoint() + { + using Socket reserved = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + reserved.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + int localPort = ((IPEndPoint)reserved.LocalEndPoint!).Port; + reserved.Close(); + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.QuicOptions = new ManagedQuicClientConnectionOptions + { + LocalEndPoint = new IPEndPoint(IPAddress.Loopback, localPort), + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(localPort, server.RemoteEndPoint.Port); + Assert.AreEqual(IPAddress.Loopback, server.RemoteEndPoint.Address); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3HandshakeTimeoutStopsASilentPeerWhenConnectTimeoutIsInfinite() + { + using Socket udp = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + udp.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + int port = ((IPEndPoint)udp.LocalEndPoint!).Port; + using TitaniumHttpHandler handler = Handler(); + handler.ConnectTimeout = Timeout.InfiniteTimeSpan; + handler.QuicOptions = new ManagedQuicClientConnectionOptions + { + HandshakeTimeout = TimeSpan.FromMilliseconds(400), + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(15) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + DateTime started = DateTime.UtcNow; + Http3ConnectException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsInstanceOfType(ex.InnerException); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(3)); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3UnresolvableHostFailsBeforeAConnection() + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://no-such-host.invalid/hello"); + Http3ConnectException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.AreEqual("The HTTP/3 connection failed before the request was sent.", ex.Message); + Assert.IsInstanceOfType(ex.InnerException); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectIsFollowedOnTheSameConnection() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream first = await server.AcceptInboundStreamAsync(cancel.Token); + string firstPath = await ReadRequestPathAsync(first, cancel.Token); + Assert.IsTrue(firstPath.EndsWith("/from", StringComparison.Ordinal)); + byte[] redirect = QpackEncoder.Encode([(":status", "302"), ("location", "/land")]); + await WriteFrameAsync(first, Http3FrameType.Headers, redirect, cancel.Token); + await first.CompleteWritesAsync(cancel.Token); + ManagedQuicStream second = await server.AcceptInboundStreamAsync(cancel.Token); + string secondPath = await ReadRequestPathAsync(second, cancel.Token); + Assert.IsTrue(secondPath.EndsWith("/land", StringComparison.Ordinal)); + await ReplyOnAcceptedAsync(second, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new Version(3, 0), response.Version); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3PostRedirectTurnsFoundIntoGetAndKeepsTemporaryRedirect() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage found = new(HttpMethod.Post, address + "/found") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(found, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string method, string path, string body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/found", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "302", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("GET", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, body); + await ReplyTextAsync(hop, "GET:", cancel.Token); + using HttpResponseMessage foundResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("GET:", await foundResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(found, foundResponse.RequestMessage); + + using HttpRequestMessage keep = new(HttpMethod.Post, address + "/keep") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + pending = client.SendAsync(keep, cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/keep", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "307", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await ReplyTextAsync(hop, "POST:payload", cancel.Token); + using HttpResponseMessage keepResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("POST:payload", await keepResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(keep, keepResponse.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3SeeOtherTurnsPostIntoGetAndKeepsHead() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage post = new(HttpMethod.Post, address + "/see") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(post, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string method, string path, string body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/see", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "303", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("GET", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, body); + await ReplyTextAsync(hop, "GET:", cancel.Token); + using HttpResponseMessage postResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("GET:", await postResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(post, postResponse.RequestMessage); + + using HttpRequestMessage head = new(HttpMethod.Head, address + "/see-head"); + head.Version = HttpVersion.Version30; + head.VersionPolicy = HttpVersionPolicy.RequestVersionExact; + pending = client.SendAsync(head, cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("HEAD", method); + Assert.IsTrue(path.EndsWith("/see-head", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "303", "/head-land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("HEAD", method); + Assert.IsTrue(path.EndsWith("/head-land", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, body); + await ReplySawAsync(hop, "HEAD", cancel.Token); + using HttpResponseMessage headResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, headResponse.StatusCode); + Assert.AreEqual("HEAD", headResponse.Headers.GetValues("X-Saw").Single()); + Assert.AreSame(head, headResponse.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3MovedPermanentlyTurnsPostIntoGetAndPermanentRedirectKeepsIt() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage moved = new(HttpMethod.Post, address + "/moved") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(moved, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string method, string path, string body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/moved", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "301", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("GET", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, body); + await ReplyTextAsync(hop, "GET:", cancel.Token); + using HttpResponseMessage movedResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("GET:", await movedResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(moved, movedResponse.RequestMessage); + + using HttpRequestMessage keep = new(HttpMethod.Post, address + "/keep") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + pending = client.SendAsync(keep, cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/keep", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "308", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await ReplyTextAsync(hop, "POST:payload", cancel.Token); + using HttpResponseMessage keepResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("POST:payload", await keepResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(keep, keepResponse.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AllowAutoRedirectFalseReturnsTheRedirect() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.AllowAutoRedirect = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "302", "/land", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.Found, response.StatusCode); + Assert.IsTrue(response.Headers.Location?.OriginalString.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(new Version(3, 0), response.Version); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectLimitStopsALongerChain() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/a"; + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.MaxAutomaticRedirections = 1; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage limited = Request(address); + Task pending = client.SendAsync(limited, cancel.Token); + ManagedQuicConnection server = await accepted; + await ServeRedirectChainAsync(server, finish: false, cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.AreEqual("The redirect limit was reached.", ex.Message); + await server.DisposeAsync(); + + accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler longer = Handler(); + longer.MaxAutomaticRedirections = 2; + using HttpClient again = new(longer, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage allowed = Request(address); + pending = again.SendAsync(allowed, cancel.Token); + server = await accepted; + await ServeRedirectChainAsync(server, finish: true, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("landed", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new Version(3, 0), response.Version); + Assert.AreSame(allowed, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectCopiesACookieHeaderOnlyWhenCookiesAreOff() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"; + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler manual = Handler(); + manual.UseCookies = false; + using HttpClient manualClient = new(manual, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage manualRequest = Request(address); + manualRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + Task pending = manualClient.SendAsync(manualRequest, cancel.Token); + ManagedQuicConnection server = await accepted; + string copied = await ReadRedirectCookieAsync(server, cancel.Token); + Assert.AreEqual("sid=manual", copied); + using HttpResponseMessage manualResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("sid=manual", await manualResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(manualRequest, manualResponse.RequestMessage); + await server.DisposeAsync(); + + accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler stored = Handler(); + stored.UseCookies = true; + using HttpClient storedClient = new(stored, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage storedRequest = Request(address); + storedRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + pending = storedClient.SendAsync(storedRequest, cancel.Token); + server = await accepted; + string dropped = await ReadRedirectCookieAsync(server, cancel.Token); + Assert.AreEqual(string.Empty, dropped); + using HttpResponseMessage storedResponse = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("none", await storedResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(storedRequest, storedResponse.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectDoesNotCopyTheHostHeader() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string port = listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + string expected = "127.0.0.1:" + port; + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + port + "/from"); + request.Headers.Host = "evil.example"; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + string authority = await ReadRedirectAuthorityAsync(server, expected, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(expected, authority); + Assert.AreEqual(expected, await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectDropsAuthorizationWhenTheHostChanges() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener origin = await ListenHttp3Async(certificate); + await using ManagedQuicListener next = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string originPort = origin.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + string nextPort = next.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture); + Task acceptedOrigin = origin.AcceptConnectionAsync(cancel.Token).AsTask(); + Task acceptedNext = next.AcceptConnectionAsync(cancel.Token).AsTask(); + using (TitaniumHttpHandler handler = Handler()) + using (HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }) + { + using HttpRequestMessage changed = Request("https://127.0.0.1:" + originPort + "/drop"); + changed.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + Task pending = client.SendAsync(changed, cancel.Token); + ManagedQuicConnection server = await acceptedOrigin; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string path, string authorization) = await ReadPathAndAuthorizationAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/drop", StringComparison.Ordinal)); + Assert.AreEqual("Bearer secret", authorization); + await WriteRedirectAsync(hop, "302", "https://localhost:" + nextPort + "/see", cancel.Token); + ManagedQuicConnection landed = await acceptedNext; + hop = await landed.AcceptInboundStreamAsync(cancel.Token); + (path, authorization) = await ReadPathAndAuthorizationAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/see", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, authorization); + await ReplyTextAsync(hop, "absent", cancel.Token); + using HttpResponseMessage dropped = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("absent", await dropped.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(changed, dropped.RequestMessage); + await server.DisposeAsync(); + await landed.DisposeAsync(); + } + + Task acceptedKeep = next.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler again = Handler(); + using HttpClient keepClient = new(again, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage same = Request("https://localhost:" + nextPort + "/keep"); + same.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + Task keptPending = keepClient.SendAsync(same, cancel.Token); + ManagedQuicConnection keepServer = await acceptedKeep; + ManagedQuicStream keepHop = await keepServer.AcceptInboundStreamAsync(cancel.Token); + (string keepPath, string keptAuthorization) = await ReadPathAndAuthorizationAsync(keepHop, cancel.Token); + Assert.IsTrue(keepPath.EndsWith("/keep", StringComparison.Ordinal)); + Assert.AreEqual("Bearer secret", keptAuthorization); + await WriteRedirectAsync(keepHop, "302", "/see", cancel.Token); + keepHop = await keepServer.AcceptInboundStreamAsync(cancel.Token); + (keepPath, keptAuthorization) = await ReadPathAndAuthorizationAsync(keepHop, cancel.Token); + Assert.IsTrue(keepPath.EndsWith("/see", StringComparison.Ordinal)); + Assert.AreEqual("Bearer secret", keptAuthorization); + await ReplyTextAsync(keepHop, "present", cancel.Token); + using HttpResponseMessage kept = await keptPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("present", await kept.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(same, kept.RequestMessage); + await keepServer.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3MultipleChoicesTurnsPostIntoGet() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/choice"; + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, address) + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string method, string path, string body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/choice", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync(hop, "300", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + (method, path, body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("GET", method); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(string.Empty, body); + await ReplyTextAsync(hop, "GET:", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("GET:", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new Version(3, 0), response.Version); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectToHttpIsFetchedAsHttp11() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync( + hop, + "302", + "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/land", + cancel.Token); + using TcpClient clear = await clearAccepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /land HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nclear"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("clear", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectReturnsToHttp3AfterACleartextHop() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + int quicPort = listener.LocalEndPoint.Port; + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + quicPort.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync( + hop, + "302", + "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/mid", + cancel.Token); + using TcpClient clear = await clearAccepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /mid HTTP/1.1\r\n", StringComparison.Ordinal), headers); + string back = "https://127.0.0.1:" + quicPort.ToString(CultureInfo.InvariantCulture) + "/land"; + await stream.WriteAsync( + System.Text.Encoding.ASCII.GetBytes("HTTP/1.1 302 Found\r\nLocation: " + back + "\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"), + cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal), path); + await ReplyTextAsync(hop, "landed", cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("landed", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new Version(3, 0), response.Version); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3TemporaryRedirectKeepsThePostBodyOnACleartextHop() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/keep") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + (string method, string path, string body) = await ReadPostedRequestAsync(hop, cancel.Token); + Assert.AreEqual("POST", method); + Assert.IsTrue(path.EndsWith("/keep", StringComparison.Ordinal)); + Assert.AreEqual("payload", body); + await WriteRedirectAsync( + hop, + "307", + "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/land", + cancel.Token); + using TcpClient clear = await clearAccepted; + await using NetworkStream stream = clear.GetStream(); + (string headers, string posted) = await ReadHttpRequestWithBodyAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("POST /land HTTP/1.1\r\n", StringComparison.Ordinal), headers); + Assert.AreEqual("payload", posted); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 12\r\nConnection: close\r\n\r\nPOST:payload"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("POST:payload", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3CleartextHopDecompressesGzip() + { + using var encoded = new MemoryStream(); + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write("hello"u8); + } + + byte[] payload = encoded.ToArray(); + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.AutomaticDecompression = DecompressionMethods.GZip; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync( + hop, + "302", + "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/land", + cancel.Token); + using TcpClient clear = await clearAccepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /land HTTP/1.1\r\n", StringComparison.Ordinal), headers); + Assert.IsTrue(headers.Contains("Accept-Encoding:", StringComparison.OrdinalIgnoreCase), headers); + byte[] status = System.Text.Encoding.ASCII.GetBytes( + "HTTP/1.1 200 OK\r\nContent-Encoding: gzip\r\nContent-Length: " + payload.Length.ToString(CultureInfo.InvariantCulture) + "\r\nConnection: close\r\n\r\n"); + await stream.WriteAsync(status, cancel.Token); + await stream.WriteAsync(payload, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("hello", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3CleartextHopSendsAStoredCookie() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.UseCookies = true; + CookieContainer cookies = new(); + cookies.Add(new Uri("http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/"), new Cookie("sid", "abc")); + handler.CookieContainer = cookies; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync( + hop, + "302", + "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture) + "/land", + cancel.Token); + using TcpClient clear = await clearAccepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /land HTTP/1.1\r\n", StringComparison.Ordinal), headers); + Assert.IsTrue(headers.Contains("Cookie: sid=abc", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 3\r\nConnection: close\r\n\r\nabc"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("abc", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3CleartextHopStoresASetCookie() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int clearPort = ((IPEndPoint)tcp.LocalEndpoint).Port; + string clearHost = "http://127.0.0.1:" + clearPort.ToString(CultureInfo.InvariantCulture); + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task clearAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.UseCookies = true; + CookieContainer cookies = new(); + handler.CookieContainer = cookies; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "302", clearHost + "/land", cancel.Token); + using (TcpClient clear = await clearAccepted) + await using (NetworkStream stream = clear.GetStream()) + { + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /land HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nSet-Cookie: sid=fromhop; Path=/\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok"u8.ToArray(), cancel.Token); + } + + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("fromhop", cookies.GetCookies(new Uri(clearHost + "/")).FirstOrDefault(static cookie => cookie.Name == "sid")?.Value); + await server.DisposeAsync(); + + Task againAccepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + using HttpRequestMessage again = new(HttpMethod.Get, clearHost + "/again") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task second = client.SendAsync(again, cancel.Token); + using TcpClient next = await againAccepted; + await using NetworkStream nextStream = next.GetStream(); + string nextHeaders = await ReadHttpHeadersAsync(nextStream, cancel.Token); + Assert.IsTrue(nextHeaders.StartsWith("GET /again HTTP/1.1\r\n", StringComparison.Ordinal), nextHeaders); + Assert.IsTrue(nextHeaders.Contains("Cookie: sid=fromhop", StringComparison.Ordinal), nextHeaders); + await nextStream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nagain"u8.ToArray(), cancel.Token); + using HttpResponseMessage secondResponse = await second.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("again", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(again, secondResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RedirectStopsWhenTheRequestIsCancelled() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using var requestCancel = new CancellationTokenSource(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/from"); + Task pending = client.SendAsync(request, requestCancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(hop, cancel.Token); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "302", "/land", cancel.Token); + hop = await server.AcceptInboundStreamAsync(cancel.Token); + DateTime started = DateTime.UtcNow; + requestCancel.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(2)); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ReusesOneConnectionForTheSameAuthority() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = Request(address); + Task pending = client.SendAsync(first, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage firstResponse = await pending; + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + + using HttpRequestMessage second = Request(address); + Task again = client.SendAsync(second, cancel.Token); + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage secondResponse = await again; + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + + using var late = new CancellationTokenSource(TimeSpan.FromMilliseconds(300)); + try + { + ManagedQuicConnection extra = await listener.AcceptConnectionAsync(late.Token); + await extra.DisposeAsync(); + Assert.Fail("A second HTTP/3 connection was opened."); + } + catch (OperationCanceledException) + { + } + + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3GoAwayOpensAnotherConnection() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = Request(address); + Task pending = client.SendAsync(first, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage firstResponse = await pending; + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + + await SendGoAwayAsync(server, 0, cancel.Token); + await handler.Pool.GoAwayObserved.WaitAsync(cancel.Token); + Assert.AreEqual(0, handler.Pool.ConnectionCount); + + Task next = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage second = Request(address); + Task again = client.SendAsync(second, cancel.Token); + ManagedQuicConnection server2 = await next; + await ReplyAsync(server2, cancel.Token); + using HttpResponseMessage secondResponse = await again; + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + await server.DisposeAsync(); + await server2.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3GoAwayClosesTheConnectionWhenTheBodyFinishes() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(1, handler.Pool.ConnectionCount); + await SendGoAwayAsync(server, 0, cancel.Token); + await handler.Pool.GoAwayObserved.WaitAsync(cancel.Token); + Assert.AreEqual(1, handler.Pool.ConnectionCount); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(0, handler.Pool.ConnectionCount); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3DynamicTableDecodesAPeerInsert() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + await using QpackContext table = new(Http3Client.TableCapacity); + table.MaxTableCapacityFromPeer = Http3Client.TableCapacity; + table.OutboundEncoderTable.Insert("x-dyn", "yes", null); + byte[] block = QpackEncoder.Encode([(":status", "200"), ("x-dyn", "yes")], table); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await SendEncoderInsertAsync(server, "x-dyn", "yes", cancel.Token); + await handler.Pool.EncoderInsertObserved.WaitAsync(cancel.Token); + await ReplyWithBlockAsync(server, block, cancel.Token); + using HttpResponseMessage response = await pending; + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.IsTrue(response.Headers.TryGetValues("x-dyn", out IEnumerable? values)); + Assert.AreEqual("yes", values!.Single()); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcUsesTheAdvertisedPort() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=60"); + return "tcp"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task pending = client.SendAsync(second, cancel.Token); + ManagedQuicConnection quic = await accepted; + await ReplyAsync(quic, cancel.Token); + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual(new Version(3, 0), secondResponse.Version); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + await quic.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcClearThenH3UsesTheAdvertisedPort() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append("Alt-Svc", "clear, h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=60"); + return "tcp"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task pending = client.SendAsync(second, cancel.Token); + ManagedQuicConnection quic = await accepted; + await ReplyAsync(quic, cancel.Token); + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual(new Version(3, 0), secondResponse.Version); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(second, secondResponse.RequestMessage); + await quic.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcExpiresWhenMaElapses() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + int tcpHits = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + int hit = Interlocked.Increment(ref tcpHits); + if (hit == 1) + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=2"); + return "tcp"; + } + + return "stayed"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using (HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }) + { + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + } + + DateTimeOffset notedAt = DateTimeOffset.UtcNow; + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using (HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }) + { + Task pending = client.SendAsync(second, cancel.Token); + ManagedQuicConnection quic = await accepted; + await ReplyAsync(quic, cancel.Token); + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual(new Version(3, 0), secondResponse.Version); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + await quic.DisposeAsync(); + } + + TimeSpan remaining = notedAt.AddSeconds(2.5) - DateTimeOffset.UtcNow; + if (remaining > TimeSpan.Zero) + { + await Task.Delay(remaining, cancel.Token); + } + + using var late = new CancellationTokenSource(TimeSpan.FromMilliseconds(400)); + Task refused = listener.AcceptConnectionAsync(late.Token).AsTask(); + using HttpRequestMessage third = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task stayed = client.SendAsync(third, cancel.Token); + try + { + ManagedQuicConnection extra = await refused; + await extra.DisposeAsync(); + Assert.Fail("HTTP/3 was used after ma elapsed."); + } + catch (OperationCanceledException) + { + } + + using HttpResponseMessage thirdResponse = await stayed; + Assert.AreEqual("stayed", await thirdResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, thirdResponse.Version.Major); + Assert.AreSame(third, thirdResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcMissingMaUsesTheAdvertisedPort() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\""); + return "tcp"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task pending = client.SendAsync(second, cancel.Token); + ManagedQuicConnection quic = await accepted; + await ReplyAsync(quic, cancel.Token); + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual(new Version(3, 0), secondResponse.Version); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(second, secondResponse.RequestMessage); + await quic.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcMaZeroDoesNotUpgrade() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=0"); + return "tcp"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using (HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token)) + { + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + } + + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task pending = client.SendAsync(second, cancel.Token); + using var late = new CancellationTokenSource(TimeSpan.FromMilliseconds(400)); + try + { + ManagedQuicConnection extra = await listener.AcceptConnectionAsync(late.Token); + await extra.DisposeAsync(); + Assert.Fail("HTTP/3 was used after ma=0."); + } + catch (OperationCanceledException) + { + } + + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual("tcp", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcClearDropsTheCachedPort() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + int tcpHits = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + int hit = Interlocked.Increment(ref tcpHits); + if (hit == 1) + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=60"); + return "tcp"; + } + + if (hit == 2) + { + response.Headers.Append("Alt-Svc", "clear"); + return "cleared"; + } + + return "stayed"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using (HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }) + { + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + } + + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using (HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }) + { + Task pending = client.SendAsync(second, cancel.Token); + ManagedQuicConnection quic = await accepted; + await ReplyAsync(quic, cancel.Token); + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual(new Version(3, 0), secondResponse.Version); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + await quic.DisposeAsync(); + } + + using (HttpRequestMessage clear = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }) + { + using HttpResponseMessage clearResponse = await client.SendAsync(clear, cancel.Token); + Assert.AreEqual("cleared", await clearResponse.Content.ReadAsStringAsync(cancel.Token)); + } + + using var late = new CancellationTokenSource(TimeSpan.FromMilliseconds(400)); + Task refused = listener.AcceptConnectionAsync(late.Token).AsTask(); + using HttpRequestMessage third = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task stayed = client.SendAsync(third, cancel.Token); + try + { + ManagedQuicConnection extra = await refused; + await extra.DisposeAsync(); + Assert.Fail("HTTP/3 was used after Alt-Svc: clear."); + } + catch (OperationCanceledException) + { + } + + using HttpResponseMessage thirdResponse = await stayed; + Assert.AreEqual("stayed", await thirdResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, thirdResponse.Version.Major); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcIgnoresADifferentHost() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + int quicPort = listener.LocalEndPoint.Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append( + "Alt-Svc", + "h3=\"other.example:" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=60"); + return "tcp"; + }); + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + using var late = new CancellationTokenSource(TimeSpan.FromMilliseconds(400)); + Task refused = listener.AcceptConnectionAsync(late.Token).AsTask(); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + Task pending = client.SendAsync(second, cancel.Token); + try + { + ManagedQuicConnection extra = await refused; + await extra.DisposeAsync(); + Assert.Fail("HTTP/3 was used for a different Alt-Svc host."); + } + catch (OperationCanceledException) + { + } + + using HttpResponseMessage secondResponse = await pending; + Assert.AreEqual("tcp", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, secondResponse.Version.Major); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3AltSvcFallsBackWhenTheUpgradeHandshakeFails() + { + using Socket udp = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + udp.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + int quicPort = ((IPEndPoint)udp.LocalEndPoint!).Port; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/tcp", (HttpResponse response) => + { + response.Headers.Append("Alt-Svc", "h3=\":" + quicPort.ToString(CultureInfo.InvariantCulture) + "\"; ma=60"); + return "tcp"; + }); + }); + using TitaniumHttpHandler handler = Handler(); + handler.EnableAltSvc = true; + handler.ConnectTimeout = TimeSpan.FromMilliseconds(400); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/tcp"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first); + Assert.AreEqual("tcp", await firstResponse.Content.ReadAsStringAsync()); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + DateTime started = DateTime.UtcNow; + using HttpResponseMessage secondResponse = await client.SendAsync(second); + string body = await secondResponse.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode, body); + Assert.AreEqual("tcp", body); + Assert.AreNotEqual(3, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + Assert.AreEqual("https", secondResponse.RequestMessage!.RequestUri!.Scheme); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(3)); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3HeadersReturnBeforeTheBody() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream stream = await HeadersAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + await WriteFrameAsync(stream, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + await stream.CompleteWritesAsync(cancel.Token); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3TrailersArriveWhileTheBodyIsRead() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream stream = await HeadersAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + byte[] trailer = QpackEncoder.Encode([("x-sum", "2")]); + await WriteFrameAsync(stream, Http3FrameType.Headers, trailer, cancel.Token); + await stream.CompleteWritesAsync(cancel.Token); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.TrailingHeaders.TryGetValues("x-sum", out IEnumerable? values)); + Assert.AreEqual("2", values!.Single()); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3UnknownFrameWhileTheBodyIsReadIsSkipped() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream stream = await HeadersAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, "ab"u8.ToArray(), cancel.Token); + await WriteFrameAsync(stream, 0x21, "no"u8.ToArray(), cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, "cd"u8.ToArray(), cancel.Token); + await stream.CompleteWritesAsync(cancel.Token); + Assert.AreEqual("abcd", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3EmptyDataFrameWhileTheBodyIsReadIsSkipped() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream stream = await HeadersAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, "ab"u8.ToArray(), cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, [], cancel.Token); + await WriteFrameAsync(stream, Http3FrameType.Data, "cd"u8.ToArray(), cancel.Token); + await stream.CompleteWritesAsync(cancel.Token); + Assert.AreEqual("abcd", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ResponseContentTypeIsReadable() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] headers = QpackEncoder.Encode([(":status", "200"), ("content-type", "text/plain")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("text/plain", response.Content.Headers.ContentType?.MediaType); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ResponseContentLengthIsReadable() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] headers = QpackEncoder.Encode([(":status", "200"), ("content-length", "2")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Content.Headers.ContentLength); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ResponseKeepsEveryValueOfARepeatedHeader() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] headers = QpackEncoder.Encode([(":status", "200"), ("x-trace", "one"), ("x-trace", "two")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "ok"u8.ToArray(), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("x-trace", out IEnumerable? values)); + CollectionAssert.AreEqual(new[] { "one", "two" }, values!.ToArray()); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3NotFoundIsReturnedWithItsBody() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/missing"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] headers = QpackEncoder.Encode([(":status", "404")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await WriteFrameAsync(inbound, Http3FrameType.Data, "missing"u8.ToArray(), cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode); + Assert.AreEqual("missing", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("/missing", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3HeadSendsTheMethodAndReturnsAnEmptyBody() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Head, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? requestHeaders = await ReadFrameAsync(inbound, cancel.Token); + Assert.IsNotNull(requestHeaders); + string method = string.Empty; + string path = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(requestHeaders)) + { + if (name == ":method") + { + method = value; + } + else if (name == ":path") + { + path = value; + } + } + + while (await ReadFrameAsync(inbound, cancel.Token) is not null) + { + } + + byte[] headers = QpackEncoder.Encode([(":status", "200")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(string.Empty, await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("HEAD", method); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3NoContentIsReturnedWithAnEmptyBody() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ListenHttp3Async(certificate); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + string path = await ReadRequestPathAsync(inbound, cancel.Token); + byte[] headers = QpackEncoder.Encode([(":status", "204")]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, headers, cancel.Token); + await inbound.CompleteWritesAsync(cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); + Assert.AreEqual(string.Empty, await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("/hello", path); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3IdleConnectionIsNotReused() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(200); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + Task firstAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage firstRequest = Request(address); + Task firstPending = client.SendAsync(firstRequest, cancel.Token); + ManagedQuicConnection firstServer = await firstAccepted; + await ReplyAsync(firstServer, cancel.Token); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, firstResponse.StatusCode); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + Task secondAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage secondRequest = Request(address); + Task secondPending = client.SendAsync(secondRequest, cancel.Token); + ManagedQuicConnection secondServer = await secondAccepted.WaitAsync(TimeSpan.FromSeconds(3), cancel.Token); + await ReplyAsync(secondServer, cancel.Token); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + await firstServer.DisposeAsync(); + await secondServer.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3ConnectionLifetimeOpensAnotherConnection() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan; + handler.PooledConnectionLifetime = TimeSpan.FromMilliseconds(200); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + Task firstAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage firstRequest = Request(address); + Task firstPending = client.SendAsync(firstRequest, cancel.Token); + ManagedQuicConnection firstServer = await firstAccepted; + await ReplyAsync(firstServer, cancel.Token); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, firstResponse.StatusCode); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + Task secondAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage secondRequest = Request(address); + Task secondPending = client.SendAsync(secondRequest, cancel.Token); + ManagedQuicConnection secondServer = await secondAccepted.WaitAsync(TimeSpan.FromSeconds(3), cancel.Token); + await ReplyAsync(secondServer, cancel.Token); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + await firstServer.DisposeAsync(); + await secondServer.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3SeventeenthRequestOpensAnotherConnection() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + Task firstAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + ManagedQuicConnection firstServer = null!; + for (int i = 0; i < Http3Pool.StreamCap; i++) + { + using HttpRequestMessage request = Request(address); + Task pending = client.SendAsync(request, cancel.Token); + if (i == 0) + { + firstServer = await firstAccepted; + } + + await ReplyAsync(firstServer, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + Task secondAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using HttpRequestMessage extra = Request(address); + Task extraPending = client.SendAsync(extra, cancel.Token); + ManagedQuicConnection secondServer = await secondAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await ReplyAsync(secondServer, cancel.Token); + using HttpResponseMessage extraResponse = await extraPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, extraResponse.StatusCode); + await firstServer.DisposeAsync(); + await secondServer.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3WaitsInsteadOfPassingMaxConnectionsPerServer() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using TitaniumHttpHandler handler = Handler(); + handler.MaxConnectionsPerServer = 1; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + Task firstAccepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + ManagedQuicConnection firstServer = null!; + for (int i = 0; i < Http3Pool.StreamCap - 1; i++) + { + using HttpRequestMessage request = Request(address); + Task pending = client.SendAsync(request, cancel.Token); + if (i == 0) + { + firstServer = await firstAccepted; + } + + await ReplyAsync(firstServer, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + using HttpRequestMessage heldRequest = Request(address); + Task heldPending = client.SendAsync(heldRequest, cancel.Token); + ManagedQuicStream held = await firstServer.AcceptInboundStreamAsync(cancel.Token); + using var probe = new CancellationTokenSource(TimeSpan.FromMilliseconds(400)); + Task refused = listener.AcceptConnectionAsync(probe.Token).AsTask(); + using HttpRequestMessage extra = Request(address); + Task extraPending = client.SendAsync(extra, cancel.Token); + try + { + ManagedQuicConnection unexpected = await refused; + await unexpected.DisposeAsync(); + Assert.Fail("A second HTTP/3 connection was opened while the first was busy."); + } + catch (OperationCanceledException) + { + } + + Task replacement = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await ReplyOnAcceptedAsync(held, cancel.Token); + using HttpResponseMessage heldResponse = await heldPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, heldResponse.StatusCode); + ManagedQuicConnection secondServer = await replacement.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await ReplyAsync(secondServer, cancel.Token); + using HttpResponseMessage extraResponse = await extraPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, extraResponse.StatusCode); + await firstServer.DisposeAsync(); + await secondServer.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3BodyReadStopsWhenCancelled() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = Timeout.InfiniteTimeSpan }; + using HttpRequestMessage request = Request("https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + await HeadersAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using Stream body = await response.Content.ReadAsStreamAsync(cancel.Token); + using var readCancel = new CancellationTokenSource(); + ValueTask read = body.ReadAsync(new byte[8], readCancel.Token); + readCancel.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await read); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3RequestInsertsAFieldThatIsNotInTheStaticTable() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + Task first = client.SendAsync(Request(address), cancel.Token); + ManagedQuicConnection server = await accepted; + QpackContext table = new(4096); + Task reading = ReadClientEncoderAsync(server, table, cancel.Token); + await SendQpackSettingsAsync(server, cancel.Token); + await ReplyOnceAsync(server, cancel.Token); + using HttpResponseMessage warmed = await first.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, warmed.StatusCode); + await handler.Pool.PeerSettingsObserved.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("x-row", "alpha"); + Task second = client.SendAsync(request, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[]? headers = null; + while (await ReadFrameAsync(inbound, cancel.Token) is byte[] frame) + { + headers = frame; + break; + } + + Assert.IsNotNull(headers); + List<(string Name, string Value)> fields = await DecodeWhenInsertedAsync(headers!, table, cancel.Token); + Assert.IsTrue(fields.Exists(static field => field.Name == "x-row" && field.Value == "alpha")); + await ReplyOnStreamAsync(inbound, cancel.Token); + using HttpResponseMessage response = await second.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + cancel.Cancel(); + await reading; + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3LargeUploadAndDownloadMatchTheirHashes() + { + byte[] upload = Pattern(1024 * 1024); + byte[] download = Pattern(1024 * 1024 + 17); + string uploadHash = Convert.ToHexString(SHA256.HashData(upload)); + string downloadHash = Convert.ToHexString(SHA256.HashData(download)); + using X509Certificate2 certificate = CreateHttp3Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/blob") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new ByteArrayContent(upload), + }; + Task pending = client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + ManagedQuicConnection server = await accepted; + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + using IncrementalHash received = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + while (await ReadTypedFrameAsync(inbound, cancel.Token) is (ulong type, byte[] payload)) + { + if (type == Http3FrameType.Data) + { + received.AppendData(payload); + } + } + + byte[] block = QpackEncoder.Encode([(":status", "200"), ("x-upload-sha256", Convert.ToHexString(received.GetHashAndReset()))]); + await WriteFrameAsync(inbound, Http3FrameType.Headers, block, cancel.Token); + Task writing = WriteDownloadAsync(inbound, download, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(10), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.IsTrue(response.Headers.TryGetValues("x-upload-sha256", out IEnumerable? hashes)); + Assert.AreEqual(uploadHash, hashes!.Single()); + await using Stream body = await response.Content.ReadAsStreamAsync(cancel.Token); + using IncrementalHash got = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + byte[] chunk = new byte[8192]; + while (true) + { + int count = await body.ReadAsync(chunk, cancel.Token); + if (count == 0) + { + break; + } + + got.AppendData(chunk.AsSpan(0, count)); + } + + Assert.AreEqual(downloadHash, Convert.ToHexString(got.GetHashAndReset())); + Assert.AreSame(request, response.RequestMessage); + await writing; + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11AgainstLoopbackReturnsTheBody() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/", (HttpRequest request) => request.Protocol); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://localhost:" + server.Port.ToString() + "/") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("HTTP/1.1", await response.Content.ReadAsStringAsync()); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http10RequestIsSentAsHttp11() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/", (HttpRequest request) => request.Protocol), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/") + { + Version = new Version(1, 0), + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("HTTP/1.1", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreEqual(1, response.Version.Minor); + Assert.AreEqual(new Version(1, 0), request.Version); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http10OrHigherUsesHttp2() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2OneOkAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = new Version(1, 0), + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreEqual(new Version(1, 0), request.Version); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11NotFoundIsReturnedWithItsBody() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/missing", () => Results.Text("missing", statusCode: 404)), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/missing") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode, body); + Assert.AreEqual("missing", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11HeadSendsTheMethodAndReturnsAnEmptyBody() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapMethods( + "/hello", + new[] { "HEAD" }, + (HttpRequest request) => + { + request.HttpContext.Response.Headers["X-Method"] = request.Method; + return Results.Text("ignored"); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Head, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual(string.Empty, body); + Assert.IsTrue(response.Headers.TryGetValues("X-Method", out IEnumerable? methods)); + Assert.AreEqual("HEAD", methods!.Single()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11NoContentIsReturnedWithAnEmptyBody() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.NoContent()), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode, body); + Assert.AreEqual(string.Empty, body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PropertyChangeAfterTheFirstRequestThrows() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/ping", () => Results.Text("pong")); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/ping") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual("pong", await response.Content.ReadAsStringAsync()); + InvalidOperationException ex = Assert.ThrowsExactly(() => handler.MaxConnectionsPerServer = 2); + Assert.AreEqual("This instance has already started one or more requests. Properties can only be modified before sending the first request.", ex.Message); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11BodyReadStopsWhenCancelled() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/slow", async context => + { + context.Response.ContentLength = 8; + await context.Response.Body.FlushAsync(); + await Task.Delay(Timeout.Infinite, context.RequestAborted); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = Timeout.InfiniteTimeSpan }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://localhost:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/slow") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + await using Stream body = await response.Content.ReadAsStreamAsync(cancel.Token); + using var readCancel = new CancellationTokenSource(); + ValueTask read = body.ReadAsync(new byte[8], readCancel.Token); + readCancel.Cancel(); + long started = Environment.TickCount64; + await Assert.ThrowsExactlyAsync(async () => await read); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestStopsWhenCancelledBeforeTheStatusLine() + { + TaskCompletionSource arrived = new(TaskCreationOptions.RunContinuationsAsynchronously); + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/wait", async context => + { + arrived.TrySetResult(); + await Task.Delay(Timeout.Infinite, context.RequestAborted); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = Timeout.InfiniteTimeSpan }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/wait") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using var requestCancel = new CancellationTokenSource(); + Task pending = client.SendAsync(request, requestCancel.Token); + await arrived.Task.WaitAsync(TimeSpan.FromSeconds(5)); + long started = Environment.TickCount64; + requestCancel.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ReusesAConnectionUntilItsLifetime() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/ping", () => Results.Text("pong")), + () => Interlocked.Increment(ref connections)); + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan; + handler.PooledConnectionLifetime = TimeSpan.FromMilliseconds(300); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/ping"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using (HttpResponseMessage firstResponse = await client.SendAsync(first)) + { + Assert.AreEqual("pong", await firstResponse.Content.ReadAsStringAsync()); + } + + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using (HttpResponseMessage secondResponse = await client.SendAsync(second)) + { + Assert.AreEqual("pong", await secondResponse.Content.ReadAsStringAsync()); + } + + Assert.AreEqual(1, connections); + await Task.Delay(TimeSpan.FromMilliseconds(500)); + using HttpRequestMessage third = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage thirdResponse = await client.SendAsync(third); + Assert.AreEqual("pong", await thirdResponse.Content.ReadAsStringAsync()); + Assert.AreEqual(2, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11WaitsInsteadOfPassingMaxConnectionsPerServer() + { + TaskCompletionSource started = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hold", async () => + { + started.TrySetResult(); + await release.Task; + return Results.Text("done"); + }), + () => Interlocked.Increment(ref connections)); + using TitaniumHttpHandler handler = Handler(); + handler.MaxConnectionsPerServer = 1; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hold"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task firstPending = client.SendAsync(first); + await started.Task.WaitAsync(TimeSpan.FromSeconds(5)); + Assert.AreEqual(1, connections); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second); + await Task.Delay(TimeSpan.FromMilliseconds(400)); + Assert.AreEqual(1, connections); + Assert.IsFalse(secondPending.IsCompleted); + release.SetResult(); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5)); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5)); + Assert.AreEqual("done", await firstResponse.Content.ReadAsStringAsync()); + Assert.AreEqual("done", await secondResponse.Content.ReadAsStringAsync()); + Assert.AreEqual(1, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestGoesThroughTheProxy() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string originUri = "http://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, originUri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET " + originUri + " HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nproxy"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("proxy", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual(originUri, response.RequestMessage!.RequestUri!.AbsoluteUri); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyCredentialsStayOffACleartextRequest() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + Credentials = new NetworkCredential("user", "secret"), + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string originUri = "http://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, originUri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string host = "127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture); + Assert.AreEqual("GET " + originUri + " HTTP/1.1\r\nHost: " + host + "\r\n\r\n", headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nproxy"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("proxy", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CleartextUserInfoStaysOffTheProxyRequest() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + BypassProxyOnLocal = false, + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string host = "127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage request = new(HttpMethod.Get, "http://user:secret@" + host + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.AreEqual("GET http://" + host + "/hello HTTP/1.1\r\nHost: " + host + "\r\n\r\n", headers); + Assert.IsFalse(headers.Contains("user", StringComparison.Ordinal), headers); + Assert.IsFalse(headers.Contains("secret", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nproxy"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("proxy", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("user:secret", request.RequestUri!.UserInfo); + Assert.AreSame(request, response.RequestMessage); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11BypassOnLocalReachesTheOrigin() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("direct")); + }); + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + BypassProxyOnLocal = true, + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task winner = await Task.WhenAny(pending, proxyAccepted).WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + if (winner == proxyAccepted) + { + using TcpClient accepted = await proxyAccepted; + Assert.Fail("The proxy accepted a connection."); + } + + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("direct", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool arrived = false; + try + { + using TcpClient proxyClient = await proxy.AcceptTcpClientAsync(extraLimit.Token); + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(arrived); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11BypassListReachesTheOrigin() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("listed")); + }); + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + BypassProxyOnLocal = false, + BypassList = ["127\\.0\\.0\\.1"], + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task winner = await Task.WhenAny(pending, proxyAccepted).WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + if (winner == proxyAccepted) + { + using TcpClient accepted = await proxyAccepted; + Assert.Fail("The proxy accepted a connection."); + } + + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("listed", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool arrived = false; + try + { + using TcpClient proxyClient = await proxy.AcceptTcpClientAsync(extraLimit.Token); + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(arrived); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UnmatchedBypassListStillTunnels() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("tunneled")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + BypassProxyOnLocal = false, + BypassList = ["example\\.invalid"], + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("tunneled", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PostBodyReachesTheProxy() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string originUri = "http://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Post, originUri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string raw = await ReadHttpHeadersAsync(stream, cancel.Token); + int split = raw.IndexOf("\r\n\r\n", StringComparison.Ordinal); + Assert.IsTrue(split >= 0, raw); + string headers = raw[..split]; + string tail = raw[(split + 4)..]; + Assert.IsTrue(headers.StartsWith("POST " + originUri + " HTTP/1.1\r\n", StringComparison.Ordinal), headers); + Assert.IsTrue(headers.EndsWith("\r\nContent-Length: 7", StringComparison.Ordinal), headers); + Assert.IsFalse(headers.Contains("Transfer-Encoding", StringComparison.OrdinalIgnoreCase), headers); + byte[] body = new byte[7]; + int copied = System.Text.Encoding.ASCII.GetBytes(tail, body); + while (copied < body.Length) + { + int read = await stream.ReadAsync(body.AsMemory(copied), cancel.Token); + Assert.IsTrue(read > 0); + copied += read; + } + + Assert.AreEqual("payload", System.Text.Encoding.ASCII.GetString(body)); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nproxy"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("proxy", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11HttpsPostBodyGoesThroughTheTunnel() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapPost("/hello", static async (HttpRequest httpRequest) => + { + using StreamReader reader = new(httpRequest.Body); + return Results.Text(await reader.ReadToEndAsync()); + }); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string authority = "127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + Assert.AreEqual("CONNECT " + authority + " HTTP/1.1\r\nHost: " + authority + "\r\n\r\n", headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("payload", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CallerHeaderGoesThroughTheTunnel() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", static (HttpRequest httpRequest) => Results.Text(httpRequest.Headers["X-Trace"].ToString())); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", "one")); + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string authority = "127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + Assert.AreEqual("CONNECT " + authority + " HTTP/1.1\r\nHost: " + authority + "\r\n\r\n", headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("one", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ConnectResponseHeadersStillOpenTheTunnel() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("tunneled")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\nProxy-Agent: local\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("tunneled", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11TunnelIsReusedForTheNextRequest() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("ok")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage first = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("ok", await first.Content.ReadAsStringAsync(cancel.Token)); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool anotherConnection = false; + try + { + using TcpClient extra = await proxy.AcceptTcpClientAsync(extraLimit.Token); + anotherConnection = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(anotherConnection); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11TunnelLifetimeOpensAnotherConnection() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("ok")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan; + handler.PooledConnectionLifetime = TimeSpan.FromMilliseconds(200); + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + List clients = []; + List copies = []; + try + { + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + TcpClient firstProxy = await proxy.AcceptTcpClientAsync(cancel.Token); + clients.Add(firstProxy); + NetworkStream firstStream = firstProxy.GetStream(); + string headers = await ReadHttpHeadersAsync(firstStream, cancel.Token); + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await firstStream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + TcpClient firstOrigin = new(); + clients.Add(firstOrigin); + await firstOrigin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + NetworkStream firstOriginStream = firstOrigin.GetStream(); + copies.Add(CopyBytesAsync(firstStream, firstOriginStream, cancel.Token)); + copies.Add(CopyBytesAsync(firstOriginStream, firstStream, cancel.Token)); + using HttpResponseMessage first = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("ok", await first.Content.ReadAsStringAsync(cancel.Token)); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + TcpClient secondProxy = await proxy.AcceptTcpClientAsync(cancel.Token).AsTask().WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + clients.Add(secondProxy); + NetworkStream secondStream = secondProxy.GetStream(); + string secondHeaders = await ReadHttpHeadersAsync(secondStream, cancel.Token); + Assert.IsTrue(secondHeaders.StartsWith(connect, StringComparison.Ordinal), secondHeaders); + await secondStream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + TcpClient secondOrigin = new(); + clients.Add(secondOrigin); + await secondOrigin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + NetworkStream secondOriginStream = secondOrigin.GetStream(); + copies.Add(CopyBytesAsync(secondStream, secondOriginStream, cancel.Token)); + copies.Add(CopyBytesAsync(secondOriginStream, secondStream, cancel.Token)); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + } + finally + { + await cancel.CancelAsync(); + try + { + await Task.WhenAll(copies).WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or TimeoutException or IOException) + { + } + + foreach (TcpClient clientSocket in clients) + { + clientSocket.Dispose(); + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11TunnelIdleTimeoutReusesTheConnection() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("ok")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(200); + handler.PooledConnectionLifetime = Timeout.InfiniteTimeSpan; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + List clients = []; + List copies = []; + try + { + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + TcpClient firstProxy = await proxy.AcceptTcpClientAsync(cancel.Token); + clients.Add(firstProxy); + NetworkStream firstStream = firstProxy.GetStream(); + string headers = await ReadHttpHeadersAsync(firstStream, cancel.Token); + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await firstStream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + TcpClient firstOrigin = new(); + clients.Add(firstOrigin); + await firstOrigin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + NetworkStream firstOriginStream = firstOrigin.GetStream(); + copies.Add(CopyBytesAsync(firstStream, firstOriginStream, cancel.Token)); + copies.Add(CopyBytesAsync(firstOriginStream, firstStream, cancel.Token)); + using HttpResponseMessage first = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("ok", await first.Content.ReadAsStringAsync(cancel.Token)); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool anotherConnection = false; + try + { + TcpClient extra = await proxy.AcceptTcpClientAsync(extraLimit.Token); + clients.Add(extra); + anotherConnection = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(anotherConnection); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + } + finally + { + await cancel.CancelAsync(); + try + { + await Task.WhenAll(copies).WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or TimeoutException or IOException) + { + } + + foreach (TcpClient clientSocket in clients) + { + clientSocket.Dispose(); + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11TunnelWaitsAtOneConnection() + { + TaskCompletionSource started = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hold", async () => + { + started.TrySetResult(); + await release.Task; + return Results.Text("done"); + }), + () => Interlocked.Increment(ref connections)); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + List clients = []; + List copies = []; + try + { + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.MaxConnectionsPerServer = 1; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hold"; + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task firstPending = client.SendAsync(first, cancel.Token); + TcpClient firstProxy = await proxy.AcceptTcpClientAsync(cancel.Token); + clients.Add(firstProxy); + NetworkStream stream = firstProxy.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + TcpClient origin = new(); + clients.Add(origin); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + NetworkStream originStream = origin.GetStream(); + copies.Add(CopyBytesAsync(stream, originStream, cancel.Token)); + copies.Add(CopyBytesAsync(originStream, stream, cancel.Token)); + await started.Task.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(1, connections); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(400)); + bool anotherConnection = false; + try + { + TcpClient extra = await proxy.AcceptTcpClientAsync(extraLimit.Token); + clients.Add(extra); + anotherConnection = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(anotherConnection); + Assert.IsFalse(secondPending.IsCompleted); + Assert.AreEqual(1, connections); + release.TrySetResult(); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("done", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("done", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, firstResponse.Version.Major); + Assert.AreEqual(1, secondResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + Assert.AreSame(second, secondResponse.RequestMessage); + Assert.AreEqual(1, connections); + } + finally + { + release.TrySetResult(); + await cancel.CancelAsync(); + try + { + await Task.WhenAll(copies).WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or TimeoutException or IOException) + { + } + + foreach (TcpClient clientSocket in clients) + { + clientSocket.Dispose(); + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SecondOriginWaitsWhileTheFirstRequestIsOutstanding() + { + TaskCompletionSource firstStarted = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource secondStarted = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource firstRelease = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource secondRelease = new(TaskCreationOptions.RunContinuationsAsynchronously); + int firstConnections = 0; + int secondConnections = 0; + await using LoopbackServer firstServer = await LoopbackServer.StartAsync( + app => app.MapGet("/hold", async () => + { + firstStarted.TrySetResult(); + await firstRelease.Task; + return Results.Text("one"); + }), + () => Interlocked.Increment(ref firstConnections)); + await using LoopbackServer secondServer = await LoopbackServer.StartAsync( + app => app.MapGet("/hold", async () => + { + secondStarted.TrySetResult(); + await secondRelease.Task; + return Results.Text("two"); + }), + () => Interlocked.Increment(ref secondConnections)); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + List clients = []; + List copies = []; + try + { + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.MaxConnectionsPerServer = 1; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + + async Task OpenAsync(int port) + { + TcpClient accepted = await proxy.AcceptTcpClientAsync(cancel.Token).AsTask().WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + clients.Add(accepted); + NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string connect = "CONNECT 127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + TcpClient origin = new(); + clients.Add(origin); + await origin.ConnectAsync(IPAddress.Loopback, port, cancel.Token); + NetworkStream originStream = origin.GetStream(); + copies.Add(CopyBytesAsync(stream, originStream, cancel.Token)); + copies.Add(CopyBytesAsync(originStream, stream, cancel.Token)); + } + + string firstAddress = "https://127.0.0.1:" + firstServer.Port.ToString(CultureInfo.InvariantCulture) + "/hold"; + string secondAddress = "https://127.0.0.1:" + secondServer.Port.ToString(CultureInfo.InvariantCulture) + "/hold"; + using HttpRequestMessage first = new(HttpMethod.Get, firstAddress) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task firstPending = client.SendAsync(first, cancel.Token); + await OpenAsync(firstServer.Port); + await firstStarted.Task.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, secondAddress) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + Task secondAccept = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + await Task.Delay(TimeSpan.FromMilliseconds(400), cancel.Token); + Assert.IsFalse(secondAccept.IsCompleted); + Assert.IsFalse(secondPending.IsCompleted); + Assert.AreEqual(1, firstConnections); + Assert.AreEqual(0, secondConnections); + firstRelease.TrySetResult(); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("one", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(first, firstResponse.RequestMessage); + await cancel.CancelAsync(); + await Assert.ThrowsExactlyAsync(async () => await secondPending); + try + { + await secondAccept; + } + catch (OperationCanceledException) + { + } + } + finally + { + firstRelease.TrySetResult(); + secondRelease.TrySetResult(); + await cancel.CancelAsync(); + try + { + await Task.WhenAll(copies).WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or TimeoutException or IOException) + { + } + + foreach (TcpClient clientSocket in clients) + { + clientSocket.Dispose(); + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UseProxyFalseIgnoresTheProxy() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "http://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await originAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 6\r\nConnection: close\r\n\r\norigin"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("origin", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.IsFalse(proxyAccepted.IsCompleted); + proxy.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11HttpsRequestTunnelsThroughTheProxy() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("tunneled")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string connect = "CONNECT 127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n"; + Assert.IsTrue(headers.StartsWith(connect, StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("tunneled", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyCredentialsStayOffTheConnectRequest() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/hello", () => Results.Text("tunneled")); + }); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + Credentials = new NetworkCredential("user", "secret"), + }; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage request = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + string authority = "127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + string connect = "CONNECT " + authority + " HTTP/1.1\r\nHost: " + authority + "\r\n\r\n"; + Assert.AreEqual(connect, headers); + await stream.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancel.Token); + using TcpClient origin = new(); + await origin.ConnectAsync(IPAddress.Loopback, server.Port, cancel.Token); + await using NetworkStream originStream = origin.GetStream(); + Task forward = CopyBytesAsync(stream, originStream, cancel.Token); + Task backward = CopyBytesAsync(originStream, stream, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("tunneled", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + cancel.Cancel(); + try + { + await Task.WhenAll(forward, backward); + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestWithAProxyFailsBeforeAConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + using TcpListener origin = new(IPAddress.Loopback, 0); + origin.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint!).Port; + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request, cancel.Token)); + Assert.IsTrue(HasMessage(ex, "unable to establish HTTP/2 connection"), ex.ToString()); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + Task proxyAccept = proxy.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + Task originAccept = origin.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + bool arrived = false; + try + { + using TcpClient proxyClient = await proxyAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + try + { + using TcpClient originClient = await originAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(arrived); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2UseProxyFalseReachesTheOrigin() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener origin = new(IPAddress.Loopback, 0); + origin.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint!).Port; + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2OneOkAsync(origin, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool proxyAccepted = false; + try + { + using TcpClient proxyClient = await proxy.AcceptTcpClientAsync(extraLimit.Token); + proxyAccepted = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(proxyAccepted); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + origin.Stop(); + proxy.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2OrLowerWithAProxyFailsBeforeAConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + using TcpListener origin = new(IPAddress.Loopback, 0); + origin.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint!).Port; + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request, cancel.Token)); + Assert.IsTrue(HasMessage(ex, "RequestVersionExact"), ex.ToString()); + Assert.IsTrue(HasMessage(ex, "unable to establish HTTP/2 connection"), ex.ToString()); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + Task proxyAccept = proxy.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + Task originAccept = origin.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + bool arrived = false; + try + { + using TcpClient proxyClient = await proxyAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + try + { + using TcpClient originClient = await originAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(arrived); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11OrHigherWithAProxyFailsBeforeAConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + using TcpListener origin = new(IPAddress.Loopback, 0); + origin.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint!).Port; + using TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => + await client.SendAsync(request, cancel.Token).WaitAsync(TimeSpan.FromSeconds(3), cancel.Token)); + Assert.IsTrue(HasMessage(ex, "RequestVersionExact"), ex.ToString()); + Assert.IsTrue(HasMessage(ex, "unable to establish HTTP/2 connection"), ex.ToString()); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + Task proxyAccept = proxy.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + Task originAccept = origin.AcceptTcpClientAsync(extraLimit.Token).AsTask(); + bool arrived = false; + try + { + using TcpClient proxyClient = await proxyAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + try + { + using TcpClient originClient = await originAccept; + arrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(arrived); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyRefusalFailsBeforeTheTlsHandshake() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + await using NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("CONNECT 127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n", StringComparison.Ordinal), headers); + long started = Environment.TickCount64; + await stream.WriteAsync("HTTP/1.1 403 Forbidden\r\nContent-Length: 0\r\nConnection: close\r\n\r\n"u8.ToArray(), cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + Assert.IsTrue(HasMessage(ex, "The proxy refused the tunnel."), ex.ToString()); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyCloseFailsBeforeTheTlsHandshake() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("CONNECT 127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n", StringComparison.Ordinal), headers); + long started = Environment.TickCount64; + accepted.Close(); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + Assert.IsTrue(HasMessage(ex, "The proxy closed the connection."), ex.ToString()); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyHeadersTooLongFailsBeforeTheTlsHandshake() + { + using var origin = new TcpListener(IPAddress.Loopback, 0); + origin.Start(); + using var proxy = new TcpListener(IPAddress.Loopback, 0); + proxy.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint).Port; + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task originAccepted = origin.AcceptTcpClientAsync(cancel.Token).AsTask(); + Task proxyAccepted = proxy.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient accepted = await proxyAccepted.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + NetworkStream stream = accepted.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("CONNECT 127.0.0.1:" + originPort.ToString(CultureInfo.InvariantCulture) + " HTTP/1.1\r\n", StringComparison.Ordinal), headers); + byte[] huge = new byte[1024]; + huge.AsSpan().Fill((byte)'x'); + long started = Environment.TickCount64; + await stream.WriteAsync(huge, cancel.Token); + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + Assert.IsTrue(HasMessage(ex, "The proxy response headers are too long."), ex.ToString()); + Assert.IsFalse(originAccepted.IsCompleted); + origin.Stop(); + } + + private static bool HasMessage(Exception exception, string text) + { + for (Exception? current = exception; current is not null; current = current.InnerException) + { + if (current.Message.Contains(text, StringComparison.Ordinal)) + { + return true; + } + } + + return false; + } + + private static async Task CopyBytesAsync(Stream from, Stream to, CancellationToken cancellationToken) + { + byte[] buffer = new byte[4096]; + try + { + while (true) + { + int count = await from.ReadAsync(buffer, cancellationToken); + if (count == 0) + { + break; + } + + await to.WriteAsync(buffer.AsMemory(0, count), cancellationToken); + } + } + catch (IOException) + { + } + catch (OperationCanceledException) + { + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestIsCleartext() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int port = ((IPEndPoint)tcp.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "http://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient clear = await accepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nplain"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("plain", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("http", response.RequestMessage!.RequestUri!.Scheme); + } + + [TestMethod] + [Timeout(60000)] + public async Task HttpVersion3OnAnHttpUriIsCleartextHttp11() + { + using var tcp = new TcpListener(IPAddress.Loopback, 0); + tcp.Start(); + int port = ((IPEndPoint)tcp.LocalEndpoint).Port; + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = tcp.AcceptTcpClientAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = false; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "http://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + using TcpClient clear = await accepted; + await using NetworkStream stream = clear.GetStream(); + string headers = await ReadHttpHeadersAsync(stream, cancel.Token); + Assert.IsTrue(headers.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), headers); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nplain"u8.ToArray(), cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("plain", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("http", response.RequestMessage!.RequestUri!.Scheme); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectsAcrossSchemesAndKeepsTheCookie() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/from", (HttpContext context) => + { + int port = context.Connection.LocalPort; + context.Response.Headers.Append("Set-Cookie", "sid=abc; Path=/"); + context.Response.Redirect("https://localhost:" + port.ToString(CultureInfo.InvariantCulture) + "/land"); + return Task.CompletedTask; + }); + app.MapGet("/land", async context => + { + if (context.Request.Cookies["sid"] != "abc") + { + context.Response.StatusCode = StatusCodes.Status401Unauthorized; + return; + } + + byte[] plain = "hello"u8.ToArray(); + using MemoryStream encoded = new(); + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write(plain); + } + + context.Response.Headers.ContentEncoding = "gzip"; + context.Response.ContentType = "text/plain"; + await context.Response.Body.WriteAsync(encoded.ToArray()); + }); + }); + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.GZip; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://localhost:" + server.Port.ToString() + "/from") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("hello", body); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectDropsAuthorizationWhenTheHostChanges() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/drop", (HttpContext context) => + { + int port = context.Connection.LocalPort; + context.Response.Redirect("https://localhost:" + port.ToString(CultureInfo.InvariantCulture) + "/see"); + return Task.CompletedTask; + }); + app.MapGet("/keep", (HttpContext context) => + { + int port = context.Connection.LocalPort; + context.Response.Redirect("https://localhost:" + port.ToString(CultureInfo.InvariantCulture) + "/see"); + return Task.CompletedTask; + }); + app.MapGet("/see", (HttpRequest request) => + request.Headers.Authorization.Count == 0 ? "absent" : "present"); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string port = server.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage changed = new(HttpMethod.Get, "https://127.0.0.1:" + port + "/drop") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + changed.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + using HttpResponseMessage dropped = await client.SendAsync(changed); + Assert.AreEqual("absent", await dropped.Content.ReadAsStringAsync()); + Assert.AreSame(changed, dropped.RequestMessage); + using HttpRequestMessage same = new(HttpMethod.Get, "https://localhost:" + port + "/keep") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + same.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + using HttpResponseMessage kept = await client.SendAsync(same); + Assert.AreEqual("present", await kept.Content.ReadAsStringAsync()); + Assert.AreSame(same, kept.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PostRedirectTurnsFoundIntoGetAndKeepsTemporaryRedirect() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapPost("/found", (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status302Found; + context.Response.Headers.Location = "/land"; + return Task.CompletedTask; + }); + app.MapPost("/keep", (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status307TemporaryRedirect; + context.Response.Headers.Location = "/land"; + return Task.CompletedTask; + }); + app.MapMethods("/land", ["GET", "POST"], async context => + { + using StreamReader reader = new(context.Request.Body); + string body = await reader.ReadToEndAsync(); + await context.Response.WriteAsync(context.Request.Method + ":" + body); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage found = new(HttpMethod.Post, address + "/found") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage foundResponse = await client.SendAsync(found); + Assert.AreEqual("GET:", await foundResponse.Content.ReadAsStringAsync()); + Assert.AreSame(found, foundResponse.RequestMessage); + using HttpRequestMessage keep = new(HttpMethod.Post, address + "/keep") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage keepResponse = await client.SendAsync(keep); + Assert.AreEqual("POST:payload", await keepResponse.Content.ReadAsStringAsync()); + Assert.AreSame(keep, keepResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11MovedPermanentlyTurnsPostIntoGetAndPermanentRedirectKeepsIt() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapPost("/moved", (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status301MovedPermanently; + context.Response.Headers.Location = "/land"; + return Task.CompletedTask; + }); + app.MapPost("/keep", (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status308PermanentRedirect; + context.Response.Headers.Location = "/land"; + return Task.CompletedTask; + }); + app.MapMethods("/land", ["GET", "POST"], async context => + { + using StreamReader reader = new(context.Request.Body); + string body = await reader.ReadToEndAsync(); + await context.Response.WriteAsync(context.Request.Method + ":" + body); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage moved = new(HttpMethod.Post, address + "/moved") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage movedResponse = await client.SendAsync(moved); + Assert.AreEqual("GET:", await movedResponse.Content.ReadAsStringAsync()); + Assert.AreSame(moved, movedResponse.RequestMessage); + using HttpRequestMessage keep = new(HttpMethod.Post, address + "/keep") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage keepResponse = await client.SendAsync(keep); + Assert.AreEqual("POST:payload", await keepResponse.Content.ReadAsStringAsync()); + Assert.AreSame(keep, keepResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SeeOtherTurnsPostIntoGetAndKeepsHead() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapPost("/see", (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status303SeeOther; + context.Response.Headers.Location = "/land"; + return Task.CompletedTask; + }); + app.MapMethods("/see-head", [HttpMethods.Head], (HttpContext context) => + { + context.Response.StatusCode = StatusCodes.Status303SeeOther; + context.Response.Headers.Location = "/head-land"; + return Task.CompletedTask; + }); + app.MapGet("/land", async context => + { + using StreamReader reader = new(context.Request.Body); + string body = await reader.ReadToEndAsync(); + await context.Response.WriteAsync(context.Request.Method + ":" + body); + }); + app.MapMethods("/head-land", [HttpMethods.Head], (HttpContext context) => + { + context.Response.Headers["X-Saw"] = context.Request.Method; + return Task.CompletedTask; + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage post = new(HttpMethod.Post, address + "/see") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage postResponse = await client.SendAsync(post); + Assert.AreEqual("GET:", await postResponse.Content.ReadAsStringAsync()); + Assert.AreSame(post, postResponse.RequestMessage); + using HttpRequestMessage head = new(HttpMethod.Head, address + "/see-head") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage headResponse = await client.SendAsync(head); + Assert.AreEqual(HttpStatusCode.OK, headResponse.StatusCode); + Assert.AreEqual("HEAD", headResponse.Headers.GetValues("X-Saw").Single()); + Assert.AreSame(head, headResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectLimitStopsALongerChain() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/a", (HttpContext context) => + { + context.Response.Redirect("/b"); + return Task.CompletedTask; + }); + app.MapGet("/b", (HttpContext context) => + { + context.Response.Redirect("/c"); + return Task.CompletedTask; + }); + app.MapGet("/c", () => "landed"); + }); + using TitaniumHttpHandler handler = Handler(); + handler.MaxAutomaticRedirections = 1; + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/a"; + using HttpRequestMessage limited = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(limited)); + Assert.AreEqual("The redirect limit was reached.", ex.Message); + using TitaniumHttpHandler longer = Handler(); + longer.MaxAutomaticRedirections = 2; + using HttpClient again = new(longer, disposeHandler: false); + using HttpRequestMessage allowed = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await again.SendAsync(allowed); + Assert.AreEqual("landed", await response.Content.ReadAsStringAsync()); + Assert.AreSame(allowed, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11AllowAutoRedirectFalseReturnsTheRedirect() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/from", (HttpContext context) => + { + context.Response.Redirect("/land"); + return Task.CompletedTask; + }); + app.MapGet("/land", () => "landed"); + }); + using TitaniumHttpHandler handler = Handler(); + handler.AllowAutoRedirect = false; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/from") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + Assert.AreEqual(HttpStatusCode.Found, response.StatusCode); + Assert.IsTrue(response.Headers.Location?.OriginalString.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectWithoutALocationIsReturned() + { + int hits = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapGet("/from", async context => + { + Interlocked.Increment(ref hits); + context.Response.StatusCode = StatusCodes.Status302Found; + await context.Response.WriteAsync("here"); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/from") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.Found, response.StatusCode, body); + Assert.AreEqual("here", body); + Assert.IsNull(response.Headers.Location); + Assert.AreEqual(1, hits); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RelativeLocationIsResolvedAgainstTheRequestPath() + { + string? seen = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => + { + app.MapGet("/dir/from", context => + { + context.Response.StatusCode = StatusCodes.Status302Found; + context.Response.Headers.Location = "land"; + return Task.CompletedTask; + }); + app.MapGet("/dir/land", (HttpContext context) => + { + seen = context.Request.Path.Value; + return Results.Text("landed"); + }); + }, + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/dir/from") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("landed", body); + Assert.AreEqual("/dir/land", seen); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectCopiesACookieHeaderOnlyWhenCookiesAreOff() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/from", (HttpContext context) => + { + context.Response.Redirect("/land"); + return Task.CompletedTask; + }); + app.MapGet("/land", (HttpRequest request) => + { + string cookie = request.Headers.Cookie.ToString(); + return cookie.Length == 0 ? "none" : cookie; + }); + }); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/from"; + using TitaniumHttpHandler manual = Handler(); + manual.UseCookies = false; + using HttpClient manualClient = new(manual, disposeHandler: false); + using HttpRequestMessage manualRequest = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + manualRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + using HttpResponseMessage manualResponse = await manualClient.SendAsync(manualRequest); + Assert.AreEqual("sid=manual", await manualResponse.Content.ReadAsStringAsync()); + using TitaniumHttpHandler stored = Handler(); + stored.UseCookies = true; + using HttpClient storedClient = new(stored, disposeHandler: false); + using HttpRequestMessage storedRequest = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + storedRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + using HttpResponseMessage storedResponse = await storedClient.SendAsync(storedRequest); + Assert.AreEqual("none", await storedResponse.Content.ReadAsStringAsync()); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RedirectDoesNotCopyTheHostHeader() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/from", (HttpContext context) => + { + context.Response.Redirect("/land"); + return Task.CompletedTask; + }); + app.MapGet("/land", (HttpRequest request) => request.Host.Value); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string port = server.Port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port + "/from") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Host = "evil.example"; + using HttpResponseMessage response = await client.SendAsync(request); + string host = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, host); + Assert.AreEqual("127.0.0.1:" + port, host); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11LargeUploadAndDownloadMatchTheirHashes() + { + byte[] upload = Pattern(1024 * 1024); + byte[] download = Pattern(1024 * 1024 + 17); + string uploadHash = Convert.ToHexString(SHA256.HashData(upload)); + string downloadHash = Convert.ToHexString(SHA256.HashData(download)); + await using LoopbackServer server = await LoopbackServer.StartAsync(app => + { + app.MapPost("/blob", async context => + { + using IncrementalHash received = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + byte[] buffer = new byte[8192]; + while (true) + { + int count = await context.Request.Body.ReadAsync(buffer); + if (count == 0) + { + break; + } + + received.AppendData(buffer.AsSpan(0, count)); + } + + context.Response.Headers.Append("X-Upload-Sha256", Convert.ToHexString(received.GetHashAndReset())); + context.Response.ContentLength = download.Length; + await context.Response.Body.WriteAsync(download); + }); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://localhost:" + server.Port.ToString() + "/blob") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new ByteArrayContent(upload), + }; + + using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.IsTrue(response.Headers.TryGetValues("X-Upload-Sha256", out IEnumerable? hashes)); + Assert.AreEqual(uploadHash, hashes!.Single()); + await using Stream body = await response.Content.ReadAsStreamAsync(); + using IncrementalHash got = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + byte[] chunk = new byte[8192]; + while (true) + { + int count = await body.ReadAsync(chunk); + if (count == 0) + { + break; + } + + got.AppendData(chunk.AsSpan(0, count)); + } + + Assert.AreEqual(downloadHash, Convert.ToHexString(got.GetHashAndReset())); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(15000)] + public async Task ConnectTimeoutStopsASilentTcpHandshake() + { + using TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + Task held = listener.AcceptTcpClientAsync(); + using TitaniumHttpHandler handler = Handler(); + handler.ConnectTimeout = TimeSpan.FromMilliseconds(400); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(15) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint).Port.ToString(CultureInfo.InvariantCulture) + "/") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + DateTime started = DateTime.UtcNow; + await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(3)); + listener.Stop(); + if (held.IsCompletedSuccessfully) + { + held.Result.Dispose(); + } + } + + [TestMethod] + [Timeout(15000)] + public async Task ConnectTimeoutStopsASilentHttp2Handshake() + { + using TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + Task held = listener.AcceptTcpClientAsync(); + using TitaniumHttpHandler handler = Handler(); + handler.ConnectTimeout = TimeSpan.FromMilliseconds(400); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(15) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + DateTime started = DateTime.UtcNow; + await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(3)); + listener.Stop(); + if (held.IsCompletedSuccessfully) + { + held.Result.Dispose(); + } + } + + [TestMethod] + [Timeout(15000)] + public async Task ConnectTimeoutStopsASilentHttp3Handshake() + { + using Socket udp = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + udp.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + int port = ((IPEndPoint)udp.LocalEndPoint!).Port; + using TitaniumHttpHandler handler = Handler(); + handler.ConnectTimeout = TimeSpan.FromMilliseconds(400); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(15) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + DateTime started = DateTime.UtcNow; + Http3ConnectException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsInstanceOfType(ex.InnerException); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(3)); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ExactDoesNotFallBackWhenTheServerResetsTheStream() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.Text("http11")), + () => Interlocked.Increment(ref connections)); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.AreEqual(HttpRequestError.HttpProtocolError, ex.HttpRequestError); + Assert.AreEqual(1, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PostDoesNotRetryWhenTheServerResetsTheStream() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapPost("/hello", () => Results.Text("retried")), + () => Interlocked.Increment(ref connections)); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + Content = new StringContent("payload"), + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.AreEqual(HttpRequestError.HttpProtocolError, ex.HttpRequestError); + Assert.AreEqual(1, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PostIsRetriedWhenAlpnSelectsHttp11() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapPost("/hello", async (HttpRequest httpRequest) => + { + using StreamReader reader = new(httpRequest.Body); + string body = await reader.ReadToEndAsync(); + return Results.Text(httpRequest.Protocol + ":" + body); + }), + () => Interlocked.Increment(ref connections), + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("HTTP/1.1:payload", body); + Assert.AreEqual(2, connections); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ExactIsNotRetriedWhenAlpnSelectsHttp11() + { + int connections = 0; + int seen = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapPost("/hello", () => + { + Interlocked.Increment(ref seen); + return Results.Text("seen"); + }), + () => Interlocked.Increment(ref connections), + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsTrue(HasMessage(ex, "The server selected HTTP/1.1."), ex.ToString()); + Assert.AreEqual(1, connections); + Assert.AreEqual(0, seen); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11OrHigherFallsBackWhenAlpnSelectsHttp11AndReusesTheConnection() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/ping", (HttpRequest httpRequest) => Results.Text(httpRequest.Protocol)), + () => Interlocked.Increment(ref connections), + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/ping"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using (HttpResponseMessage firstResponse = await client.SendAsync(first)) + { + Assert.AreEqual("HTTP/1.1", await firstResponse.Content.ReadAsStringAsync()); + Assert.AreSame(first, firstResponse.RequestMessage); + } + + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using (HttpResponseMessage secondResponse = await client.SendAsync(second)) + { + Assert.AreEqual("HTTP/1.1", await secondResponse.Content.ReadAsStringAsync()); + } + + Assert.AreEqual(2, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11OrHigherOnAnotherPortStillTriesAHigherVersion() + { + int firstConnections = 0; + int secondConnections = 0; + await using LoopbackServer first = await LoopbackServer.StartAsync( + static app => app.MapGet("/ping", () => Results.Text("one")), + () => Interlocked.Increment(ref firstConnections), + HttpProtocols.Http1); + await using LoopbackServer second = await LoopbackServer.StartAsync( + static app => app.MapGet("/ping", () => Results.Text("two")), + () => Interlocked.Increment(ref secondConnections), + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage firstRequest = new(HttpMethod.Get, "https://127.0.0.1:" + first.Port.ToString(CultureInfo.InvariantCulture) + "/ping") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using (HttpResponseMessage firstResponse = await client.SendAsync(firstRequest)) + { + Assert.AreEqual("one", await firstResponse.Content.ReadAsStringAsync()); + } + + Assert.AreEqual(2, firstConnections); + using HttpRequestMessage secondRequest = new(HttpMethod.Get, "https://127.0.0.1:" + second.Port.ToString(CultureInfo.InvariantCulture) + "/ping") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionOrHigher, + }; + using (HttpResponseMessage secondResponse = await client.SendAsync(secondRequest)) + { + Assert.AreEqual("two", await secondResponse.Content.ReadAsStringAsync()); + } + + Assert.AreEqual(2, secondConnections); + Assert.AreEqual(2, firstConnections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PresentsTheClientCertificate() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/who", (HttpContext context) => + { + string subject = context.Connection.ClientCertificate?.Subject ?? "none"; + return Results.Text(subject); + }), + null, + HttpProtocols.Http1, + requestClientCertificate: true); + using X509Certificate2 clientCertificate = CreateClientCertificate(); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { clientCertificate }; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=client", StringComparison.Ordinal), body); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SelectionCallbackChoosesTheClientCertificate() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/who", (HttpContext context) => + { + string subject = context.Connection.ClientCertificate?.Subject ?? "none"; + return Results.Text(subject); + }), + null, + HttpProtocols.Http1, + requestClientCertificate: true); + using X509Certificate2 first = CreateClientCertificate("first"); + using X509Certificate2 second = CreateClientCertificate("second"); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { first, second }; + handler.SslOptions.LocalCertificateSelectionCallback = static (_, _, localCertificates, _, _) => localCertificates[1]; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=second", StringComparison.Ordinal), body); + Assert.IsFalse(body.Contains("CN=first", StringComparison.Ordinal), body); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SkipsAClientCertificateWithoutAPrivateKey() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/who", (HttpContext context) => + { + string subject = context.Connection.ClientCertificate?.Subject ?? "none"; + return Results.Text(subject); + }), + null, + HttpProtocols.Http1, + requestClientCertificate: true); + using X509Certificate2 source = CreateClientCertificate("bare"); + using X509Certificate2 bare = X509CertificateLoader.LoadCertificate(source.Export(X509ContentType.Cert)); + using X509Certificate2 kept = CreateClientCertificate("kept"); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { bare, kept }; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=kept", StringComparison.Ordinal), body); + Assert.IsFalse(body.Contains("CN=bare", StringComparison.Ordinal), body); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UsesTargetHostAsTheServerName() + { + TaskCompletionSource serverName = new(TaskCreationOptions.RunContinuationsAsynchronously); + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.Text("ok")), + null, + HttpProtocols.Http1, + requestClientCertificate: false, + observedServerName: serverName); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.TargetHost = "app.example"; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual("app.example", await serverName.Task); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11EmptyTargetHostSendsTheUriHost() + { + TaskCompletionSource serverName = new(TaskCreationOptions.RunContinuationsAsynchronously); + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", () => Results.Text("ok")), + null, + HttpProtocols.Http1, + requestClientCertificate: false, + observedServerName: serverName); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual("127.0.0.1", await serverName.Task); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsTheCallerHost() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpRequest request) => request.Host.Value), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Host = "app.example"; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("app.example", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UserInfoStaysOffTheRequest() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://user:secret@127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nHost: 127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("user", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("secret", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Authorization:", StringComparison.OrdinalIgnoreCase), raw); + Assert.AreEqual("user:secret", request.RequestUri!.UserInfo); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11Ipv6LoopbackSendsTheBracketedHost() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.IPv6Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://[::1]:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue( + raw.Contains("\r\nHost: [::1]:" + port.ToString(CultureInfo.InvariantCulture) + "\r\n", StringComparison.Ordinal), + raw); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyConnectToIpv6UsesBrackets() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener origin = new(IPAddress.IPv6Loopback, 0); + origin.Start(); + int originPort = ((IPEndPoint)origin.LocalEndpoint!).Port; + TcpListener proxy = new(IPAddress.Loopback, 0); + proxy.Start(); + int proxyPort = ((IPEndPoint)proxy.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task<(string Connect, string Request)> wire = AcceptConnectThenHttpsAsync(proxy, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.UseProxy = true; + handler.Proxy = new WebProxy("http://127.0.0.1:" + proxyPort.ToString(CultureInfo.InvariantCulture)) + { + BypassProxyOnLocal = false, + }; + using HttpClient client = new(handler, disposeHandler: false); + string authority = "[::1]:" + originPort.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage request = new(HttpMethod.Get, "https://" + authority + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + (string connect, string tunneled) = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(connect.StartsWith("CONNECT " + authority + " HTTP/1.1\r\n", StringComparison.Ordinal), connect); + Assert.IsTrue(connect.Contains("\r\nHost: " + authority + "\r\n", StringComparison.Ordinal), connect); + Assert.IsTrue(tunneled.StartsWith("GET http://" + authority + "/hello HTTP/1.1\r\n", StringComparison.Ordinal), tunneled); + Assert.IsTrue(tunneled.Contains("\r\nHost: " + authority + "\r\n", StringComparison.Ordinal), tunneled); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + origin.Stop(); + proxy.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsACallerHeader() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpRequest request) => request.Headers["X-Trace"].ToString()), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("X-Trace", "one"); + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("one", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsEveryValueOfARepeatedHeader() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpRequest request) => request.Headers["X-Trace"].ToString()), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", new[] { "one", "two" })); + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("one, two", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsAuthorization() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpRequest request) => request.Headers["Authorization"].ToString()), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("Bearer secret", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PostSendsTheContentType() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapPost("/post", async (HttpRequest request) => + { + using StreamReader reader = new(request.Body); + string posted = await reader.ReadToEndAsync(); + return Results.Text((request.ContentType ?? "none") + "\n" + posted); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + string[] lines = body.Split('\n'); + Assert.AreEqual(2, lines.Length, body); + Assert.IsTrue(lines[0].Contains("text/plain", StringComparison.OrdinalIgnoreCase), body); + Assert.AreEqual("payload", lines[1]); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ExpectContinueReachesTheOrigin() + { + string? expect = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapPost("/post", async (HttpRequest request) => + { + expect = request.Headers.Expect.ToString(); + using StreamReader reader = new(request.Body); + string posted = await reader.ReadToEndAsync(); + return Results.Text(posted); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + request.Headers.ExpectContinue = true; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("payload", body); + Assert.IsTrue(expect?.Contains("100-continue", StringComparison.OrdinalIgnoreCase) == true, expect); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UnseekablePostIsSentWithContentLength() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using Stream body = new UnseekableReadStream("payload"u8.ToArray()); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StreamContent(body), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("POST /post HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nContent-Length: 7\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Transfer-Encoding:", StringComparison.OrdinalIgnoreCase), raw); + Assert.IsTrue(raw.EndsWith("\r\n\r\npayload", StringComparison.Ordinal), raw); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UnseekablePostIsChunkedWhenRedirectsAreOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.AllowAutoRedirect = false; + using HttpClient client = new(handler, disposeHandler: false); + using Stream body = new UnseekableReadStream("payload"u8.ToArray()); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StreamContent(body), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("POST /post HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nTransfer-Encoding: chunked\r\n", StringComparison.OrdinalIgnoreCase), raw); + Assert.IsFalse(raw.Contains("Content-Length:", StringComparison.OrdinalIgnoreCase), raw); + Assert.IsTrue(raw.Contains("\r\n\r\n7\r\npayload\r\n0\r\n\r\n", StringComparison.Ordinal), raw); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestKeepsTheQuery() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpRequest request) => request.Path + request.QueryString), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello?x=1") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("/hello?x=1", body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11EncodedPathStaysEncoded() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello%20world?x=%2F") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello%20world?x=%2F HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nHost: 127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PlusInTheQueryStaysAPlus() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello?x=a+b&y=%2B") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello?x=a+b&y=%2B HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11NonAsciiPathIsUtf8Encoded() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/h\u00e9llo") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /h%C3%A9llo HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CustomMethodIsSentAsWritten() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(new HttpMethod("QUERY"), "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("QUERY /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11GetSendsItsBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nContent-Length: 7\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.EndsWith("\r\n\r\npayload", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CallerHeaderKeepsItsCase() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", "one")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nX-Trace: one\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11EmptyPostSendsContentLengthZero() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent(string.Empty), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("POST /post HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nContent-Length: 0\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Transfer-Encoding", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.EndsWith("\r\n\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsHopByHopHeaders() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", "one")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Connection", "close")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Upgrade", "websocket")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Keep-Alive", "timeout=5")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Proxy-Connection", "keep-alive")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nX-Trace: one\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nConnection: close\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nUpgrade: websocket\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nKeep-Alive: timeout=5\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nProxy-Connection: keep-alive\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsAHeaderNamedByConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Connection", "close, x-trace")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", "one")); + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Upgrade", "websocket")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nConnection: close, x-trace\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nX-Trace: one\r\n", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nUpgrade: websocket\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11KeepsTheReasonPhrase() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync(listener, certificate, cancel.Token, "Fine"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("Fine", response.ReasonPhrase); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsEveryValueOfARepeatedHeader() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Trace: one\r\nX-Trace: two\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Trace", out IEnumerable? values), "missing X-Trace"); + CollectionAssert.AreEqual(new[] { "one", "two" }, values!.ToArray()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentTypeIsReadable() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Type: text/plain\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("text/plain", response.Content.Headers.ContentType?.MediaType); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseHeaderKeepsItsCase() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Trace: one\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string? observed = null; + foreach (KeyValuePair> header in response.Headers) + { + if (string.Equals(header.Key, "X-Trace", StringComparison.OrdinalIgnoreCase)) + { + observed = header.Key; + CollectionAssert.AreEqual(new[] { "one" }, header.Value.ToArray()); + } + } + + Assert.AreEqual("X-Trace", observed); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ChunkedResponseReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n2\r\nok\r\n0\r\n\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ConnectionCloseDelimitsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\nok", + closeNotify: true); + try + { + using (TitaniumHttpHandler handler = Handler()) + using (HttpClient client = new(handler, disposeHandler: false)) + using (HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }) + using (HttpResponseMessage response = await client.SendAsync(request, cancel.Token)) + { + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAnEmptyHeaderValue() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Trace:\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Trace", out IEnumerable? values)); + CollectionAssert.AreEqual(new[] { string.Empty }, values!.ToArray()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseTrimsHeaderWhitespace() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Trace: one \r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Trace", out IEnumerable? values)); + CollectionAssert.AreEqual(new[] { "one" }, values!.ToArray()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11FragmentStaysOffTheRequestLine() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello?x=1#section") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello?x=1 HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("#section", StringComparison.Ordinal), raw); + Assert.AreEqual("#section", request.RequestUri!.Fragment); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentLengthIsReadable() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nContent-Length: 5\r\nConnection: close\r\n\r\nhello"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("hello", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(5, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentTypeKeepsTheCharset() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Type: text/plain; charset=utf-8\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("text/plain", response.Content.Headers.ContentType?.MediaType); + Assert.AreEqual("utf-8", response.Content.Headers.ContentType?.CharSet); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestKeepsSpacesInAHeaderValue() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", " one ")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nX-Trace: one \r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsAnEmptyHeaderValue() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", string.Empty)); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nX-Trace: \r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestLeavesUserAgentOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.StartsWith("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("User-Agent", StringComparison.OrdinalIgnoreCase), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsTheCallerUserAgent() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("User-Agent", "Titanium")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nUser-Agent: Titanium\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAnHttp10StatusLine() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.0 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreEqual(0, response.Version.Minor); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ChunkedResponseJoinsChunks() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n2\r\nab\r\n1\r\nc\r\n0\r\n\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("abc", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(3, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ChunkedResponseReadsAHexSize() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\na\r\n0123456789\r\n0\r\n\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("0123456789", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(10, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ChunkedResponseIgnoresAChunkExtension() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nTransfer-Encoding: chunked\r\nConnection: close\r\n\r\n2;ext=1\r\nok\r\n0\r\n\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Content.Headers.ContentLength); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsACommaInAHeaderValue() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Trace: one, two\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Trace", out IEnumerable? values)); + CollectionAssert.AreEqual(new[] { "one, two" }, values!.ToArray()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestKeepsACommaInAHeaderValue() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", "one, two")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nX-Trace: one, two\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseReordersCacheControl() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Cache-Control: no-cache, no-store\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Cache-Control", out IEnumerable? values)); + Assert.AreEqual("no-store, no-cache", string.Join("|", values!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseExposesAnETag() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "ETag: \"abc\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNotNull(response.Headers.ETag); + Assert.IsFalse(response.Headers.ETag.IsWeak); + Assert.AreEqual("\"abc\"", response.Headers.ETag.Tag); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ConnectionCloseOpensAnotherConnection() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/ping", async context => + { + context.Response.Headers.Connection = "close"; + context.Response.ContentType = "text/plain"; + await context.Response.WriteAsync("pong"); + }), + () => Interlocked.Increment(ref connections), + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan; + handler.PooledConnectionLifetime = Timeout.InfiniteTimeSpan; + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/ping"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using (HttpResponseMessage firstResponse = await client.SendAsync(first)) + { + Assert.AreEqual(HttpStatusCode.OK, firstResponse.StatusCode); + Assert.AreEqual("pong", await firstResponse.Content.ReadAsStringAsync()); + Assert.AreSame(first, firstResponse.RequestMessage); + } + + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("pong", await secondResponse.Content.ReadAsStringAsync()); + Assert.AreSame(second, secondResponse.RequestMessage); + Assert.AreEqual(2, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11NotModifiedReturnsAnEmptyBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Not Modified", + rawResponse: "HTTP/1.1 304 Not Modified\r\nContent-Length: 4\r\nConnection: close\r\n\r\nbody"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.NotModified, response.StatusCode); + Assert.AreEqual(string.Empty, await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CreatedReturnsItsBodyAndKeepsLocation() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Created", + rawResponse: "HTTP/1.1 201 Created\r\nLocation: /land\r\nContent-Length: 4\r\nConnection: close\r\n\r\nmade"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); + Assert.AreEqual("made", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.Location?.OriginalString.EndsWith("/land", StringComparison.Ordinal) == true); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("GET /land", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UnsolicitedContinueIsNotTheResponse() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 100 Continue\r\n\r\nHTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(raw.Contains("Expect:", StringComparison.OrdinalIgnoreCase), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UnauthorizedReturnsItsBodyAndChallenge() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Unauthorized", + rawResponse: "HTTP/1.1 401 Unauthorized\r\nWWW-Authenticate: Basic realm=\"origin\"\r\nContent-Length: 6\r\nConnection: close\r\n\r\ndenied"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.Unauthorized, response.StatusCode); + Assert.AreEqual("denied", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("Basic realm=\"origin\"", response.Headers.WwwAuthenticate.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Authorization:", StringComparison.OrdinalIgnoreCase), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseDateIsTheParsedInstant() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Date: Sun, 06 Nov 1994 08:49:37 GMT\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), response.Headers.Date); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11IdentityEncodingLeavesTheBodyUnchanged() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + rawResponse: "HTTP/1.1 200 OK\r\nContent-Encoding: identity\r\nContent-Length: 5\r\nConnection: close\r\n\r\nplain"); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.All; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("plain", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("identity", string.Join(",", response.Content.Headers.ContentEncoding)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("Accept-Encoding:", StringComparison.OrdinalIgnoreCase), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PartialContentReturnsTheBodyAndRange() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Partial Content", + rawResponse: "HTTP/1.1 206 Partial Content\r\nContent-Range: bytes 0-4/10\r\nContent-Length: 5\r\nConnection: close\r\n\r\nhello"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.PartialContent, response.StatusCode); + Assert.AreEqual("hello", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("bytes 0-4/10", response.Content.Headers.ContentRange?.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseRetryAfterIsADelta() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Retry-After: 120\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(TimeSpan.FromSeconds(120), response.Headers.RetryAfter?.Delta); + Assert.IsNull(response.Headers.RetryAfter?.Date); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestLeavesAcceptOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(raw.Split("\r\n").Any(line => line.StartsWith("Accept:", StringComparison.OrdinalIgnoreCase)), raw); + Assert.AreEqual(0, request.Headers.Accept.Count); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11MethodNotAllowedReturnsTheBodyAndAllow() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Method Not Allowed", + rawResponse: "HTTP/1.1 405 Method Not Allowed\r\nAllow: GET, HEAD\r\nContent-Length: 2\r\nConnection: close\r\n\r\nno"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.MethodNotAllowed, response.StatusCode); + Assert.AreEqual("no", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("GET, HEAD", string.Join(", ", response.Content.Headers.Allow)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("POST /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentDispositionKeepsTheFileName() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Disposition: attachment; filename=\"report.txt\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("attachment", response.Content.Headers.ContentDisposition?.DispositionType); + Assert.AreEqual("report.txt", response.Content.Headers.ContentDisposition?.FileName); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsIfNoneMatch() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"abc\"")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nIf-None-Match: \"abc\"\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsAByteRange() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Range = new System.Net.Http.Headers.RangeHeaderValue(0, 4); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nRange: bytes=0-4\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ExpectationFailedIsReturned() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadExpectationFailedAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + request.Headers.ExpectContinue = true; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.ExpectationFailed, response.StatusCode); + Assert.AreEqual("no", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("POST /post HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("Expect: 100-continue", StringComparison.OrdinalIgnoreCase), raw); + Assert.IsFalse(raw.Contains("payload", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + + static async Task ReadExpectationFailedAsync( + TcpListener listener, + X509Certificate2 certificate, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + string headers = await ReadHttpHeadersAsync(stream, cancellationToken); + await stream.WriteAsync( + "HTTP/1.1 417 Expectation Failed\r\nContent-Length: 2\r\nConnection: close\r\n\r\nno"u8.ToArray(), + cancellationToken); + return headers; + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ExactHttp10IsSentAsHttp11() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version10, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("HTTP/1.0", StringComparison.Ordinal), raw); + Assert.AreEqual(HttpVersion.Version10, request.Version); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11InternalServerErrorReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Internal Server Error", + rawResponse: "HTTP/1.1 500 Internal Server Error\r\nContent-Length: 4\r\nConnection: close\r\n\r\ndown"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.InternalServerError, response.StatusCode); + Assert.AreEqual("down", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseLastModifiedIsTheParsedInstant() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Last-Modified: Sun, 06 Nov 1994 08:49:37 GMT\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), response.Content.Headers.LastModified); + Assert.IsNull(response.Headers.Date); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseAgeIsADelta() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Age: 30\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(TimeSpan.FromSeconds(30), response.Headers.Age); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseServerKeepsTheProduct() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Server: origin/1.0\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("origin/1.0", response.Headers.Server.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsReferer() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Referrer = new Uri("https://example.test/from"); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nReferer: https://example.test/from\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentLanguageKeepsTheTag() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Language: en\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("en", string.Join(", ", response.Content.Headers.ContentLanguage)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsFrom() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.From = "ada@example.test"; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nFrom: ada@example.test\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseVaryKeepsTheField() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Vary: Accept\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("Accept", response.Headers.Vary.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseViaKeepsTheHop() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Via: 1.1 edge\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("1.1 edge", response.Headers.Via.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentLocationStaysRelative() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Location: /report\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Uri? location = response.Content.Headers.ContentLocation; + Assert.IsNotNull(location); + Assert.IsFalse(location.IsAbsoluteUri); + Assert.AreEqual("/report", location.ToString()); + Assert.AreEqual("https", request.RequestUri!.Scheme); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseWarningKeepsTheCode() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Warning: 199 - \"stale\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("199 - \"stale\"", response.Headers.Warning.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsMaxForwards() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Trace, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.MaxForwards = 4; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("TRACE /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nMax-Forwards: 4\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsProxyAuthorization() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.ProxyAuthorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", "dTpw"); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsTrue(raw.Contains("\r\nProxy-Authorization: Basic dTpw\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponsePragmaStaysNoCache() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Pragma: no-cache\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("no-cache", response.Headers.Pragma.ToString()); + Assert.IsNull(response.Headers.CacheControl); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsACallerAccept() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("text/plain")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nAccept: text/plain\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsIfMatch() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.IfMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"abc\"")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nIf-Match: \"abc\"\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseExpiresIsTheParsedInstant() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Expires: Sun, 06 Nov 1994 08:49:37 GMT\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), response.Content.Headers.Expires); + Assert.IsNull(response.Headers.Date); + Assert.IsNull(response.Content.Headers.LastModified); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseAbsoluteContentLocationStaysHttps() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Location: https://example.test/report\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Uri? location = response.Content.Headers.ContentLocation; + Assert.IsNotNull(location); + Assert.IsTrue(location.IsAbsoluteUri); + Assert.AreEqual("https://example.test/report", location.AbsoluteUri); + Assert.AreEqual("https", request.RequestUri!.Scheme); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsAcceptLanguage() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.AcceptLanguage.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("en")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nAccept-Language: en\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsIfModifiedSince() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.IfModifiedSince = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nIf-Modified-Since: Sun, 06 Nov 1994 08:49:37 GMT\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11BadGatewayReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Bad Gateway", + rawResponse: "HTTP/1.1 502 Bad Gateway\r\nContent-Length: 4\r\nConnection: close\r\n\r\nmiss"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.BadGateway, response.StatusCode); + Assert.AreEqual("miss", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsALink() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Link: ; rel=stylesheet\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Link", out IEnumerable? link)); + Assert.AreEqual("; rel=stylesheet", string.Join(", ", link!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsTe() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TE.Add(new System.Net.Http.Headers.TransferCodingWithQualityHeaderValue("trailers")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nTE: trailers\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsUpgrade() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Upgrade: websocket\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Upgrade", out IEnumerable? upgrade)); + Assert.AreEqual("websocket", string.Join(", ", upgrade!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(raw.Contains("Upgrade:", StringComparison.OrdinalIgnoreCase), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsAcceptCharset() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.AcceptCharset.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("utf-8")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nAccept-Charset: utf-8\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ProxyAuthenticationRequiredReturnsTheBodyAndChallenge() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Proxy Authentication Required", + rawResponse: "HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: Basic realm=\"proxy\"\r\nContent-Length: 2\r\nConnection: close\r\n\r\nno"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.ProxyAuthenticationRequired, response.StatusCode); + Assert.AreEqual("no", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("Basic realm=\"proxy\"", response.Headers.ProxyAuthenticate.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Proxy-Authorization:", StringComparison.OrdinalIgnoreCase), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsIfUnmodifiedSince() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.IfUnmodifiedSince = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nIf-Unmodified-Since: Sun, 06 Nov 1994 08:49:37 GMT\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("If-Modified-Since:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseAcceptRangesStaysBytes() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Accept-Ranges: bytes\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("bytes", response.Headers.AcceptRanges.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Range:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsForwarded() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Forwarded", "for=192.0.2.43")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nForwarded: for=192.0.2.43\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Via:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAccessControlAllowOrigin() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Access-Control-Allow-Origin: https://example.test\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Access-Control-Allow-Origin", out IEnumerable? origin)); + Assert.AreEqual("https://example.test", string.Join(", ", origin!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11PreconditionFailedReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Precondition Failed", + rawResponse: "HTTP/1.1 412 Precondition Failed\r\nContent-Length: 2\r\nConnection: close\r\n\r\nno"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.PreconditionFailed, response.StatusCode); + Assert.AreEqual("no", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("If-Match:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("If-Unmodified-Since:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsPrefer() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Prefer", "return=minimal")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nPrefer: return=minimal\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Preference-Applied:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseRetryAfterIsAnHttpDate() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Retry-After: Sun, 06 Nov 1994 08:49:37 GMT\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), response.Headers.RetryAfter?.Date); + Assert.IsNull(response.Headers.RetryAfter?.Delta); + Assert.IsNull(response.Headers.Date); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseContentDispositionKeepsTheExtendedFileName() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Disposition: attachment; filename*=UTF-8''report%20name.txt\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("attachment", response.Content.Headers.ContentDisposition?.DispositionType); + Assert.AreEqual("report name.txt", response.Content.Headers.ContentDisposition?.FileNameStar); + Assert.IsNull(response.Content.Headers.ContentDisposition?.FileName); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Content-Disposition:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseExposesAWeakETag() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "ETag: W/\"abc\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNotNull(response.Headers.ETag); + Assert.IsTrue(response.Headers.ETag.IsWeak); + Assert.AreEqual("\"abc\"", response.Headers.ETag.Tag); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("If-None-Match:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("If-Match:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsPreferenceApplied() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Preference-Applied: return=minimal\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Preference-Applied", out IEnumerable? applied)); + Assert.AreEqual("return=minimal", string.Join(", ", applied!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Prefer:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsIfRange() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.IfRange = new System.Net.Http.Headers.RangeConditionHeaderValue("\"abc\""); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nIf-Range: \"abc\"\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nRange:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ServiceUnavailableReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Service Unavailable", + rawResponse: "HTTP/1.1 503 Service Unavailable\r\nContent-Length: 4\r\nConnection: close\r\n\r\nbusy"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.ServiceUnavailable, response.StatusCode); + Assert.AreEqual("busy", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNull(response.Headers.RetryAfter); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAcceptPatch() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Accept-Patch: application/merge-patch+json\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Accept-Patch", out IEnumerable? patch)); + Assert.AreEqual("application/merge-patch+json", string.Join(", ", patch!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Accept-Patch:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsOrigin() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Origin", "https://example.test")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Access-Control-Allow-Origin", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nOrigin: https://example.test\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseCacheControlMaxAgeIsADelta() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Cache-Control: max-age=60\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(TimeSpan.FromSeconds(60), response.Headers.CacheControl?.MaxAge); + Assert.IsFalse(response.Headers.CacheControl?.NoCache); + Assert.IsFalse(response.Headers.CacheControl?.NoStore); + Assert.AreEqual(string.Empty, response.Headers.Pragma.ToString()); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Cache-Control:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsContentMd5() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-MD5: REvLOj/Pg4kpbElGfyfh1g==\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Content.Headers.TryGetValues("Content-MD5", out IEnumerable? digest)); + Assert.AreEqual("REvLOj/Pg4kpbElGfyfh1g==", string.Join(", ", digest!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Content-MD5:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsContentTypeOptions() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Content-Type-Options: nosniff\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Content-Type-Options", out IEnumerable? options)); + Assert.AreEqual("nosniff", string.Join(", ", options!)); + Assert.IsNull(response.Content.Headers.ContentType); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("X-Content-Type-Options:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11GatewayTimeoutReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Gateway Timeout", + rawResponse: "HTTP/1.1 504 Gateway Timeout\r\nContent-Length: 4\r\nConnection: close\r\n\r\nlate"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.GatewayTimeout, response.StatusCode); + Assert.AreEqual("late", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNull(response.Headers.RetryAfter); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsServerTiming() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Server-Timing: app;dur=12\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Server-Timing", out IEnumerable? timing)); + Assert.AreEqual("app;dur=12", string.Join(", ", timing!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Server-Timing:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsPriority() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Priority", "u=1")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Priority", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nPriority: u=1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsCacheControl() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.CacheControl = new System.Net.Http.Headers.CacheControlHeaderValue { NoCache = true }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNull(response.Headers.CacheControl); + Assert.AreEqual(string.Empty, response.Headers.Pragma.ToString()); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nCache-Control: no-cache\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("no-store", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsReferrerPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Referrer-Policy: no-referrer\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Referrer-Policy", out IEnumerable? policy)); + Assert.AreEqual("no-referrer", string.Join(", ", policy!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Referer:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Referrer-Policy:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ConflictReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Conflict", + rawResponse: "HTTP/1.1 409 Conflict\r\nContent-Length: 5\r\nConnection: close\r\n\r\nclash"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); + Assert.AreEqual("clash", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsFrameOptions() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Frame-Options: DENY\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Frame-Options", out IEnumerable? frame)); + Assert.AreEqual("DENY", string.Join(", ", frame!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("X-Frame-Options:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsStrictTransportSecurity() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Strict-Transport-Security: max-age=31536000\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Strict-Transport-Security", out IEnumerable? policy)); + Assert.AreEqual("max-age=31536000", string.Join(", ", policy!)); + Assert.IsNull(response.Headers.CacheControl); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Strict-Transport-Security:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsSaveData() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Save-Data", "on")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Save-Data", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nSave-Data: on\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsPermissionsPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Permissions-Policy: camera=()\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Permissions-Policy", out IEnumerable? policy)); + Assert.AreEqual("camera=()", string.Join(", ", policy!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Permissions-Policy:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAcceptCH() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Accept-CH: Sec-CH-UA\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Accept-CH", out IEnumerable? hints)); + Assert.AreEqual("Sec-CH-UA", string.Join(", ", hints!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Accept-CH:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Sec-CH-UA:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsCrossOriginEmbedderPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Cross-Origin-Embedder-Policy: require-corp\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Cross-Origin-Embedder-Policy", out IEnumerable? policy)); + Assert.AreEqual("require-corp", string.Join(", ", policy!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Cross-Origin-Embedder-Policy:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11GoneReturnsTheBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "Gone", + rawResponse: "HTTP/1.1 410 Gone\r\nContent-Length: 4\r\nConnection: close\r\n\r\ngone"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.Gone, response.StatusCode); + Assert.AreEqual("gone", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsNull(response.Headers.Location); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsContentSecurityPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Content-Security-Policy: default-src 'none'\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Content-Security-Policy", out IEnumerable? policy)); + Assert.AreEqual("default-src 'none'", string.Join(", ", policy!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Content-Security-Policy:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsClearSiteData() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Clear-Site-Data: \"cache\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Clear-Site-Data", out IEnumerable? directive)); + Assert.AreEqual("\"cache\"", string.Join(", ", directive!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Clear-Site-Data:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsTimingAllowOrigin() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Timing-Allow-Origin: *\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Timing-Allow-Origin", out IEnumerable? origin)); + Assert.AreEqual("*", string.Join(", ", origin!)); + Assert.IsFalse(response.Headers.TryGetValues("Server-Timing", out _)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Timing-Allow-Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsOriginAgentCluster() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Origin-Agent-Cluster: ?1\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Origin-Agent-Cluster", out IEnumerable? cluster)); + Assert.AreEqual("?1", string.Join(", ", cluster!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin-Agent-Cluster:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsDnsPrefetchControl() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-DNS-Prefetch-Control: off\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-DNS-Prefetch-Control", out IEnumerable? prefetch)); + Assert.AreEqual("off", string.Join(", ", prefetch!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("X-DNS-Prefetch-Control:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsDnt() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("DNT", "1")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("DNT", out _)); + Assert.IsFalse(response.Headers.TryGetValues("Tk", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nDNT: 1\r\n", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAcceptPost() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Accept-Post: application/json\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Accept-Post", out IEnumerable? acceptPost)); + Assert.AreEqual("application/json", string.Join(", ", acceptPost!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nAccept-Post:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsServiceWorkerAllowed() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Service-Worker-Allowed: /\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Service-Worker-Allowed", out IEnumerable? allowed)); + Assert.AreEqual("/", string.Join(", ", allowed!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nService-Worker-Allowed:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsSupportsLoadingMode() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Supports-Loading-Mode: credentialed-prerender\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Supports-Loading-Mode", out IEnumerable? loading)); + Assert.AreEqual("credentialed-prerender", string.Join(", ", loading!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nSupports-Loading-Mode:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsRobotsTag() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Robots-Tag: noindex\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Robots-Tag", out IEnumerable? robots)); + Assert.AreEqual("noindex", string.Join(", ", robots!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nX-Robots-Tag:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsSecFetchDest() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Sec-Fetch-Dest", "document")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Sec-Fetch-Dest", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nSec-Fetch-Dest: document\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nSec-Fetch-Mode:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nSec-Fetch-Site:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsReportingEndpoints() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Reporting-Endpoints: default=\"https://example.test/reports\"\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Reporting-Endpoints", out IEnumerable? endpoints)); + Assert.AreEqual("default=\"https://example.test/reports\"", string.Join(", ", endpoints!)); + Assert.IsFalse(response.Headers.TryGetValues("Report-To", out _)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nReporting-Endpoints:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsRefresh() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Refresh: 5\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Refresh", out IEnumerable? refresh)); + Assert.AreEqual("5", string.Join(", ", refresh!)); + Assert.IsNull(response.Headers.Location); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nRefresh:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsDocumentPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Document-Policy: force-load-at-top\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Document-Policy", out IEnumerable? policy)); + Assert.AreEqual("force-load-at-top", string.Join(", ", policy!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nDocument-Policy:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nRequire-Document-Policy:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsPrefersColorScheme() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Sec-CH-Prefers-Color-Scheme", "dark")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Sec-CH-Prefers-Color-Scheme", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nSec-CH-Prefers-Color-Scheme: dark\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nSec-CH-Prefers-Reduced-Motion:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsXssProtection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-XSS-Protection: 0\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-XSS-Protection", out IEnumerable? xss)); + Assert.AreEqual("0", string.Join(", ", xss!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nX-XSS-Protection:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsPermittedCrossDomainPolicies() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Permitted-Cross-Domain-Policies: none\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Permitted-Cross-Domain-Policies", out IEnumerable? policies)); + Assert.AreEqual("none", string.Join(", ", policies!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nX-Permitted-Cross-Domain-Policies:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsDownloadOptions() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-Download-Options: noopen\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-Download-Options", out IEnumerable? download)); + Assert.AreEqual("noopen", string.Join(", ", download!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nX-Download-Options:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsWantDigest() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Want-Digest", "sha-256")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Want-Digest", out _)); + Assert.IsFalse(response.Headers.TryGetValues("Content-Digest", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nWant-Digest: sha-256\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nContent-Digest:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsSunset() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Sunset: Sun, 06 Nov 1994 08:49:37 GMT\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Sunset", out IEnumerable? sunset)); + Assert.AreEqual("Sun, 06 Nov 1994 08:49:37 GMT", string.Join(", ", sunset!)); + Assert.IsNull(response.Headers.Date); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nSunset:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsAim() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("A-IM", "identity")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("A-IM", out _)); + Assert.IsFalse(response.Headers.TryGetValues("IM", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nA-IM: identity\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nIM:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsUpgradeInsecureRequests() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Upgrade-Insecure-Requests", "1")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Upgrade-Insecure-Requests", out _)); + Assert.IsFalse(response.Headers.TryGetValues("Upgrade", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nUpgrade-Insecure-Requests: 1\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nUpgrade:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsCrossOriginOpenerPolicy() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Cross-Origin-Opener-Policy: same-origin\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Cross-Origin-Opener-Policy", out IEnumerable? opener)); + Assert.AreEqual("same-origin", string.Join(", ", opener!)); + Assert.IsFalse(response.Headers.TryGetValues("Cross-Origin-Embedder-Policy", out _)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Cross-Origin-Opener-Policy:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsCdnCacheControl() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "CDN-Cache-Control: no-store\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("CDN-Cache-Control", out IEnumerable? cdn)); + Assert.AreEqual("no-store", string.Join(", ", cdn!)); + Assert.IsNull(response.Headers.CacheControl); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nCDN-Cache-Control:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nCache-Control:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsAccessControlAllowMethods() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "Access-Control-Allow-Methods: GET\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("Access-Control-Allow-Methods", out IEnumerable? methods)); + Assert.AreEqual("GET", string.Join(", ", methods!)); + Assert.IsFalse(response.Headers.TryGetValues("Access-Control-Allow-Origin", out _)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nAccess-Control-Allow-Methods:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("Origin:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ResponseKeepsUaCompatible() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestCoreAsync( + listener, + certificate, + cancel.Token, + "OK", + "X-UA-Compatible: IE=edge\r\n"); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsTrue(response.Headers.TryGetValues("X-UA-Compatible", out IEnumerable? compatible)); + Assert.AreEqual("IE=edge", string.Join(", ", compatible!)); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("GET /hello HTTP/1.1", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nX-UA-Compatible:", StringComparison.Ordinal), raw); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsEct() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("ECT", "4g")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("ECT", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nECT: 4g\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nRTT:", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nDownlink:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11RequestSendsServiceWorker() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task wire = ReadHttps11RequestAsync(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Service-Worker", "script")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.IsFalse(response.Headers.TryGetValues("Service-Worker", out _)); + Assert.IsFalse(response.Headers.TryGetValues("Service-Worker-Allowed", out _)); + string raw = await wire.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(raw.Contains("\r\nService-Worker: script\r\n", StringComparison.Ordinal), raw); + Assert.IsFalse(raw.Contains("\r\nService-Worker-Allowed:", StringComparison.Ordinal), raw); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await wire.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11Tls12IsRefusedBeforeTheRequest() + { + int seen = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hello", () => + { + seen++; + return Results.Text("ok"); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(5) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsTrue(HasMessage(ex, "The remote party selected a TLS version below 1.3."), ex.ToString()); + Assert.AreEqual(0, seen); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3EmptyTargetHostSendsTheUriHost() + { + using X509Certificate2 certificate = CreateHttp3Certificate(); + TaskCompletionSource serverName = new(TaskCreationOptions.RunContinuationsAsynchronously); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, hello, _) => + { + serverName.TrySetResult(hello.ServerName); + return ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }); + }, + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + listener.LocalEndPoint.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task pending = client.SendAsync(request, cancel.Token); + ManagedQuicConnection server = await accepted; + await ReplyAsync(server, cancel.Token); + using HttpResponseMessage response = await pending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("127.0.0.1", await serverName.Task); + Assert.AreEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await server.DisposeAsync(); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11GzipStaysCompressedWhenDecompressionIsOff() + { + byte[] payload; + using (MemoryStream encoded = new()) + { + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + string? acceptEncoding = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/gzip", async context => + { + acceptEncoding = context.Request.Headers.AcceptEncoding.ToString(); + context.Response.Headers.ContentEncoding = "gzip"; + context.Response.ContentType = "text/plain"; + context.Response.ContentLength = payload.Length; + await context.Response.Body.WriteAsync(payload); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + Assert.AreEqual(DecompressionMethods.None, handler.AutomaticDecompression); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/gzip") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + byte[] body = await response.Content.ReadAsByteArrayAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + CollectionAssert.AreEqual(payload, body); + Assert.AreEqual("gzip", string.Join(", ", response.Content.Headers.ContentEncoding)); + Assert.AreEqual("", acceptEncoding); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11DecompressesGzip() + { + byte[] payload; + using (MemoryStream encoded = new()) + { + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + string? acceptEncoding = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/gzip", async context => + { + acceptEncoding = context.Request.Headers.AcceptEncoding.ToString(); + context.Response.Headers.ContentEncoding = "gzip"; + context.Response.ContentType = "text/plain"; + context.Response.ContentLength = payload.Length; + await context.Response.Body.WriteAsync(payload); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.GZip; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/gzip") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("hello", body); + Assert.IsTrue(acceptEncoding?.Contains("gzip", StringComparison.OrdinalIgnoreCase) == true, acceptEncoding); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11DeflateStaysCompressedWhenDecompressionIsOff() + { + byte[] payload; + using (MemoryStream encoded = new()) + { + using (DeflateStream deflate = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + deflate.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + string? acceptEncoding = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/deflate", async context => + { + acceptEncoding = context.Request.Headers.AcceptEncoding.ToString(); + context.Response.Headers.ContentEncoding = "deflate"; + context.Response.ContentType = "text/plain"; + context.Response.ContentLength = payload.Length; + await context.Response.Body.WriteAsync(payload); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + Assert.AreEqual(DecompressionMethods.None, handler.AutomaticDecompression); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/deflate") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + byte[] body = await response.Content.ReadAsByteArrayAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + CollectionAssert.AreEqual(payload, body); + Assert.AreEqual("deflate", string.Join(", ", response.Content.Headers.ContentEncoding)); + Assert.AreEqual("", acceptEncoding); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11DecompressesDeflate() + { + byte[] payload; + using (MemoryStream encoded = new()) + { + using (DeflateStream deflate = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + deflate.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + string? acceptEncoding = null; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/deflate", async context => + { + acceptEncoding = context.Request.Headers.AcceptEncoding.ToString(); + context.Response.Headers.ContentEncoding = "deflate"; + context.Response.ContentType = "text/plain"; + context.Response.ContentLength = payload.Length; + await context.Response.Body.WriteAsync(payload); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.Deflate; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/deflate") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("hello", body); + Assert.IsTrue(acceptEncoding?.Contains("deflate", StringComparison.OrdinalIgnoreCase) == true, acceptEncoding); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11SendsAndStoresACookie() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpContext context) => + { + string incoming = context.Request.Cookies["session"] ?? "none"; + context.Response.Cookies.Append("next", "two"); + return Results.Text(incoming); + }), + null, + HttpProtocols.Http1); + Uri uri = new("https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + CookieContainer cookies = new(); + cookies.Add(uri, new Cookie("session", "one")); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("one", body); + CookieCollection stored = cookies.GetCookies(uri); + Assert.AreEqual("one", stored["session"]?.Value); + Assert.AreEqual("two", stored["next"]?.Value); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11CookiePathLimitsWhereItIsSent() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => + { + app.MapGet("/only", (HttpContext context) => + { + context.Response.Cookies.Append("next", "two", new CookieOptions { Path = "/only" }); + return Results.Text(context.Request.Cookies["next"] ?? "none"); + }); + app.MapGet("/other", (HttpContext context) => Results.Text(context.Request.Cookies["next"] ?? "none")); + }, + null, + HttpProtocols.Http1); + string root = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture); + CookieContainer cookies = new(); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage first = new(HttpMethod.Get, root + "/only") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first); + Assert.AreEqual("none", await firstResponse.Content.ReadAsStringAsync()); + Assert.AreEqual("two", cookies.GetCookies(new Uri(root + "/only"))["next"]?.Value); + Assert.IsNull(cookies.GetCookies(new Uri(root + "/other"))["next"]); + + using HttpRequestMessage other = new(HttpMethod.Get, root + "/other") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage otherResponse = await client.SendAsync(other); + Assert.AreEqual("none", await otherResponse.Content.ReadAsStringAsync()); + Assert.AreSame(other, otherResponse.RequestMessage); + + using HttpRequestMessage again = new(HttpMethod.Get, root + "/only") + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage againResponse = await client.SendAsync(again); + Assert.AreEqual("two", await againResponse.Content.ReadAsStringAsync()); + Assert.AreEqual(1, againResponse.Version.Major); + Assert.AreSame(again, againResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11ExpiredSetCookieDropsTheStoredCookie() + { + int hits = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hello", (HttpContext context) => + { + int hit = Interlocked.Increment(ref hits); + string incoming = context.Request.Cookies["next"] ?? "none"; + if (hit == 1) + { + context.Response.Cookies.Append("next", "two"); + } + else if (hit == 2) + { + context.Response.Cookies.Delete("next"); + } + + return Results.Text(incoming); + }), + null, + HttpProtocols.Http1); + Uri uri = new("https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + CookieContainer cookies = new(); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false); + + using (HttpRequestMessage first = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }) + { + using HttpResponseMessage response = await client.SendAsync(first); + Assert.AreEqual("none", await response.Content.ReadAsStringAsync()); + Assert.AreEqual("two", cookies.GetCookies(uri)["next"]?.Value); + } + + using (HttpRequestMessage second = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }) + { + using HttpResponseMessage response = await client.SendAsync(second); + Assert.AreEqual("two", await response.Content.ReadAsStringAsync()); + Assert.IsNull(cookies.GetCookies(uri)["next"]); + Assert.AreSame(second, response.RequestMessage); + } + + using HttpRequestMessage third = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage thirdResponse = await client.SendAsync(third); + Assert.AreEqual("none", await thirdResponse.Content.ReadAsStringAsync()); + Assert.AreEqual(1, thirdResponse.Version.Major); + Assert.AreSame(third, thirdResponse.RequestMessage); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11UseCookiesFalseLeavesTheContainerUnused() + { + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/hello", (HttpContext context) => + { + string incoming = context.Request.Cookies["session"] ?? "none"; + context.Response.Cookies.Append("next", "two"); + return Results.Text(incoming); + }), + null, + HttpProtocols.Http1); + Uri uri = new("https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello"); + CookieContainer cookies = new(); + cookies.Add(uri, new Cookie("session", "one")); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = false; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version11, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("none", body); + CookieCollection stored = cookies.GetCookies(uri); + Assert.AreEqual(1, stored.Count); + Assert.AreEqual("one", stored["session"]?.Value); + Assert.IsNull(stored["next"]); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + } + + private static X509Certificate2 CreateClientCertificate() => CreateClientCertificate("client"); + + private static X509Certificate2 CreateClientCertificate(string commonName) + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + CertificateRequest request = new("CN=" + commonName, key, HashAlgorithmName.SHA256); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PostBodyIsReturned() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2EchoAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("payload", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + Assert.AreEqual(SslApplicationProtocol.Http2, await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2LargeUploadAndDownloadMatchTheirHashes() + { + byte[] upload = Pattern(1024 * 1024); + byte[] download = Pattern(1024 * 1024 + 17); + string uploadHash = Convert.ToHexString(SHA256.HashData(upload)); + string downloadHash = Convert.ToHexString(SHA256.HashData(download)); + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2HashAsync(listener, certificate, download, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/blob") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new ByteArrayContent(upload), + }; + using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(2, response.Version.Major); + Assert.IsTrue(response.Headers.TryGetValues("x-upload-sha256", out IEnumerable? hashes)); + Assert.AreEqual(uploadHash, hashes!.Single()); + await using Stream body = await response.Content.ReadAsStreamAsync(cancel.Token); + using IncrementalHash got = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + byte[] chunk = new byte[8192]; + while (true) + { + int count = await body.ReadAsync(chunk, cancel.Token); + if (count == 0) + { + break; + } + + got.AppendData(chunk.AsSpan(0, count)); + } + + Assert.AreEqual(downloadHash, Convert.ToHexString(got.GetHashAndReset())); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + Assert.AreEqual(uploadHash, await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2IdleConnectionIsReused() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(int FirstStream, int SecondStream)> server = ServeHttp2ReuseAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionLifetime = Timeout.InfiniteTimeSpan; + handler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(200); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, firstResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + release.TrySetResult(); + (int firstStream, int secondStream) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreNotEqual(firstStream, secondStream); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ConnectionLifetimeOpensAnotherConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2TwoConnectionsAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.PooledConnectionIdleTimeout = Timeout.InfiniteTimeSpan; + handler.PooledConnectionLifetime = TimeSpan.FromMilliseconds(200); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, firstResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + await Task.Delay(TimeSpan.FromMilliseconds(500), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2MaxConnectionsPerServerKeepsTwoRequestsOnOneConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource firstHeaders = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource<(int FirstStream, int SecondStream)> streamsSeen = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2TwoInFlightAsync(listener, certificate, firstHeaders, streamsSeen, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.MaxConnectionsPerServer = 1; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task firstPending = client.SendAsync(first, cancel.Token); + await firstHeaders.Task.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Task secondPending = client.SendAsync(second, cancel.Token); + (int firstStream, int secondStream) = await streamsSeen.Task.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreNotEqual(firstStream, secondStream); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + using HttpResponseMessage firstResponse = await firstPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + using HttpResponseMessage secondResponse = await secondPending.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, firstResponse.Version.Major); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + Assert.AreSame(second, secondResponse.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2DecompressesGzip() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2GzipAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.AutomaticDecompression = DecompressionMethods.GZip; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/gzip") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("hello", body); + Assert.AreEqual(0, response.Content.Headers.ContentEncoding.Count); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string? acceptEncoding = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(acceptEncoding?.Contains("gzip", StringComparison.OrdinalIgnoreCase) == true, acceptEncoding); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2GoAwayOpensAnotherConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2GoAwayAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, firstResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PresentsTheClientCertificate() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + using X509Certificate2 clientCertificate = CreateClientCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2ClientCertificateAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { clientCertificate }; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=client", StringComparison.Ordinal), body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string subject = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(subject.Contains("CN=client", StringComparison.Ordinal), subject); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2SelectionCallbackChoosesTheClientCertificate() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + using X509Certificate2 first = CreateClientCertificate("first"); + using X509Certificate2 second = CreateClientCertificate("second"); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2ClientCertificateAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { first, second }; + handler.SslOptions.LocalCertificateSelectionCallback = static (_, _, localCertificates, _, _) => localCertificates[1]; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=second", StringComparison.Ordinal), body); + Assert.IsFalse(body.Contains("CN=first", StringComparison.Ordinal), body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string subject = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(subject.Contains("CN=second", StringComparison.Ordinal), subject); + Assert.IsFalse(subject.Contains("CN=first", StringComparison.Ordinal), subject); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2SkipsAClientCertificateWithoutAPrivateKey() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + using X509Certificate2 source = CreateClientCertificate("bare"); + using X509Certificate2 bare = X509CertificateLoader.LoadCertificate(source.Export(X509ContentType.Cert)); + using X509Certificate2 kept = CreateClientCertificate("kept"); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2ClientCertificateAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.ClientCertificates = new X509CertificateCollection { bare, kept }; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/who") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.IsTrue(body.Contains("CN=kept", StringComparison.Ordinal), body); + Assert.IsFalse(body.Contains("CN=bare", StringComparison.Ordinal), body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string subject = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsTrue(subject.Contains("CN=kept", StringComparison.Ordinal), subject); + Assert.IsFalse(subject.Contains("CN=bare", StringComparison.Ordinal), subject); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2SendsAndStoresACookie() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + Uri uri = new("https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CookieAsync(listener, certificate, release.Task, cancel.Token); + try + { + CookieContainer cookies = new(); + cookies.Add(uri, new Cookie("session", "one")); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = true; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string? cookie = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("session=one", cookie); + CookieCollection stored = cookies.GetCookies(uri); + Assert.AreEqual("one", stored["session"]?.Value); + Assert.AreEqual("two", stored["next"]?.Value); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2UseCookiesFalseLeavesTheContainerUnused() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + Uri uri = new("https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CookieAsync(listener, certificate, release.Task, cancel.Token); + try + { + CookieContainer cookies = new(); + cookies.Add(uri, new Cookie("session", "one")); + using TitaniumHttpHandler handler = Handler(); + handler.CookieContainer = cookies; + handler.UseCookies = false; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, uri) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string? cookie = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsNull(cookie); + CookieCollection stored = cookies.GetCookies(uri); + Assert.AreEqual(1, stored.Count); + Assert.AreEqual("one", stored["session"]?.Value); + Assert.IsNull(stored["next"]); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2BodyReadStopsWhenCancelled() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2OpenBodyAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = Timeout.InfiniteTimeSpan }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/slow") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + await using Stream body = await response.Content.ReadAsStreamAsync(cancel.Token); + using CancellationTokenSource readCancel = new(); + ValueTask read = body.ReadAsync(new byte[8], readCancel.Token); + readCancel.Cancel(); + long started = Environment.TickCount64; + await Assert.ThrowsExactlyAsync(async () => await read); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestStopsWhenCancelledBeforeTheResponseHeaders() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource arrived = new(TaskCreationOptions.RunContinuationsAsynchronously); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2WaitForHeadersAsync(listener, certificate, arrived, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = Timeout.InfiniteTimeSpan }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/wait") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using CancellationTokenSource requestCancel = new(); + Task pending = client.SendAsync(request, requestCancel.Token); + await arrived.Task.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + long started = Environment.TickCount64; + requestCancel.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await pending); + Assert.IsTrue(Environment.TickCount64 - started < 2000); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2Tls12IsRefusedBeforeTheRequest() + { + int seen = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + app => app.MapGet("/hello", () => + { + seen++; + return Results.Text("ok"); + }), + null, + HttpProtocols.Http1); + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls12; + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(5) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(request)); + Assert.IsTrue(HasMessage(ex, "The remote party selected a TLS version below 1.3."), ex.ToString()); + Assert.AreEqual(0, seen); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2UsesTargetHostAsTheServerName() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2TargetHostAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.SslOptions.TargetHost = "app.example"; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + Assert.AreEqual("app.example", await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2EmptyTargetHostSendsTheUriHost() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2TargetHostAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + Assert.AreEqual("127.0.0.1", await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestReusesTheConnection() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(int FirstStream, int SecondStream)> server = ServeHttp2ReuseAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("ok", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, firstResponse.Version.Major); + Assert.AreSame(first, firstResponse.RequestMessage); + + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("ok", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + release.TrySetResult(); + (int firstStream, int secondStream) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreNotEqual(firstStream, secondStream); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestLeavesTransferEncodingOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(byte[] Headers, byte[] Body)> server = ServeHttp2PostAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("Transfer-Encoding", "chunked")); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (byte[] headers, byte[] posted) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsNull(ReadHttp2HeaderValue(headers, "transfer-encoding"), Convert.ToHexString(headers)); + Assert.AreEqual("payload", System.Text.Encoding.ASCII.GetString(posted)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2EmptyPostSendsAnEmptyDataFrame() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(byte[] Headers, bool HeadersEnded, int DataFrames, int DataLength)> server = + ServeHttp2EmptyPostAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent(string.Empty), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (byte[] headers, bool headersEnded, int dataFrames, int dataLength) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("POST", ReadHttp2Method(headers), Convert.ToHexString(headers)); + Assert.IsFalse(headersEnded, Convert.ToHexString(headers)); + Assert.AreEqual(1, dataFrames); + Assert.AreEqual(0, dataLength); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PostSendsTheContentType() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(byte[] Headers, byte[] Body)> server = ServeHttp2PostAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/post") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (byte[] headers, byte[] posted) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + string contentType = ReadHttp2HeaderValue(headers, "content-type") ?? string.Empty; + Assert.AreEqual("POST", ReadHttp2Method(headers), Convert.ToHexString(headers)); + Assert.IsTrue(contentType.Contains("text/plain", StringComparison.OrdinalIgnoreCase), contentType + " " + Convert.ToHexString(headers)); + Assert.AreEqual("payload", System.Text.Encoding.ASCII.GetString(posted)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestJoinsARepeatedHeader() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CallerHeaderAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + Assert.IsTrue(request.Headers.TryAddWithoutValidation("X-Trace", new[] { "one", "two" })); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + byte[] headers = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("one, two", ReadHttp2HeaderValue(headers, "x-trace"), Convert.ToHexString(headers)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestSendsACallerHeaderAndLeavesConnectionOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CallerHeaderAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.TryAddWithoutValidation("X-Trace", "one"); + request.Headers.TryAddWithoutValidation("Connection", "close"); + request.Headers.TryAddWithoutValidation("Upgrade", "websocket"); + request.Headers.TryAddWithoutValidation("Keep-Alive", "timeout=5"); + request.Headers.TryAddWithoutValidation("Proxy-Connection", "keep-alive"); + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + byte[] headers = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("one", ReadHttp2HeaderValue(headers, "x-trace"), Convert.ToHexString(headers)); + Assert.IsNull(ReadHttp2HeaderValue(headers, "connection"), Convert.ToHexString(headers)); + Assert.IsNull(ReadHttp2HeaderValue(headers, "upgrade"), Convert.ToHexString(headers)); + Assert.AreEqual("timeout=5", ReadHttp2HeaderValue(headers, "keep-alive"), Convert.ToHexString(headers)); + Assert.IsNull(ReadHttp2HeaderValue(headers, "proxy-connection"), Convert.ToHexString(headers)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2CallerHostBecomesTheAuthority() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CallerHeaderAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Host = "app.example"; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("ok", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + byte[] headers = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("app.example", ReadHttp2HeaderValue(headers, ":authority"), Convert.ToHexString(headers)); + Assert.IsNull(ReadHttp2HeaderValue(headers, "host"), Convert.ToHexString(headers)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestSendsSchemeHttp() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CallerHeaderAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("ok", await response.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + byte[] headers = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("http", ReadHttp2HeaderValue(headers, ":scheme"), Convert.ToHexString(headers)); + Assert.AreEqual("GET", ReadHttp2HeaderValue(headers, ":method"), Convert.ToHexString(headers)); + Assert.AreEqual("/hello", ReadHttp2HeaderValue(headers, ":path"), Convert.ToHexString(headers)); + Assert.AreEqual("127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture), ReadHttp2HeaderValue(headers, ":authority"), Convert.ToHexString(headers)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RequestKeepsTheQueryOnThePath() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2QueryAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello?x=1") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("/hello?x=1", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string path = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("/hello?x=1", path); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2FragmentStaysOffThePath() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2QueryAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello?x=1#section") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("/hello?x=1", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string path = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("/hello?x=1", path); + Assert.AreEqual("#section", request.RequestUri!.Fragment); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2EncodedPathStaysEncoded() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2QueryAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/hello%20world?x=%2F") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("/hello%20world?x=%2F", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + string path = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("/hello%20world?x=%2F", path); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RedirectLimitStopsALongerChain() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(string First, string Second, string? Third, string Landed)> server = + ServeHttp2RedirectLimitAsync(listener, certificate, release.Task, cancel.Token); + try + { + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/a"; + using TitaniumHttpHandler handler = Handler(); + handler.MaxAutomaticRedirections = 1; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage limited = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + HttpRequestException ex = await Assert.ThrowsExactlyAsync(async () => await client.SendAsync(limited, cancel.Token)); + Assert.AreEqual("The redirect limit was reached.", ex.Message); + + using TitaniumHttpHandler longer = Handler(); + longer.MaxAutomaticRedirections = 2; + using HttpClient again = new(longer, disposeHandler: false); + using HttpRequestMessage allowed = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await again.SendAsync(allowed, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("landed", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(allowed, response.RequestMessage); + release.TrySetResult(); + (string first, string second, string? third, string landed) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("/a", first); + Assert.AreEqual("/b", second); + Assert.IsNull(third); + Assert.AreEqual("/c", landed); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2AllowAutoRedirectFalseReturnsTheRedirect() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2RedirectWithoutFollowingAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + handler.AllowAutoRedirect = false; + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/from") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(HttpStatusCode.Found, response.StatusCode); + Assert.IsTrue(response.Headers.Location?.OriginalString.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + bool followed = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.IsFalse(followed); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RedirectDoesNotCopyTheHostHeader() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2HostRedirectAsync(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/from") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + request.Headers.Host = "evil.example"; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string host = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, host); + Assert.AreEqual("127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture), host); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RedirectCopiesACookieHeaderOnlyWhenCookiesAreOff() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeHttp2CookieRedirectAsync(listener, certificate, release.Task, cancel.Token); + try + { + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/from"; + using TitaniumHttpHandler manual = Handler(); + manual.UseCookies = false; + using HttpClient manualClient = new(manual, disposeHandler: false); + using HttpRequestMessage manualRequest = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + manualRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + using HttpResponseMessage manualResponse = await manualClient.SendAsync(manualRequest, cancel.Token); + string copied = await manualResponse.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, manualResponse.StatusCode, copied); + Assert.AreEqual("sid=manual", copied); + Assert.AreEqual(2, manualResponse.Version.Major); + Assert.AreSame(manualRequest, manualResponse.RequestMessage); + + using TitaniumHttpHandler stored = Handler(); + stored.UseCookies = true; + using HttpClient storedClient = new(stored, disposeHandler: false); + using HttpRequestMessage storedRequest = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + storedRequest.Headers.TryAddWithoutValidation("Cookie", "sid=manual"); + using HttpResponseMessage storedResponse = await storedClient.SendAsync(storedRequest, cancel.Token); + string omitted = await storedResponse.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, storedResponse.StatusCode, omitted); + Assert.AreEqual("none", omitted); + Assert.AreEqual(2, storedResponse.Version.Major); + Assert.AreSame(storedRequest, storedResponse.RequestMessage); + release.TrySetResult(); + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RedirectDropsAuthorizationWhenTheHostChanges() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(string? Dropped, string? Landed, string? Kept, string? KeptHop)> server = + ServeHttp2AuthorizationRedirectAsync(listener, certificate, port, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture); + using HttpRequestMessage changed = new(HttpMethod.Get, address + "/drop") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + changed.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + using HttpResponseMessage dropped = await client.SendAsync(changed, cancel.Token); + Assert.AreEqual("absent", await dropped.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, dropped.Version.Major); + Assert.AreSame(changed, dropped.RequestMessage); + + using TitaniumHttpHandler again = Handler(); + using HttpClient keepClient = new(again, disposeHandler: false); + using HttpRequestMessage same = new(HttpMethod.Get, "https://localhost:" + port.ToString(CultureInfo.InvariantCulture) + "/keep") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + same.Headers.TryAddWithoutValidation("Authorization", "Bearer secret"); + using HttpResponseMessage kept = await keepClient.SendAsync(same, cancel.Token); + Assert.AreEqual("present", await kept.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, kept.Version.Major); + Assert.AreSame(same, kept.RequestMessage); + release.TrySetResult(); + (string? droppedAuthorization, string? landedAuthorization, string? keptAuthorization, string? keptHopAuthorization) = + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual("Bearer secret", droppedAuthorization); + Assert.IsNull(landedAuthorization); + Assert.AreEqual("Bearer secret", keptAuthorization); + Assert.AreEqual("Bearer secret", keptHopAuthorization); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2TemporaryRedirectKeepsThePostBody() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(SslApplicationProtocol Protocol, byte[] SecondHeaders, byte[] SecondBody)> server = + ServeHttp2TemporaryRedirectAsync(listener, certificate, port, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("followed", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (SslApplicationProtocol protocol, byte[] secondHeaders, byte[] secondBody) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, protocol); + Assert.AreEqual("POST", ReadHttp2Method(secondHeaders), Convert.ToHexString(secondHeaders)); + Assert.AreEqual("payload", System.Text.Encoding.ASCII.GetString(secondBody)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2SeeOtherKeepsHead() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(SslApplicationProtocol Protocol, byte[] FirstHeaders, byte[] SecondHeaders)> server = + ServeHttp2SeeOtherAsync(listener, certificate, port, release.Task, cancel.Token, emptyBody: true); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Head, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual(string.Empty, body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (SslApplicationProtocol protocol, byte[] firstHeaders, byte[] secondHeaders) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, protocol); + Assert.AreEqual("HEAD", ReadHttp2Method(firstHeaders), Convert.ToHexString(firstHeaders)); + Assert.AreEqual("HEAD", ReadHttp2Method(secondHeaders), Convert.ToHexString(secondHeaders)); + Assert.IsFalse(secondHeaders.Contains((byte)0x82), Convert.ToHexString(secondHeaders)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2SeeOtherTurnsPostIntoGet() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(SslApplicationProtocol Protocol, byte[] FirstHeaders, byte[] SecondHeaders)> server = + ServeHttp2SeeOtherAsync(listener, certificate, port, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Post, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = new StringContent("payload"), + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("followed", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + release.TrySetResult(); + (SslApplicationProtocol protocol, byte[] firstHeaders, byte[] secondHeaders) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, protocol); + Assert.IsTrue(firstHeaders.Contains((byte)0x83), Convert.ToHexString(firstHeaders)); + Assert.IsTrue(secondHeaders.Contains((byte)0x82), Convert.ToHexString(secondHeaders)); + Assert.IsFalse(secondHeaders.Contains((byte)0x83), Convert.ToHexString(secondHeaders)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2RedirectIsFollowedOnHttp2() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint!).Port; + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(SslApplicationProtocol Protocol, int FirstStream, int SecondStream)> server = + ServeHttp2RedirectAsync(listener, certificate, port, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("followed", body); + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + release.TrySetResult(); + (SslApplicationProtocol protocol, int firstStream, int secondStream) = await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, protocol); + Assert.AreNotEqual(firstStream, secondStream); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2TrailerIsReadable() + { + await AssertHttp2StatusIsReturned( + HttpMethod.Get, + HttpVersionPolicy.RequestVersionExact, + Http2Status200TrailerAndBody, + HttpStatusCode.OK, + "ok", + trailerName: "x-trace", + trailerValue: "done"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ResponseKeepsEveryValueOfARepeatedHeader() + { + await AssertHttp2StatusIsReturned( + HttpMethod.Get, + HttpVersionPolicy.RequestVersionExact, + Http2Status200RepeatedHeaderAndBody, + HttpStatusCode.OK, + "ok", + headerName: "x-trace", + headerValues: ["one", "two"]); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ResponseContentLengthIsReadable() + { + await AssertHttp2StatusIsReturned( + HttpMethod.Get, + HttpVersionPolicy.RequestVersionExact, + Http2Status200ContentLengthAndBody, + HttpStatusCode.OK, + "ok", + contentLength: 2); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ResponseContentTypeIsReadable() + { + await AssertHttp2StatusIsReturned( + HttpMethod.Get, + HttpVersionPolicy.RequestVersionExact, + Http2Status200ContentTypeAndBody, + HttpStatusCode.OK, + "ok", + contentMediaType: "text/plain"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ResponseHeaderIsReadable() + { + await AssertHttp2StatusIsReturned( + HttpMethod.Get, + HttpVersionPolicy.RequestVersionExact, + Http2Status200HeaderAndBody, + HttpStatusCode.OK, + "ok", + "x-trace", + "one"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ResponseBodyIsReturned() + { + await AssertHttp2StatusIsReturned(HttpMethod.Get, HttpVersionPolicy.RequestVersionExact, Http2Status200AndBody, HttpStatusCode.OK, "ok"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ServerErrorIsReturnedWithoutRetrying() + { + await AssertHttp2StatusIsReturned(HttpMethod.Get, HttpVersionPolicy.RequestVersionOrLower, Http2Status500, HttpStatusCode.InternalServerError); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2PostReturnsABadRequestWithoutRetrying() + { + await AssertHttp2StatusIsReturned(HttpMethod.Post, HttpVersionPolicy.RequestVersionOrLower, Http2Status400, HttpStatusCode.BadRequest); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ExactReturnsABadRequestWithoutRetrying() + { + await AssertHttp2StatusIsReturned(HttpMethod.Get, HttpVersionPolicy.RequestVersionExact, Http2Status400, HttpStatusCode.BadRequest); + } + + private static Task AssertHttp2StatusIsReturned(HttpMethod method, HttpVersionPolicy policy, byte[] statusFrame, HttpStatusCode status) => + AssertHttp2StatusIsReturned(method, policy, statusFrame, status, string.Empty); + + private static async Task AssertHttp2StatusIsReturned( + HttpMethod method, + HttpVersionPolicy policy, + byte[] statusFrame, + HttpStatusCode status, + string expectedBody, + string? headerName = null, + string? headerValue = null, + string[]? headerValues = null, + string? contentMediaType = null, + long? contentLength = null, + string? trailerName = null, + string? trailerValue = null) + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = ServeOneHttp2StatusAsync(listener, certificate, statusFrame, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(method, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = policy, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + Assert.AreEqual(status, response.StatusCode); + Assert.AreEqual(expectedBody, await response.Content.ReadAsStringAsync(cancel.Token)); + if (headerName is not null) + { + Assert.IsTrue(response.Headers.TryGetValues(headerName, out IEnumerable? values), headerName); + if (headerValues is not null) + { + CollectionAssert.AreEqual(headerValues, values!.ToArray()); + } + else + { + Assert.AreEqual(headerValue, values!.Single()); + } + } + + if (contentMediaType is not null) + { + Assert.AreEqual(contentMediaType, response.Content.Headers.ContentType?.MediaType); + } + + if (contentLength is not null) + { + Assert.AreEqual(contentLength, response.Content.Headers.ContentLength); + } + + if (trailerName is not null) + { + Assert.IsTrue(response.TrailingHeaders.TryGetValues(trailerName, out IEnumerable? trailers), trailerName); + Assert.AreEqual(trailerValue, trailers!.Single()); + } + + Assert.AreEqual(2, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + using CancellationTokenSource secondLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + secondLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool secondArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(secondLimit.Token); + secondArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(secondArrived); + release.TrySetResult(); + Assert.AreEqual(SslApplicationProtocol.Http2, await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token)); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2BadRequestIsRememberedAsHttp11() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task<(SslApplicationProtocol First, SslApplicationProtocol Second, SslApplicationProtocol Third, string RetryHeaders, string NextHeaders)> server = + ServeHttp2BadRequestThenTwoHttp11Async(listener, certificate, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/scheme"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("downgraded", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("again", await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(1, secondResponse.Version.Major); + (SslApplicationProtocol firstProtocol, SslApplicationProtocol secondProtocol, SslApplicationProtocol thirdProtocol, string retryHeaders, string nextHeaders) = + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, firstProtocol); + Assert.AreEqual(SslApplicationProtocol.Http11, secondProtocol); + Assert.AreEqual(SslApplicationProtocol.Http11, thirdProtocol); + Assert.IsTrue(retryHeaders.StartsWith("GET /scheme HTTP/1.1\r\n", StringComparison.Ordinal), retryHeaders); + Assert.IsTrue(nextHeaders.StartsWith("GET /scheme HTTP/1.1\r\n", StringComparison.Ordinal), nextHeaders); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2ExactStillTriesHttp2AfterTheAuthorityIsRemembered() + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + TaskCompletionSource release = new(TaskCreationOptions.RunContinuationsAsynchronously); + Task<(SslApplicationProtocol First, SslApplicationProtocol Second, SslApplicationProtocol Third, string RetryHeaders)> server = + ServeHttp2BadRequestThenHttp11ThenExactHttp2Async(listener, certificate, release.Task, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/scheme"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first, cancel.Token); + Assert.AreEqual("downgraded", await firstResponse.Content.ReadAsStringAsync(cancel.Token)); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second, cancel.Token); + Assert.AreEqual(HttpStatusCode.BadRequest, secondResponse.StatusCode); + Assert.AreEqual(string.Empty, await secondResponse.Content.ReadAsStringAsync(cancel.Token)); + Assert.AreEqual(2, secondResponse.Version.Major); + Assert.AreSame(second, secondResponse.RequestMessage); + release.TrySetResult(); + (SslApplicationProtocol firstProtocol, SslApplicationProtocol secondProtocol, SslApplicationProtocol thirdProtocol, string retryHeaders) = + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(SslApplicationProtocol.Http2, firstProtocol); + Assert.AreEqual(SslApplicationProtocol.Http11, secondProtocol); + Assert.AreEqual(SslApplicationProtocol.Http2, thirdProtocol); + Assert.IsTrue(retryHeaders.StartsWith("GET /scheme HTTP/1.1\r\n", StringComparison.Ordinal), retryHeaders); + using CancellationTokenSource extraLimit = CancellationTokenSource.CreateLinkedTokenSource(cancel.Token); + extraLimit.CancelAfter(TimeSpan.FromMilliseconds(300)); + bool extraArrived = false; + try + { + using TcpClient extra = await listener.AcceptTcpClientAsync(extraLimit.Token); + extraArrived = true; + } + catch (OperationCanceledException) when (!cancel.IsCancellationRequested) + { + } + + Assert.IsFalse(extraArrived); + } + finally + { + release.TrySetResult(); + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2TraceBadRequestIsRetriedOverHttp11() + { + await AssertHttp2StatusIsRetriedOverHttp11(HttpMethod.Trace, Http2Status400, "downgraded"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2OptionsBadRequestIsRetriedOverHttp11() + { + await AssertHttp2StatusIsRetriedOverHttp11(HttpMethod.Options, Http2Status400, "downgraded"); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2HeadBadRequestIsRetriedOverHttp11() + { + await AssertHttp2StatusIsRetriedOverHttp11(HttpMethod.Head, Http2Status400, string.Empty); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2MisdirectedRequestIsRetriedOverHttp11() + { + await AssertHttp2StatusIsRetriedOverHttp11(Http2Status421); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http2BadRequestIsRetriedOverHttp11() + { + await AssertHttp2StatusIsRetriedOverHttp11(Http2Status400); + } + + private static Task AssertHttp2StatusIsRetriedOverHttp11(byte[] statusFrame) => + AssertHttp2StatusIsRetriedOverHttp11(HttpMethod.Get, statusFrame, "downgraded"); + + private static async Task AssertHttp2StatusIsRetriedOverHttp11(HttpMethod method, byte[] statusFrame, string expectedBody) + { + using CancellationTokenSource cancel = new(TimeSpan.FromSeconds(20)); + TcpListener listener = new(IPAddress.Loopback, 0); + listener.Start(); + using X509Certificate2 certificate = CreateTlsServerCertificate(); + Task<(SslApplicationProtocol First, SslApplicationProtocol Second, string RequestHeaders, int? ErrorCode)> server = + ServeHttp2BadRequestThenHttp11Async(listener, certificate, statusFrame, cancel.Token); + try + { + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(method, "https://127.0.0.1:" + ((IPEndPoint)listener.LocalEndpoint!).Port.ToString(CultureInfo.InvariantCulture) + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage response = await client.SendAsync(request, cancel.Token); + string body = await response.Content.ReadAsStringAsync(cancel.Token); + (SslApplicationProtocol first, SslApplicationProtocol second, string headers, int? errorCode) = + await server.WaitAsync(TimeSpan.FromSeconds(5), cancel.Token); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual(expectedBody, body); + Assert.AreEqual(1, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual(SslApplicationProtocol.Http2, first); + Assert.AreEqual(SslApplicationProtocol.Http11, second); + Assert.IsTrue(headers.StartsWith(method.Method + " /scheme HTTP/1.1\r\n", StringComparison.Ordinal), headers); + if (errorCode is int code) + { + Assert.AreNotEqual(1, code); + } + } + finally + { + listener.Stop(); + await cancel.CancelAsync(); + try + { + await server.WaitAsync(TimeSpan.FromSeconds(2)); + } + catch (Exception ex) when (ex is OperationCanceledException or IOException or System.Security.Authentication.AuthenticationException) + { + } + } + } + + private static X509Certificate2 CreateTlsServerCertificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + CertificateRequest request = new("CN=127.0.0.1", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + private static async Task<(SslApplicationProtocol Protocol, byte[] SecondHeaders, byte[] SecondBody)> ServeHttp2TemporaryRedirectAsync( + TcpListener listener, + X509Certificate2 certificate, + int port, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + (int firstStream, _) = await ReadNextHttp2HeadersAsync(stream, ackSettings: true, cancellationToken); + await stream.WriteAsync(Http2Redirect(firstStream, port, '7'), cancellationToken); + await stream.FlushAsync(cancellationToken); + (int secondStream, byte[] secondHeaders) = await ReadNextHttp2HeadersAsync(stream, ackSettings: false, cancellationToken); + byte[] secondBody = await ReadHttp2DataUntilEndAsync(stream, cancellationToken); + await stream.WriteAsync(Http2Followed(secondStream), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (protocol, secondHeaders, secondBody); + } + + private static async Task ReadHttp2DataUntilEndAsync(Stream stream, CancellationToken cancellationToken) + { + using MemoryStream body = new(); + for (int i = 0; i < 20; i++) + { + (byte type, byte flags, _, byte[] payload) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (type == 0) + { + body.Write(payload); + } + + if (type is 0 or 1 && (flags & 0x1) != 0) + { + return body.ToArray(); + } + } + + throw new InvalidOperationException("The HTTP/2 request body did not arrive."); + } + + private static async Task ServeHttp2RedirectWithoutFollowingAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2RedirectTo(originId, "/land", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + using CancellationTokenSource extra = new(TimeSpan.FromMilliseconds(300)); + bool followed = false; + try + { + while (!followed) + { + (byte type, _, _, _) = await ReadHttp2FrameWithStreamAsync(origin, extra.Token); + followed = type == 1; + } + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + } + + await release.WaitAsync(cancellationToken); + return followed; + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2ClientCertificateAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + await stream.AuthenticateAsServerAsync( + new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ClientCertificateRequired = true, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + ApplicationProtocols = new List + { + SslApplicationProtocol.Http2, + SslApplicationProtocol.Http11, + }, + }, + cancellationToken); + string subject = stream.RemoteCertificate?.Subject ?? "none"; + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + (int streamId, _) = await ReadNextHttp2HeadersAsync(stream, ackSettings: true, cancellationToken); + await stream.WriteAsync(Http2Text(streamId, subject), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return subject; + } + + private static async Task ServeHttp2TargetHostAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + TaskCompletionSource serverName = new(TaskCreationOptions.RunContinuationsAsynchronously); + await stream.AuthenticateAsServerAsync( + new SslServerAuthenticationOptions + { + ServerCertificateSelectionCallback = (_, name) => + { + serverName.TrySetResult(name ?? string.Empty); + return certificate; + }, + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + ApplicationProtocols = new List + { + SslApplicationProtocol.Http2, + SslApplicationProtocol.Http11, + }, + }, + cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + (int streamId, _) = await ReadNextHttp2HeadersAsync(stream, ackSettings: true, cancellationToken); + await stream.WriteAsync(Http2Text(streamId, "ok"), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return await serverName.Task.WaitAsync(cancellationToken); + } + + private static async Task ServeHttp2GoAwayAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int streamId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + byte[] response = Http2Text(streamId, "ok"); + byte[] goAway = Http2GoAway(streamId); + byte[] both = new byte[response.Length + goAway.Length]; + response.CopyTo(both, 0); + goAway.CopyTo(both.AsSpan(response.Length)); + await origin.WriteAsync(both, cancellationToken); + await origin.FlushAsync(cancellationToken); + await ServeOneHttp2OkAsync(listener, certificate, clients, streams, cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2TwoConnectionsAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + await ServeOneHttp2OkAsync(listener, certificate, clients, streams, cancellationToken); + await ServeOneHttp2OkAsync(listener, certificate, clients, streams, cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeOneHttp2OkAsync( + TcpListener listener, + X509Certificate2 certificate, + List clients, + List streams, + CancellationToken cancellationToken) + { + (SslStream origin, int streamId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2Text(streamId, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + } + + private static async Task<(int FirstStream, int SecondStream)> ServeHttp2ReuseAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int firstStream, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2Text(firstStream, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + (int secondStream, _) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + await origin.WriteAsync(Http2Text(secondStream, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (firstStream, secondStream); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2TwoInFlightAsync( + TcpListener listener, + X509Certificate2 certificate, + TaskCompletionSource firstHeaders, + TaskCompletionSource<(int FirstStream, int SecondStream)> streamsSeen, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int firstStream, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + firstHeaders.TrySetResult(); + (int secondStream, _) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + streamsSeen.TrySetResult((firstStream, secondStream)); + await origin.WriteAsync(Http2Text(firstStream, "ok"), cancellationToken); + await origin.WriteAsync(Http2Text(secondStream, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + firstHeaders.TrySetResult(); + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2OneOkAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int streamId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2Text(streamId, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2WaitForHeadersAsync( + TcpListener listener, + X509Certificate2 certificate, + TaskCompletionSource arrived, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + _ = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + arrived.TrySetResult(); + await release.WaitAsync(cancellationToken); + } + finally + { + arrived.TrySetResult(); + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2OpenBodyAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int streamId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2Frame(1, 0x4, streamId, [0x88]), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2CookieAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int streamId, byte[] headers) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string? cookie = ReadHttp2HeaderValue(headers, "cookie"); + await origin.WriteAsync(Http2SetCookie(streamId), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return cookie; + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2GzipAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int streamId, byte[] headers) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string? acceptEncoding = ReadHttp2HeaderValue(headers, "accept-encoding"); + byte[] payload; + using (MemoryStream encoded = new()) + { + using (GZipStream gzip = new(encoded, CompressionLevel.Fastest, leaveOpen: true)) + { + gzip.Write("hello"u8); + } + + payload = encoded.ToArray(); + } + + await origin.WriteAsync(Http2Gzip(streamId, payload), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return acceptEncoding; + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task<(byte[] Headers, bool HeadersEnded, int DataFrames, int DataLength)> ServeHttp2EmptyPostAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + clients.Add(client); + SslStream stream = new(client.GetStream()); + streams.Add(stream); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + bool acked = false; + bool sawHeaders = false; + bool headersEnded = false; + int streamId = 0; + byte[] headers = []; + int dataFrames = 0; + int dataLength = 0; + bool streamEnded = false; + for (int i = 0; i < 20 && !streamEnded; i++) + { + (byte type, byte flags, int id, byte[] payload) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (!acked && type == 4) + { + await stream.WriteAsync(Http2ServerSettings, cancellationToken); + await stream.FlushAsync(cancellationToken); + acked = true; + } + + if (!sawHeaders && type == 1) + { + sawHeaders = true; + streamId = id; + headers = payload; + headersEnded = (flags & 0x1) != 0; + streamEnded = headersEnded; + } + else if (sawHeaders && type == 0) + { + dataFrames++; + dataLength += payload.Length; + streamEnded = (flags & 0x1) != 0; + } + } + + if (!sawHeaders) + { + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + await stream.WriteAsync(Http2Text(streamId, "ok"), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (headers, headersEnded, dataFrames, dataLength); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task<(byte[] Headers, byte[] Body)> ServeHttp2PostAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, byte[] headers) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + byte[] posted = await ReadHttp2DataUntilEndAsync(origin, cancellationToken); + await origin.WriteAsync(Http2Text(originId, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (headers, posted); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2CallerHeaderAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, byte[] headers) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2Text(originId, "ok"), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return headers; + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2QueryAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, byte[] headers) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string path = ReadHttp2HeaderValue(headers, ":path") ?? string.Empty; + await origin.WriteAsync(Http2Text(originId, path), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return path; + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task<(string First, string Second, string? Third, string Landed)> ServeHttp2RedirectLimitAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (string first, string second, string? third) = await ServeHttp2RedirectChainAsync(listener, certificate, clients, streams, expectThird: false, cancellationToken); + (_, _, string? landedPath) = await ServeHttp2RedirectChainAsync(listener, certificate, clients, streams, expectThird: true, cancellationToken); + await release.WaitAsync(cancellationToken); + return (first, second, third, landedPath ?? string.Empty); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task<(string First, string Second, string? Third)> ServeHttp2RedirectChainAsync( + TcpListener listener, + X509Certificate2 certificate, + List clients, + List streams, + bool expectThird, + CancellationToken cancellationToken) + { + (SslStream origin, int originId, byte[] firstHeaders) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string first = ReadHttp2HeaderValue(firstHeaders, ":path") ?? string.Empty; + await origin.WriteAsync(Http2RedirectTo(originId, "/b", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + (int secondId, byte[] secondHeaders) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + string second = ReadHttp2HeaderValue(secondHeaders, ":path") ?? string.Empty; + await origin.WriteAsync(Http2RedirectTo(secondId, "/c", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + if (!expectThird) + { + using CancellationTokenSource extra = new(TimeSpan.FromMilliseconds(300)); + string? third = null; + try + { + while (third is null) + { + (byte type, _, _, byte[] payload) = await ReadHttp2FrameWithStreamAsync(origin, extra.Token); + if (type == 1) + { + third = ReadHttp2HeaderValue(payload, ":path") ?? string.Empty; + } + } + } + catch (Exception ex) when (!cancellationToken.IsCancellationRequested && ex is OperationCanceledException or IOException) + { + } + + return (first, second, third); + } + + (int thirdId, byte[] thirdHeaders) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + string landed = ReadHttp2HeaderValue(thirdHeaders, ":path") ?? string.Empty; + await origin.WriteAsync(Http2Text(thirdId, "landed"), cancellationToken); + await origin.FlushAsync(cancellationToken); + return (first, second, landed); + } + + private static async Task ServeHttp2HostRedirectAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2RedirectTo(originId, "/land", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + (int hopId, byte[] hopHeaders) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + string authority = ReadHttp2HeaderValue(hopHeaders, ":authority") ?? "missing"; + await origin.WriteAsync(Http2Text(hopId, authority), cancellationToken); + await origin.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2CookieRedirectAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + await ServeHttp2CookieHopAsync(listener, certificate, clients, streams, cancellationToken); + await ServeHttp2CookieHopAsync(listener, certificate, clients, streams, cancellationToken); + await release.WaitAsync(cancellationToken); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task ServeHttp2CookieHopAsync( + TcpListener listener, + X509Certificate2 certificate, + List clients, + List streams, + CancellationToken cancellationToken) + { + (SslStream origin, int originId, _) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + await origin.WriteAsync(Http2RedirectTo(originId, "/land", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + (int hopId, byte[] hopHeaders) = await ReadNextHttp2HeadersAsync(origin, ackSettings: false, cancellationToken); + string? cookie = ReadHttp2HeaderValue(hopHeaders, "cookie"); + string body = string.IsNullOrEmpty(cookie) ? "none" : cookie; + await origin.WriteAsync(Http2Text(hopId, body), cancellationToken); + await origin.FlushAsync(cancellationToken); + } + + private static async Task<(string? Dropped, string? Landed, string? Kept, string? KeptHop)> ServeHttp2AuthorizationRedirectAsync( + TcpListener listener, + X509Certificate2 certificate, + int port, + Task release, + CancellationToken cancellationToken) + { + List clients = []; + List streams = []; + try + { + (SslStream origin, int originId, byte[] originHeaders) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string? dropped = ReadHttp2HeaderValue(originHeaders, "authorization"); + await origin.WriteAsync(Http2RedirectTo(originId, "https://localhost:" + port.ToString(CultureInfo.InvariantCulture) + "/next", '2'), cancellationToken); + await origin.FlushAsync(cancellationToken); + + (SslStream landedStream, int landedId, byte[] landedHeaders) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string? landed = ReadHttp2HeaderValue(landedHeaders, "authorization"); + await landedStream.WriteAsync(Http2Text(landedId, "absent"), cancellationToken); + await landedStream.FlushAsync(cancellationToken); + + (SslStream keptStream, int keptId, byte[] keptHeaders) = await AcceptHttp2Async(listener, certificate, clients, streams, cancellationToken); + string? kept = ReadHttp2HeaderValue(keptHeaders, "authorization"); + await keptStream.WriteAsync(Http2RedirectTo(keptId, "/see", '2'), cancellationToken); + await keptStream.FlushAsync(cancellationToken); + (int hopId, byte[] hopHeaders) = await ReadNextHttp2HeadersAsync(keptStream, ackSettings: false, cancellationToken); + string? keptHop = ReadHttp2HeaderValue(hopHeaders, "authorization"); + await keptStream.WriteAsync(Http2Text(hopId, "present"), cancellationToken); + await keptStream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (dropped, landed, kept, keptHop); + } + finally + { + foreach (SslStream stream in streams) + { + await stream.DisposeAsync(); + } + + foreach (TcpClient client in clients) + { + client.Dispose(); + } + } + } + + private static async Task<(SslStream Stream, int StreamId, byte[] Headers)> AcceptHttp2Async( + TcpListener listener, + X509Certificate2 certificate, + List clients, + List streams, + CancellationToken cancellationToken) + { + TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + clients.Add(client); + SslStream stream = new(client.GetStream()); + streams.Add(stream); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + (int streamId, byte[] headers) = await ReadNextHttp2HeadersAsync(stream, ackSettings: true, cancellationToken); + return (stream, streamId, headers); + } + + private static Task<(SslApplicationProtocol Protocol, byte[] FirstHeaders, byte[] SecondHeaders)> ServeHttp2SeeOtherAsync( + TcpListener listener, + X509Certificate2 certificate, + int port, + Task release, + CancellationToken cancellationToken) => + ServeHttp2SeeOtherAsync(listener, certificate, port, release, cancellationToken, emptyBody: false); + + private static async Task<(SslApplicationProtocol Protocol, byte[] FirstHeaders, byte[] SecondHeaders)> ServeHttp2SeeOtherAsync( + TcpListener listener, + X509Certificate2 certificate, + int port, + Task release, + CancellationToken cancellationToken, + bool emptyBody) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + (int firstStream, byte[] firstHeaders) = await ReadNextHttp2HeadersAsync(stream, ackSettings: true, cancellationToken); + await stream.WriteAsync(Http2SeeOther(firstStream, port), cancellationToken); + await stream.FlushAsync(cancellationToken); + (int secondStream, byte[] secondHeaders) = await ReadNextHttp2HeadersAsync(stream, ackSettings: false, cancellationToken); + await stream.WriteAsync(emptyBody ? Http2EmptyOk(secondStream) : Http2Followed(secondStream), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (protocol, firstHeaders, secondHeaders); + } + + private static async Task<(int StreamId, byte[] Headers)> ReadNextHttp2HeadersAsync( + Stream stream, + bool ackSettings, + CancellationToken cancellationToken) + { + bool acked = !ackSettings; + for (int i = 0; i < 20; i++) + { + (byte type, _, int streamId, byte[] payload) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (!acked && type == 4) + { + await stream.WriteAsync(Http2ServerSettings, cancellationToken); + await stream.FlushAsync(cancellationToken); + acked = true; + } + + if (type == 1) + { + return (streamId, payload); + } + } + + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + private static byte[] Http2SeeOther(int streamId, int port) => Http2Redirect(streamId, port, '3'); + + private static async Task<(SslApplicationProtocol Protocol, int FirstStream, int SecondStream)> ServeHttp2RedirectAsync( + TcpListener listener, + X509Certificate2 certificate, + int port, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + bool acked = false; + int firstStream = 0; + bool sawHeaders = false; + for (int i = 0; i < 20 && !sawHeaders; i++) + { + (byte type, _, int streamId, _) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (!acked && type == 4) + { + await stream.WriteAsync(Http2ServerSettings, cancellationToken); + await stream.FlushAsync(cancellationToken); + acked = true; + } + + if (type == 1) + { + firstStream = streamId; + sawHeaders = true; + } + } + + if (!sawHeaders) + { + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + await stream.WriteAsync(Http2Redirect(firstStream, port), cancellationToken); + await stream.FlushAsync(cancellationToken); + int secondStream = 0; + sawHeaders = false; + for (int i = 0; i < 20 && !sawHeaders; i++) + { + (byte type, _, int streamId, _) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (type == 1) + { + secondStream = streamId; + sawHeaders = true; + } + } + + if (!sawHeaders) + { + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + await stream.WriteAsync(Http2Followed(secondStream), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (protocol, firstStream, secondStream); + } + + private static byte[] Http2Redirect(int streamId, int port, char units = '2') => + Http2RedirectTo(streamId, "https://127.0.0.1:" + port.ToString(CultureInfo.InvariantCulture) + "/next", units); + + private static byte[] Http2RedirectTo(int streamId, string location, char units) + { + byte[] url = System.Text.Encoding.ASCII.GetBytes(location); + byte[] payload = new byte[5 + 2 + 8 + 1 + url.Length]; + payload[0] = 0x08; + payload[1] = 0x03; + payload[2] = (byte)'3'; + payload[3] = (byte)'0'; + payload[4] = (byte)units; + payload[5] = 0x00; + payload[6] = 8; + "location"u8.CopyTo(payload.AsSpan(7)); + payload[15] = (byte)url.Length; + url.CopyTo(payload.AsSpan(16)); + return Http2Frame(1, 0x5, streamId, payload); + } + + private static byte[] Http2Text(int streamId, string text) + { + byte[] headers = Http2Frame(1, 0x4, streamId, [0x88]); + byte[] data = Http2Frame(0, 0x1, streamId, System.Text.Encoding.ASCII.GetBytes(text)); + byte[] response = new byte[headers.Length + data.Length]; + headers.CopyTo(response, 0); + data.CopyTo(response.AsSpan(headers.Length)); + return response; + } + + private static byte[] Http2SetCookie(int streamId) + { + byte[] value = "next=two"u8.ToArray(); + byte[] headerBlock = new byte[4 + value.Length]; + headerBlock[0] = 0x88; + headerBlock[1] = 0x0F; + headerBlock[2] = 0x28; + headerBlock[3] = (byte)value.Length; + value.CopyTo(headerBlock.AsSpan(4)); + byte[] headers = Http2Frame(1, 0x4, streamId, headerBlock); + byte[] data = Http2Frame(0, 0x1, streamId, "ok"u8.ToArray()); + byte[] response = new byte[headers.Length + data.Length]; + headers.CopyTo(response, 0); + data.CopyTo(response.AsSpan(headers.Length)); + return response; + } + + private static byte[] Http2GoAway(int lastStreamId) + { + byte[] payload = new byte[8]; + payload[0] = (byte)((lastStreamId >> 24) & 0x7F); + payload[1] = (byte)((lastStreamId >> 16) & 0xFF); + payload[2] = (byte)((lastStreamId >> 8) & 0xFF); + payload[3] = (byte)(lastStreamId & 0xFF); + return Http2Frame(7, 0, 0, payload); + } + + private static byte[] Http2Gzip(int streamId, byte[] payload) + { + byte[] headerBlock = + [ + 0x88, + 0x0F, 0x10, + 0x0A, (byte)'t', (byte)'e', (byte)'x', (byte)'t', (byte)'/', (byte)'p', (byte)'l', (byte)'a', (byte)'i', (byte)'n', + 0x0F, 0x0B, + 0x04, (byte)'g', (byte)'z', (byte)'i', (byte)'p', + ]; + byte[] headers = Http2Frame(1, 0x4, streamId, headerBlock); + byte[] data = Http2Frame(0, 0x1, streamId, payload); + byte[] response = new byte[headers.Length + data.Length]; + headers.CopyTo(response, 0); + data.CopyTo(response.AsSpan(headers.Length)); + return response; + } + + private static byte[] Http2EmptyOk(int streamId) => Http2Frame(1, 0x5, streamId, [0x88]); + + private static string ReadHttp2Method(byte[] block) + { + List<(string Name, string Value)> dynamic = []; + int i = 0; + string? method = null; + while (i < block.Length) + { + byte first = block[i]; + if ((first & 0x80) != 0) + { + int index = ReadHpackInt(block, ref i, 7); + (string name, string value) = LookupHpack(index, dynamic); + if (name == ":method") + { + method = value; + } + } + else if ((first & 0x40) != 0) + { + (string name, string value) = ReadHpackLiteral(block, ref i, 6, dynamic); + dynamic.Insert(0, (name, value)); + if (name == ":method") + { + method = value; + } + } + else if ((first & 0x20) != 0) + { + _ = ReadHpackInt(block, ref i, 5); + } + else + { + (string name, string value) = ReadHpackLiteral(block, ref i, 4, dynamic); + if (name == ":method") + { + method = value; + } + } + } + + return method ?? string.Empty; + } + + private static string? ReadHttp2HeaderValue(byte[] block, string headerName) + { + List values = ReadHttp2HeaderValues(block, headerName); + return values.Count == 0 ? null : values[^1]; + } + + private static List ReadHttp2HeaderValues(byte[] block, string headerName) + { + List<(string Name, string Value)> dynamic = []; + List found = []; + int i = 0; + while (i < block.Length) + { + byte first = block[i]; + string name; + string value; + if ((first & 0x80) != 0) + { + int index = ReadHpackInt(block, ref i, 7); + (name, value) = LookupHpack(index, dynamic); + } + else if ((first & 0x40) != 0) + { + (name, value) = ReadHpackLiteral(block, ref i, 6, dynamic); + dynamic.Insert(0, (name, value)); + } + else if ((first & 0x20) != 0) + { + _ = ReadHpackInt(block, ref i, 5); + continue; + } + else + { + (name, value) = ReadHpackLiteral(block, ref i, 4, dynamic); + } + + if (name.Equals(headerName, StringComparison.OrdinalIgnoreCase)) + { + found.Add(value); + } + } + + return found; + } + + private static (string Name, string Value) ReadHpackLiteral(byte[] block, ref int i, int prefixBits, List<(string Name, string Value)> dynamic) + { + int index = ReadHpackInt(block, ref i, prefixBits); + string name = index == 0 ? ReadHpackString(block, ref i) : LookupHpack(index, dynamic).Name; + string value = ReadHpackString(block, ref i); + return (name, value); + } + + private static (string Name, string Value) LookupHpack(int index, List<(string Name, string Value)> dynamic) + { + if (index == 1) + { + return (":authority", string.Empty); + } + + if (index == 2) + { + return (":method", "GET"); + } + + if (index == 3) + { + return (":method", "POST"); + } + + if (index == 4) + { + return (":path", "/"); + } + + if (index == 6) + { + return (":scheme", "http"); + } + + if (index == 7) + { + return (":scheme", "https"); + } + + if (index == 16) + { + return ("accept-encoding", string.Empty); + } + + if (index == 23) + { + return ("authorization", string.Empty); + } + + if (index == 31) + { + return ("content-type", string.Empty); + } + + if (index == 32) + { + return ("cookie", string.Empty); + } + + if (index >= 62 && index - 62 < dynamic.Count) + { + return dynamic[index - 62]; + } + + return ("#" + index.ToString(CultureInfo.InvariantCulture), string.Empty); + } + + private static string ReadHpackString(byte[] block, ref int i) + { + bool huffman = (block[i] & 0x80) != 0; + int length = ReadHpackInt(block, ref i, 7); + if (i + length > block.Length) + { + throw new IOException("The HTTP/2 header string is truncated."); + } + + string value = huffman + ? "huffman:" + Convert.ToHexString(block.AsSpan(i, length)) + : System.Text.Encoding.ASCII.GetString(block, i, length); + i += length; + return value; + } + + private static int ReadHpackInt(byte[] block, ref int i, int prefixBits) + { + int mask = (1 << prefixBits) - 1; + int value = block[i] & mask; + i++; + if (value < mask) + { + return value; + } + + int shift = 0; + while (i < block.Length) + { + byte next = block[i++]; + value += (next & 0x7F) << shift; + if ((next & 0x80) == 0) + { + return value; + } + + shift += 7; + } + + throw new IOException("The HTTP/2 header integer is truncated."); + } + + private static byte[] Http2Followed(int streamId) + { + byte[] headers = Http2Frame(1, 0x4, streamId, [0x88]); + byte[] data = Http2Frame(0, 0x1, streamId, "followed"u8.ToArray()); + byte[] response = new byte[headers.Length + data.Length]; + headers.CopyTo(response, 0); + data.CopyTo(response.AsSpan(headers.Length)); + return response; + } + + private static byte[] Http2Frame(byte type, byte flags, int streamId, byte[] payload) + { + byte[] frame = new byte[9 + payload.Length]; + frame[0] = (byte)((payload.Length >> 16) & 0xFF); + frame[1] = (byte)((payload.Length >> 8) & 0xFF); + frame[2] = (byte)(payload.Length & 0xFF); + frame[3] = type; + frame[4] = flags; + frame[5] = (byte)((streamId >> 24) & 0x7F); + frame[6] = (byte)((streamId >> 16) & 0xFF); + frame[7] = (byte)((streamId >> 8) & 0xFF); + frame[8] = (byte)(streamId & 0xFF); + payload.CopyTo(frame.AsSpan(9)); + return frame; + } + + private static async Task<(byte Type, byte Flags, int StreamId, byte[] Payload)> ReadHttp2FrameWithStreamAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] header = new byte[9]; + await ReadExactAsync(stream, header, cancellationToken); + int length = (header[0] << 16) | (header[1] << 8) | header[2]; + if (length is < 0 or > 16384) + { + throw new IOException("The HTTP/2 frame is too long."); + } + + byte[] payload = length == 0 ? [] : new byte[length]; + if (length > 0) + { + await ReadExactAsync(stream, payload, cancellationToken); + } + + int streamId = ((header[5] & 0x7F) << 24) | (header[6] << 16) | (header[7] << 8) | header[8]; + return (header[3], header[4], streamId, payload); + } + + private static async Task ServeHttp2HashAsync( + TcpListener listener, + X509Certificate2 certificate, + byte[] download, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + await stream.WriteAsync(Http2Frame(4, 0, 0, [0x00, 0x04, 0x01, 0x00, 0x00, 0x00]), cancellationToken); + await stream.WriteAsync(Http2Frame(8, 0, 0, [0x00, 0xFF, 0x00, 0x01]), cancellationToken); + await stream.FlushAsync(cancellationToken); + using IncrementalHash received = IncrementalHash.CreateHash(HashAlgorithmName.SHA256); + int streamId = 0; + bool headersSeen = false; + bool endStream = false; + int connectionWindow = 65535; + int streamWindow = 65535; + int initialWindow = 65535; + for (int i = 0; i < 256 && !endStream; i++) + { + (byte type, byte flags, int id, byte[] payload) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (type == 4 && (flags & 0x1) == 0) + { + ApplyHttp2Settings(payload, ref streamWindow, ref initialWindow); + await stream.WriteAsync(Http2Frame(4, 0x1, 0, []), cancellationToken); + await stream.FlushAsync(cancellationToken); + } + else if (type == 6 && (flags & 0x1) == 0) + { + await stream.WriteAsync(Http2Frame(6, 0x1, 0, payload), cancellationToken); + await stream.FlushAsync(cancellationToken); + } + else if (type == 8) + { + ApplyHttp2WindowUpdate(payload, id, streamId, ref connectionWindow, ref streamWindow); + } + else if (type == 1) + { + headersSeen = true; + streamId = id; + endStream = (flags & 0x1) != 0; + } + else if (headersSeen && type == 0 && id == streamId) + { + received.AppendData(payload); + endStream = (flags & 0x1) != 0; + } + } + + if (!headersSeen || !endStream) + { + throw new InvalidOperationException("The HTTP/2 request body did not finish."); + } + + string hash = Convert.ToHexString(received.GetHashAndReset()); + await stream.WriteAsync(Http2Frame(1, 0x4, streamId, EncodeHttp2StatusAndHash(hash)), cancellationToken); + await stream.FlushAsync(cancellationToken); + int offset = 0; + while (offset < download.Length) + { + while (connectionWindow == 0 || streamWindow == 0) + { + (byte type, byte flags, int id, byte[] payload) = await ReadHttp2FrameWithStreamAsync(stream, cancellationToken); + if (type == 8) + { + ApplyHttp2WindowUpdate(payload, id, streamId, ref connectionWindow, ref streamWindow); + } + else if (type == 6 && (flags & 0x1) == 0) + { + await stream.WriteAsync(Http2Frame(6, 0x1, 0, payload), cancellationToken); + await stream.FlushAsync(cancellationToken); + } + } + + int count = Math.Min(download.Length - offset, Math.Min(16384, Math.Min(connectionWindow, streamWindow))); + bool last = offset + count == download.Length; + await stream.WriteAsync(Http2Frame(0, last ? (byte)1 : (byte)0, streamId, download.AsSpan(offset, count).ToArray()), cancellationToken); + connectionWindow -= count; + streamWindow -= count; + offset += count; + } + + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return hash; + } + + private static void ApplyHttp2Settings(byte[] payload, ref int streamWindow, ref int initialWindow) + { + for (int i = 0; i + 6 <= payload.Length; i += 6) + { + int id = (payload[i] << 8) | payload[i + 1]; + if (id != 4) + { + continue; + } + + int value = (payload[i + 2] << 24) | (payload[i + 3] << 16) | (payload[i + 4] << 8) | payload[i + 5]; + streamWindow += value - initialWindow; + initialWindow = value; + } + } + + private static void ApplyHttp2WindowUpdate(byte[] payload, int id, int streamId, ref int connectionWindow, ref int streamWindow) + { + if (payload.Length < 4) + { + return; + } + + int increment = ((payload[0] & 0x7F) << 24) | (payload[1] << 16) | (payload[2] << 8) | payload[3]; + if (id == 0) + { + connectionWindow += increment; + } + else if (streamId == 0 || id == streamId) + { + streamWindow += increment; + } + } + + private static byte[] EncodeHttp2StatusAndHash(string hash) + { + byte[] name = "x-upload-sha256"u8.ToArray(); + byte[] value = System.Text.Encoding.ASCII.GetBytes(hash); + byte[] block = new byte[3 + name.Length + 1 + value.Length]; + block[0] = 0x88; + block[1] = 0x40; + block[2] = (byte)name.Length; + name.CopyTo(block.AsSpan(3)); + block[3 + name.Length] = (byte)value.Length; + value.CopyTo(block.AsSpan(4 + name.Length)); + return block; + } + + private static async Task ServeHttp2EchoAsync( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + string posted = await ReadHttp2RequestBodyAsync(stream, cancellationToken); + await stream.WriteAsync(Http2EchoResponse(posted), cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return protocol; + } + + private static async Task ServeOneHttp2StatusAsync( + TcpListener listener, + X509Certificate2 certificate, + byte[] statusFrame, + Task release, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + await ReadHttp2UntilHeadersAsync(stream, cancellationToken); + await stream.WriteAsync(statusFrame, cancellationToken); + await stream.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return protocol; + } + + private static async Task<(SslApplicationProtocol First, SslApplicationProtocol Second, string RequestHeaders, int? ErrorCode)> ServeHttp2BadRequestThenHttp11Async( + TcpListener listener, + X509Certificate2 certificate, + byte[] statusFrame, + CancellationToken cancellationToken) + { + using TcpClient firstClient = await listener.AcceptTcpClientAsync(cancellationToken); + firstClient.NoDelay = true; + await using SslStream first = new(firstClient.GetStream()); + SslApplicationProtocol firstProtocol = await AuthenticateServerAsync(first, certificate, cancellationToken); + await ReadHttp2UntilHeadersAsync(first, cancellationToken); + await first.WriteAsync(statusFrame, cancellationToken); + await first.FlushAsync(cancellationToken); + Task trailing = ReadHttp2ErrorCodeAsync(first, cancellationToken); + (SslApplicationProtocol secondProtocol, string requestHeaders) = await ServeHttp11Async(listener, certificate, cancellationToken); + return (firstProtocol, secondProtocol, requestHeaders, await trailing); + } + + private static async Task<(SslApplicationProtocol First, SslApplicationProtocol Second, SslApplicationProtocol Third, string RetryHeaders)> ServeHttp2BadRequestThenHttp11ThenExactHttp2Async( + TcpListener listener, + X509Certificate2 certificate, + Task release, + CancellationToken cancellationToken) + { + using TcpClient firstClient = await listener.AcceptTcpClientAsync(cancellationToken); + firstClient.NoDelay = true; + SslStream first = new(firstClient.GetStream()); + SslApplicationProtocol firstProtocol; + SslApplicationProtocol secondProtocol; + string retryHeaders; + try + { + firstProtocol = await AuthenticateServerAsync(first, certificate, cancellationToken); + await ReadHttp2UntilHeadersAsync(first, cancellationToken); + await first.WriteAsync(Http2Status400, cancellationToken); + await first.FlushAsync(cancellationToken); + (secondProtocol, retryHeaders) = await ServeHttp11Async(listener, certificate, "downgraded", cancellationToken); + } + finally + { + await first.DisposeAsync(); + } + + using TcpClient thirdClient = await listener.AcceptTcpClientAsync(cancellationToken); + thirdClient.NoDelay = true; + await using SslStream third = new(thirdClient.GetStream()); + SslApplicationProtocol thirdProtocol = await AuthenticateServerAsync(third, certificate, cancellationToken); + await ReadHttp2UntilHeadersAsync(third, cancellationToken); + await third.WriteAsync(Http2Status400, cancellationToken); + await third.FlushAsync(cancellationToken); + await release.WaitAsync(cancellationToken); + return (firstProtocol, secondProtocol, thirdProtocol, retryHeaders); + } + + private static async Task<(SslApplicationProtocol First, SslApplicationProtocol Second, SslApplicationProtocol Third, string RetryHeaders, string NextHeaders)> ServeHttp2BadRequestThenTwoHttp11Async( + TcpListener listener, + X509Certificate2 certificate, + CancellationToken cancellationToken) + { + using TcpClient firstClient = await listener.AcceptTcpClientAsync(cancellationToken); + firstClient.NoDelay = true; + await using SslStream first = new(firstClient.GetStream()); + SslApplicationProtocol firstProtocol = await AuthenticateServerAsync(first, certificate, cancellationToken); + await ReadHttp2UntilHeadersAsync(first, cancellationToken); + await first.WriteAsync(Http2Status400, cancellationToken); + await first.FlushAsync(cancellationToken); + (SslApplicationProtocol secondProtocol, string retryHeaders) = await ServeHttp11Async(listener, certificate, "downgraded", cancellationToken); + (SslApplicationProtocol thirdProtocol, string nextHeaders) = await ServeHttp11Async(listener, certificate, "again", cancellationToken); + return (firstProtocol, secondProtocol, thirdProtocol, retryHeaders, nextHeaders); + } + + private static Task<(SslApplicationProtocol Protocol, string RequestHeaders)> ServeHttp11Async( + TcpListener listener, + X509Certificate2 certificate, + CancellationToken cancellationToken) => + ServeHttp11Async(listener, certificate, "downgraded", cancellationToken); + + private static async Task<(SslApplicationProtocol Protocol, string RequestHeaders)> ServeHttp11Async( + TcpListener listener, + X509Certificate2 certificate, + string body, + CancellationToken cancellationToken) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + SslApplicationProtocol protocol = await AuthenticateServerAsync(stream, certificate, cancellationToken); + string headers = await ReadHeaderTextAsync(stream, cancellationToken); + string response = "HTTP/1.1 200 OK\r\nContent-Length: " + + body.Length.ToString(CultureInfo.InvariantCulture) + + "\r\nConnection: close\r\n\r\n" + + body; + await stream.WriteAsync(System.Text.Encoding.ASCII.GetBytes(response), cancellationToken); + await stream.FlushAsync(cancellationToken); + return (protocol, headers); + } + + private static async Task AuthenticateServerAsync( + SslStream stream, + X509Certificate2 certificate, + CancellationToken cancellationToken) + { + await stream.AuthenticateAsServerAsync( + new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + ApplicationProtocols = new List + { + SslApplicationProtocol.Http2, + SslApplicationProtocol.Http11, + }, + }, + cancellationToken); + return stream.NegotiatedApplicationProtocol; + } + + private static async Task ReadHttp2UntilHeadersAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + bool acked = false; + for (int i = 0; i < 20; i++) + { + (byte type, _, _) = await ReadHttp2FrameAsync(stream, cancellationToken); + if (!acked && type == 4) + { + await stream.WriteAsync(Http2ServerSettings, cancellationToken); + await stream.FlushAsync(cancellationToken); + acked = true; + } + + if (type == 1) + { + return; + } + } + + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + private static async Task ReadHttp2ErrorCodeAsync(Stream stream, CancellationToken cancellationToken) + { + using CancellationTokenSource limit = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); + limit.CancelAfter(TimeSpan.FromSeconds(2)); + try + { + (byte type, _, byte[] payload) = await ReadHttp2FrameAsync(stream, limit.Token); + if (type is not (0x3 or 0x7)) + { + return null; + } + + int offset = type == 0x7 ? 4 : 0; + if (payload.Length < offset + 4) + { + return null; + } + + return (payload[offset] << 24) | (payload[offset + 1] << 16) | (payload[offset + 2] << 8) | payload[offset + 3]; + } + catch (OperationCanceledException) when (!cancellationToken.IsCancellationRequested) + { + return null; + } + catch (IOException) + { + return null; + } + } + + private static async Task<(byte Type, byte Flags, byte[] Payload)> ReadHttp2FrameAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] header = new byte[9]; + await ReadExactAsync(stream, header, cancellationToken); + int length = (header[0] << 16) | (header[1] << 8) | header[2]; + if (length is < 0 or > 16384) + { + throw new IOException("The HTTP/2 frame is too long."); + } + + byte[] payload = length == 0 ? [] : new byte[length]; + if (length > 0) + { + await ReadExactAsync(stream, payload, cancellationToken); + } + + return (header[3], header[4], payload); + } + + private static async Task ReadHttp2RequestBodyAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] preface = new byte[24]; + await ReadExactAsync(stream, preface, cancellationToken); + bool acked = false; + bool headersSeen = false; + bool endStream = false; + using MemoryStream body = new(); + for (int i = 0; i < 20 && !endStream; i++) + { + (byte type, byte flags, byte[] payload) = await ReadHttp2FrameAsync(stream, cancellationToken); + if (!acked && type == 4) + { + await stream.WriteAsync(Http2ServerSettings, cancellationToken); + await stream.FlushAsync(cancellationToken); + acked = true; + } + + if (type == 1) + { + headersSeen = true; + endStream = (flags & 0x1) != 0; + } + else if (headersSeen && type == 0) + { + body.Write(payload); + endStream = (flags & 0x1) != 0; + } + } + + if (!headersSeen) + { + throw new InvalidOperationException("The HTTP/2 request headers did not arrive."); + } + + return System.Text.Encoding.ASCII.GetString(body.ToArray()); + } + + private static byte[] Http2EchoResponse(string body) + { + byte[] data = System.Text.Encoding.ASCII.GetBytes(body); + byte[] response = new byte[19 + data.Length]; + response[2] = 1; + response[3] = 1; + response[4] = 0x4; + response[8] = 1; + response[9] = 0x88; + response[10] = (byte)((data.Length >> 16) & 0xFF); + response[11] = (byte)((data.Length >> 8) & 0xFF); + response[12] = (byte)(data.Length & 0xFF); + response[14] = 0x1; + response[18] = 1; + data.CopyTo(response.AsSpan(19)); + return response; + } + + private static async Task ReadExactAsync(Stream stream, Memory buffer, CancellationToken cancellationToken) + { + int read = 0; + while (read < buffer.Length) + { + int count = await stream.ReadAsync(buffer[read..], cancellationToken); + if (count == 0) + { + throw new IOException("The connection closed early."); + } + + read += count; + } + } + + private static async Task ReadHeaderTextAsync(Stream stream, CancellationToken cancellationToken) + { + byte[] buffer = new byte[1024]; + int length = 0; + while (length < buffer.Length) + { + int read = await stream.ReadAsync(buffer.AsMemory(length, 1), cancellationToken); + if (read == 0) + { + break; + } + + length++; + if (length >= 4 + && buffer[length - 4] == (byte)'\r' + && buffer[length - 3] == (byte)'\n' + && buffer[length - 2] == (byte)'\r' + && buffer[length - 1] == (byte)'\n') + { + return System.Text.Encoding.ASCII.GetString(buffer, 0, length); + } + } + + throw new IOException("The HTTP/1.1 request headers did not arrive."); + } + + private static readonly byte[] Http2ServerSettings = [0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 0]; + + private static readonly byte[] Http2Status400 = [0, 0, 1, 1, 5, 0, 0, 0, 1, 0x8C]; + + private static readonly byte[] Http2Status500 = [0, 0, 1, 1, 5, 0, 0, 0, 1, 0x8E]; + + private static readonly byte[] Http2Status200AndBody = + [ + 0, 0, 1, 1, 0x4, 0, 0, 0, 1, 0x88, + 0, 0, 2, 0, 0x1, 0, 0, 0, 1, (byte)'o', (byte)'k', + ]; + + private static readonly byte[] Http2Status200HeaderAndBody = + [ + 0, 0, 14, 1, 0x4, 0, 0, 0, 1, + 0x88, + 0x00, 0x07, (byte)'x', (byte)'-', (byte)'t', (byte)'r', (byte)'a', (byte)'c', (byte)'e', + 0x03, (byte)'o', (byte)'n', (byte)'e', + 0, 0, 2, 0, 0x1, 0, 0, 0, 1, (byte)'o', (byte)'k', + ]; + + private static readonly byte[] Http2Status200ContentTypeAndBody = + [ + 0, 0, 14, 1, 0x4, 0, 0, 0, 1, + 0x88, + 0x0F, 0x10, + 0x0A, (byte)'t', (byte)'e', (byte)'x', (byte)'t', (byte)'/', (byte)'p', (byte)'l', (byte)'a', (byte)'i', (byte)'n', + 0, 0, 2, 0, 0x1, 0, 0, 0, 1, (byte)'o', (byte)'k', + ]; + + private static readonly byte[] Http2Status200ContentLengthAndBody = + [ + 0, 0, 5, 1, 0x4, 0, 0, 0, 1, + 0x88, + 0x0F, 0x0D, + 0x01, (byte)'2', + 0, 0, 2, 0, 0x1, 0, 0, 0, 1, (byte)'o', (byte)'k', + ]; + + private static readonly byte[] Http2Status200RepeatedHeaderAndBody = + [ + 0, 0, 27, 1, 0x4, 0, 0, 0, 1, + 0x88, + 0x00, 0x07, (byte)'x', (byte)'-', (byte)'t', (byte)'r', (byte)'a', (byte)'c', (byte)'e', + 0x03, (byte)'o', (byte)'n', (byte)'e', + 0x00, 0x07, (byte)'x', (byte)'-', (byte)'t', (byte)'r', (byte)'a', (byte)'c', (byte)'e', + 0x03, (byte)'t', (byte)'w', (byte)'o', + 0, 0, 2, 0, 0x1, 0, 0, 0, 1, (byte)'o', (byte)'k', + ]; + + private static readonly byte[] Http2Status200TrailerAndBody = + [ + 0, 0, 1, 1, 0x4, 0, 0, 0, 1, 0x88, + 0, 0, 2, 0, 0, 0, 0, 0, 1, (byte)'o', (byte)'k', + 0, 0, 14, 1, 0x5, 0, 0, 0, 1, + 0x00, 0x07, (byte)'x', (byte)'-', (byte)'t', (byte)'r', (byte)'a', (byte)'c', (byte)'e', + 0x04, (byte)'d', (byte)'o', (byte)'n', (byte)'e', + ]; + + private static readonly byte[] Http2Status421 = [0, 0, 5, 1, 5, 0, 0, 0, 1, 0x08, 0x03, 0x34, 0x32, 0x31]; + + [TestMethod] + [Timeout(60000)] + public async Task Http2OrLowerRetriesWhenTheServerRejectsTheScheme() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/scheme", (HttpRequest request) => + request.Protocol == "HTTP/2" + ? Results.StatusCode(StatusCodes.Status421MisdirectedRequest) + : Results.Text("downgraded")); + }); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + using HttpRequestMessage request = new(HttpMethod.Get, "https://localhost:" + server.Port.ToString() + "/scheme") + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("downgraded", body); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http11IsRememberedAfterTheServerSelectsIt() + { + int connections = 0; + await using LoopbackServer server = await LoopbackServer.StartAsync( + static app => app.MapGet("/scheme", () => Results.Text("http11")), + () => Interlocked.Increment(ref connections)); + using TitaniumHttpHandler handler = Handler(); + using HttpClient client = new(handler, disposeHandler: false); + string address = "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/scheme"; + using HttpRequestMessage first = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage firstResponse = await client.SendAsync(first); + Assert.AreEqual("http11", await firstResponse.Content.ReadAsStringAsync()); + using HttpRequestMessage second = new(HttpMethod.Get, address) + { + Version = HttpVersion.Version20, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + using HttpResponseMessage secondResponse = await client.SendAsync(second); + Assert.AreEqual(HttpStatusCode.OK, secondResponse.StatusCode); + Assert.AreEqual("http11", await secondResponse.Content.ReadAsStringAsync()); + Assert.AreEqual(2, connections); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3OrLowerFallsBackWhenTheHandshakeFails() + { + await using LoopbackServer server = await LoopbackServer.StartAsync(static app => + { + app.MapGet("/down", () => Results.Text("http11")); + }); + using TitaniumHttpHandler handler = Handler(); + handler.ConnectTimeout = TimeSpan.FromMilliseconds(400); + using HttpClient client = new(handler, disposeHandler: false) { Timeout = TimeSpan.FromSeconds(20) }; + using HttpRequestMessage request = new(HttpMethod.Get, "https://127.0.0.1:" + server.Port.ToString(CultureInfo.InvariantCulture) + "/down") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionOrLower, + }; + DateTime started = DateTime.UtcNow; + using HttpResponseMessage response = await client.SendAsync(request); + string body = await response.Content.ReadAsStringAsync(); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode, body); + Assert.AreEqual("http11", body); + Assert.AreNotEqual(3, response.Version.Major); + Assert.AreSame(request, response.RequestMessage); + Assert.AreEqual("https", response.RequestMessage!.RequestUri!.Scheme); + Assert.IsTrue(DateTime.UtcNow - started < TimeSpan.FromSeconds(5)); + } + + private static HttpRequestMessage Request(string address) => new(HttpMethod.Get, address) + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + }; + + private static byte[] Pattern(int length) + { + byte[] data = new byte[length]; + for (int i = 0; i < data.Length; i++) + { + data[i] = (byte)((i * 17) + 3); + } + + return data; + } + + private static TitaniumHttpHandler Handler() + { + TitaniumHttpHandler handler = new() + { + AllowManagedStackUnderFips = true, + ConnectTimeout = TimeSpan.FromSeconds(10), + }; + handler.SslOptions.RemoteCertificateValidationCallback = static (_, _, _, _) => true; + return handler; + } + + private static X509Certificate2 CreateHttp3Certificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + CertificateRequest request = new("CN=localhost", key, HashAlgorithmName.SHA256); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + private static async Task SendQpackSettingsAsync(ManagedQuicConnection server, CancellationToken cancellationToken) + { + Http3Settings settings = new(); + settings.SetQpackMaxTableCapacity(4096); + settings.SetQpackBlockedStreams(16); + ManagedQuicStream control = await server.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancellationToken); + byte[] type = new byte[8]; + int typeLength = Http3VarInt.Write(type, Http3StreamType.Control); + await control.WriteAsync(type.AsMemory(0, typeLength), cancellationToken); + await WriteFrameAsync(control, Http3FrameType.Settings, settings.Serialize(), cancellationToken); + } + + private static async Task ReadClientEncoderAsync(ManagedQuicConnection server, QpackContext table, CancellationToken cancellationToken) + { + try + { + for (int i = 0; i < 3; i++) + { + ManagedQuicStream stream = await server.AcceptInboundUnidirectionalStreamAsync(cancellationToken); + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken); + if (type == Http3StreamType.QpackEncoder) + { + await QpackEncoderStreamReader.ProcessAsync(stream, table, cancellationToken); + return; + } + } + } + catch (OperationCanceledException) + { + } + catch (QuicException) + { + } + } + + private static async Task> DecodeWhenInsertedAsync( + byte[] headers, + QpackContext table, + CancellationToken cancellationToken) + { + for (int i = 0; i < 50; i++) + { + try + { + List<(string Name, string Value)> fields = QpackDecoder.Decode(headers, table, cancellationToken); + if (fields.Exists(static field => field.Name == "x-row")) + { + return fields; + } + } + catch (Http3ConnectionException) + { + } + + await Task.Delay(20, cancellationToken); + } + + return QpackDecoder.Decode(headers, table, cancellationToken); + } + + private static async Task ReplyOnceAsync(ManagedQuicConnection server, CancellationToken cancellationToken) + { + ManagedQuicStream request = await server.AcceptInboundStreamAsync(cancellationToken); + await ReplyOnStreamAsync(request, cancellationToken); + } + + private static async Task ReplyOnStreamAsync(ManagedQuicStream request, CancellationToken cancellationToken) + { + byte[] block = QpackEncoder.Encode([(":status", "200")]); + await WriteFrameAsync(request, Http3FrameType.Headers, block, cancellationToken); + await WriteFrameAsync(request, Http3FrameType.Data, "ok"u8.ToArray(), cancellationToken); + await request.CompleteWritesAsync(cancellationToken); + } + + private static async Task<(string Headers, string Body)> ReadHttpRequestWithBodyAsync( + NetworkStream stream, + CancellationToken cancellationToken) + { + using var buffer = new MemoryStream(); + byte[] chunk = new byte[1024]; + int headerEnd = -1; + while (headerEnd < 0) + { + int count = await stream.ReadAsync(chunk, cancellationToken); + if (count == 0) + { + break; + } + + buffer.Write(chunk, 0, count); + headerEnd = buffer.GetBuffer().AsSpan(0, (int)buffer.Length).IndexOf("\r\n\r\n"u8); + } + + if (headerEnd < 0) + { + return (System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), 0, (int)buffer.Length), string.Empty); + } + + string headers = System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), 0, headerEnd); + int length = 0; + foreach (string line in headers.Split("\r\n")) + { + if (line.StartsWith("Content-Length:", StringComparison.OrdinalIgnoreCase) + && int.TryParse(line.AsSpan(15).Trim(), out int parsed)) + { + length = parsed; + } + } + + int have = (int)buffer.Length - (headerEnd + 4); + while (have < length) + { + int count = await stream.ReadAsync(chunk, cancellationToken); + if (count == 0) + { + break; + } + + buffer.Write(chunk, 0, count); + have += count; + } + + string posted = System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), headerEnd + 4, Math.Min(length, have)); + return (headers, posted); + } + + private static async Task ReadHttpHeadersAsync(Stream stream, CancellationToken cancellationToken) + { + using var buffer = new MemoryStream(); + byte[] chunk = new byte[1024]; + while (true) + { + int count = await stream.ReadAsync(chunk, cancellationToken); + if (count == 0) + { + break; + } + + buffer.Write(chunk, 0, count); + if (buffer.GetBuffer().AsSpan(0, (int)buffer.Length).IndexOf("\r\n\r\n"u8) >= 0) + { + break; + } + } + + return System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), 0, (int)buffer.Length); + } + + private static async Task<(string Connect, string Request)> AcceptConnectThenHttpsAsync( + TcpListener proxy, + X509Certificate2 certificate, + CancellationToken cancellationToken) + { + using TcpClient client = await proxy.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using NetworkStream network = client.GetStream(); + string connect = await ReadHttpHeadersAsync(network, cancellationToken); + await network.WriteAsync("HTTP/1.1 200 Connection Established\r\n\r\n"u8.ToArray(), cancellationToken); + await using SslStream stream = new(network, leaveInnerStreamOpen: true); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + string request = await ReadHttpHeadersAsync(stream, cancellationToken); + await stream.WriteAsync("HTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\nok"u8.ToArray(), cancellationToken); + return (connect, request); + } + + private static Task ReadHttps11RequestAsync( + TcpListener listener, + X509Certificate2 certificate, + CancellationToken cancellationToken) => + ReadHttps11RequestCoreAsync(listener, certificate, cancellationToken, "OK"); + + private static async Task ReadHttps11RequestCoreAsync( + TcpListener listener, + X509Certificate2 certificate, + CancellationToken cancellationToken, + string reasonPhrase, + string extraHeaders = "", + string? rawResponse = null, + bool closeNotify = false) + { + using TcpClient client = await listener.AcceptTcpClientAsync(cancellationToken); + client.NoDelay = true; + await using SslStream stream = new(client.GetStream()); + await AuthenticateServerAsync(stream, certificate, cancellationToken); + using MemoryStream buffer = new(); + byte[] chunk = new byte[1024]; + while (true) + { + int count = await stream.ReadAsync(chunk, cancellationToken); + if (count == 0) + { + break; + } + + buffer.Write(chunk, 0, count); + string text = System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), 0, (int)buffer.Length); + int split = text.IndexOf("\r\n\r\n", StringComparison.Ordinal); + if (split < 0) + { + continue; + } + + string headers = text[..split]; + string rest = text[(split + 4)..]; + bool complete = headers.Contains("Transfer-Encoding: chunked", StringComparison.OrdinalIgnoreCase) + ? rest.Contains("\r\n0\r\n\r\n", StringComparison.Ordinal) || rest.EndsWith("0\r\n\r\n", StringComparison.Ordinal) + : RestCoversContentLength(headers, rest); + if (!complete) + { + continue; + } + + await stream.WriteAsync( + System.Text.Encoding.ASCII.GetBytes(rawResponse ?? "HTTP/1.1 200 " + reasonPhrase + "\r\n" + extraHeaders + "Content-Length: 2\r\nConnection: close\r\n\r\nok"), + cancellationToken); + if (closeNotify) + { + await stream.ShutdownAsync().WaitAsync(cancellationToken); + } + + return text; + } + + return System.Text.Encoding.ASCII.GetString(buffer.GetBuffer(), 0, (int)buffer.Length); + } + + private static bool RestCoversContentLength(string headers, string rest) + { + foreach (string line in headers.Split("\r\n")) + { + if (line.StartsWith("Content-Length:", StringComparison.OrdinalIgnoreCase) + && int.TryParse(line.AsSpan("Content-Length:".Length).Trim(), NumberStyles.None, CultureInfo.InvariantCulture, out int length)) + { + return rest.Length >= length; + } + } + + return true; + } + + private static async Task ListenHttp3Async(X509Certificate2 certificate, IPAddress? address = null) => + await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(address ?? IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("h3") }, + }, + }), + }); + + private static async Task<(string Path, string Authorization)> ReadPathAndAuthorizationAsync( + ManagedQuicStream request, + CancellationToken cancellationToken) + { + byte[]? headers = await ReadFrameAsync(request, cancellationToken); + Assert.IsNotNull(headers); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + string path = string.Empty; + string authorization = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":path") + { + path = value; + } + else if (string.Equals(name, "authorization", StringComparison.OrdinalIgnoreCase)) + { + authorization = value; + } + } + + return (path, authorization); + } + + private static async Task ReadRedirectAuthorityAsync( + ManagedQuicConnection server, + string expected, + CancellationToken cancellationToken) + { + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancellationToken); + (string path, string authority) = await ReadPathAndAuthorityAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + Assert.AreEqual(expected, authority); + await WriteRedirectAsync(hop, "302", "/land", cancellationToken); + hop = await server.AcceptInboundStreamAsync(cancellationToken); + (path, authority) = await ReadPathAndAuthorityAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + Assert.AreEqual(expected, authority); + await ReplyTextAsync(hop, authority, cancellationToken); + return authority; + } + + private static async Task<(string Path, string Authority)> ReadPathAndAuthorityAsync( + ManagedQuicStream request, + CancellationToken cancellationToken) + { + byte[]? headers = await ReadFrameAsync(request, cancellationToken); + Assert.IsNotNull(headers); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + string path = string.Empty; + string authority = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":path") + { + path = value; + } + else if (name == ":authority") + { + authority = value; + } + + Assert.AreNotEqual("evil.example", value, name); + Assert.AreNotEqual("host", name, value); + } + + return (path, authority); + } + + private static async Task ReadRedirectCookieAsync(ManagedQuicConnection server, CancellationToken cancellationToken) + { + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancellationToken); + (string path, string cookie) = await ReadPathAndCookieAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/from", StringComparison.Ordinal)); + Assert.AreEqual("sid=manual", cookie); + await WriteRedirectAsync(hop, "302", "/land", cancellationToken); + hop = await server.AcceptInboundStreamAsync(cancellationToken); + (path, cookie) = await ReadPathAndCookieAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/land", StringComparison.Ordinal)); + await ReplyTextAsync(hop, cookie.Length == 0 ? "none" : cookie, cancellationToken); + return cookie; + } + + private static async Task<(string Path, string Cookie)> ReadPathAndCookieAsync( + ManagedQuicStream request, + CancellationToken cancellationToken) + { + byte[]? headers = await ReadFrameAsync(request, cancellationToken); + Assert.IsNotNull(headers); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + string path = string.Empty; + string cookie = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":path") + { + path = value; + } + else if (string.Equals(name, "cookie", StringComparison.OrdinalIgnoreCase)) + { + cookie = value; + } + } + + return (path, cookie); + } + + private static async Task ServeRedirectChainAsync(ManagedQuicConnection server, bool finish, CancellationToken cancellationToken) + { + ManagedQuicStream hop = await server.AcceptInboundStreamAsync(cancellationToken); + string path = await ReadRequestPathAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/a", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "302", "/b", cancellationToken); + hop = await server.AcceptInboundStreamAsync(cancellationToken); + path = await ReadRequestPathAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/b", StringComparison.Ordinal)); + await WriteRedirectAsync(hop, "302", "/c", cancellationToken); + if (!finish) + { + return; + } + + hop = await server.AcceptInboundStreamAsync(cancellationToken); + path = await ReadRequestPathAsync(hop, cancellationToken); + Assert.IsTrue(path.EndsWith("/c", StringComparison.Ordinal)); + await ReplyTextAsync(hop, "landed", cancellationToken); + } + + private static async Task<(string Method, string Path, string Body)> ReadPostedRequestAsync( + ManagedQuicStream request, + CancellationToken cancellationToken) + { + byte[]? headers = await ReadFrameAsync(request, cancellationToken); + Assert.IsNotNull(headers); + using var body = new MemoryStream(); + while (await ReadFrameAsync(request, cancellationToken) is byte[] frame) + { + body.Write(frame); + } + + string method = string.Empty; + string path = string.Empty; + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":method") + { + method = value; + } + else if (name == ":path") + { + path = value; + } + } + + return (method, path, System.Text.Encoding.UTF8.GetString(body.ToArray())); + } + + private static async Task WriteRedirectAsync( + ManagedQuicStream stream, + string status, + string location, + CancellationToken cancellationToken) + { + byte[] headers = QpackEncoder.Encode([(":status", status), ("location", location)]); + await WriteFrameAsync(stream, Http3FrameType.Headers, headers, cancellationToken); + await stream.CompleteWritesAsync(cancellationToken); + } + + private static async Task ReplySawAsync(ManagedQuicStream stream, string saw, CancellationToken cancellationToken) + { + byte[] headers = QpackEncoder.Encode([(":status", "200"), ("x-saw", saw)]); + await WriteFrameAsync(stream, Http3FrameType.Headers, headers, cancellationToken); + await stream.CompleteWritesAsync(cancellationToken); + } + + private static async Task ReplyTextAsync(ManagedQuicStream stream, string text, CancellationToken cancellationToken) + { + byte[] headers = QpackEncoder.Encode([(":status", "200")]); + await WriteFrameAsync(stream, Http3FrameType.Headers, headers, cancellationToken); + await WriteFrameAsync(stream, Http3FrameType.Data, System.Text.Encoding.UTF8.GetBytes(text), cancellationToken); + await stream.CompleteWritesAsync(cancellationToken); + } + + private static async Task ReadRequestPathAsync(ManagedQuicStream request, CancellationToken cancellationToken) + { + byte[]? headers = await ReadFrameAsync(request, cancellationToken); + Assert.IsNotNull(headers); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + foreach ((string name, string value) in QpackDecoder.Decode(headers)) + { + if (name == ":path") + { + return value; + } + } + + return string.Empty; + } + + private static async Task ReplyAsync(ManagedQuicConnection server, CancellationToken cancellationToken) + { + ManagedQuicStream request = await server.AcceptInboundStreamAsync(cancellationToken); + await ReplyOnAcceptedAsync(request, cancellationToken); + } + + private static async Task ReplyOnAcceptedAsync(ManagedQuicStream request, CancellationToken cancellationToken) + { + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + byte[] block = QpackEncoder.Encode([(":status", "200")]); + await WriteFrameAsync(request, Http3FrameType.Headers, block, cancellationToken); + await WriteFrameAsync(request, Http3FrameType.Data, "ok"u8.ToArray(), cancellationToken); + await request.CompleteWritesAsync(cancellationToken); + } + + private static async Task HeadersAsync(ManagedQuicConnection server, CancellationToken cancellationToken) + { + ManagedQuicStream request = await server.AcceptInboundStreamAsync(cancellationToken); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + byte[] block = QpackEncoder.Encode([(":status", "200")]); + await WriteFrameAsync(request, Http3FrameType.Headers, block, cancellationToken); + return request; + } + + private static async Task SendGoAwayAsync(ManagedQuicConnection server, ulong streamId, CancellationToken cancellationToken) + { + ManagedQuicStream control = await server.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancellationToken); + byte[] type = new byte[8]; + int typeLength = Http3VarInt.Write(type, Http3StreamType.Control); + await control.WriteAsync(type.AsMemory(0, typeLength), cancellationToken); + byte[] id = new byte[8]; + int idLength = Http3VarInt.Write(id, streamId); + byte[] payload = new byte[idLength]; + id.AsSpan(0, idLength).CopyTo(payload); + await WriteFrameAsync(control, Http3FrameType.GoAway, payload, cancellationToken); + } + + private static async Task SendEncoderInsertAsync(ManagedQuicConnection server, string name, string value, CancellationToken cancellationToken) + { + ManagedQuicStream encoder = await server.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancellationToken); + byte[] type = new byte[8]; + int typeLength = Http3VarInt.Write(type, Http3StreamType.QpackEncoder); + await encoder.WriteAsync(type.AsMemory(0, typeLength), cancellationToken); + byte[] nameBytes = System.Text.Encoding.Latin1.GetBytes(name); + byte[] valueBytes = System.Text.Encoding.Latin1.GetBytes(value); + byte[] instruction = new byte[1 + 1 + nameBytes.Length + 1 + valueBytes.Length]; + instruction[0] = 0x20; + instruction[1] = (byte)nameBytes.Length; + nameBytes.CopyTo(instruction.AsSpan(2)); + instruction[2 + nameBytes.Length] = (byte)valueBytes.Length; + valueBytes.CopyTo(instruction.AsSpan(3 + nameBytes.Length)); + await encoder.WriteAsync(instruction, cancellationToken); + } + + private static async Task ReplyWithBlockAsync(ManagedQuicConnection server, byte[] block, CancellationToken cancellationToken) + { + ManagedQuicStream request = await server.AcceptInboundStreamAsync(cancellationToken); + while (await ReadFrameAsync(request, cancellationToken) is not null) + { + } + + await WriteFrameAsync(request, Http3FrameType.Headers, block, cancellationToken); + await WriteFrameAsync(request, Http3FrameType.Data, "ok"u8.ToArray(), cancellationToken); + await request.CompleteWritesAsync(cancellationToken); + } + + private static async Task WriteDownloadAsync(ManagedQuicStream stream, byte[] download, CancellationToken cancellationToken) + { + int offset = 0; + while (offset < download.Length) + { + int count = Math.Min(16 * 1024, download.Length - offset); + byte[] slice = new byte[count]; + download.AsSpan(offset, count).CopyTo(slice); + await WriteFrameAsync(stream, Http3FrameType.Data, slice, cancellationToken); + offset += count; + } + + await stream.CompleteWritesAsync(cancellationToken); + } + + private static async Task<(ulong Type, byte[] Payload)?> ReadTypedFrameAsync(Stream stream, CancellationToken cancellationToken) + { + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken); + if (type is null) + { + return null; + } + + ulong? length = await Http3VarInt.ReadAsync(stream, cancellationToken); + if (length is null) + { + return null; + } + + byte[] payload = new byte[(int)length.Value]; + int read = 0; + while (read < payload.Length) + { + int count = await stream.ReadAsync(payload.AsMemory(read), cancellationToken); + if (count == 0) + { + return null; + } + + read += count; + } + + return (type.Value, payload); + } + + private static async Task ReadFrameAsync(Stream stream, CancellationToken cancellationToken) + { + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken); + if (type is null) + { + return null; + } + + ulong? length = await Http3VarInt.ReadAsync(stream, cancellationToken); + if (length is null) + { + return null; + } + + byte[] payload = new byte[(int)length.Value]; + int read = 0; + while (read < payload.Length) + { + int count = await stream.ReadAsync(payload.AsMemory(read), cancellationToken); + if (count == 0) + { + return null; + } + + read += count; + } + + return payload; + } + + private static async Task WriteFrameAsync(Stream stream, ulong type, byte[] payload, CancellationToken cancellationToken) + { + byte[] frame = new byte[payload.Length + 16]; + int written = Http3FrameCodec.Write(frame, type, payload); + await stream.WriteAsync(frame.AsMemory(0, written), cancellationToken); + } + + private sealed class UnseekableReadStream : Stream + { + private readonly byte[] _bytes; + private int _offset; + + public UnseekableReadStream(byte[] bytes) => _bytes = bytes; + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => false; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) => Read(buffer.AsSpan(offset, count)); + + public override int Read(Span buffer) + { + int count = Math.Min(buffer.Length, _bytes.Length - _offset); + _bytes.AsSpan(_offset, count).CopyTo(buffer); + _offset += count; + return count; + } + + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + return ValueTask.FromResult(Read(buffer.Span)); + } + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); + + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + } + + private sealed class LoopbackServer : IAsyncDisposable + { + private readonly WebApplication _app; + private readonly X509Certificate2 _certificate; + + private LoopbackServer(WebApplication app, X509Certificate2 certificate, int port) + { + _app = app; + _certificate = certificate; + Port = port; + } + + public int Port { get; } + + public static Task StartAsync(Action map) => + StartAsync(map, null, HttpProtocols.Http1AndHttp2); + + public static Task StartAsync(Action map, Action? onConnection) => + StartAsync(map, onConnection, HttpProtocols.Http1AndHttp2); + + public static Task StartAsync(Action map, Action? onConnection, HttpProtocols protocols) => + StartAsync(map, onConnection, protocols, requestClientCertificate: false); + + public static async Task StartAsync( + Action map, + Action? onConnection, + HttpProtocols protocols, + bool requestClientCertificate, + TaskCompletionSource? observedServerName = null) + { + X509Certificate2 certificate = CreateCertificate(); + try + { + WebApplicationBuilder builder = WebApplication.CreateBuilder(); + builder.Logging.ClearProviders(); + builder.WebHost.ConfigureKestrel(options => + { + options.Listen(IPAddress.Loopback, 0, listen => + { + if (onConnection is not null) + { + listen.Use(next => connection => + { + onConnection(); + return next(connection); + }); + } + + listen.Protocols = protocols; + if (requestClientCertificate) + { + listen.UseHttps(adapter => + { + adapter.ServerCertificate = certificate; + adapter.ClientCertificateMode = Microsoft.AspNetCore.Server.Kestrel.Https.ClientCertificateMode.RequireCertificate; + adapter.ClientCertificateValidation = static (_, _, _) => true; + }); + } + else if (observedServerName is not null) + { + listen.UseHttps(new Microsoft.AspNetCore.Server.Kestrel.Https.TlsHandshakeCallbackOptions + { + OnConnection = context => + { + observedServerName.TrySetResult(context.ClientHelloInfo.ServerName); + List applicationProtocols = new(); + if ((protocols & HttpProtocols.Http2) != 0) + { + applicationProtocols.Add(SslApplicationProtocol.Http2); + } + + if ((protocols & HttpProtocols.Http1) != 0) + { + applicationProtocols.Add(SslApplicationProtocol.Http11); + } + + return new ValueTask(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = applicationProtocols, + }); + }, + }); + } + else + { + listen.UseHttps(certificate); + } + }); + }); + WebApplication app = builder.Build(); + map(app); + await app.StartAsync(); + IServerAddressesFeature? addresses = app.Services.GetRequiredService().Features.Get(); + string? address = null; + if (addresses is not null) + { + foreach (string candidate in addresses.Addresses) + { + address = candidate; + } + } + + if (address is null) + { + await app.DisposeAsync(); + throw new InvalidOperationException("Kestrel did not publish an address."); + } + + return new LoopbackServer(app, certificate, new Uri(address).Port); + } + catch + { + certificate.Dispose(); + throw; + } + } + + public async ValueTask DisposeAsync() + { + await _app.StopAsync(); + await _app.DisposeAsync(); + _certificate.Dispose(); + } + + private static X509Certificate2 CreateCertificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + CertificateRequest request = new("CN=localhost", key, HashAlgorithmName.SHA256); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12( + created.Export(X509ContentType.Pfx), + password: null, + X509KeyStorageFlags.Exportable); + } + } +} diff --git a/tests/Titanium.Quic.Tests/ArchitectureTests.cs b/tests/Titanium.Quic.Tests/ArchitectureTests.cs new file mode 100644 index 000000000..89b2e5710 --- /dev/null +++ b/tests/Titanium.Quic.Tests/ArchitectureTests.cs @@ -0,0 +1,38 @@ +using System; +using System.Reflection; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class ArchitectureTests +{ + [TestMethod] + public void HostRuns() + { + Assert.AreEqual("Titanium.Quic", AssemblyMarker.Name); + } + + [TestMethod] + public void LibraryDoesNotReferenceTheProxyAndDoesNotPInvoke() + { + Assembly assembly = typeof(AssemblyMarker).Assembly; + foreach (AssemblyName referenced in assembly.GetReferencedAssemblies()) + { + string name = referenced.Name ?? string.Empty; + Assert.IsFalse(name.StartsWith("Titanium.Web.Proxy", StringComparison.Ordinal), name); + } + + byte[]? token = assembly.GetName().GetPublicKeyToken(); + Assert.IsNotNull(token); + Assert.IsTrue(token!.Length > 0); + + foreach (Type type in assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)) + { + Assert.IsFalse(method.Attributes.HasFlag(MethodAttributes.PinvokeImpl), method.Name); + } + } + } +} diff --git a/tests/Titanium.Quic.Tests/ManagedQuicConnectionEdgeTests.cs b/tests/Titanium.Quic.Tests/ManagedQuicConnectionEdgeTests.cs new file mode 100644 index 000000000..963c8dfe4 --- /dev/null +++ b/tests/Titanium.Quic.Tests/ManagedQuicConnectionEdgeTests.cs @@ -0,0 +1,180 @@ +#pragma warning disable CA1416 // The test names the BCL stream type. It does not open a platform listener. +using System; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class ManagedQuicConnectionEdgeTests +{ + [TestMethod] + public async Task AConnectWithoutAnEndpointOrATokenDoesNotOpen() + { + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicConnection.ConnectAsync(null!)); + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions())); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicConnection.ConnectAsync( + new ManagedQuicClientConnectionOptions { RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, 9) }, + canceled.Token)); + } + + [TestMethod] + public async Task OneConnectionOpensBidirectionalAndUnidirectionalStreams() + { + using X509Certificate2 certificate = Certificate(); + string? serverName = null; + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, hello, _) => + { + serverName = hello.ServerName; + return ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }); + }, + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + int localPort = FreePort(); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + LocalEndPoint = new IPEndPoint(IPAddress.Loopback, localPort), + HandshakeTimeout = TimeSpan.Zero, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = string.Empty }, + }, cancel.Token); + Assert.AreEqual(localPort, client.LocalEndPoint.Port); + await using ManagedQuicConnection server = await accepted; + Assert.AreEqual("localhost", serverName); + Assert.AreEqual(listener.LocalEndPoint, client.RemoteEndPoint); + + using var stopOpen = new CancellationTokenSource(); + stopOpen.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, stopOpen.Token)); + await Assert.ThrowsExactlyAsync(async () => await server.AcceptInboundStreamAsync(stopOpen.Token)); + ManagedQuicStream unidirectional = await client.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancel.Token); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream second = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + ManagedQuicStream secondAccept = await server.AcceptInboundStreamAsync(cancel.Token); + ManagedQuicStream inboundUni = await server.AcceptInboundUnidirectionalStreamAsync(cancel.Token); + Assert.AreEqual(2L, unidirectional.Id); + Assert.AreEqual(0L, outbound.Id); + Assert.AreEqual(4L, second.Id); + Assert.AreEqual(0L, inbound.Id); + Assert.AreEqual(4L, secondAccept.Id); + Assert.AreEqual(2L, inboundUni.Id); + + using var closed = new CancellationTokenSource(); + closed.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await client.CloseAsync(1, closed.Token)); + await client.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task ASilentPeerTimesOutAndAnUnfinishedHandshakeOpensNothing() + { + using var sink = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + sink.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + int port = ((IPEndPoint)sink.LocalEndPoint!).Port; + QuicException timed = await Assert.ThrowsExactlyAsync(async () => await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, port), + HandshakeTimeout = TimeSpan.FromMilliseconds(200), + })); + Assert.AreEqual(QuicError.ConnectionTimeout, timed.QuicError); + Assert.AreEqual("The handshake timed out.", timed.Message); + using var caller = new CancellationTokenSource(TimeSpan.FromSeconds(1)); + QuicException fast = await Assert.ThrowsExactlyAsync(async () => await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = new IPEndPoint(IPAddress.Loopback, port), + HandshakeTimeout = TimeSpan.FromMilliseconds(50), + }, caller.Token)); + Assert.AreEqual(QuicError.ConnectionTimeout, fast.QuicError); + + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + using var core = new QuicConnectionCore(); + using var transport = new IdleTransport(); + var session = new QuicConnectionSession(core, transport, local, remote, ownsTransport: false); + await using var connection = new ManagedQuicConnection(session); + QuicException open = await Assert.ThrowsExactlyAsync(async () => await connection.OpenOutboundStreamAsync(QuicStreamType.Bidirectional)); + Assert.AreEqual("The handshake is not complete.", open.Message); + QuicException accept = await Assert.ThrowsExactlyAsync(async () => await connection.AcceptInboundStreamAsync()); + Assert.AreEqual("The handshake is not complete.", accept.Message); + } + + [TestMethod] + public async Task AnIpv6LoopbackConnects() + { + using X509Certificate2 certificate = Certificate(); + string? serverName = null; + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.IPv6Loopback, 0), + ConnectionOptionsCallback = (_, hello, _) => + { + serverName = hello.ServerName; + return ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }); + }, + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "example.test" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + Assert.AreEqual("example.test", serverName); + Assert.AreEqual(AddressFamily.InterNetworkV6, client.LocalEndPoint.AddressFamily); + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + private static int FreePort() + { + using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + return ((IPEndPoint)socket.LocalEndPoint!).Port; + } + + private sealed class IdleTransport : IUdpPacketTransport + { + public IPEndPoint LocalEndpoint { get; } = new(IPAddress.Loopback, 9); + + public int MaximumDatagramSize => 1200; + + public bool DatagramPending => false; + + public ValueTask SendAsync(ReadOnlyMemory datagram, IPEndPoint destination, CancellationToken cancellationToken) => ValueTask.FromResult(0); + + public ValueTask SendBatchAsync(ReadOnlyMemory> datagrams, IPEndPoint destination, CancellationToken cancellationToken) => ValueTask.FromResult(0); + + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken) => throw new NotSupportedException(); + + public void Dispose() + { + } + } + + private static X509Certificate2 Certificate() + { + using var key = System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, System.Security.Cryptography.HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/ManagedQuicListenerEdgeTests.cs b/tests/Titanium.Quic.Tests/ManagedQuicListenerEdgeTests.cs new file mode 100644 index 000000000..b4e14f9a4 --- /dev/null +++ b/tests/Titanium.Quic.Tests/ManagedQuicListenerEdgeTests.cs @@ -0,0 +1,291 @@ +#pragma warning disable CA1416 // The test names the BCL error type. It does not open a platform listener. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class ManagedQuicListenerEdgeTests +{ + [TestMethod] + public async Task AListenWithoutAnEndpointOrATokenDoesNotBind() + { + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicListener.ListenAsync(null!)); + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions())); + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + })); + using var canceled = new CancellationTokenSource(); + canceled.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions()), + }, canceled.Token)); + } + + [TestMethod] + public async Task ACanceledWaiterIsDroppedAndTheNextAcceptReceives() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.Zero); + using var firstCancel = new CancellationTokenSource(); + using var secondCancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task first = listener.AcceptConnectionAsync(firstCancel.Token).AsTask(); + Task second = listener.AcceptConnectionAsync(secondCancel.Token).AsTask(); + firstCancel.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await first); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), secondCancel.Token); + await using ManagedQuicConnection server = await second; + Assert.AreEqual(listener.LocalEndPoint, client.RemoteEndPoint); + await client.CloseAsync(0, secondCancel.Token); + await server.CloseAsync(0, secondCancel.Token); + } + + [TestMethod] + public async Task ABrokenCallbackAndAMissingCertificateFailTheAccept() + { + await using ManagedQuicListener broken = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => throw new InvalidOperationException("no certificate choice"), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = broken.AcceptConnectionAsync(cancel.Token).AsTask(); + Task connect = ConnectQuietly(broken.LocalEndPoint, cancel.Token); + QuicException callback = await Assert.ThrowsExactlyAsync(async () => await accepted); + Assert.AreEqual(QuicError.CallbackError, callback.QuicError); + Assert.AreEqual("no certificate choice", callback.Message); + await connect; + + await using ManagedQuicListener missing = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions()), + }); + Task missingAccept = missing.AcceptConnectionAsync(cancel.Token).AsTask(); + Task missingConnect = ConnectQuietly(missing.LocalEndPoint, cancel.Token); + QuicException certificate = await Assert.ThrowsExactlyAsync(async () => await missingAccept); + Assert.AreEqual(QuicError.CallbackError, certificate.QuicError); + Assert.AreEqual("The server certificate is missing.", certificate.Message); + await missingConnect; + } + + [TestMethod] + public async Task ASlowCallbackTimesOutAndAContextCertificateConnects() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener slow = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + HandshakeTimeout = TimeSpan.FromMilliseconds(50), + ConnectionOptionsCallback = async (_, _, token) => + { + await Task.Delay(300, token); + return new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }; + }, + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = slow.AcceptConnectionAsync(cancel.Token).AsTask(); + Task connect = ConnectQuietly(slow.LocalEndPoint, cancel.Token); + QuicException timed = await Assert.ThrowsExactlyAsync(async () => await accepted); + Assert.AreEqual(QuicError.ConnectionTimeout, timed.QuicError); + Assert.AreEqual("The handshake timed out.", timed.Message); + await connect; + + string? serverName = null; + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + HandshakeTimeout = TimeSpan.Zero, + ConnectionOptionsCallback = async (_, hello, token) => + { + serverName = hello.ServerName; + await Task.Delay(100, token); + return new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificateContext = SslStreamCertificateContext.Create(certificate, null), + }, + }; + }, + }); + Task contextAccept = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection server = await contextAccept; + Assert.AreEqual("example.test", serverName); + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task AFinishedHandshakeWaitsInTheQueueUntilAccept() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await Task.Delay(50, cancel.Token); + await using ManagedQuicConnection server = await listener.AcceptConnectionAsync(cancel.Token); + Assert.AreEqual(listener.LocalEndPoint, client.RemoteEndPoint); + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task AProtocolTheClientDidNotOfferStopsTheHandshake() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { new("nope") }, + }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + ManagedQuicClientConnectionOptions client = Client(listener.LocalEndPoint); + client.ClientAuthenticationOptions!.ApplicationProtocols = new List { new("h3") }; + async Task ConnectOffered() + { + try + { + await using ManagedQuicConnection connection = await ManagedQuicConnection.ConnectAsync(client, cancel.Token); + } + catch (QuicException) + { + } + } + + Task connect = ConnectOffered(); + QuicException stopped = await Assert.ThrowsExactlyAsync(async () => await accepted); + Assert.AreEqual(QuicError.ConnectionAborted, stopped.QuicError); + Assert.AreEqual("The handshake did not continue.", stopped.Message); + await connect; + } + + [TestMethod] + public async Task AResetPeerDoesNotStopTheListener() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(5)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + using var handshake = new CancellationTokenSource(); + ValueTask connecting = ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), handshake.Token); + handshake.Cancel(); + try + { + await using ManagedQuicConnection abandoned = await connecting; + } + catch (Exception ex) when (ex is OperationCanceledException or QuicException) + { + } + + await Task.Delay(50, cancel.Token); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection server = await accepted; + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task ADisposedConnectionDoesNotStopTheListener() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(5)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task acceptedFirst = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection first = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + ManagedQuicConnection firstServer = await acceptedFirst; + + // The server leaves a packet in flight and disposes the connection. The client is still + // open, so its acknowledgement and every timer on the listener's side reach a core whose + // keys are gone. That must not end the receive loop. + await using (ManagedQuicStream stream = await firstServer.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancel.Token)) + { + await stream.WriteAsync(new byte[200_000], cancel.Token); + } + + await firstServer.DisposeAsync(); + await Task.Delay(3000, cancel.Token); + + Task acceptedSecond = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection second = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection secondServer = await acceptedSecond; + Assert.IsTrue(secondServer.HandshakeCompleted); + } + + [TestMethod] + public async Task JunkIsIgnoredAndDisposeCancelsTheWait() + { + using X509Certificate2 certificate = Certificate(); + ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using (var udp = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)) + { + udp.Connect(listener.LocalEndPoint); + udp.Send(new byte[] { 0x40, 0x01 }); + udp.Send(new byte[] { 0xC0 }); + } + + Task pending = listener.AcceptConnectionAsync().AsTask(); + await listener.DisposeAsync(); + await Assert.ThrowsExactlyAsync(async () => await pending); + } + + private static async Task ConnectQuietly(IPEndPoint remote, CancellationToken cancellationToken) + { + try + { + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(remote), cancellationToken); + } + catch (QuicException) + { + } + } + + private static ManagedQuicClientConnectionOptions Client(IPEndPoint remote) => new() + { + RemoteEndPoint = remote, + HandshakeTimeout = TimeSpan.FromSeconds(2), + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "example.test" }, + }; + + private static ValueTask Listen(X509Certificate2 certificate, TimeSpan handshakeTimeout) => + ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + HandshakeTimeout = handshakeTimeout, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/ManagedQuicStreamEdgeTests.cs b/tests/Titanium.Quic.Tests/ManagedQuicStreamEdgeTests.cs new file mode 100644 index 000000000..1d4846ba3 --- /dev/null +++ b/tests/Titanium.Quic.Tests/ManagedQuicStreamEdgeTests.cs @@ -0,0 +1,74 @@ +#pragma warning disable CA1416 // The test names the BCL stream type. It does not open a platform listener. +#pragma warning disable CA2022 // These reads assert a zero return or a cancel, not a filled buffer. +using System; +using System.IO; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class ManagedQuicStreamEdgeTests +{ + [TestMethod] + public async Task SynchronousMembersThrowAndAnEmptyWriteSendsNothing() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + Assert.IsTrue(outbound.CanRead); + Assert.IsFalse(outbound.CanSeek); + Assert.IsTrue(outbound.CanWrite); + Assert.AreEqual(0L, outbound.Id); + Assert.AreEqual(QuicStreamType.Bidirectional, outbound.Type); + Assert.ThrowsExactly(() => _ = outbound.Length); + Assert.ThrowsExactly(() => _ = outbound.Position); + Assert.ThrowsExactly(() => outbound.Position = 1); + NotSupportedException read = Assert.ThrowsExactly(() => outbound.Read(new byte[1], 0, 1)); + Assert.AreEqual("Use ReadAsync.", read.Message); + NotSupportedException write = Assert.ThrowsExactly(() => outbound.Write(new byte[1], 0, 1)); + Assert.AreEqual("Use WriteAsync.", write.Message); + Assert.ThrowsExactly(() => outbound.Seek(0, SeekOrigin.Begin)); + Assert.ThrowsExactly(() => outbound.SetLength(1)); + outbound.Flush(); + await outbound.WriteAsync(ReadOnlyMemory.Empty, cancel.Token); + + using var stopped = new CancellationTokenSource(); + stopped.Cancel(); + await Assert.ThrowsExactlyAsync(async () => await outbound.WriteAsync(new byte[] { 1 }, stopped.Token)); + await Assert.ThrowsExactlyAsync(async () => await inbound.ReadAsync(new byte[1], stopped.Token)); + + await client.CloseAsync(0, cancel.Token); + int count = await inbound.ReadAsync(new byte[8], cancel.Token); + Assert.AreEqual(0, count); + await server.CloseAsync(0, cancel.Token); + } + + private static X509Certificate2 Certificate() + { + using var key = System.Security.Cryptography.ECDsa.Create(System.Security.Cryptography.ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, System.Security.Cryptography.HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/ManagedQuicTests.cs b/tests/Titanium.Quic.Tests/ManagedQuicTests.cs new file mode 100644 index 000000000..dcb5cbf46 --- /dev/null +++ b/tests/Titanium.Quic.Tests/ManagedQuicTests.cs @@ -0,0 +1,175 @@ +#pragma warning disable CA1416 // The test names the BCL stream type. It does not open a platform listener. +using System; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class ManagedQuicTests +{ + [TestMethod] + public async Task LoopbackConnectsOneBidirectionalStreamAndCloses() + { + using X509Certificate2 certificate = Certificate(); + string? serverName = null; + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, hello, _) => + { + serverName = hello.ServerName; + return ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + }, + }); + }, + }); + AssertEphemeral(listener.LocalEndPoint.Port); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + Assert.AreEqual("localhost", serverName); + AssertEphemeral(client.LocalEndPoint.Port); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[] payload = RandomNumberGenerator.GetBytes(64); + await outbound.WriteAsync(payload, cancel.Token); + byte[] got = new byte[payload.Length]; + int read = 0; + while (read < got.Length) + { + int count = await inbound.ReadAsync(got.AsMemory(read), cancel.Token); + Assert.IsTrue(count > 0); + read += count; + } + + byte[] expected = SHA256.HashData(payload); + byte[] actual = SHA256.HashData(got); + Assert.IsTrue(expected.AsSpan().SequenceEqual(actual)); + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task TwoStreamsKeepTheirBytesAndAFinEndsTheRead() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + ManagedQuicStream first = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream second = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream control = await client.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancel.Token); + await first.WriteAsync("one"u8.ToArray(), cancel.Token); + await first.CompleteWritesAsync(cancel.Token); + await second.WriteAsync("two"u8.ToArray(), cancel.Token); + await second.CompleteWritesAsync(cancel.Token); + await control.WriteAsync("uni"u8.ToArray(), cancel.Token); + await control.CompleteWritesAsync(cancel.Token); + + ManagedQuicStream readFirst = await server.AcceptInboundStreamAsync(cancel.Token); + ManagedQuicStream readSecond = await server.AcceptInboundStreamAsync(cancel.Token); + ManagedQuicStream readUni = await server.AcceptInboundUnidirectionalStreamAsync(cancel.Token); + Assert.AreEqual("one", await ReadUntilEndAsync(readFirst, cancel.Token)); + Assert.AreEqual("two", await ReadUntilEndAsync(readSecond, cancel.Token)); + Assert.AreEqual("uni", await ReadUntilEndAsync(readUni, cancel.Token)); + } + + [TestMethod] + public async Task AWriteLargerThanTheCongestionWindowIsDelivered() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[] payload = RandomNumberGenerator.GetBytes(32 * 1024); + await outbound.WriteAsync(payload, cancel.Token); + byte[] got = new byte[payload.Length]; + int read = 0; + while (read < got.Length) + { + int count = await inbound.ReadAsync(got.AsMemory(read), cancel.Token); + Assert.IsTrue(count > 0); + read += count; + } + + Assert.IsTrue(SHA256.HashData(payload).AsSpan().SequenceEqual(SHA256.HashData(got))); + } + + private static async Task ReadUntilEndAsync(ManagedQuicStream stream, CancellationToken cancellationToken) + { + byte[] chunk = new byte[16]; + int total = 0; + while (total < chunk.Length) + { + int count = await stream.ReadAsync(chunk.AsMemory(total), cancellationToken); + if (count == 0) + { + break; + } + + total += count; + } + + return System.Text.Encoding.UTF8.GetString(chunk, 0, total); + } + + private static void AssertEphemeral(int port) + { + Assert.AreNotEqual(0, port); + Assert.AreNotEqual(8000, port); + Assert.AreNotEqual(8866, port); + Assert.AreNotEqual(9080, port); + Assert.AreNotEqual(9464, port); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicAckDelayTests.cs b/tests/Titanium.Quic.Tests/QuicAckDelayTests.cs new file mode 100644 index 000000000..79fdb4d48 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicAckDelayTests.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicAckDelayTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + private static readonly byte[] Body = new byte[100]; + + [TestMethod] + public void AFirstPacketIsHeldAndASecondIsAcknowledgedAtOnce() + { + (QuicConnectionCore client, QuicConnectionCore server, X509Certificate2 certificate) = Connected(); + using (client) + using (server) + using (certificate) + { + Deliver(client, server, Now, Send(client)); + Assert.AreEqual(0, Poll(server, Now).Count, "one packet waits for the delay"); + Assert.AreEqual(Now + QuicLossRecovery.MaxAckDelay, server.AckDeadline); + + Deliver(client, server, Now, Send(client)); + List acknowledgement = Poll(server, Now); + Assert.AreEqual(1, acknowledgement.Count, "the second packet is acknowledged at once"); + Assert.IsNull(server.AckDeadline); + Handle(client, Now, acknowledgement[0]); + Assert.AreEqual(0, client.BytesInFlight); + } + } + + [TestMethod] + public void ALonePacketIsAcknowledgedWhenTheDelayRunsOut() + { + (QuicConnectionCore client, QuicConnectionCore server, X509Certificate2 certificate) = Connected(); + using (client) + using (server) + using (certificate) + { + Deliver(client, server, Now, Send(client)); + Assert.AreEqual(Now + QuicLossRecovery.MaxAckDelay, server.NextTimeout()); + + DateTimeOffset early = Now + QuicLossRecovery.MaxAckDelay - TimeSpan.FromMilliseconds(1); + server.HandleTimeout(early); + Assert.AreEqual(0, Poll(server, early).Count); + + DateTimeOffset due = Now + QuicLossRecovery.MaxAckDelay; + server.HandleTimeout(due); + List acknowledgement = Poll(server, due); + Assert.AreEqual(1, acknowledgement.Count); + Assert.IsNull(server.AckDeadline); + Handle(client, due, acknowledgement[0]); + Assert.AreEqual(0, client.BytesInFlight); + } + } + + [TestMethod] + public void AnAcknowledgementRidesInTheNextStreamPacket() + { + (QuicConnectionCore client, QuicConnectionCore server, X509Certificate2 certificate) = Connected(); + using (client) + using (server) + using (certificate) + { + Deliver(client, server, Now, Send(client)); + Assert.AreEqual(Body.Length, server.SendStream(0, Body)); + List reply = Poll(server, Now); + Assert.AreEqual(1, reply.Count, "the echo carries the acknowledgement"); + Assert.IsNull(server.AckDeadline); + Handle(client, Now, reply[0]); + Assert.AreEqual(0, client.BytesInFlight, "the client's packet was acknowledged by the echo"); + Assert.AreEqual(Body.Length, client.ReceivedStream.Length); + Assert.AreEqual(0, Poll(server, Now).Count); + } + } + + [TestMethod] + public void AnOutOfOrderPacketIsAcknowledgedAtOnce() + { + (QuicConnectionCore client, QuicConnectionCore server, X509Certificate2 certificate) = Connected(); + using (client) + using (server) + using (certificate) + { + byte[] first = Send(client); + byte[] second = Send(client); + byte[] third = Send(client); + Assert.IsNotNull(second); + Handle(server, Now, first); + Assert.AreEqual(0, Poll(server, Now).Count); + Handle(server, Now, third); + Assert.AreEqual(1, Poll(server, Now).Count, "a gap in the packet numbers is acknowledged at once"); + } + } + + [TestMethod] + public void TheAcknowledgementReportsHowLongTheLargestPacketWaited() + { + (QuicConnectionCore client, QuicConnectionCore server, X509Certificate2 certificate) = Connected(); + using (client) + using (server) + using (certificate) + { + Deliver(client, server, Now, Send(client)); + DateTimeOffset later = Now + TimeSpan.FromMilliseconds(20); + server.ObserveTime(later); + Assert.AreEqual(Body.Length, server.SendStream(0, Body)); + List reply = Poll(server, later); + Assert.AreEqual(1, reply.Count); + Handle(client, later, reply[0]); + Assert.AreEqual(0, client.BytesInFlight); + Assert.IsTrue(client.SmoothedRtt < TimeSpan.FromMilliseconds(1), "the 20 ms hold is not counted as round trip time, got " + client.SmoothedRtt); + } + } + + private static byte[] Send(QuicConnectionCore sender) + { + Assert.AreEqual(Body.Length, sender.SendStream(0, Body)); + return Poll(sender, Now)[0]; + } + + private static List Poll(QuicConnectionCore core, DateTimeOffset at) + { + var datagrams = new List(); + byte[] buffer = new byte[16384]; + int count; + while ((count = core.PollTransmit(at, buffer, out _)) > 0) + { + datagrams.Add(buffer.AsSpan(0, count).ToArray()); + } + + return datagrams; + } + + private static void Handle(QuicConnectionCore receiver, DateTimeOffset at, byte[] datagram) + { + receiver.HandleDatagram(at, datagram, Path); + } + + private static void Deliver(QuicConnectionCore sender, QuicConnectionCore receiver, DateTimeOffset at, byte[] datagram) + { + Assert.IsNotNull(sender); + Handle(receiver, at, datagram); + } + + private static (QuicConnectionCore Client, QuicConnectionCore Server, X509Certificate2 Certificate) Connected() + { + X509Certificate2 certificate = Certificate(); + var client = new QuicConnectionCore(); + var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + byte[] buffer = new byte[16384]; + for (int i = 0; i < 16; i++) + { + int count = client.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + server.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = server.PollTransmit(Now, buffer, out path); + if (count > 0) + { + client.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + + Assert.IsTrue(client.HandshakeComplete && server.HandshakeComplete); + + // Settle whatever the handshake left staged, so each test starts from an idle pair. + for (int round = 0; round < 8; round++) + { + foreach (byte[] datagram in Poll(client, Now)) + { + server.HandleDatagram(Now, datagram, Path); + } + + foreach (byte[] datagram in Poll(server, Now)) + { + client.HandleDatagram(Now, datagram, Path); + } + } + + server.HandleTimeout(Now + QuicLossRecovery.MaxAckDelay); + foreach (byte[] datagram in Poll(server, Now + QuicLossRecovery.MaxAckDelay)) + { + client.HandleDatagram(Now + QuicLossRecovery.MaxAckDelay, datagram, Path); + } + + return (client, server, certificate); + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + MaxIdleTimeout = 5000, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicAckTrackerTests.cs b/tests/Titanium.Quic.Tests/QuicAckTrackerTests.cs new file mode 100644 index 000000000..14a2c68d2 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicAckTrackerTests.cs @@ -0,0 +1,87 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicAckTrackerTests +{ + [TestMethod] + public void AnEmptyTrackerWritesNothing() + { + var tracker = new QuicAckTracker(); + var ranges = new QuicAckRange[4]; + Assert.AreEqual(0, tracker.Fill(ranges, out ulong largest)); + Assert.AreEqual(0UL, largest); + Assert.IsNull(tracker.Largest); + } + + [TestMethod] + public void ConsecutiveNumbersCollapseIntoOneRange() + { + var tracker = new QuicAckTracker(); + tracker.Accept(0); + tracker.Accept(1); + tracker.Accept(2); + var ranges = new QuicAckRange[4]; + Assert.AreEqual(1, tracker.Fill(ranges, out ulong largest)); + Assert.AreEqual(2UL, largest); + Assert.AreEqual(2UL, ranges[0].Length); + } + + [TestMethod] + public void AGapKeepsTheOlderNumberAcknowledged() + { + var tracker = new QuicAckTracker(); + tracker.Accept(0); + tracker.Accept(1); + tracker.Accept(3); + var ranges = new QuicAckRange[4]; + int count = tracker.Fill(ranges, out ulong largest); + Assert.AreEqual(2, count); + Assert.AreEqual(3UL, largest); + Assert.AreEqual(0UL, ranges[0].Length); + Assert.AreEqual(1UL, ranges[1].Length); + Assert.AreEqual(0UL, ranges[1].Gap); + } + + [TestMethod] + public void AFilledGapJoinsTheTwoRanges() + { + var tracker = new QuicAckTracker(); + tracker.Accept(0); + tracker.Accept(2); + tracker.Accept(1); + var ranges = new QuicAckRange[4]; + Assert.AreEqual(1, tracker.Fill(ranges, out ulong largest)); + Assert.AreEqual(2UL, largest); + Assert.AreEqual(2UL, ranges[0].Length); + } + + [TestMethod] + public void TheNewestRangeComesFirst() + { + var tracker = new QuicAckTracker(); + tracker.Accept(9); + tracker.Accept(2); + var ranges = new QuicAckRange[4]; + Assert.AreEqual(2, tracker.Fill(ranges, out ulong largest)); + Assert.AreEqual(9UL, largest); + + // RFC 9000 section 19.3.1: gap is the count of unacknowledged packets minus one. + Assert.AreEqual(5UL, ranges[1].Gap); + } + + [TestMethod] + public void OnlyTheNewestRangesAreKept() + { + var tracker = new QuicAckTracker(); + for (ulong number = 0; number < QuicAckTracker.MaxRanges + 5; number++) + { + tracker.Accept(number * 3); + } + + var ranges = new QuicAckRange[QuicFrameReader.MaxAckRanges]; + Assert.AreEqual(QuicAckTracker.MaxRanges, tracker.Fill(ranges, out _)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicAesBlockTests.cs b/tests/Titanium.Quic.Tests/QuicAesBlockTests.cs new file mode 100644 index 000000000..08187bd5e --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicAesBlockTests.cs @@ -0,0 +1,88 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicAesBlockTests +{ + [TestMethod] + public void MatchesTheFips197Vector() + { + if (!QuicAesBlock.IsSupported) + { + Assert.IsNull(QuicAesBlock.TryCreate(new byte[16])); + return; + } + + byte[] key = Convert.FromHexString("000102030405060708090a0b0c0d0e0f"); + byte[] plain = Convert.FromHexString("00112233445566778899aabbccddeeff"); + byte[] expected = Convert.FromHexString("69c4e0d86a7b0430d8cdb78070b4c55a"); + QuicAesBlock block = QuicAesBlock.TryCreate(key)!; + byte[] cipher = new byte[16]; + block.Encrypt(plain, cipher); + CollectionAssert.AreEqual(expected, cipher); + } + + [TestMethod] + public void MatchesThePlatformCipherOnRandomKeysAndBlocks() + { + if (!QuicAesBlock.IsSupported) + { + return; + } + + byte[] key = new byte[16]; + byte[] plain = new byte[16]; + byte[] fast = new byte[16]; + byte[] reference = new byte[16]; + for (int i = 0; i < 2000; i++) + { + RandomNumberGenerator.Fill(key); + RandomNumberGenerator.Fill(plain); + QuicAesBlock block = QuicAesBlock.TryCreate(key)!; + using var aes = Aes.Create(); + aes.Key = key; + aes.EncryptEcb(plain, reference, PaddingMode.None); + block.Encrypt(plain, fast); + CollectionAssert.AreEqual(reference, fast); + } + } + + [TestMethod] + public void RefusesKeysOfOtherLengths() + { + Assert.IsNull(QuicAesBlock.TryCreate(new byte[15])); + Assert.IsNull(QuicAesBlock.TryCreate(new byte[32])); + } + + [TestMethod] + public void HeaderProtectionMasksTheSamePacketNumberBytesAsThePlatformCipher() + { + byte[] key = new byte[16]; + RandomNumberGenerator.Fill(key); + using var protection = new QuicHeaderProtection(QuicHeaderCipher.Aes128, key); + using var aes = Aes.Create(); + aes.Key = key; + for (int i = 0; i < 200; i++) + { + byte[] sample = new byte[16]; + RandomNumberGenerator.Fill(sample); + byte[] packet = new byte[40]; + RandomNumberGenerator.Fill(packet); + packet[0] = (byte)(0x40 | (packet[0] & 0x3f)); + byte[] expected = (byte[])packet.Clone(); + byte[] mask = aes.EncryptEcb(sample, PaddingMode.None); + int length = (expected[0] & 0x03) + 1; + expected[0] ^= (byte)(mask[0] & 0x1f); + for (int n = 0; n < length; n++) + { + expected[1 + n] ^= mask[1 + n]; + } + + Assert.IsTrue(protection.Protect(packet, 1, sample)); + CollectionAssert.AreEqual(expected, packet); + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicCampaignTests.cs b/tests/Titanium.Quic.Tests/QuicCampaignTests.cs new file mode 100644 index 000000000..dedf2f8ef --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicCampaignTests.cs @@ -0,0 +1,379 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicCampaignTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly PathInfo Rebound = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50099); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void BytesArriveOnceAndInOrder() + { + byte[] payload = Pattern(256); + byte[] received = Transfer(payload, static sim => + { + sim.Reorder = true; + sim.Duplicate = true; + sim.Delay = TimeSpan.FromMilliseconds(10); + }); + CollectionAssert.AreEqual(payload, received); + } + + [TestMethod] + public void OneCorruptedDatagramIsNotDeliveredAsStreamData() + { + byte[] payload = Pattern(128); + byte[] received = Transfer(payload, static sim => sim.CorruptCount = 1); + CollectionAssert.AreEqual(payload, received); + } + + [TestMethod] + public void AFlippedHandshakeDatagramDoesNotThrow() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + byte[] buffer = new byte[16384]; + int count = client.PollTransmit(Now, buffer, out PathInfo path); + Assert.IsTrue(count > 16); + byte[] mutant = buffer.AsSpan(0, count).ToArray(); + mutant[count / 2] ^= 0x01; + server.HandleDatagram(Now, mutant, path); + var sim = new QuicSimulator(); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + } + + [TestMethod] + public void ADatagramFrameClosesTheConnection() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var sim = new QuicSimulator(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + byte[] payload = [9, 9, 9]; + var frame = new QuicFrame { Kind = QuicFrameKind.Datagram, Data = payload }; + byte[] encoded = new byte[16]; + int written = QuicFrameWriter.Write(frame, [], encoded); + Assert.IsTrue(written > 1); + server.InjectApplicationPayload(encoded.AsSpan(0, written)); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, server.CloseError); + Assert.AreEqual(0, server.ReceivedStream.Length); + } + + [TestMethod] + public void MutatedDatagramsDoNotEscapeOrGrowWithoutBound() + { + byte[] sample = FirstFlight(); + Assert.IsTrue(sample.Length > 8); + var random = new Random(9000); + using X509Certificate2 certificate = Certificate(); + byte[] transmit = new byte[2048]; + for (int i = 0; i < 24; i++) + { + byte[] mutant = Mutate(sample, random, i); + using var server = new QuicConnectionCore(); + server.StartServer(ServerId, certificate, Parameters(client: false)); + server.HandleDatagram(Now, mutant, Path); + server.PollTransmit(Now, transmit, out _); + Assert.IsTrue(server.ReceivedStream.Length <= mutant.Length); + } + + using var client = new QuicConnectionCore(); + using var live = new QuicConnectionCore(); + var sim = new QuicSimulator(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + live.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, live, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + byte[] body = new byte[16]; + Assert.AreEqual(body.Length, client.SendStream(0, body)); + int count = client.PollTransmit(time, transmit, out _); + Assert.IsTrue(count > 4); + transmit[count / 2] ^= 0x01; + live.HandleDatagram(time, transmit.AsSpan(0, count), Path); + Assert.IsFalse(live.IsClosed); + + byte[] stream = new byte[16]; + var frame = new QuicFrame { Kind = QuicFrameKind.Stream, StreamId = 0, Data = stream }; + byte[] encoded = new byte[32]; + int written = QuicFrameWriter.Write(frame, [], encoded); + Assert.IsTrue(written > 1); + for (int i = 0; i < 8; i++) + { + byte[] mutant = Mutate(encoded.AsSpan(0, written).ToArray(), random, i); + using var receiver = new QuicConnectionCore(); + using var sender = new QuicConnectionCore(); + var link = new QuicSimulator(); + sender.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + receiver.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset at = Now; + Assert.IsTrue(Run(sender, receiver, link, ref at, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + receiver.InjectApplicationPayload(mutant); + Assert.IsTrue(receiver.ReceivedStream.Length <= mutant.Length); + } + } + + [TestMethod] + public void AReboundAddressGetsTheReplyWithinTheAmplificationLimit() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var sim = new QuicSimulator(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + byte[] buffer = new byte[16384]; + while (client.PollTransmit(time, buffer, out _) > 0) + { + } + + while (server.PollTransmit(time, buffer, out _) > 0) + { + } + + byte[] body = new byte[32]; + Assert.AreEqual(body.Length, client.SendStream(0, body)); + int count = client.PollTransmit(time, buffer, out _); + Assert.IsTrue(count > 0); + server.HandleDatagram(time, buffer.AsSpan(0, count), Rebound); + Assert.IsFalse(server.IsClosed); + Assert.IsFalse(server.IsPathValidated(Rebound)); + + // A lone ack-eliciting packet is acknowledged when the acknowledgement delay runs out. + Assert.AreEqual(0, server.PollTransmit(time, buffer, out _)); + time += QuicLossRecovery.MaxAckDelay; + server.HandleTimeout(time); + int reply = server.PollTransmit(time, buffer, out PathInfo path); + Assert.IsTrue(reply > 0); + Assert.IsTrue(path.Equals(Rebound)); + long received = server.BytesReceived(Rebound); + Assert.IsTrue(received >= count); + Assert.IsTrue(server.BytesSent(Rebound) <= received * 3); + Assert.AreEqual(body.Length, server.ReceivedStream.Length); + } + + [TestMethod] + public void AnEmptyDatagramIsDropped() + { + var sim = new QuicSimulator(); + sim.Submit(toServer: true, ReadOnlySpan.Empty, Now); + Assert.IsNull(sim.NextDelivery()); + } + + [TestMethod] + public void ABlackholeDropsThePayload() + { + byte[] payload = Pattern(32); + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var sim = new QuicSimulator(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + sim.Blackhole = true; + Assert.AreEqual(payload.Length, client.SendStream(0, payload)); + DateTimeOffset limit = time + TimeSpan.FromSeconds(2); + byte[] buffer = new byte[16384]; + while (time < limit && !client.IsClosed && !server.IsClosed) + { + Exchange(client, server, sim, buffer, time); + time += TimeSpan.FromMilliseconds(50); + client.HandleTimeout(time); + server.HandleTimeout(time); + } + + Assert.AreEqual(0, server.ReceivedStream.Length); + } + + private static byte[] Transfer(byte[] payload, Action arrange) + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var sim = new QuicSimulator(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + Assert.IsTrue(Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)); + arrange(sim); + Assert.AreEqual(payload.Length, client.SendStream(0, payload)); + int need = payload.Length; + Assert.IsTrue(Run(client, server, sim, ref time, (left, right) => right.ReceivedStreamLength >= need)); + Assert.IsFalse(client.IsClosed); + Assert.IsFalse(server.IsClosed); + return server.ReceivedStream[..payload.Length]; + } + + private static byte[] FirstFlight() + { + using var client = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + byte[] buffer = new byte[16384]; + int count = client.PollTransmit(Now, buffer, out _); + return buffer.AsSpan(0, count).ToArray(); + } + + private static byte[] Mutate(byte[] sample, Random random, int index) + { + if (sample.Length == 0) + { + return [0xFF]; + } + + int mode = index % 4; + if (mode == 0) + { + byte[] flipped = (byte[])sample.Clone(); + flipped[random.Next(flipped.Length)] ^= (byte)(1 << random.Next(8)); + return flipped; + } + + if (mode == 1) + { + return sample.AsSpan(0, random.Next(sample.Length + 1)).ToArray(); + } + + int at = random.Next(sample.Length + 1); + byte[] grown = new byte[sample.Length + 1]; + sample.AsSpan(0, at).CopyTo(grown); + grown[at] = mode == 2 ? (byte)0xFF : sample[Math.Min(at, sample.Length - 1)]; + sample.AsSpan(at).CopyTo(grown.AsSpan(at + 1)); + return grown; + } + + private static byte[] Pattern(int length) + { + var payload = new byte[length]; + for (int i = 0; i < payload.Length; i++) + { + payload[i] = (byte)(i % 251); + } + + return payload; + } + + private static bool Run( + QuicConnectionCore client, + QuicConnectionCore server, + QuicSimulator sim, + ref DateTimeOffset time, + Func done) + { + DateTimeOffset limit = time + TimeSpan.FromSeconds(30); + byte[] buffer = new byte[16384]; + while (time <= limit) + { + if (client.IsClosed || server.IsClosed) + { + return false; + } + + Exchange(client, server, sim, buffer, time); + if (done(client, server)) + { + return true; + } + + DateTimeOffset? jump = Soonest(Soonest(client.NextTimeout(), server.NextTimeout()), sim.NextDelivery()); + if (jump is DateTimeOffset at && at > time) + { + time = at; + } + else + { + time += TimeSpan.FromMilliseconds(5); + } + + client.HandleTimeout(time); + server.HandleTimeout(time); + } + + return false; + } + + private static void Exchange(QuicConnectionCore client, QuicConnectionCore server, QuicSimulator sim, byte[] buffer, DateTimeOffset time) + { + for (int round = 0; round < 8; round++) + { + while (client.PollTransmit(time, buffer, out _) is int clientCount && clientCount > 0) + { + sim.Submit(toServer: true, buffer.AsSpan(0, clientCount), time); + } + + while (server.PollTransmit(time, buffer, out _) is int serverCount && serverCount > 0) + { + sim.Submit(toServer: false, buffer.AsSpan(0, serverCount), time); + } + + sim.Deliver(server, toServer: true, time, Path); + sim.Deliver(client, toServer: false, time, Path); + } + } + + private static DateTimeOffset? Soonest(DateTimeOffset? left, DateTimeOffset? right) + { + if (left is null) + { + return right; + } + + if (right is null) + { + return left; + } + + return left < right ? left : right; + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicConnectionCoreEdgeTests.cs b/tests/Titanium.Quic.Tests/QuicConnectionCoreEdgeTests.cs new file mode 100644 index 000000000..da3796ecc --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicConnectionCoreEdgeTests.cs @@ -0,0 +1,217 @@ +using System; +using System.Net; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicConnectionCoreEdgeTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + [TestMethod] + public void AddressAndConnectionIdEdgesStayInsideTheLength() + { + Assert.ThrowsExactly(() => new PathInfo([], 1, [1], 1)); + Assert.ThrowsExactly(() => new PathInfo(new byte[17], 1, [1], 1)); + Assert.ThrowsExactly(() => new PathInfo([1], 65536, [1], 1)); + Assert.ThrowsExactly(() => new PathInfo([1], 1, [], 1)); + + byte[] high = new byte[16]; + high[0] = 1; + byte[] low = new byte[16]; + low[8] = 1; + var left = new PathInfo(high, 65535, [9], 0); + var right = new PathInfo(low, 65535, [9], 0); + Assert.IsTrue(left.Equals(left)); + Assert.IsFalse(left.Equals(right)); + Assert.IsFalse(left.Equals(new PathInfo(high, 65534, [9], 0))); + Assert.IsFalse(left.Equals(null)); + Assert.AreEqual(left.GetHashCode(), new PathInfo(high, 65535, [9], 0).GetHashCode()); + + Assert.ThrowsExactly(() => new QuicConnectionId(new byte[21])); + var empty = new QuicConnectionId([]); + Assert.AreEqual(0, empty.Length); + Assert.IsTrue(empty.Matches([])); + Assert.IsFalse(empty.Matches([1])); + byte[] full = new byte[20]; + full[8] = 2; + full[19] = 3; + var id = new QuicConnectionId(full); + Assert.AreEqual(20, id.Length); + Assert.IsTrue(id.Equals(new QuicConnectionId(full))); + Assert.IsFalse(id.Equals(new QuicConnectionId(new byte[20]))); + Assert.IsFalse(id.Equals(null)); + } + + [TestMethod] + public void TheLongerShortHeaderMatchAndATruncatedLongHeaderAreEdges() + { + var table = new QuicConnectionTable(); + var shorter = new QuicConnectionCore(); + var longer = new QuicConnectionCore(); + table.Add(new QuicConnectionId([0xaa]), shorter); + table.Add(new QuicConnectionId([0xaa, 0xbb]), longer); + + Assert.IsFalse(table.TryDispatch(Now, [0xC0, 0, 0, 0, 0], Path)); + var tooLong = new byte[27]; + tooLong[0] = 0xC0; + tooLong[5] = 21; + Assert.IsFalse(table.TryDispatch(Now, tooLong, Path)); + var truncated = new byte[8]; + truncated[0] = 0xC0; + truncated[5] = 4; + Assert.IsFalse(table.TryDispatch(Now, truncated, Path)); + + Assert.IsTrue(table.TryDispatch(Now, [0x40, 0xaa, 0xbb], Path)); + Assert.AreEqual(0L, shorter.BytesReceived(Path)); + Assert.AreEqual(3L, longer.BytesReceived(Path)); + } + + [TestMethod] + public void AmplificationMtuAndPacingStopAtTheBoundary() + { + var core = new QuicConnectionCore(); + Assert.IsFalse(core.TryStageTransmit(Path, [])); + Assert.IsFalse(core.TryStageTransmit(Path, new byte[65536])); + core.HandleDatagram(Now, new byte[100], Path); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[301])); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[300])); + var buffer = new byte[65535]; + Assert.AreEqual(300, core.PollTransmit(Now, buffer, out PathInfo sent)); + Assert.AreEqual(Path, sent); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(300L, core.BytesSent(Path)); + Assert.AreEqual(0L, core.BytesSent(new PathInfo([10, 0, 0, 9], 1, [10, 0, 0, 8], 2))); + + core.MarkAddressValidated(Path); + Assert.IsTrue(core.IsPathValidated(Path)); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[800])); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[100])); + Assert.AreEqual(100, core.PollTransmit(Now, new byte[150], out _)); + Assert.AreEqual(0, core.PollTransmit(Now, new byte[150], out _)); + Assert.AreEqual(301, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(800, core.PollTransmit(Now, buffer, out _)); + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1201])); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1201], pmtu: true)); + Assert.AreEqual(1201, core.PollTransmit(Now, buffer, out _)); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[65535], pmtu: true)); + Assert.AreEqual(65535, core.PollTransmit(Now, buffer, out _)); + + for (int i = 0; i < 9; i++) + { + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: (ulong)i, payload: [1])); + } + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[200], track: true, number: 9, payload: [1])); + for (int i = 0; i < 10; i++) + { + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + } + + Assert.AreEqual(11000L, core.BytesInFlight); + + // An exempt packet does not touch the window, so it goes out whether or not the window holds data. + Assert.IsTrue(core.TryStageTransmit(Path, new byte[50], track: true, exempt: true, number: 12, payload: [1])); + long flight = core.BytesInFlight; + Assert.AreEqual(50, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(flight, core.BytesInFlight); + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: 10, payload: [1])); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[100], track: true, number: 11, payload: [1])); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(Now + TimeSpan.FromMilliseconds(333), core.NextTimeout()); + Assert.IsFalse(core.HandleTimeout(Now + TimeSpan.FromMilliseconds(333))); + Assert.AreEqual(Now + TimeSpan.FromMilliseconds(666), core.NextTimeout()); + + // A probe exists to get out while the window is closed. + Assert.IsTrue(core.TryStageTransmit(Path, new byte[100], track: true, probe: true, number: 13, payload: [1])); + Assert.AreEqual(100, core.PollTransmit(Now, buffer, out _)); + + var migrated = new PathInfo([10, 0, 0, 4], 9, [10, 0, 0, 5], 10); + core.Migrate(migrated); + Assert.IsFalse(core.IsPathValidated(migrated)); + core.MarkAddressValidated(migrated); + Assert.IsTrue(core.IsPathValidated(migrated)); + core.MarkAddressValidated(migrated); + var unseen = new PathInfo([1, 2, 3, 4], 7, [5, 6, 7, 8], 8); + core.MarkAddressValidated(unseen); + Assert.IsTrue(core.IsPathValidated(unseen)); + var missing = new PathInfo([9], 1, [8], 2); + Assert.IsTrue(core.TryStageTransmit(missing, new byte[20])); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + } + + [TestMethod] + public void AnExemptPacketLeavesWhileTheWindowHoldsData() + { + var core = new QuicConnectionCore(); + var buffer = new byte[65535]; + core.MarkAddressValidated(Path); + + // Fill the initial window, then queue data that cannot go out yet. + for (int i = 0; i < 9; i++) + { + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: (ulong)i, payload: [1])); + } + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: 9, payload: [1])); + for (int i = 0; i < 10; i++) + { + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + } + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: 10, payload: [1])); + long flight = core.BytesInFlight; + + // The ACK-only packet carries the higher number and still leaves. Two peers that both hold + // data behind a closed window open each other's window only through ACKs, so an ACK that + // waited behind that data would stall both directions. + Assert.IsTrue(core.TryStageTransmit(Path, new byte[40], track: true, exempt: true, number: 11, payload: [1])); + Assert.AreEqual(40, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(flight, core.BytesInFlight); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + } + + [TestMethod] + public void AnIdleDeadlineClosesBeforeTheLossTimer() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + var core = new QuicConnectionCore(); + byte[] id = QuicConnectionSession.NewConnectionId(); + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = id, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + MaxIdleTimeout = 1, + }; + byte[] encoded = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, encoded); + core.StartClient(QuicConnectionSession.PathOf(local, remote), id, id, encoded.AsSpan(0, written)); + var buffer = new byte[8192]; + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + Assert.IsFalse(core.IdleTimedOut); + Assert.IsTrue(core.HandleTimeout(Now.AddHours(1))); + Assert.IsTrue(core.IdleTimedOut); + Assert.IsTrue(core.IsClosed); + Assert.IsTrue(core.TryStageTransmit(QuicConnectionSession.PathOf(local, remote), [1, 2, 3])); + Assert.AreEqual(0, core.PollTransmit(Now.AddHours(1), buffer, out _)); + + var loss = new QuicConnectionCore(); + byte[] lossId = QuicConnectionSession.NewConnectionId(); + loss.StartClient(QuicConnectionSession.PathOf(local, remote), lossId, lossId, QuicConnectionSession.Parameters(client: true, lossId)); + Assert.IsTrue(loss.PollTransmit(Now, buffer, out _) > 0); + Assert.IsTrue(loss.HandleTimeout(Now.AddHours(1))); + Assert.IsFalse(loss.IdleTimedOut); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicConnectionCoreTests.cs b/tests/Titanium.Quic.Tests/QuicConnectionCoreTests.cs new file mode 100644 index 000000000..c3fdbade5 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicConnectionCoreTests.cs @@ -0,0 +1,91 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicConnectionCoreTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + [TestMethod] + public void AnUnknownDestinationConnectionIdDoesNotAllocate() + { + var table = new QuicConnectionTable(); + var core = new QuicConnectionCore(); + table.Add(new QuicConnectionId([0x01, 0x02]), core); + Assert.IsFalse(table.TryDispatch(Now, Datagram([0x99], 40), Path)); + Assert.IsFalse(table.TryDispatch(Now, [0x40, 0x03, 0x04], Path)); + Assert.IsFalse(table.TryDispatch(Now, [], Path)); + Assert.AreEqual(1, table.Count); + Assert.AreEqual(0L, core.BytesReceived(Path)); + + Assert.IsTrue(table.TryDispatch(Now, Datagram([0x01, 0x02], 40), Path)); + Assert.AreEqual(1, table.Count); + Assert.AreEqual(40L, core.BytesReceived(Path)); + } + + [TestMethod] + public void ASmallDatagramProducesNoTransmitOverTheLimit() + { + var core = new QuicConnectionCore(); + core.HandleDatagram(Now, Datagram([0x01], 50), Path); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200])); + var buffer = new byte[2048]; + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(0L, core.BytesSent(Path)); + + core.HandleDatagram(Now, Datagram([0x01], 350), Path); + Assert.AreEqual(400L, core.BytesReceived(Path)); + Assert.AreEqual(1200, core.PollTransmit(Now, buffer, out PathInfo sent)); + Assert.AreEqual(Path, sent); + Assert.AreEqual(1200L, core.BytesSent(Path)); + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200])); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(1200L, core.BytesSent(Path)); + + core.MarkAddressValidated(Path); + Assert.AreEqual(1200, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(2400L, core.BytesSent(Path)); + } + + [TestMethod] + public void AmplificationIsPerPath() + { + var other = new PathInfo([10, 0, 0, 1], 443, [10, 0, 0, 3], 50001); + var core = new QuicConnectionCore(); + core.HandleDatagram(Now, Datagram([0x01], 50), Path); + core.HandleDatagram(Now, Datagram([0x01], 200), other); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[200])); + Assert.IsTrue(core.TryStageTransmit(other, new byte[200])); + var buffer = new byte[200]; + Assert.AreEqual(200, core.PollTransmit(Now, buffer, out PathInfo sent)); + Assert.AreEqual(other, sent); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + Assert.AreEqual(0L, core.BytesSent(Path)); + Assert.AreEqual(200L, core.BytesSent(other)); + } + + [TestMethod] + public void AReceivedDatagramDoesNotArmALossTimer() + { + var core = new QuicConnectionCore(); + Assert.IsNull(core.NextTimeout()); + core.HandleDatagram(Now, Datagram([0x01], 50), Path); + Assert.IsNull(core.NextTimeout()); + Assert.IsFalse(core.HandleTimeout(Now + TimeSpan.FromSeconds(1))); + } + + private static byte[] Datagram(byte[] connectionId, int size) + { + var buffer = new byte[size]; + buffer[0] = 0xC0; + buffer[4] = 1; + buffer[5] = (byte)connectionId.Length; + connectionId.CopyTo(buffer.AsSpan(6)); + return buffer; + } +} diff --git a/tests/Titanium.Quic.Tests/QuicConnectionSessionTests.cs b/tests/Titanium.Quic.Tests/QuicConnectionSessionTests.cs new file mode 100644 index 000000000..98b3e3be5 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicConnectionSessionTests.cs @@ -0,0 +1,174 @@ +#pragma warning disable CA1416 // QuicException is the BCL error type. These tests do not start the platform QUIC stack. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicConnectionSessionTests +{ + [TestMethod] + public void StaticHelpersKeepTheIdLengthAndTheServerParameter() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + Assert.IsTrue(path.Equals(new PathInfo(local.Address.GetAddressBytes(), 9, remote.Address.GetAddressBytes(), 10))); + Assert.IsFalse(path.Equals(new PathInfo(remote.Address.GetAddressBytes(), 10, local.Address.GetAddressBytes(), 9))); + + byte[] id = QuicConnectionSession.NewConnectionId(); + Assert.AreEqual(QuicConnectionSession.ConnectionIdLength, id.Length); + byte[] client = QuicConnectionSession.Parameters(client: true, id); + byte[] server = QuicConnectionSession.Parameters(client: false, id); + Assert.IsTrue(client.Length > 0); + Assert.IsTrue(server.Length > client.Length); + byte[] limited = QuicConnectionSession.Parameters(client: true, id, maxStreamsBidi: 0, maxStreamsUni: 3, idleTimeoutMs: 30_000); + Assert.IsTrue(QuicTransportParametersCodec.TryRead(limited, fromServer: false, retryReceived: false, out QuicTransportParameters read, out ulong error)); + Assert.AreEqual(0UL, error); + Assert.AreEqual(0UL, read.InitialMaxStreamsBidi); + Assert.AreEqual(3UL, read.InitialMaxStreamsUni); + Assert.AreEqual(30_000UL, read.MaxIdleTimeout); + + Assert.IsNull(QuicConnectionSession.ProtocolNames(null)); + Assert.IsNull(QuicConnectionSession.ProtocolNames(new List())); + string[] names = QuicConnectionSession.ProtocolNames([new SslApplicationProtocol("h3")])!; + CollectionAssert.AreEqual(new[] { "h3" }, names); + + QuicConnectionSession.RejectFips(allow: true); + QuicConnectionSession.RejectFips(allow: false); + } + + [TestMethod] + public async Task AClosedSessionRejectsAWriteAndASecondDisposeIsQuiet() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + using var core = new QuicConnectionCore(); + var transport = new FakeTransport(); + var session = new QuicConnectionSession(core, transport, local, remote, ownsTransport: false); + byte[] localId = QuicConnectionSession.NewConnectionId(); + core.StartClient(QuicConnectionSession.PathOf(local, remote), localId, QuicConnectionSession.NewConnectionId(), QuicConnectionSession.Parameters(client: true, localId)); + + session.SetRemote(new IPEndPoint(IPAddress.Loopback, 11)); + Assert.AreEqual(11, session.RemoteEndPoint.Port); + Assert.IsFalse(session.TakePendingHello(out string serverName)); + Assert.IsTrue(string.IsNullOrEmpty(serverName)); + using X509Certificate2 certificate = Certificate(); + Assert.IsFalse(session.CompleteHello(certificate)); + Assert.IsFalse(session.IsClosed); + Assert.AreEqual(0, session.CopyReceived(0, [])); + Assert.AreEqual(0, session.CopyReceived(4, new byte[8])); + session.Timeout(DateTimeOffset.MinValue); + + var stream = new ManagedQuicStream(session, 0, QuicStreamType.Bidirectional); + session.AddStream(stream); + session.NotifyStreams(); + await session.FlushAsync(); + DateTimeOffset? due = session.NextTimeout(); + Assert.IsTrue(due.HasValue); + session.Timeout(due.Value); + await session.FlushAsync(); + Assert.IsTrue(transport.Sends >= 2); + Assert.AreEqual(0, transport.Batches); + + QuicException rejected = Assert.ThrowsExactly(() => session.Send(0, [1, 2, 3])); + Assert.AreEqual(QuicError.InternalError, rejected.QuicError); + Assert.AreEqual("The stream did not accept the write.", rejected.Message); + session.Close(-1); + Assert.IsTrue(session.IsClosed); + session.SignalClosedHandshake(); + Assert.IsTrue(session.Handshake.IsFaulted); + Assert.AreEqual("The connection closed before the handshake completed (local transport 0x0).", session.Handshake.Exception!.InnerException!.Message); + QuicException closed = Assert.ThrowsExactly(() => session.Send(0, [1])); + Assert.AreEqual(QuicError.ConnectionAborted, closed.QuicError); + Assert.AreEqual("The connection closed with error 0x0.", closed.Message); + + session.Dispose(); + session.Dispose(); + Assert.AreEqual(0, transport.Disposed); + } + + [TestMethod] + [Timeout(10000)] + public async Task TheClientLoopStopsWhenTheSessionStops() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + using var core = new QuicConnectionCore(); + var transport = new FakeTransport(); + var session = new QuicConnectionSession(core, transport, local, remote, ownsTransport: true); + byte[] localId = QuicConnectionSession.NewConnectionId(); + core.StartClient(QuicConnectionSession.PathOf(local, remote), localId, QuicConnectionSession.NewConnectionId(), QuicConnectionSession.Parameters(client: true, localId)); + session.StartClientLoop(); + DateTime deadline = DateTime.UtcNow.AddSeconds(5); + while (transport.Receives < 3 && DateTime.UtcNow < deadline) + { + await Task.Delay(20); + } + + Assert.IsTrue(transport.Receives >= 3); + await session.StopAsync(); + Assert.IsTrue(transport.Sends >= 1); + Assert.AreEqual(1, transport.Disposed); + session.Dispose(); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } + + private sealed class FakeTransport : IUdpPacketTransport + { + public int Sends; + + public int Batches; + + public int Receives; + + public int Disposed; + + public IPEndPoint LocalEndpoint { get; } = new(IPAddress.Loopback, 9); + + public int MaximumDatagramSize => 65507; + + public bool DatagramPending => false; + + public ValueTask SendAsync(ReadOnlyMemory datagram, IPEndPoint destination, CancellationToken cancellationToken) + { + Sends++; + return ValueTask.FromResult(datagram.Length); + } + + public ValueTask SendBatchAsync(ReadOnlyMemory> datagrams, IPEndPoint destination, CancellationToken cancellationToken) + { + Batches++; + return ValueTask.FromResult(datagrams.Length); + } + + public async ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken) + { + Receives++; + if (Receives == 1 && buffer.Length > 0) + { + buffer.Span[0] = 0; + return new UdpReceived(1, new IPEndPoint(IPAddress.Loopback, 10)); + } + + await Task.Delay(Timeout.Infinite, cancellationToken).ConfigureAwait(false); + return new UdpReceived(0, new IPEndPoint(IPAddress.Loopback, 10)); + } + + public void Dispose() => Disposed++; + } +} diff --git a/tests/Titanium.Quic.Tests/QuicCubicComparisonTests.cs b/tests/Titanium.Quic.Tests/QuicCubicComparisonTests.cs new file mode 100644 index 000000000..cd208b563 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicCubicComparisonTests.cs @@ -0,0 +1,179 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicCubicComparisonTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + private const int PayloadBytes = 64 * 1024; + + [TestMethod] + public void TheSimulatorTimesATransfer() + { + long renoLoop = Transfer(static () => new QuicNewReno(), TimeSpan.Zero, 0); + long cubicLoop = Transfer(static () => new QuicCubic(), TimeSpan.Zero, 0); + long renoDelay = Transfer(static () => new QuicNewReno(), TimeSpan.FromMilliseconds(80), 0); + long cubicDelay = Transfer(static () => new QuicCubic(), TimeSpan.FromMilliseconds(80), 0); + long renoLoss = Transfer(static () => new QuicNewReno(), TimeSpan.FromMilliseconds(80), 1); + long cubicLoss = Transfer(static () => new QuicCubic(), TimeSpan.FromMilliseconds(80), 1); + Assert.IsTrue(renoLoop >= 0 && cubicLoop >= renoLoop); + Assert.IsTrue(renoDelay > renoLoop && cubicDelay >= renoDelay); + Assert.IsTrue(renoLoss > 0, "Reno must deliver after one dropped datagram"); + Assert.IsTrue(cubicLoss > 0, "CUBIC must deliver after one dropped datagram"); + // One dropped datagram costs a recovery round or two. The lossless transfer now finishes in about three round trips\r\n // because a 64 KiB application flight is allowed, so the bound is five lossless transfers. A controller that collapses to the minimum window + // or retransmits spuriously takes several times the lossless transfer. + Assert.IsTrue(renoLoss <= 5 * renoDelay, "Reno must recover one loss within five lossless transfers"); + Assert.IsTrue(cubicLoss <= 5 * cubicDelay, "CUBIC must recover one loss within five lossless transfers"); + } + + private static long Transfer(Func controller, TimeSpan delay, int dropOnce) + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(controller()); + using var server = new QuicConnectionCore(controller()); + var sim = new QuicSimulator { Delay = delay }; + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + DateTimeOffset time = Now; + if (!Run(client, server, sim, ref time, static (left, right) => left.HandshakeComplete && right.HandshakeComplete)) + { + return -1; + } + + var payload = new byte[PayloadBytes]; + payload[0] = 0x5A; + payload[^1] = 0xA5; + if (client.SendStream(0, payload) != payload.Length) + { + return -1; + } + + sim.DropCount = dropOnce; + DateTimeOffset started = time; + bool delivered = Run(client, server, sim, ref time, static (left, right) => right.ReceivedStreamLength >= PayloadBytes); + if (!delivered || client.IsClosed || server.IsClosed) + { + return -1; + } + + byte[] received = server.ReceivedStream; + if (received.Length < PayloadBytes || received[0] != 0x5A || received[PayloadBytes - 1] != 0xA5) + { + return -1; + } + + return (time - started).Ticks; + } + + private static bool Run( + QuicConnectionCore client, + QuicConnectionCore server, + QuicSimulator sim, + ref DateTimeOffset time, + Func done) + { + DateTimeOffset limit = time + TimeSpan.FromSeconds(30); + byte[] buffer = new byte[16384]; + while (time <= limit) + { + if (client.IsClosed || server.IsClosed) + { + return false; + } + + Exchange(client, server, sim, buffer, time); + if (done(client, server)) + { + return true; + } + + DateTimeOffset? jump = Soonest(Soonest(client.NextTimeout(), server.NextTimeout()), sim.NextDelivery()); + if (jump is DateTimeOffset at && at > time) + { + time = at; + } + else + { + time += TimeSpan.FromMilliseconds(5); + } + + client.HandleTimeout(time); + server.HandleTimeout(time); + } + + return false; + } + + private static void Exchange(QuicConnectionCore client, QuicConnectionCore server, QuicSimulator sim, byte[] buffer, DateTimeOffset time) + { + for (int round = 0; round < 8; round++) + { + while (client.PollTransmit(time, buffer, out _) is int clientCount && clientCount > 0) + { + sim.Submit(toServer: true, buffer.AsSpan(0, clientCount), time); + } + + while (server.PollTransmit(time, buffer, out _) is int serverCount && serverCount > 0) + { + sim.Submit(toServer: false, buffer.AsSpan(0, serverCount), time); + } + + sim.Deliver(server, toServer: true, time, Path); + sim.Deliver(client, toServer: false, time, Path); + } + } + + private static DateTimeOffset? Soonest(DateTimeOffset? left, DateTimeOffset? right) + { + if (left is null) + { + return right; + } + + if (right is null) + { + return left; + } + + return left < right ? left : right; + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicCubicTests.cs b/tests/Titanium.Quic.Tests/QuicCubicTests.cs new file mode 100644 index 000000000..d8dba9ccc --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicCubicTests.cs @@ -0,0 +1,76 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicCubicTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + [TestMethod] + public void ALossKeepsSeventyPercentOfTheBytesInFlight() + { + var cubic = new QuicCubic(); + cubic.OnSent(12000); + cubic.OnLost(1200, Now, Now, persistentCongestion: false); + Assert.AreEqual(8400, cubic.CongestionWindow); + + var reno = new QuicNewReno(); + reno.OnSent(12000); + reno.OnLost(1200, Now, Now, persistentCongestion: false); + Assert.IsTrue(cubic.CongestionWindow > reno.CongestionWindow); + } + + [TestMethod] + public void TheWindowGrowsTowardTheRememberedSize() + { + var cubic = new QuicCubic(); + cubic.OnSent(12000); + cubic.OnLost(1200, Now, Now, persistentCongestion: false); + DateTimeOffset ack = Now + TimeSpan.FromSeconds(2); + cubic.OnAcked(1200, ack - TimeSpan.FromMilliseconds(10), ack, grow: true); + Assert.AreEqual(8914, cubic.CongestionWindow); + DateTimeOffset again = ack + TimeSpan.FromSeconds(1); + cubic.OnAcked(1200, again - TimeSpan.FromMilliseconds(50), again, grow: true); + Assert.AreEqual(9406, cubic.CongestionWindow); + } + + [TestMethod] + public void PersistentCongestionUsesTheMinimumWindow() + { + var cubic = new QuicCubic(); + cubic.OnSent(12000); + cubic.OnLost(1200, Now, Now, persistentCongestion: true); + Assert.AreEqual(cubic.MinimumWindow, cubic.CongestionWindow); + DateTimeOffset after = Now + TimeSpan.FromMilliseconds(5); + cubic.OnAcked(1200, after, after, grow: true); + Assert.AreEqual(cubic.MinimumWindow + 1200, cubic.CongestionWindow); + cubic.OnDiscarded(20000); + Assert.AreEqual(0, cubic.BytesInFlight); + Assert.AreEqual(cubic.MinimumWindow + 1200, cubic.CongestionWindow); + } + + [TestMethod] + public void SlowStartGrowsAndASecondLossInRecoveryDoesNot() + { + var cubic = new QuicCubic(); + cubic.OnSent(1000); + cubic.OnAcked(1000, Now, Now, grow: true); + Assert.AreEqual(0, cubic.BytesInFlight); + Assert.AreEqual(13000, cubic.CongestionWindow); + cubic.OnAcked(50, Now, Now, grow: false); + Assert.AreEqual(13000, cubic.CongestionWindow); + + cubic.OnSent(12000); + cubic.OnLost(1200, Now, Now, persistentCongestion: false); + Assert.AreEqual(8400, cubic.CongestionWindow); + cubic.OnLost(100, Now, Now + TimeSpan.FromMilliseconds(1), persistentCongestion: false); + Assert.AreEqual(8400, cubic.CongestionWindow); + cubic.OnAcked(100, Now, Now + TimeSpan.FromMilliseconds(1), grow: true); + Assert.AreEqual(8400, cubic.CongestionWindow); + cubic.OnLost(100000, Now, Now + TimeSpan.FromMilliseconds(2), persistentCongestion: false); + Assert.AreEqual(0, cubic.BytesInFlight); + Assert.AreEqual(8400, cubic.CongestionWindow); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicDatagramInjectTests.cs b/tests/Titanium.Quic.Tests/QuicDatagramInjectTests.cs new file mode 100644 index 000000000..c2d8ef529 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicDatagramInjectTests.cs @@ -0,0 +1,74 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicDatagramInjectTests +{ + [TestMethod] + public async Task InjectedListenerRepliesWithoutASocket() + { + var remote = new IPEndPoint(IPAddress.Loopback, 9); + IPEndPoint? sentTo = null; + int sent = 0; + await using ManagedQuicListener listener = ManagedQuicListener.CreateInjected( + new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions(), + }), + }, + new IPEndPoint(IPAddress.Loopback, 443), + (datagram, destination, _) => + { + sent = datagram.Length; + sentTo = destination; + return ValueTask.CompletedTask; + }); + + var packet = new byte[1200]; + packet[0] = 0xC0; + packet[4] = 2; + packet[5] = 4; + packet[10] = 0; + await listener.HandleDatagramAsync(packet, remote); + Assert.IsTrue(sent > 0); + Assert.AreEqual(remote, sentTo); + } + + [TestMethod] + public async Task SocketListenerRejectsAnInjectedDatagram() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + + await Assert.ThrowsExceptionAsync(() => + listener.HandleDatagramAsync(new byte[1200], new IPEndPoint(IPAddress.Loopback, 9)).AsTask()); + await Assert.ThrowsExceptionAsync(() => listener.DriveAsync().AsTask()); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicFlowEdgeTests.cs b/tests/Titanium.Quic.Tests/QuicFlowEdgeTests.cs new file mode 100644 index 000000000..bbf67ac49 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicFlowEdgeTests.cs @@ -0,0 +1,292 @@ +using System; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicFlowEdgeTests +{ + [TestMethod] + public void SendCreditStopsAtTheSmallerLimitAndResumes() + { + var flow = new QuicFlow(); + flow.SetLocal(Parameters(100, 100, 100, 100, 4, 4), client: true); + flow.SetPeer(Parameters(2, 5, 5, 3, 1, 1)); + + Assert.AreEqual(0, flow.Queue(0, [], out bool blocked)); + Assert.IsTrue(blocked); + Assert.AreEqual(0, flow.Queue(4, [1], out blocked)); + Assert.IsTrue(blocked); + Assert.AreEqual(0, flow.Queue(6, [1], out blocked)); + + int sent = flow.Queue(0, [1, 2, 3, 4, 5], out blocked); + Assert.AreEqual(2, sent); + Assert.IsTrue(blocked); + IReadOnlyList ready = flow.TakeReady(); + Assert.AreEqual(1, ready.Count); + Assert.AreEqual(0L, ready[0].Offset); + CollectionAssert.AreEqual(new byte[] { 1, 2 }, ready[0].ToArray()); + Assert.AreEqual(0, flow.TakeReady().Count); + + flow.RaiseSend(2, 0, 5); + Assert.IsTrue(flow.SendBlocked); + flow.RaiseSend(20, 0, 5); + Assert.IsFalse(flow.SendBlocked); + ready = flow.TakeReady(); + Assert.AreEqual(2L, ready[0].Offset); + CollectionAssert.AreEqual(new byte[] { 3, 4, 5 }, ready[0].ToArray()); + + Assert.AreEqual(3, flow.Queue(1, [6, 7, 8], out _)); + Assert.AreEqual(3, flow.Queue(2, [9, 10, 11, 12], out blocked)); + Assert.IsTrue(blocked); + ready = flow.TakeReady(); + CollectionAssert.AreEqual(new byte[] { 6, 7, 8 }, ready[0].ToArray()); + CollectionAssert.AreEqual(new byte[] { 9, 10, 11 }, ready[1].ToArray()); + + var raised = new QuicFlow(); + raised.SetLocal(Parameters(100, 100, 100, 100, 4, 4), client: true); + raised.SetPeer(Parameters(100, 100, 2, 0, 4, 4)); + Assert.AreEqual(2, raised.Queue(0, [1, 2, 3, 4], out bool still)); + Assert.IsTrue(still); + raised.RaiseSend(100, 0, 2); + Assert.IsTrue(raised.SendBlocked); + raised.RaiseSend(100, 0, 4); + Assert.IsFalse(raised.SendBlocked); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, raised.TakeReady()[0].ToArray()); + Assert.AreEqual(0, raised.Queue(2, [9], out still)); + Assert.IsTrue(still); + } + + [TestMethod] + public void ReceiveCreditRejectsAWrapAndASecondLimit() + { + var flow = new QuicFlow(); + flow.SetLocal(Parameters(100, 100, 100, 100, 1, 1), client: true); + flow.SetPeer(Parameters(100, 100, 100, 100, 1, 1)); + + Assert.IsFalse(flow.AcceptStream(4, 0, [1], out ulong error)); + Assert.AreEqual(QuicFlow.StreamStateError, error); + Assert.IsFalse(flow.AcceptStream(5, 0, [1], out error)); + Assert.AreEqual(QuicFlow.StreamLimitError, error); + Assert.IsTrue(flow.Queue(0, [9], out _) > 0); + Assert.AreEqual(1, flow.TakeReady().Count); + Assert.IsFalse(flow.AcceptStream(0, ulong.MaxValue, [1], out error)); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, error); + + Assert.IsTrue(flow.AcceptStream(0, 2, [3, 4], out error)); + Assert.AreEqual(0UL, error); + Assert.AreEqual(0, flow.Received.Length); + Assert.IsTrue(flow.AcceptStream(0, 0, [1, 2], out _)); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, flow.Received); + Assert.IsTrue(flow.AcceptStream(0, 0, [1, 2], out _)); + Assert.AreEqual(4, flow.Received.Length); + + var limited = new QuicFlow(); + limited.SetLocal(Parameters(4, 2, 8, 8, 4, 4), client: true); + limited.SetPeer(Parameters(4, 2, 8, 8, 4, 4)); + Assert.IsTrue(limited.Queue(0, [9], out _) > 0); + Assert.AreEqual(1, limited.TakeReady().Count); + Assert.IsFalse(limited.AcceptStream(0, 0, [1, 2, 3], out error)); + Assert.AreEqual(QuicFlow.FlowControlError, error); + Assert.IsTrue(limited.AcceptStream(0, 0, [1, 2], out _)); + Assert.IsFalse(limited.AcceptStream(1, 0, [5, 6, 7], out error)); + Assert.AreEqual(QuicFlow.FlowControlError, error); + limited.Grant(1, 8, 4); + Assert.IsFalse(limited.AcceptStream(1, 0, [5, 6, 7], out error)); + limited.Grant(1, 8, 10); + Assert.IsTrue(limited.AcceptStream(1, 0, [5, 6, 7], out _)); + CollectionAssert.AreEqual(new byte[] { 1, 2, 5, 6, 7 }, limited.Received); + + var granted = new QuicFlow(); + granted.SetLocal(Parameters(100, 2, 100, 100, 4, 4), client: true); + granted.SetPeer(Parameters(100, 2, 100, 100, 4, 4)); + Assert.IsTrue(granted.Queue(0, [9], out _) > 0); + Assert.AreEqual(1, granted.TakeReady().Count); + Assert.IsTrue(granted.AcceptStream(0, 0, [1, 2], out _)); + granted.Grant(0, 2, 100); + Assert.IsFalse(granted.AcceptStream(0, 2, [3, 4], out error)); + Assert.AreEqual(QuicFlow.FlowControlError, error); + granted.Grant(0, 4, 100); + Assert.IsTrue(granted.AcceptStream(0, 2, [3, 4], out _)); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, granted.Received); + + var wide = new QuicFlow(); + wide.SetLocal(Parameters(100000, 100000, 100000, 100000, 4, 4), client: true); + wide.SetPeer(Parameters(100000, 100000, 100000, 100000, 4, 4)); + Assert.IsTrue(wide.Queue(0, [9], out _) > 0); + Assert.AreEqual(1, wide.TakeReady().Count); + + // A sender may fill the window we advertised, so every byte of it can be out of order. + Assert.IsTrue(wide.AcceptStream(0, 16385, [1], out _)); + + // Past the advertised limit stays an error, and a gap beyond the window is a protocol fault. + Assert.IsFalse(wide.AcceptStream(0, 100001, [1], out error)); + Assert.AreEqual(QuicFlow.FlowControlError, error); + + Assert.IsFalse(flow.NoteReset(0, 1, out error)); + Assert.AreEqual(QuicFlow.FinalSizeError, error); + Assert.IsTrue(flow.NoteReset(0, 4, out _)); + Assert.AreEqual(1, flow.ResetsDelivered); + Assert.IsTrue(flow.NoteReset(0, 4, out _)); + Assert.AreEqual(1, flow.ResetsDelivered); + Assert.IsFalse(flow.NoteReset(0, 5, out error)); + Assert.AreEqual(QuicFlow.FinalSizeError, error); + Assert.AreEqual(1, flow.ResetsDelivered); + + Assert.IsFalse(flow.NoteStopSending(2, out error)); + Assert.AreEqual(QuicFlow.StreamStateError, error); + Assert.AreEqual(1, flow.Queue(2, [1], out _)); + Assert.IsTrue(flow.NoteStopSending(2, out error)); + Assert.AreEqual(0UL, error); + Assert.IsTrue(flow.NoteStopSending(2, out _)); + Assert.AreEqual(1, flow.StopsDelivered); + Assert.IsFalse(flow.NoteReset(2, 1, out error)); + Assert.AreEqual(QuicFlow.StreamStateError, error); + Assert.IsFalse(flow.RaiseSend(null, 3, 10)); + + var rewindable = new QuicFlow(); + rewindable.SetLocal(Parameters(100, 100, 100, 100, 4, 4), client: true); + rewindable.SetPeer(Parameters(100, 100, 100, 100, 4, 4)); + Assert.AreEqual(3, rewindable.Queue(0, [6, 7, 8], out _)); + IReadOnlyList taken = rewindable.TakeReady(); + Assert.AreEqual(0L, taken[0].Offset); + Assert.AreEqual(3, taken[0].Length); + rewindable.ReturnReady(0, 2); + IReadOnlyList returned = rewindable.TakeReady(); + Assert.AreEqual(2L, returned[0].Offset); + CollectionAssert.AreEqual(new byte[] { 8 }, returned[0].ToArray()); + } + + [TestMethod] + public void CryptoAndAGapReassembleInOrder() + { + var flow = new QuicFlow(); + Assert.IsTrue(flow.PushCrypto(QuicPacketKind.Initial, 0, [1], out ReadOnlySpan ready, out _)); + CollectionAssert.AreEqual(new byte[] { 1 }, ready.ToArray()); + Assert.IsTrue(flow.PushCrypto(QuicPacketKind.Handshake, 1, [3], out ready, out _)); + Assert.AreEqual(0, ready.Length); + Assert.IsTrue(flow.PushCrypto(QuicPacketKind.Handshake, 0, [2], out ready, out _)); + CollectionAssert.AreEqual(new byte[] { 2, 3 }, ready.ToArray()); + var bounded = new QuicFlow(); + Assert.IsTrue(bounded.PushCrypto(QuicPacketKind.Initial, 16384, [1], out _, out _)); + Assert.IsFalse(bounded.PushCrypto(QuicPacketKind.Initial, 16385, [1], out _, out ulong cryptoError)); + Assert.AreEqual(QuicFlow.CryptoBufferExceeded, cryptoError); + + var sink = new CaptureSink(); + var buffer = new QuicReassembly(8); + Assert.IsTrue(buffer.Push(0, [], 99, sink, out _)); + Assert.IsFalse(buffer.Push(ulong.MaxValue, [1], 99, sink, out ulong error)); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, error); + Assert.IsFalse(buffer.Push(9, [1], 99, sink, out error)); + Assert.AreEqual(99UL, error); + long at = sink.End; + Assert.IsTrue(buffer.Push(2, [3, 4], 99, sink, out _)); + Assert.AreEqual(0, sink.End - at); + Assert.IsTrue(buffer.Push(2, [3, 4], 99, sink, out _)); + Assert.IsTrue(buffer.Push(0, [1, 2], 99, sink, out _)); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, sink.Written); + at = sink.End; + Assert.IsTrue(buffer.Push(3, [4, 5, 6], 99, sink, out _)); + CollectionAssert.AreEqual(new byte[] { 5, 6 }, sink.Written[(int)at..]); + + var held = new QuicReassembly(8); + Assert.IsTrue(held.Push(1, new byte[4], 99, sink, out _)); + Assert.IsTrue(held.Push(5, new byte[4], 99, sink, out _)); + Assert.IsFalse(held.Push(6, [1], 99, sink, out error)); + Assert.AreEqual(99UL, error); + + var ordered = new QuicReassembly(32); + var ahead = new CaptureSink(); + Assert.IsTrue(ordered.Push(6, [7], 99, ahead, out _)); + Assert.IsTrue(ordered.Push(2, [3, 4], 99, ahead, out _)); + at = ahead.End; + Assert.IsTrue(ordered.Push(0, [1, 2], 99, ahead, out _)); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, ahead.Written[(int)at..]); + at = ahead.End; + Assert.IsTrue(ordered.Push(4, [5, 6], 99, ahead, out _)); + CollectionAssert.AreEqual(new byte[] { 5, 6, 7 }, ahead.Written[(int)at..]); + } + + [TestMethod] + public void AServerUsesTheOppositeStreamDirection() + { + var server = new QuicFlow(); + server.SetLocal(Parameters(20, 5, 2, 4, 2, 2), client: false); + server.SetPeer(Parameters(20, 2, 5, 4, 2, 2)); + + Assert.AreEqual(2, server.Queue(0, [1, 2, 3], out bool blocked)); + Assert.IsTrue(blocked); + Assert.AreEqual(3, server.Queue(1, [4, 5, 6], out _)); + Assert.AreEqual(4, server.Queue(3, [7, 8, 9, 10, 11], out blocked)); + Assert.IsTrue(blocked); + Assert.AreEqual(0, server.Queue(8, [1], out _)); + Assert.AreEqual(0, server.Queue(11, [1], out _)); + + Assert.IsFalse(server.AcceptStream(0, 0, [1, 2, 3], out ulong error)); + Assert.AreEqual(QuicFlow.FlowControlError, error); + Assert.IsTrue(server.AcceptStream(0, 0, [1, 2], out _)); + Assert.IsTrue(server.AcceptStream(1, 0, [3, 4, 5, 6, 7], out _)); + Assert.IsFalse(server.AcceptStream(3, 0, [1, 2, 3, 4, 5], out error)); + Assert.AreEqual(QuicFlow.StreamStateError, error); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4, 5, 6, 7 }, server.Received); + } + + [TestMethod] + public void EachStreamKeepsItsOwnBytesAndAFinEndsTheRead() + { + var flow = new QuicFlow(); + flow.SetLocal(Parameters(100, 100, 100, 100, 4, 4), client: false); + flow.SetPeer(Parameters(100, 100, 100, 100, 4, 4)); + Assert.IsTrue(flow.TryAllocateRemote(unidirectional: false, out ulong first)); + Assert.IsTrue(flow.TryAllocateRemote(unidirectional: false, out ulong second)); + Assert.AreEqual(0UL, first); + Assert.AreEqual(4UL, second); + Assert.IsTrue(flow.AcceptStream(0, 0, [1, 2], out _, fin: true)); + Assert.IsTrue(flow.AcceptStream(4, 0, [3], out _)); + byte[] one = new byte[2]; + byte[] two = new byte[1]; + Assert.AreEqual(2, flow.CopyDelivered(0, 0, one)); + Assert.AreEqual(1, flow.CopyDelivered(4, 0, two)); + Assert.AreEqual(1, one[0]); + Assert.AreEqual(3, two[0]); + Assert.IsTrue(flow.IsStreamReadClosed(0, 2)); + Assert.IsFalse(flow.IsStreamReadClosed(4, 1)); + Assert.IsTrue(flow.AcceptStream(4, 1, [], out _, fin: true)); + Assert.IsTrue(flow.IsStreamReadClosed(4, 1)); + } + + private static QuicTransportParameters Parameters(ulong maxData, ulong bidiLocal, ulong bidiRemote, ulong uni, ulong maxBidi, ulong maxUni) + { + return new QuicTransportParameters + { + InitialMaxData = maxData, + InitialMaxStreamDataBidiLocal = bidiLocal, + InitialMaxStreamDataBidiRemote = bidiRemote, + InitialMaxStreamDataUni = uni, + InitialMaxStreamsBidi = maxBidi, + InitialMaxStreamsUni = maxUni, + }; + } + + private sealed class CaptureSink : IReceiveSink + { + private byte[] _written = new byte[256]; + + public long End { get; private set; } + + internal byte[] Written => _written.AsSpan(0, (int)End).ToArray(); + + public void Write(long offset, ReadOnlySpan data) + { + int need = (int)offset + data.Length; + if (need > _written.Length) + { + Array.Resize(ref _written, Math.Max(need, _written.Length * 2)); + } + + data.CopyTo(_written.AsSpan((int)offset)); + End = need; + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicFlowTests.cs b/tests/Titanium.Quic.Tests/QuicFlowTests.cs new file mode 100644 index 000000000..78c41f6f8 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicFlowTests.cs @@ -0,0 +1,143 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicFlowTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void AStreamBlocksAtTheCreditAndResumes() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, 4)); + server.StartServer(ServerId, certificate, Parameters(client: false, 4)); + Pump(client, server); + Assert.AreEqual(4, client.SendStream(0, [1, 2, 3, 4, 5, 6, 7, 8])); + Assert.IsTrue(client.StreamSendBlocked); + Pump(client, server); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, server.ReceivedStream); + server.GrantStreamCredit(0, 8, 8); + Pump(client, server); + Assert.IsFalse(client.StreamSendBlocked); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, server.ReceivedStream); + } + + [TestMethod] + public void APeerThatExceedsTheCreditClosesTheConnection() + { + using X509Certificate2 certificate = Certificate(); + using var server = new QuicConnectionCore(); + server.StartServer(ServerId, certificate, Parameters(client: false, 4)); + Span frame = stackalloc byte[16]; + var stream = new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = 0, + HasLength = true, + Data = [1, 2, 3, 4, 5], + }; + int written = QuicFrameWriter.Write(in stream, default, frame); + server.InjectApplicationPayload(frame[..written]); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFlow.FlowControlError, server.CloseError); + } + + [TestMethod] + public void AHugeReassemblyGapIsRejected() + { + using X509Certificate2 certificate = Certificate(); + using var server = new QuicConnectionCore(); + server.StartServer(ServerId, certificate, Parameters(client: false, 4)); + Span frame = stackalloc byte[16]; + byte[] one = [0x01]; + var crypto = new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = 20_000, Data = one }; + int framed = QuicFrameWriter.Write(in crypto, default, frame); + using var send = QuicPacketProtector.FromInitial(ServerId, client: true); + byte[] packet = new byte[1500]; + int written = QuicPackets.SealLong(packet, QuicPacketKind.Initial, ServerId, ClientId, 0, frame[..framed], send, 1200); + Assert.IsTrue(written > 0); + server.HandleDatagram(Now, packet.AsSpan(0, written), Path); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFlow.CryptoBufferExceeded, server.CloseError); + } + + [TestMethod] + public void ResetAndStopSendingAreDeliveredOnce() + { + using X509Certificate2 certificate = Certificate(); + using var server = new QuicConnectionCore(); + server.StartServer(ServerId, certificate, Parameters(client: false, 4)); + Span frame = stackalloc byte[24]; + var reset = new QuicFrame { Kind = QuicFrameKind.ResetStream, StreamId = 0, ErrorCode = 1, Limit = 0 }; + int written = QuicFrameWriter.Write(in reset, default, frame); + server.InjectApplicationPayload(frame[..written]); + server.InjectApplicationPayload(frame[..written]); + var stop = new QuicFrame { Kind = QuicFrameKind.StopSending, StreamId = 4, ErrorCode = 2 }; + written = QuicFrameWriter.Write(in stop, default, frame); + server.InjectApplicationPayload(frame[..written]); + server.InjectApplicationPayload(frame[..written]); + Assert.AreEqual(1, server.ResetsDelivered); + Assert.AreEqual(1, server.StopsDelivered); + Assert.IsFalse(server.IsClosed); + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 16; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Parameters(bool client, ulong credit) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = credit, + InitialMaxStreamDataBidiLocal = credit, + InitialMaxStreamDataBidiRemote = credit, + InitialMaxStreamDataUni = credit, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicFrameTests.cs b/tests/Titanium.Quic.Tests/QuicFrameTests.cs new file mode 100644 index 000000000..a7d3d056b --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicFrameTests.cs @@ -0,0 +1,386 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicFrameTests +{ + [TestMethod] + public void EveryFrameRoundTrips() + { + RoundTrip(new QuicFrame { Kind = QuicFrameKind.Padding }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.Ping }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.ResetStream, StreamId = 4, ErrorCode = 9, Limit = 20 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.StopSending, StreamId = 8, ErrorCode = 3 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = 3, Data = [0x0a, 0x0b] }, QuicPacketKind.OneRtt); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.NewToken, Data = [0x11, 0x22] }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.MaxData, Limit = 1000 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.MaxStreamData, StreamId = 4, Limit = 80 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.MaxStreams, Limit = 6 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.MaxStreams, Unidirectional = true, Limit = 2 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.DataBlocked, Limit = 40 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.StreamDataBlocked, StreamId = 4, Limit = 40 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.StreamsBlocked, Limit = 6 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.StreamsBlocked, Unidirectional = true, Limit = 1 }); + byte[] token = new byte[16]; + token[0] = 0x7e; + RoundTrip(new QuicFrame { Kind = QuicFrameKind.NewConnectionId, Sequence = 4, RetirePriorTo = 1, Data = [0xaa, 0xbb], Token = token }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.RetireConnectionId, Sequence = 2 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.PathChallenge, Data = [1, 2, 3, 4, 5, 6, 7, 8] }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.PathResponse, Data = [8, 7, 6, 5, 4, 3, 2, 1] }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.ConnectionClose, ErrorCode = 0x07, TriggeringFrame = 0x08, Data = "bye"u8.ToArray() }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.ConnectionClose, ApplicationClose = true, ErrorCode = 9 }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.HandshakeDone }); + RoundTrip(new QuicFrame { Kind = QuicFrameKind.Datagram, HasLength = true, Data = [0x44] }); + } + + [TestMethod] + public void AckWithEcnRoundTrips() + { + QuicAckRange[] ranges = + [ + new() { Length = 2 }, + new() { Gap = 0, Length = 1 }, + ]; + var frame = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = 10, + AckDelay = 5, + AckRangeCount = 2, + Ecn = true, + Ect0 = 1, + Ect1 = 2, + Ce = 3, + }; + ReadBack read = WriteAndRead(frame, ranges, QuicPacketKind.OneRtt); + Assert.AreEqual(0UL, read.Error); + Assert.AreEqual(10UL, read.LargestAcknowledged); + Assert.AreEqual(5UL, read.AckDelay); + Assert.AreEqual(2, read.AckRangeCount); + Assert.AreEqual(2UL, read.Ranges[0].Length); + Assert.AreEqual(0UL, read.Ranges[1].Gap); + Assert.AreEqual(1UL, read.Ranges[1].Length); + Assert.IsTrue(read.Ecn); + Assert.AreEqual(1UL, read.Ect0); + Assert.AreEqual(2UL, read.Ect1); + Assert.AreEqual(3UL, read.Ce); + } + + [TestMethod] + public void StreamRoundTripsWithAndWithoutLength() + { + ReadBack withLength = WriteAndRead(new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = 4, + Offset = 9, + Fin = true, + HasLength = true, + Data = [0x0c, 0x0d], + }, [], QuicPacketKind.OneRtt); + Assert.AreEqual(0UL, withLength.Error); + Assert.IsTrue(withLength.HasLength); + Assert.IsTrue(withLength.Fin); + Assert.AreEqual(9UL, withLength.Offset); + CollectionAssert.AreEqual(new byte[] { 0x0c, 0x0d }, withLength.Data); + + ReadBack without = WriteAndRead(new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = 4, + HasLength = false, + Data = [0x61, 0x62], + }, [], QuicPacketKind.ZeroRtt); + Assert.AreEqual(0UL, without.Error); + Assert.IsFalse(without.HasLength); + Assert.AreEqual(0UL, without.Offset); + CollectionAssert.AreEqual(new byte[] { 0x61, 0x62 }, without.Data); + } + + [TestMethod] + public void DatagramWithoutLengthConsumesThePacket() + { + ReadBack read = WriteAndRead(new QuicFrame + { + Kind = QuicFrameKind.Datagram, + HasLength = false, + Data = [0x09, 0x08], + }, [], QuicPacketKind.OneRtt); + Assert.AreEqual(0UL, read.Error); + Assert.IsFalse(read.HasLength); + CollectionAssert.AreEqual(new byte[] { 0x09, 0x08 }, read.Data); + } + + [TestMethod] + public void CryptoInOneRttIsLegalAndAckInInitialIsLegal() + { + ReadBack crypto = WriteAndRead(new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = 0, Data = [0x01] }, [], QuicPacketKind.OneRtt); + Assert.AreEqual(QuicFrameKind.Crypto, crypto.Kind); + Assert.AreEqual(0UL, crypto.Error); + + ReadBack ack = WriteAndRead(new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = 1, + AckRangeCount = 1, + }, [new QuicAckRange { Length = 0 }], QuicPacketKind.Initial); + Assert.AreEqual(QuicFrameKind.Ack, ack.Kind); + Assert.AreEqual(0UL, ack.Error); + } + + [TestMethod] + public void AckInZeroRttAndStreamInInitialAreProtocolViolations() + { + AssertRejected(new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = 1, + AckRangeCount = 1, + }, [new QuicAckRange { Length = 0 }], QuicPacketKind.ZeroRtt, QuicFrameReader.ProtocolViolation); + AssertRejected(new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = 0, + HasLength = true, + Data = [0x01], + }, [], QuicPacketKind.Initial, QuicFrameReader.ProtocolViolation); + } + + [TestMethod] + public void UnknownTypeAndNonMinimalTypeAndEmptyPayloadAreErrors() + { + AssertRaw([0x1f], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRaw([0x40, 0x01], QuicPacketKind.OneRtt, QuicFrameReader.ProtocolViolation); + AssertRaw([], QuicPacketKind.Initial, QuicFrameReader.ProtocolViolation); + } + + [TestMethod] + public void AckAndStreamThatDoNotFitAreFrameEncodingErrors() + { + AssertRaw([0x02, 0x00, 0x00, 0x00, 0x01], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRaw([0x02, 0x64, 0x00, 0x20, 0x00], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRejected(new QuicFrame + { + Kind = QuicFrameKind.Stream, + StreamId = 0, + Offset = QuicVarInt.MaxValue, + HasLength = true, + Data = [0x01], + }, [], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRaw([0x07, 0x00], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + } + + [TestMethod] + public void FrameEdgesAreEncodingOrProtocolErrors() + { + AssertRaw([0x07, 0x00], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRaw([0x1a, 1, 2, 3, 4, 5, 6, 7], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + AssertRaw([0x1e], QuicPacketKind.Initial, QuicFrameReader.ProtocolViolation); + AssertRaw([0x1d, 0x00, 0x00], QuicPacketKind.Initial, QuicFrameReader.ProtocolViolation); + AssertRaw([0x08, 0x00, 0x01], QuicPacketKind.Handshake, QuicFrameReader.ProtocolViolation); + AssertRaw([0x03, 0x00, 0x00, 0x00, 0x00], QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + + byte[] over = new byte[9]; + over[0] = 0x12; + Assert.AreEqual(8, QuicVarInt.Encode((1UL << 60) + 1, over.AsSpan(1))); + AssertRaw(over, QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + + byte[] retired = new byte[21]; + retired[0] = 0x18; + retired[2] = 0x01; + retired[3] = 0x01; + retired[4] = 0xaa; + AssertRaw(retired, QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + + byte[] emptyId = new byte[4]; + emptyId[0] = 0x18; + emptyId[1] = 0x01; + AssertRaw(emptyId, QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + + byte[] crypto = new byte[11]; + crypto[0] = 0x06; + Assert.AreEqual(8, QuicVarInt.Encode(QuicVarInt.MaxValue, crypto.AsSpan(1))); + crypto[9] = 0x01; + crypto[10] = 0x01; + AssertRaw(crypto, QuicPacketKind.OneRtt, QuicFrameReader.FrameEncodingError); + } + + [TestMethod] + public void AFrameFitsItsOwnLengthAndNotOneByteLess() + { + byte[] id = new byte[20]; + id[0] = 0x20; + byte[] token = new byte[16]; + token[0] = 0x21; + Fits(new QuicFrame { Kind = QuicFrameKind.Stream, StreamId = 4, HasLength = true, Data = [0x0c] }); + Fits(new QuicFrame { Kind = QuicFrameKind.Datagram, HasLength = true, Data = [0x44, 0x45] }); + Fits(new QuicFrame { Kind = QuicFrameKind.Datagram, HasLength = false, Data = [0x09] }); + Fits(new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = 3, Data = [0x0a, 0x0b] }); + Fits(new QuicFrame { Kind = QuicFrameKind.NewToken, Data = [0x11] }); + Fits(new QuicFrame { Kind = QuicFrameKind.NewConnectionId, Sequence = 4, RetirePriorTo = 1, Data = id, Token = token }); + Fits(new QuicFrame { Kind = QuicFrameKind.ConnectionClose, ErrorCode = 7, TriggeringFrame = 8, Data = "bye"u8.ToArray() }); + Fits(new QuicFrame { Kind = QuicFrameKind.PathChallenge, Data = [1, 2, 3, 4, 5, 6, 7, 8] }); + Fits(new QuicFrame { Kind = QuicFrameKind.MaxStreams, Limit = QuicFrameReader.MaxStreamsLimit }); + Fits(new QuicFrame { Kind = QuicFrameKind.StreamsBlocked, Unidirectional = true, Limit = QuicFrameReader.MaxStreamsLimit }); + + var tooLong = new QuicFrame { Kind = QuicFrameKind.NewConnectionId, Sequence = 1, Data = new byte[21], Token = token }; + Assert.AreEqual(0, QuicFrameWriter.Write(tooLong, [], new byte[64])); + } + + [TestMethod] + public void TwoFramesAreReadInOrder() + { + byte[] payload = [0x01, 0x00]; + var reader = new QuicFrameReader(payload, QuicPacketKind.Initial); + var ranges = new QuicAckRange[1]; + Assert.IsTrue(reader.TryNext(ranges, out QuicFrame first)); + Assert.AreEqual(QuicFrameKind.Ping, first.Kind); + Assert.IsTrue(reader.TryNext(ranges, out QuicFrame second)); + Assert.AreEqual(QuicFrameKind.Padding, second.Kind); + Assert.IsFalse(reader.TryNext(ranges, out _)); + Assert.IsTrue(reader.Completed); + } + + private static void Fits(QuicFrame frame) + { + byte[] wide = new byte[128]; + int written = QuicFrameWriter.Write(frame, [], wide); + Assert.IsTrue(written > 1, frame.Kind.ToString()); + Assert.AreEqual(written, QuicFrameWriter.Write(frame, [], wide.AsSpan(0, written)), frame.Kind.ToString()); + Assert.AreEqual(0, QuicFrameWriter.Write(frame, [], wide.AsSpan(0, written - 1)), frame.Kind.ToString()); + var reader = new QuicFrameReader(wide.AsSpan(0, written), QuicPacketKind.OneRtt); + Assert.IsTrue(reader.TryNext(new QuicAckRange[QuicFrameReader.MaxAckRanges], out QuicFrame decoded), frame.Kind.ToString()); + Assert.AreEqual(frame.Kind, decoded.Kind); + Assert.AreEqual(frame.Limit, decoded.Limit); + Assert.IsTrue(reader.Completed || reader.Error == 0); + } + + private static void RoundTrip(QuicFrame frame, QuicPacketKind packet = QuicPacketKind.OneRtt) + { + ReadBack read = WriteAndRead(frame, frame.Kind == QuicFrameKind.Ack ? [] : [], packet); + Assert.AreEqual(0UL, read.Error, frame.Kind.ToString()); + Assert.IsTrue(read.Completed, frame.Kind.ToString()); + Assert.AreEqual(frame.Kind, read.Kind); + Assert.AreEqual(frame.StreamId, read.StreamId); + Assert.AreEqual(frame.ErrorCode, read.ErrorCode); + Assert.AreEqual(frame.Offset, read.Offset); + Assert.AreEqual(frame.Limit, read.Limit); + Assert.AreEqual(frame.Sequence, read.Sequence); + Assert.AreEqual(frame.RetirePriorTo, read.RetirePriorTo); + Assert.AreEqual(frame.TriggeringFrame, read.TriggeringFrame); + Assert.AreEqual(frame.Fin, read.Fin); + Assert.AreEqual(frame.HasLength || frame.Kind == QuicFrameKind.Crypto, read.HasLength); + Assert.AreEqual(frame.Unidirectional, read.Unidirectional); + Assert.AreEqual(frame.ApplicationClose, read.ApplicationClose); + CollectionAssert.AreEqual(frame.Data.ToArray(), read.Data, frame.Kind.ToString()); + CollectionAssert.AreEqual(frame.Token.ToArray(), read.Token, frame.Kind.ToString()); + } + + private static void AssertRejected(QuicFrame frame, QuicAckRange[] ranges, QuicPacketKind packet, ulong error) + { + ReadBack read = WriteAndRead(frame, ranges, packet); + Assert.AreEqual(error, read.Error); + Assert.IsFalse(read.Completed); + } + + private static void AssertRaw(byte[] payload, QuicPacketKind packet, ulong error) + { + var reader = new QuicFrameReader(payload, packet); + Assert.IsFalse(reader.TryNext(new QuicAckRange[QuicFrameReader.MaxAckRanges], out _)); + Assert.AreEqual(error, reader.Error); + } + + private static ReadBack WriteAndRead(QuicFrame frame, QuicAckRange[] ranges, QuicPacketKind packet) + { + var buffer = new byte[128]; + int written = QuicFrameWriter.Write(frame, ranges, buffer); + Assert.IsTrue(written > 0, frame.Kind.ToString()); + var reader = new QuicFrameReader(buffer.AsSpan(0, written), packet); + var gotRanges = new QuicAckRange[QuicFrameReader.MaxAckRanges]; + var read = new ReadBack { Ranges = gotRanges, Data = [], Token = [] }; + if (!reader.TryNext(gotRanges, out QuicFrame decoded)) + { + read.Error = reader.Error; + return read; + } + + read.Kind = decoded.Kind; + read.StreamId = decoded.StreamId; + read.ErrorCode = decoded.ErrorCode; + read.Offset = decoded.Offset; + read.Limit = decoded.Limit; + read.Sequence = decoded.Sequence; + read.RetirePriorTo = decoded.RetirePriorTo; + read.TriggeringFrame = decoded.TriggeringFrame; + read.LargestAcknowledged = decoded.LargestAcknowledged; + read.AckDelay = decoded.AckDelay; + read.Ect0 = decoded.Ect0; + read.Ect1 = decoded.Ect1; + read.Ce = decoded.Ce; + read.Fin = decoded.Fin; + read.HasLength = decoded.HasLength; + read.Ecn = decoded.Ecn; + read.Unidirectional = decoded.Unidirectional; + read.ApplicationClose = decoded.ApplicationClose; + read.AckRangeCount = decoded.AckRangeCount; + read.Data = decoded.Data.ToArray(); + read.Token = decoded.Token.ToArray(); + Assert.IsFalse(reader.TryNext(gotRanges, out _)); + read.Error = reader.Error; + read.Completed = reader.Completed; + return read; + } + + private sealed class ReadBack + { + internal QuicFrameKind Kind; + + internal ulong StreamId; + + internal ulong ErrorCode; + + internal ulong Offset; + + internal ulong Limit; + + internal ulong Sequence; + + internal ulong RetirePriorTo; + + internal ulong TriggeringFrame; + + internal ulong LargestAcknowledged; + + internal ulong AckDelay; + + internal ulong Ect0; + + internal ulong Ect1; + + internal ulong Ce; + + internal bool Fin; + + internal bool HasLength; + + internal bool Ecn; + + internal bool Unidirectional; + + internal bool ApplicationClose; + + internal int AckRangeCount; + + internal QuicAckRange[] Ranges = []; + + internal byte[] Data = []; + + internal byte[] Token = []; + + internal ulong Error; + + internal bool Completed; + } +} diff --git a/tests/Titanium.Quic.Tests/QuicFuzzTests.cs b/tests/Titanium.Quic.Tests/QuicFuzzTests.cs new file mode 100644 index 000000000..d03d11ee8 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicFuzzTests.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicFuzzTests +{ + private static readonly byte[][] PacketSeeds = + [ + [0x80], + [0xC0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00], + [0x40, 0x01, 0x02, 0x03, 0x04], + [0x00], + ]; + + private static readonly byte[][] FrameSeeds = + [ + [0x00], + [0x01], + [0x02, 0x00, 0x00, 0x00, 0x00], + [0x06, 0x00, 0x00, 0x00], + [0xFF], + ]; + + [TestMethod] + public void PacketAndFrameSeedsDoNotThrow() + { + var random = new Random(9000); + foreach (byte[] seed in PacketSeeds) + { + Exercise(seed); + for (int length = 0; length <= seed.Length; length++) + { + Exercise(seed.AsSpan(0, length).ToArray()); + } + + for (int i = 0; i < 16; i++) + { + byte[] mutant = (byte[])seed.Clone(); + mutant[random.Next(mutant.Length)] ^= (byte)(1 << random.Next(8)); + Exercise(mutant); + } + } + + foreach (byte[] seed in FrameSeeds) + { + ExerciseFrames(seed); + byte[] mutant = (byte[])seed.Clone(); + mutant[0] ^= 0x7F; + ExerciseFrames(mutant); + } + } + + private static void Exercise(byte[] datagram) + { + _ = QuicDatagramReader.TryParse(datagram, 8, out _); + ExerciseFrames(datagram); + } + + private static void ExerciseFrames(byte[] payload) + { + var reader = new QuicFrameReader(payload, QuicPacketKind.OneRtt); + var ranges = new QuicAckRange[32]; + while (reader.TryNext(ranges, out _)) + { + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicHandshakeEdgeTests.cs b/tests/Titanium.Quic.Tests/QuicHandshakeEdgeTests.cs new file mode 100644 index 000000000..ae67deac1 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicHandshakeEdgeTests.cs @@ -0,0 +1,585 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicHandshakeEdgeTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + [TestMethod] + public void CallsBeforeTheKeysExistDoNotSend() + { + using X509Certificate2 certificate = Certificate(); + using var core = new QuicConnectionCore(); + var path = new PathInfo([10, 0, 0, 1], 443, [10, 0, 0, 2], 9); + Assert.AreEqual(string.Empty, core.PendingServerName); + Assert.IsFalse(core.PendingHello); + Assert.IsFalse(core.CompleteHello(certificate)); + Assert.AreEqual(0, core.SendStream(0, [1, 2, 3])); + core.SendStreamByte(1); + core.SendNewToken([]); + core.SendNewToken([9]); + core.IssueConnectionId(); + core.RetireConnectionId(1); + core.SendKeepAlive(); + core.SendPathChallenge(path); + core.GrantStreamCredit(0, 100, 100); + Assert.IsFalse(core.SendPathMtuProbe()); + Assert.IsFalse(core.SendPathMtuProbe(confirm: true)); + core.ReportTunnelMaximum(100); + Assert.AreEqual(QuicPathMtu.Base, core.PathMtu); + Assert.IsFalse(core.IsClosed); + + core.AcknowledgeApplication(0, Now); + Assert.IsTrue(core.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, core.CloseError); + core.Close(7); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, core.CloseError); + Assert.AreEqual(0, core.PollTransmit(Now, new byte[2048], out _)); + core.Dispose(); + } + + [TestMethod] + public void AClientCloseStagesOneDatagram() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + using var core = new QuicConnectionCore(new QuicCubic()); + byte[] id = QuicConnectionSession.NewConnectionId(); + core.StartClient(QuicConnectionSession.PathOf(local, remote), id, id, QuicConnectionSession.Parameters(client: true, id), serverName: "example.test"); + Assert.AreEqual(string.Empty, core.PendingServerName); + core.Close(0x1c); + Assert.AreEqual(0x1cUL, core.CloseError); + Assert.IsTrue(core.PollTransmit(Now, new byte[8192], out _) > 0); + core.Dispose(); + } + + [TestMethod] + public void TheFirstClientDatagramIsPaddedAndTheServerSeesTheName() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var named = new QuicConnectionCore(); + using var seen = new QuicConnectionCore(); + named.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false), serverName: "example.test"); + byte[] buffer = new byte[8192]; + Assert.AreEqual(1200, named.PollTransmit(Now, buffer, out PathInfo sent)); + seen.StartServer(serverId, certificate, Limits(serverId, idleMs: 60_000, server: true)); + seen.HandleDatagram(Now, buffer.AsSpan(0, 1200), sent); + Assert.AreEqual("example.test", seen.PendingServerName); + + using var plain = new QuicConnectionCore(); + plain.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + Assert.AreEqual(1200, plain.PollTransmit(Now, buffer, out _)); + using var blank = new QuicConnectionCore(); + blank.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false), serverName: ""); + Assert.AreEqual(1200, blank.PollTransmit(Now, buffer, out _)); + } + + [TestMethod] + public void ADeferredHelloRejectsAProtocolTheClientDidNotOffer() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false), serverName: "example.test", applicationProtocols: ["h3"]); + server.StartServer(serverId, certificate: null, Limits(serverId, idleMs: 0, server: true)); + byte[] buffer = new byte[8192]; + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + Assert.IsTrue(server.PendingHello); + Assert.AreEqual("example.test", server.PendingServerName); + Assert.IsFalse(server.CompleteHello(certificate, ["nope"])); + Assert.IsTrue(server.IsClosed); + + using var again = new QuicConnectionCore(); + using var resumed = new QuicConnectionCore(); + again.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false), applicationProtocols: ["h3"]); + resumed.StartServer(serverId, certificate: null, Limits(serverId, idleMs: 0, server: true)); + count = again.PollTransmit(Now, buffer, out sent); + resumed.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + Assert.IsTrue(resumed.CompleteHello(certificate, ["h3"])); + Assert.IsFalse(resumed.IsClosed); + Assert.IsFalse(resumed.CompleteHello(certificate, [])); + } + + [TestMethod] + public void AClientOfferingOnlyAnUnknownProtocolIsRejected() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false), applicationProtocols: ["dummy"]); + server.StartServer(serverId, certificate: null, Limits(serverId, idleMs: 0, server: true)); + byte[] buffer = new byte[8192]; + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + Assert.IsFalse(server.CompleteHello(certificate, ["h3", "h3-29", "hq-interop", "hq-29"])); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(0x0100UL + 120, server.CloseError); + } + + [TestMethod] + public void ATinyPeerIdleIsFlooredAndAShortRetryIsIgnored() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 60_000, server: false), serverName: "localhost"); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 1, server: true)); + Pump(client, server); + byte[] sink = new byte[8192]; + while (client.PollTransmit(Now, sink, out _) > 0) + { + } + + Assert.IsFalse(client.HandleTimeout(Now + TimeSpan.FromMilliseconds(2)) && client.IdleTimedOut); + Assert.IsFalse(client.IdleTimedOut); + Assert.IsTrue(client.HandleTimeout(Now + TimeSpan.FromMilliseconds(200))); + Assert.IsTrue(client.IdleTimedOut); + + using var fresh = new QuicConnectionCore(); + fresh.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + fresh.PollTransmit(Now, sink, out _); + fresh.HandleDatagram(Now, new byte[] { 0xF0, 0, 0, 0, 1 }, path); + Assert.IsFalse(fresh.IsClosed); + Assert.AreEqual(0, fresh.PollTransmit(Now, sink, out _)); + } + + [TestMethod] + public void AStreamLargerThanTheWindowIsDelivered() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(client, server); + byte[] payload = new byte[20_000]; + payload[0] = 0x11; + payload[^1] = 0x22; + Assert.AreEqual(payload.Length, client.SendStream(0, payload)); + Pump(client, server); + CollectionAssert.AreEqual(payload, server.ReceivedStream); + } + + [TestMethod] + public void AFinishedStreamSendsTheBodyAndAFinalFrame() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(client, server); + byte[] request = "GET /hello\r\n"u8.ToArray(); + byte[] body = "hello"u8.ToArray(); + Assert.AreEqual(request.Length, client.SendStream(0, request)); + byte[] buffer = new byte[2048]; + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + Assert.IsTrue(count > 0); + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + CollectionAssert.AreEqual(request, server.ReceivedStream); + Assert.AreEqual(body.Length, server.SendStream(0, body)); + server.FinishStream(0); + int first = server.PollTransmit(Now, buffer, out sent); + Assert.IsTrue(first > 0); + client.HandleDatagram(Now, buffer.AsSpan(0, first), sent); + int second = server.PollTransmit(Now, buffer, out sent); + Assert.IsTrue(second > 0); + client.HandleDatagram(Now, buffer.AsSpan(0, second), sent); + CollectionAssert.AreEqual(body, client.ReceivedStream); + } + + [TestMethod] + public void ReservedHeaderBitsCloseTheConnection() + { + Assert.IsFalse(QuicPacket.ReservedBitsSet(0xC3)); + Assert.IsTrue(QuicPacket.ReservedBitsSet(0xCC)); + Assert.IsFalse(QuicPacket.ReservedBitsSet(0x40)); + Assert.IsTrue(QuicPacket.ReservedBitsSet(0x58)); + + using X509Certificate2 certificate = Certificate(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + using var server = new QuicConnectionCore(); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + byte[] packet = InitialWithReservedBits(serverId, clientId); + var path = new PathInfo([10, 0, 0, 1], 443, [10, 0, 0, 2], 9); + server.HandleDatagram(Now, packet, path); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, server.CloseError); + } + + [TestMethod] + public void ACryptoOffsetPastTheBufferClosesWithTheBufferError() + { + using X509Certificate2 certificate = Certificate(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + using var server = new QuicConnectionCore(); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + byte[] packet = InitialCrypto(serverId, clientId, (1UL << 20) + 1); + server.HandleDatagram(Now, packet, new PathInfo([10, 0, 0, 1], 443, [10, 0, 0, 2], 9)); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFlow.CryptoBufferExceeded, server.CloseError); + } + + [TestMethod] + public void AServerRejectsAClientNewTokenAndHandshakeDone() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(client, server); + client.SendNewToken([1, 2, 3]); + Pump(client, server); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, server.CloseError); + + using var again = new QuicConnectionCore(); + using var other = new QuicConnectionCore(); + again.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + other.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(again, other); + again.SendHandshakeDone(); + Pump(again, other); + Assert.IsTrue(other.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, other.CloseError); + + using var third = new QuicConnectionCore(); + using var peer = new QuicConnectionCore(); + third.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + peer.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(third, peer); + third.SendApplicationCrypto([24, 0, 0, 1, 0]); + Pump(third, peer); + Assert.IsTrue(peer.IsClosed); + Assert.AreEqual(0x0100UL + 10, peer.CloseError); + } + + private static byte[] InitialWithReservedBits(byte[] serverId, byte[] clientId) + { + const int headerLength = 26; + byte[] plaintext = new byte[32]; + byte[] packet = new byte[headerLength + plaintext.Length + 16]; + packet[0] = 0xCC; + packet[1] = 0; + packet[2] = 0; + packet[3] = 0; + packet[4] = 1; + packet[5] = (byte)serverId.Length; + serverId.CopyTo(packet.AsSpan(6)); + packet[14] = (byte)clientId.Length; + clientId.CopyTo(packet.AsSpan(15)); + packet[23] = 0; + packet[24] = (byte)(1 + plaintext.Length + 16); + using QuicPacketProtector protector = QuicPacketProtector.FromInitial(serverId, client: true); + int written = protector.Seal(packet, headerLength, packetNumber: 0, plaintext); + Assert.IsTrue(written > 0); + return packet[..written]; + } + + private static byte[] InitialCrypto(byte[] serverId, byte[] clientId, ulong offset) + { + byte[] one = [1]; + Span frame = stackalloc byte[32]; + var crypto = new QuicFrame { Kind = QuicFrameKind.Crypto, Offset = offset, Data = one }; + int frameLength = QuicFrameWriter.Write(in crypto, default, frame); + Assert.IsTrue(frameLength > 0); + const int headerLength = 26; + byte[] plaintext = frame[..frameLength].ToArray(); + byte[] packet = new byte[headerLength + plaintext.Length + 16]; + packet[0] = 0xC0; + packet[4] = 1; + packet[5] = (byte)serverId.Length; + serverId.CopyTo(packet.AsSpan(6)); + packet[14] = (byte)clientId.Length; + clientId.CopyTo(packet.AsSpan(15)); + packet[24] = (byte)(1 + plaintext.Length + 16); + using QuicPacketProtector protector = QuicPacketProtector.FromInitial(serverId, client: true); + int written = protector.Seal(packet, headerLength, packetNumber: 0, plaintext); + Assert.IsTrue(written > 0); + return packet[..written]; + } + + [TestMethod] + public void AnApplicationPacketValidatesTheHandshakePath() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + byte[] buffer = new byte[8192]; + for (int turn = 0; turn < 80 && !client.HandshakeComplete; turn++) + { + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + if (count > 0 && !IsHandshakePacket(buffer[0])) + { + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + } + + count = server.PollTransmit(Now, buffer, out sent); + if (count > 0) + { + client.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + } + } + + Assert.IsTrue(client.HandshakeComplete); + Assert.IsFalse(server.IsPathValidated(path)); + Assert.AreEqual(4, client.SendStream(0, [1, 2, 3, 4])); + int sentCount = client.PollTransmit(Now, buffer, out PathInfo oneRtt); + Assert.IsTrue(sentCount > 0); + server.HandleDatagram(Now, buffer.AsSpan(0, sentCount), oneRtt); + Assert.IsFalse(server.IsClosed); + Assert.IsTrue(server.IsPathValidated(path)); + } + + [TestMethod] + public void AnApplicationPacketBeforeTheHandshakeIsDeliveredWhenTheHandshakeArrives() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + byte[] buffer = new byte[8192]; + var held = new List(); + for (int turn = 0; turn < 80 && !client.HandshakeComplete; turn++) + { + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + if (count > 0 && IsHandshakePacket(buffer[0])) + { + var copy = new byte[count]; + buffer.AsSpan(0, count).CopyTo(copy); + held.Add(copy); + } + else if (count > 0) + { + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + } + + count = server.PollTransmit(Now, buffer, out sent); + if (count > 0) + { + client.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + } + } + + Assert.IsTrue(client.HandshakeComplete); + Assert.IsFalse(server.HandshakeComplete); + for (int turn = 0; turn < 10 && held.Count == 0; turn++) + { + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + if (count == 0) + { + break; + } + + if (IsHandshakePacket(buffer[0])) + { + var copy = new byte[count]; + buffer.AsSpan(0, count).CopyTo(copy); + held.Add(copy); + } + else + { + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + } + } + + Assert.IsTrue(held.Count > 0); + byte[] body = [1, 2, 3, 4]; + Assert.AreEqual(body.Length, client.SendStream(0, body)); + bool delivered = false; + for (int turn = 0; turn < 10 && !delivered; turn++) + { + int count = client.PollTransmit(Now, buffer, out PathInfo sent); + if (count == 0) + { + break; + } + + if (IsHandshakePacket(buffer[0])) + { + var copy = new byte[count]; + buffer.AsSpan(0, count).CopyTo(copy); + held.Add(copy); + continue; + } + + server.HandleDatagram(Now, buffer.AsSpan(0, count), sent); + delivered = true; + } + + Assert.IsTrue(delivered); + Assert.IsFalse(server.HandshakeComplete); + Assert.AreEqual(0, server.ReceivedStream.Length); + foreach (byte[] packet in held) + { + server.HandleDatagram(Now, packet, path); + } + + Assert.IsFalse(server.IsClosed); + Assert.IsTrue(server.HandshakeComplete); + CollectionAssert.AreEqual(body, server.ReceivedStream); + } + + [TestMethod] + public void QueuedStreamDataIsSentAfterTheCongestionWindowOpens() + { + using X509Certificate2 certificate = Certificate(); + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + PathInfo path = QuicConnectionSession.PathOf(local, remote); + byte[] clientId = QuicConnectionSession.NewConnectionId(); + byte[] serverId = QuicConnectionSession.NewConnectionId(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(path, clientId, serverId, Limits(clientId, idleMs: 0, server: false)); + server.StartServer(serverId, certificate, Limits(serverId, idleMs: 0, server: true)); + Pump(client, server); + Assert.IsTrue(client.HandshakeComplete, "client handshake"); + Assert.IsTrue(server.HandshakeComplete, "server handshake"); + byte[] body = new byte[20000]; + body[0] = 9; + Assert.AreEqual(body.Length, client.SendStream(0, body)); + byte[] buffer = new byte[8192]; + var flight = new List(); + PathInfo sentPath = path; + for (int i = 0; i < 40; i++) + { + int count = client.PollTransmit(Now, buffer, out sentPath); + if (count == 0) + { + break; + } + + var copy = new byte[count]; + buffer.AsSpan(0, count).CopyTo(copy); + flight.Add(copy); + } + + Assert.IsTrue(flight.Count > 0); + Assert.AreEqual(0, client.PollTransmit(Now, buffer, out _)); + foreach (byte[] packet in flight) + { + server.HandleDatagram(Now, packet, sentPath); + } + + for (int i = 0; i < 10; i++) + { + int count = server.PollTransmit(Now, buffer, out PathInfo ackPath); + if (count == 0) + { + break; + } + + client.HandleDatagram(Now, buffer.AsSpan(0, count), ackPath); + } + + Assert.IsTrue(client.PollTransmit(Now, buffer, out _) > 0); + } + + private static bool IsHandshakePacket(byte first) => (first & 0x80) != 0 && ((first >> 4) & 0x03) == 2; + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 80; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Limits(byte[] sourceId, ulong idleMs, bool server) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = sourceId, + OriginalDestinationConnectionId = server ? sourceId : null, + MaxIdleTimeout = idleMs, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = 16, + InitialMaxStreamsUni = 16, + MaxUdpPayloadSize = 1452, + }; + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicHandshakeTests.cs b/tests/Titanium.Quic.Tests/QuicHandshakeTests.cs new file mode 100644 index 000000000..61e5265ed --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicHandshakeTests.cs @@ -0,0 +1,169 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicHandshakeTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void TwoCoresReachApplicationDataAndExchangeOneByte() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, match: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, match: true)); + Pump(client, server); + Assert.IsTrue(client.HandshakeComplete); + Assert.IsTrue(server.HandshakeComplete); + Assert.IsFalse(client.IsClosed); + Assert.IsFalse(server.IsClosed); + + client.SendStreamByte(0x5A); + Pump(client, server); + Assert.AreEqual((byte)0x5A, server.ReceivedStreamByte); + } + + [TestMethod] + public void AKeepAliveSendsOnePingWhenItsDeadlineArrives() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.SetKeepAlive(TimeSpan.FromSeconds(1)); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, match: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, match: true)); + Pump(client, server); + Assert.IsTrue(client.HandshakeComplete); + Assert.AreEqual(0, client.KeepAlivesSent); + + client.HandleTimeout(Now); + Assert.AreEqual(0, client.KeepAlivesSent); + Assert.IsTrue(client.HandleTimeout(Now.AddSeconds(1))); + Assert.AreEqual(1, client.KeepAlivesSent); + client.HandleTimeout(Now.AddSeconds(1)); + Assert.AreEqual(1, client.KeepAlivesSent); + } + + [TestMethod] + public void AResetCarriesTheStreamErrorAndTheFinalSize() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, match: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, match: true)); + Pump(client, server); + client.SendStreamByte(0x11); + Pump(client, server); + client.ResetStream(0, 0x10c, 1); + Pump(client, server); + Assert.IsFalse(server.IsClosed); + Assert.AreEqual(1, server.ResetsDelivered); + } + + [TestMethod] + public void ABadFinishedClosesTheConnection() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, match: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, match: true)); + client.CorruptNextHandshakePayload = true; + Pump(client, server); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(0x0100UL + 51, server.CloseError); + } + + [TestMethod] + public void ATransportParameterMismatchClosesTheConnection() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, match: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, match: false)); + Pump(client, server); + Assert.IsTrue(client.IsClosed); + Assert.AreEqual(QuicTransportParametersCodec.TransportParameterError, client.CloseError); + } + + [TestMethod] + public void HandshakeBytesAboveTheTlsCapAreACryptoError() + { + using X509Certificate2 certificate = Certificate(); + using var server = new QuicConnectionCore(); + server.StartServer(ServerId, certificate, Parameters(client: false, match: true)); + byte[] message = [0x01, 0x03, 0x0D, 0x40]; + Span frame = stackalloc byte[16]; + var crypto = new QuicFrame { Kind = QuicFrameKind.Crypto, Data = message }; + int framed = QuicFrameWriter.Write(in crypto, default, frame); + using var send = QuicPacketProtector.FromInitial(ServerId, client: true); + byte[] packet = new byte[1500]; + int written = QuicPackets.SealLong(packet, QuicPacketKind.Initial, ServerId, ClientId, 0, frame[..framed], send, 1200); + Assert.IsTrue(written > 0); + server.HandleDatagram(Now, packet.AsSpan(0, written), Path); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(0x0100UL + 50, server.CloseError); + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 12; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Parameters(bool client, bool match) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = 16, + InitialMaxStreamsUni = 16, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = match ? ServerId : [0xFF]; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicIdentityTests.cs b/tests/Titanium.Quic.Tests/QuicIdentityTests.cs new file mode 100644 index 000000000..7bf71f6a3 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicIdentityTests.cs @@ -0,0 +1,306 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicIdentityTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly PathInfo Other = new([10, 0, 0, 1], 443, [10, 0, 0, 3], 50001); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + private static readonly byte[] RetryToken = [0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88]; + + private static readonly byte[] ResetToken = + [ + 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, + 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, 0x5A, + ]; + + [TestMethod] + public void ARetryRoundTripUsesTheNewDestinationConnectionId() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + server.ArmRetry(RetryToken); + byte[] buffer = new byte[16384]; + int first = client.PollTransmit(Now, buffer, out PathInfo path); + Assert.IsTrue(first > 0); + server.HandleDatagram(Now, buffer.AsSpan(0, first), path); + int retry = server.PollTransmit(Now, buffer, out path); + Assert.IsTrue(retry > 0); + Assert.AreEqual(0xF0, buffer[0]); + client.HandleDatagram(Now, buffer.AsSpan(0, retry), path); + int second = client.PollTransmit(Now, buffer, out path); + Assert.IsTrue(second > 0); + var reader = new QuicDatagramReader(buffer.AsSpan(0, second), 0); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + Assert.AreEqual(QuicPacketKind.Initial, packet.Kind); + Assert.AreEqual(8, packet.DestinationConnectionId.Length); + CollectionAssert.AreEqual(RetryToken, packet.Token.ToArray()); + server.HandleDatagram(Now, buffer.AsSpan(0, second), path); + Assert.IsNotNull(server.ReceivedInitialToken); + CollectionAssert.AreEqual(RetryToken, server.ReceivedInitialToken); + } + + [TestMethod] + public void ARetryWithABadTagIsIgnored() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + server.ArmRetry(RetryToken); + byte[] buffer = new byte[16384]; + int first = client.PollTransmit(Now, buffer, out PathInfo path); + server.HandleDatagram(Now, buffer.AsSpan(0, first), path); + int retry = server.PollTransmit(Now, buffer, out path); + buffer[retry - 1] ^= 0xFF; + client.HandleDatagram(Now, buffer.AsSpan(0, retry), path); + Assert.AreEqual(0, client.PollTransmit(Now, buffer, out _)); + Assert.IsFalse(client.IsClosed); + } + + [TestMethod] + public void ANewTokenIsUsedOnTheNextConnection() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + Pump(client, server); + byte[] token = [0x71, 0x72, 0x73, 0x74]; + server.SendNewToken(token); + Pump(client, server); + Assert.IsNotNull(client.IssuedNewToken); + CollectionAssert.AreEqual(token, client.IssuedNewToken); + + using var next = new QuicConnectionCore(); + next.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false), token); + byte[] buffer = new byte[16384]; + int count = next.PollTransmit(Now, buffer, out _); + Assert.IsTrue(count > 0); + var reader = new QuicDatagramReader(buffer.AsSpan(0, count), 0); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + CollectionAssert.AreEqual(token, packet.Token.ToArray()); + } + + [TestMethod] + public void AStatelessResetClosesWithoutDecrypting() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: true)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: true)); + Pump(client, server); + byte[] bogus = new byte[48]; + bogus[0] = 0x40; + ResetToken.CopyTo(bogus.AsSpan(^16)); + client.HandleDatagram(Now, bogus, Path); + Assert.IsTrue(client.ClosedByStatelessReset); + byte[] buffer = new byte[256]; + Assert.AreEqual(0, client.PollTransmit(Now, buffer, out _)); + } + + [TestMethod] + public void APathChallengeValidatesTheNewPath() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + Pump(client, server); + Assert.IsFalse(client.IsPathValidated(Other)); + byte[] sink = new byte[16384]; + while (client.PollTransmit(Now, sink, out _) > 0) + { + } + + while (server.PollTransmit(Now, sink, out _) > 0) + { + } + + client.SendPathChallenge(Other); + byte[] buffer = new byte[2048]; + int challenge = client.PollTransmit(Now, buffer, out PathInfo path); + Assert.IsTrue(challenge >= 1200); + Assert.IsTrue(path.Equals(Other)); + server.HandleDatagram(Now, buffer.AsSpan(0, challenge), path); + int response = server.PollTransmit(Now, buffer, out path); + Assert.IsTrue(response > 0); + client.HandleDatagram(Now, buffer.AsSpan(0, response), path); + Assert.IsTrue(client.IsPathValidated(Other)); + } + + [TestMethod] + public void ANewConnectionIdIsAccepted() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + Pump(client, server); + Assert.AreEqual(1, client.PeerConnectionIds); + server.IssueConnectionId(); + Pump(client, server); + Assert.AreEqual(2, client.PeerConnectionIds); + Assert.IsFalse(client.IsClosed); + } + + [TestMethod] + public void TheHighestSequenceIsTheSendTarget() + { + var ids = new QuicIdentity(); + var retire = new System.Collections.Generic.List(); + byte[] older = PeerId(1); + byte[] newer = PeerId(3); + Assert.IsTrue(ids.TryAddPeer(1, 0, older, ResetToken, retire, out _)); + Assert.IsTrue(ids.TryAddPeer(3, 0, newer, ResetToken, retire, out _)); + CollectionAssert.AreEqual(newer, ids.ActivePeer()); + } + + [TestMethod] + public void AnEmptyOrRepeatedPeerIdIsNotStoredTwice() + { + var ids = new QuicIdentity(); + ids.AddPeer([]); + ids.AddPeer(ServerId); + ids.AddPeer(ServerId); + Assert.AreEqual(1, ids.PeerActive); + CollectionAssert.AreEqual(ServerId, ids.ActivePeer()); + } + + [TestMethod] + public void TheNinthConnectionIdIsRejected() + { + var ids = new QuicIdentity(); + var retire = new System.Collections.Generic.List(); + for (ulong sequence = 0; sequence < QuicIdentity.ActiveLimit; sequence++) + { + Assert.IsTrue(ids.TryAddPeer(sequence, 0, PeerId(sequence), ResetToken, retire, out ulong error)); + Assert.AreEqual(0UL, error); + } + + Assert.IsFalse(ids.TryAddPeer(QuicIdentity.ActiveLimit, 0, PeerId(QuicIdentity.ActiveLimit), ResetToken, retire, out ulong limit)); + Assert.AreEqual(QuicIdentity.ConnectionIdLimitError, limit); + Assert.AreEqual(QuicIdentity.ActiveLimit, ids.PeerActive); + } + + [TestMethod] + public void AMinimumStatelessResetMatchesOnce() + { + var ids = new QuicIdentity(); + var retire = new System.Collections.Generic.List(); + byte[] first = PeerId(1); + byte[] second = PeerId(2); + Assert.IsTrue(ids.TryAddPeer(1, 0, first, ResetToken, retire, out _)); + Assert.IsTrue(ids.TryAddPeer(2, 0, second, ResetToken, retire, out _)); + ids.MarkUsed(first); + ids.MarkUsed(second); + byte[] datagram = new byte[21]; + ResetToken.CopyTo(datagram.AsSpan(datagram.Length - 16)); + Assert.IsTrue(ids.MatchesReset(datagram)); + Assert.IsFalse(ids.MatchesReset(datagram.AsSpan(0, 20).ToArray())); + } + + [TestMethod] + public void AResetTokenForTheOriginalDestinationIsNotTheSendTarget() + { + var ids = new QuicIdentity(); + byte[] server = [0x13, 0x92, 0xE0, 0x5D, 0x63, 0xCA, 0xAF, 0xD8, 0x27]; + byte[] original = [0xD2, 0x45, 0x1C, 0x73, 0x83, 0x1C, 0x94, 0xB9]; + ids.AddPeer(server); + ids.RememberResetToken(original, ResetToken); + CollectionAssert.AreEqual(server, ids.ActivePeer()); + Assert.AreEqual(1, ids.PeerActive); + ids.MarkUsed(original); + byte[] datagram = new byte[40]; + ResetToken.CopyTo(datagram.AsSpan(datagram.Length - 16)); + Assert.IsTrue(ids.MatchesReset(datagram)); + } + + [TestMethod] + public void RetiringTheLastConnectionIdClosesTheConnection() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, reset: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, reset: false)); + Pump(client, server); + client.RetireConnectionId(0); + Pump(client, server); + Assert.IsTrue(server.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, server.CloseError); + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 12; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] PeerId(ulong sequence) + { + byte[] id = new byte[8]; + id[0] = (byte)sequence; + return id; + } + + private static byte[] Parameters(bool client, bool reset) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + if (reset) + { + parameters.StatelessResetToken = (byte[])ResetToken.Clone(); + } + } + + byte[] buffer = new byte[256]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicIdleTests.cs b/tests/Titanium.Quic.Tests/QuicIdleTests.cs new file mode 100644 index 000000000..32085783f --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicIdleTests.cs @@ -0,0 +1,150 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicIdleTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly PathInfo Other = new([10, 0, 0, 1], 443, [10, 0, 0, 3], 50001); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + private static readonly TimeSpan Idle = TimeSpan.FromMilliseconds(5000); + + [TestMethod] + public void AnIdleConnectionTimesOut() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + Pump(client, server); + Assert.IsFalse(client.HandleTimeout(Now + Idle - TimeSpan.FromMilliseconds(1)) && client.IdleTimedOut); + Assert.IsFalse(client.IdleTimedOut); + Assert.IsTrue(client.HandleTimeout(Now + Idle)); + Assert.IsTrue(client.IdleTimedOut); + byte[] buffer = new byte[256]; + Assert.AreEqual(0, client.PollTransmit(Now + Idle, buffer, out _)); + } + + [TestMethod] + public void AKeepAlivePreventsTheIdleTimeout() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + Pump(client, server); + byte[] buffer = new byte[16384]; + while (client.PollTransmit(Now, buffer, out _) > 0) + { + } + + DateTimeOffset sent = Now + TimeSpan.FromSeconds(2); + client.SendKeepAlive(); + int count = client.PollTransmit(sent, buffer, out PathInfo path); + Assert.IsTrue(count > 0); + server.HandleDatagram(sent, buffer.AsSpan(0, count), path); + Assert.IsFalse(server.IdleTimedOut); + server.HandleTimeout(Now + Idle); + Assert.IsFalse(server.IdleTimedOut); + Assert.IsTrue(server.HandleTimeout(sent + Idle)); + Assert.IsTrue(server.IdleTimedOut); + } + + [TestMethod] + public void AnUnvalidatedPathDoesNotRaiseTheSendLimit() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + Pump(client, server); + byte[] buffer = new byte[16384]; + while (client.PollTransmit(Now, buffer, out _) > 0) + { + } + + client.Migrate(Other); + Assert.IsFalse(client.IsPathValidated(Other)); + client.SendKeepAlive(); + int sent = client.PollTransmit(Now, buffer, out PathInfo path); + Assert.IsTrue(sent > 0); + Assert.IsTrue(path.Equals(Other)); + long window = client.CongestionWindow; + long inFlight = client.BytesInFlight; + Span frame = stackalloc byte[16]; + var ranges = new QuicAckRange[1]; + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = client.LastSentApplication, + AckRangeCount = 1, + }; + int written = QuicFrameWriter.Write(in ack, ranges, frame); + client.InjectApplicationPayload(frame[..written]); + Assert.IsFalse(client.IsClosed); + Assert.AreEqual(window, client.CongestionWindow); + Assert.IsTrue(client.BytesInFlight < inFlight); + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 16; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + MaxIdleTimeout = (ulong)Idle.TotalMilliseconds, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicInitialTests.cs b/tests/Titanium.Quic.Tests/QuicInitialTests.cs new file mode 100644 index 000000000..221cda6ba --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicInitialTests.cs @@ -0,0 +1,166 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicInitialTests +{ + private static readonly byte[] ConnectionId = Convert.FromHexString("8394c8f03e515708"); + + [TestMethod] + public void ClientAndServerInitialKeysMatchAppendixA() + { + AssertSide(client: true, + "c00cf151ca5be075ed0ebfb5c80323c42d6b7db67881289af4008f1f6c357aea", + "1f369613dd76d5467730efcbe3b1a22d", + "fa044b2f42a3fd3b46fb255c", + "9f50449e04a0e810283a1e9933adedd2"); + AssertSide(client: false, + "3c199828fd139efd216c155ad844cc81fb82fa8d7446fa7d78be803acdda951b", + "cf3a5331653c364c88f0f379b6067e37", + "0ac1493ca1905853b0bba03e", + "c206b8d9b9f0f37644430b490eeaa314"); + } + + [TestMethod] + public void AesHeaderProtectionRoundTripsTheAppendixHeaders() + { + AssertHeader(packetNumberOffset: 18, + unprotected: "c300000001088394c8f03e5157080000449e00000002", + sample: "d1b1c98dd7689fb8ec11d242b123dc9b", + protectedHeader: "c000000001088394c8f03e5157080000449e7b9aec34", + headerKey: "9f50449e04a0e810283a1e9933adedd2"); + AssertHeader(packetNumberOffset: 18, + unprotected: "c1000000010008f067a5502a4262b50040750001", + sample: "2cd0991cd25b0aac406a5816b6394100", + protectedHeader: "cf000000010008f067a5502a4262b5004075c0d9", + headerKey: "c206b8d9b9f0f37644430b490eeaa314"); + } + + [TestMethod] + public void ChaCha20BlockMatchesRfc8439() + { + var key = new byte[32]; + for (int i = 0; i < key.Length; i++) + { + key[i] = (byte)i; + } + + byte[] nonce = [0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x00]; + var block = new byte[64]; + ChaCha20Block.Write(key, counter: 1, nonce, block); + CollectionAssert.AreEqual(Convert.FromHexString( + "10f1e7e4d13b5915500fdd1fa32071c4" + + "c7d1f4c733c068030422aa9ac3d46c4e" + + "d2826446079faa0914c2d705d98b02a2" + + "b5129cd1de164eb9cbd083e8a2503c4e"), block); + + var wide = new byte[65]; + ChaCha20Block.Write(key, counter: 1, nonce, wide); + CollectionAssert.AreEqual(block, wide[..64]); + Assert.AreEqual(0, wide[64]); + } + + [TestMethod] + public void ChaCha20BlockRejectsAShortInput() + { + var key = new byte[32]; + byte[] nonce = new byte[12]; + var block = new byte[64]; + Assert.ThrowsExactly(() => ChaCha20Block.Write(key.AsSpan(0, 31), 1, nonce, block)); + Assert.ThrowsExactly(() => ChaCha20Block.Write(new byte[33], 1, nonce, block)); + Assert.ThrowsExactly(() => ChaCha20Block.Write(key, 1, nonce.AsSpan(0, 11), block)); + Assert.ThrowsExactly(() => ChaCha20Block.Write(key, 1, new byte[13], block)); + Assert.ThrowsExactly(() => ChaCha20Block.Write(key, 1, nonce, block.AsSpan(0, 63))); + } + + [TestMethod] + public void ChaCha20HeaderProtectionMatchesAppendixA() + { + byte[] secret = Convert.FromHexString("9ac312a7f877468ebe69422748ad00a15443f18203a07d6060f688f30f21632b"); + var key = new byte[32]; + var iv = new byte[12]; + var hp = new byte[32]; + var ku = new byte[32]; + QuicInitial.DeriveTraffic(HashAlgorithmName.SHA256, secret, key, iv, hp); + QuicInitial.DeriveUpdate(HashAlgorithmName.SHA256, secret, ku); + CollectionAssert.AreEqual(Convert.FromHexString("c6d98ff3441c3fe1b2182094f69caa2ed4b716b65488960a7a984979fb23e1c8"), key); + CollectionAssert.AreEqual(Convert.FromHexString("e0459b3474bdd0e44a41c144"), iv); + CollectionAssert.AreEqual(Convert.FromHexString("25a282b9e82f06f21f488917a4fc8f1b73573685608597d0efcb076b0ab7a7a4"), hp); + CollectionAssert.AreEqual(Convert.FromHexString("1223504755036d556342ee9361d253421a826c9ecdf3c7148684b36b714881f9"), ku); + + byte[] header = Convert.FromHexString("4200bff4"); + byte[] sample = Convert.FromHexString("5e5cd55c41f69080575d7999c25a5bfb"); + using var protection = new QuicHeaderProtection(QuicHeaderCipher.ChaCha20, hp); + Assert.IsTrue(protection.Protect(header, packetNumberOffset: 1, sample)); + CollectionAssert.AreEqual(Convert.FromHexString("4cfe4189"), header); + Assert.IsTrue(protection.Remove(header, packetNumberOffset: 1, sample)); + CollectionAssert.AreEqual(Convert.FromHexString("4200bff4"), header); + } + + [TestMethod] + public void HeaderProtectionRejectsAShortBufferAndAWrongKey() + { + byte[] header = Convert.FromHexString("c300000001088394c8f03e5157080000449e00000002"); + byte[] sample = Convert.FromHexString("d1b1c98dd7689fb8ec11d242b123dc9b"); + byte[] key = Convert.FromHexString("9f50449e04a0e810283a1e9933adedd2"); + using var protection = new QuicHeaderProtection(QuicHeaderCipher.Aes128, key); + + byte[] tooShort = header[..21]; + byte[] before = (byte[])tooShort.Clone(); + Assert.IsFalse(protection.Protect(tooShort, 18, sample)); + CollectionAssert.AreEqual(before, tooShort); + + Assert.IsTrue(protection.Protect(header, 18, sample)); + byte[] truncated = header[..21]; + byte protectedFirst = truncated[0]; + Assert.IsFalse(protection.Remove(truncated, 18, sample)); + Assert.AreEqual(protectedFirst, truncated[0]); + + Assert.IsFalse(protection.Protect(header, 18, sample.AsSpan(0, 15))); + Assert.IsFalse(protection.Protect(header, 18, new byte[17])); + Assert.IsFalse(protection.Protect([], 0, sample)); + Assert.IsFalse(protection.Protect(header, 0, sample)); + Assert.IsFalse(protection.Protect(header, header.Length, sample)); + + byte[] packet = [0xC0, 0x11]; + var aes256 = new QuicHeaderProtection(QuicHeaderCipher.Aes256, new byte[32]); + Assert.IsTrue(aes256.Protect(packet, 1, sample)); + Assert.IsTrue(aes256.Remove(packet, 1, sample)); + Assert.AreEqual(0xC0, packet[0]); + Assert.AreEqual(0x11, packet[1]); + aes256.Dispose(); + aes256.Dispose(); + Assert.ThrowsExactly(() => aes256.Protect(packet, 1, sample)); + + Assert.ThrowsExactly(() => new QuicHeaderProtection(QuicHeaderCipher.Aes128, new byte[15])); + Assert.ThrowsExactly(() => new QuicHeaderProtection(QuicHeaderCipher.Aes256, new byte[16])); + Assert.ThrowsExactly(() => new QuicHeaderProtection(QuicHeaderCipher.ChaCha20, new byte[31])); + } + + private static void AssertSide(bool client, string secret, string key, string iv, string hp) + { + var gotSecret = new byte[32]; + var gotKey = new byte[16]; + var gotIv = new byte[12]; + var gotHp = new byte[16]; + QuicInitial.Derive(ConnectionId, client, gotSecret, gotKey, gotIv, gotHp); + CollectionAssert.AreEqual(Convert.FromHexString(secret), gotSecret); + CollectionAssert.AreEqual(Convert.FromHexString(key), gotKey); + CollectionAssert.AreEqual(Convert.FromHexString(iv), gotIv); + CollectionAssert.AreEqual(Convert.FromHexString(hp), gotHp); + } + + private static void AssertHeader(int packetNumberOffset, string unprotected, string sample, string protectedHeader, string headerKey) + { + byte[] header = Convert.FromHexString(unprotected); + byte[] original = (byte[])header.Clone(); + using var protection = new QuicHeaderProtection(QuicHeaderCipher.Aes128, Convert.FromHexString(headerKey)); + Assert.IsTrue(protection.Protect(header, packetNumberOffset, Convert.FromHexString(sample))); + CollectionAssert.AreEqual(Convert.FromHexString(protectedHeader), header); + Assert.IsTrue(protection.Remove(header, packetNumberOffset, Convert.FromHexString(sample))); + CollectionAssert.AreEqual(original, header); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicInteropTests.cs b/tests/Titanium.Quic.Tests/QuicInteropTests.cs new file mode 100644 index 000000000..6caeec20b --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicInteropTests.cs @@ -0,0 +1,158 @@ +#pragma warning disable CA1416 // The platform listener is started only off Windows, and only when TITANIUM_QUIC_PLATFORM_LISTENER is 1. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicInteropTests +{ + [TestMethod] + public async Task APlatformClientReachesTheManagedListener() + { + if (!QuicConnection.IsSupported) + { + Assert.Inconclusive("The platform QUIC client is not supported on this machine."); + } + + using X509Certificate2 certificate = Certificate(); + var protocol = new SslApplicationProtocol("test"); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { protocol }, + }, + }), + }); + Assert.AreNotEqual(0, listener.LocalEndPoint.Port); + Assert.IsFalse(listener.LocalEndPoint.Port is 8000 or 8866 or 9080 or 9464); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + var clientOptions = new QuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + HandshakeTimeout = TimeSpan.FromSeconds(10), + ClientAuthenticationOptions = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + ApplicationProtocols = new List { protocol }, + RemoteCertificateValidationCallback = (_, _, _, _) => true, + }, + }; + await using QuicConnection platform = await QuicConnection.ConnectAsync(clientOptions, cancel.Token); + await using ManagedQuicConnection server = await accepted; + await using QuicStream outbound = await platform.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + byte[] payload = RandomNumberGenerator.GetBytes(32); + await outbound.WriteAsync(payload, cancel.Token); + byte[] got = new byte[payload.Length]; + int read = 0; + while (read < got.Length) + { + int count = await inbound.ReadAsync(got.AsMemory(read), cancel.Token); + Assert.IsTrue(count > 0); + read += count; + } + + Assert.IsTrue(SHA256.HashData(payload).AsSpan().SequenceEqual(SHA256.HashData(got))); + await platform.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + [TestMethod] + public async Task AManagedClientReachesThePlatformListener() + { + bool allowed = !OperatingSystem.IsWindows() + && string.Equals(Environment.GetEnvironmentVariable("TITANIUM_QUIC_PLATFORM_LISTENER"), "1", StringComparison.Ordinal); + if (!allowed || !QuicListener.IsSupported) + { + return; + } + + using X509Certificate2 certificate = Certificate(); + var protocol = new SslApplicationProtocol("test"); + await using QuicListener listener = await QuicListener.ListenAsync(new QuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ApplicationProtocols = new List { protocol }, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new QuicServerConnectionOptions + { + DefaultCloseErrorCode = 0, + DefaultStreamErrorCode = 0, + IdleTimeout = TimeSpan.FromMinutes(1), + MaxInboundBidirectionalStreams = 4, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = new List { protocol }, + }, + }), + }); + Assert.AreNotEqual(0, listener.LocalEndPoint.Port); + Assert.IsFalse(listener.LocalEndPoint.Port is 8000 or 8866 or 9080 or 9464); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + HandshakeTimeout = TimeSpan.FromSeconds(10), + ClientAuthenticationOptions = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + ApplicationProtocols = new List { protocol }, + }, + }, cancel.Token); + await using QuicConnection server = await accepted; + Task inboundTask = server.AcceptInboundStreamAsync(cancel.Token).AsTask(); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + byte[] payload = RandomNumberGenerator.GetBytes(32); + await outbound.WriteAsync(payload, cancel.Token); + await using QuicStream inbound = await inboundTask; + byte[] got = new byte[payload.Length]; + int read = 0; + while (read < got.Length) + { + int count = await inbound.ReadAsync(got.AsMemory(read), cancel.Token); + Assert.IsTrue(count > 0); + read += count; + } + + Assert.IsTrue(SHA256.HashData(payload).AsSpan().SequenceEqual(SHA256.HashData(got))); + byte[] reply = RandomNumberGenerator.GetBytes(32); + await inbound.WriteAsync(reply, cancel.Token); + byte[] echoed = new byte[reply.Length]; + read = 0; + while (read < echoed.Length) + { + int count = await outbound.ReadAsync(echoed.AsMemory(read), cancel.Token); + Assert.IsTrue(count > 0); + read += count; + } + + Assert.IsTrue(SHA256.HashData(reply).AsSpan().SequenceEqual(SHA256.HashData(echoed))); + await client.CloseAsync(0, cancel.Token); + await server.CloseAsync(0, cancel.Token); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicListenerPathTests.cs b/tests/Titanium.Quic.Tests/QuicListenerPathTests.cs new file mode 100644 index 000000000..31d4c4843 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicListenerPathTests.cs @@ -0,0 +1,555 @@ +#pragma warning disable CA1416 // The test names the BCL error type. It does not open a platform listener. +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +/// The listener's receive path with several peers on one socket. +[TestClass] +public sealed class QuicListenerPathTests +{ + [TestMethod] + public async Task TwoPeersSendingAtOnceKeepTheirOwnBytes() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(60)); + Task acceptFirst = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection first = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection firstServer = await acceptFirst; + Task acceptSecond = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection second = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection secondServer = await acceptSecond; + + const int total = 384 * 1024; + Task firstRead = ReceiveAsync(firstServer, total, cancel.Token); + Task secondRead = ReceiveAsync(secondServer, total, cancel.Token); + await Task.WhenAll(SendAsync(first, total, seed: 1, cancel.Token), SendAsync(second, total, seed: 2, cancel.Token)); + byte[] fromFirst = await firstRead; + byte[] fromSecond = await secondRead; + + AssertPattern(fromFirst, seed: 1); + AssertPattern(fromSecond, seed: 2); + } + + [TestMethod] + public async Task PeersThatConnectTogetherEachGetTheirOwnConnectionAndAddress() + { + // Sixteen first flights reach the socket within microseconds of each other, so on a batch read several of them + // are taken by one call. Each connection must still be keyed by its own source address. + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(60)); + const int peers = 16; + var accepts = new Task[peers]; + for (int i = 0; i < peers; i++) + { + accepts[i] = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + } + + var connects = new Task[peers]; + for (int i = 0; i < peers; i++) + { + ManagedQuicClientConnectionOptions options = Client(listener.LocalEndPoint); + connects[i] = ManagedQuicConnection.ConnectAsync(options, cancel.Token).AsTask(); + } + + ManagedQuicConnection[] clients = await Task.WhenAll(connects); + ManagedQuicConnection[] servers = await Task.WhenAll(accepts); + try + { + var remotes = new HashSet(); + foreach (ManagedQuicConnection server in servers) + { + Assert.IsTrue(remotes.Add(server.RemoteEndPoint), "two connections share a remote address"); + } + + foreach (ManagedQuicConnection client in clients) + { + Assert.IsTrue(remotes.Contains(client.LocalEndPoint), "a client's own address is the remote of one server connection"); + } + + // Each client sends its own pattern and its server connection must hold exactly those bytes. + var reads = new Task[peers]; + var sends = new Task[peers]; + var byRemote = new Dictionary(); + foreach (ManagedQuicConnection server in servers) + { + byRemote[server.RemoteEndPoint] = server; + } + + for (int i = 0; i < peers; i++) + { + reads[i] = ReceiveAsync(byRemote[clients[i].LocalEndPoint], 20_000, cancel.Token); + sends[i] = SendAsync(clients[i], 20_000, seed: i + 1, cancel.Token); + } + + await Task.WhenAll(sends); + for (int i = 0; i < peers; i++) + { + AssertPattern(await reads[i], seed: i + 1); + } + } + finally + { + foreach (ManagedQuicConnection client in clients) + { + await client.DisposeAsync(); + } + + foreach (ManagedQuicConnection server in servers) + { + await server.DisposeAsync(); + } + } + } + + [TestMethod] + public void AQueuedBatchKeepsEachSourceAddress() + { + using var receiver = new UdpSocketTransport(); + using var first = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + using var second = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + first.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + second.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + for (int i = 0; i < 6; i++) + { + (i % 2 == 0 ? first : second).SendTo(new byte[] { (byte)i, 7, 7 }, receiver.LocalEndpoint); + } + + int count = receiver.ReceiveQueued(32); + if (!OperatingSystem.IsLinux() || System.Environment.GetEnvironmentVariable("TITANIUM_UDP_OFFLOAD") == "0") + { + // The portable path has no batch read. The listener takes these one at a time. + Assert.AreEqual(0, count); + return; + } + + Assert.AreEqual(6, count); + for (int i = 0; i < count; i++) + { + Assert.AreEqual(i, receiver.QueuedDatagram(i)[0]); + Assert.AreEqual((IPEndPoint)(i % 2 == 0 ? first : second).LocalEndPoint!, receiver.QueuedRemote(i)); + } + + Assert.AreEqual(0, receiver.ReceiveQueued(32)); + } + + [TestMethod] + public async Task TheHandshakeTimerStillFiresWhileAnotherPeerKeepsTheSocketBusy() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromMilliseconds(600)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(60)); + Task acceptBusy = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection busy = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection busyServer = await acceptBusy; + + // A real client Initial, captured from a socket that never answers the server, is replayed from a socket that + // never reads the server's reply. That connection's handshake cannot finish, so only the listener's timers can end it. + byte[] initial = await CaptureInitialAsync(cancel.Token); + Task acceptStalled = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + + long delivered = 0; + using var stop = new CancellationTokenSource(); + Task drain = Task.Run(async () => + { + ManagedQuicStream inbound = await busyServer.AcceptInboundStreamAsync(cancel.Token); + var buffer = new byte[64 * 1024]; + while (!stop.IsCancellationRequested) + { + int read = await inbound.ReadAsync(buffer, cancel.Token); + if (read == 0) + { + return; + } + + Interlocked.Add(ref delivered, read); + } + }, cancel.Token); + await using ManagedQuicStream outbound = await busy.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + Task flood = Task.Run(async () => + { + var chunk = new byte[8 * 1024]; + while (!stop.IsCancellationRequested) + { + await outbound.WriteAsync(chunk, cancel.Token); + await Task.Yield(); + } + }, cancel.Token); + + using var replay = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + replay.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + while (Interlocked.Read(ref delivered) < 256 * 1024) + { + await Task.Delay(5, cancel.Token); + } + + long before = Interlocked.Read(ref delivered); + replay.SendTo(initial, listener.LocalEndPoint); + QuicException timedOut = await Assert.ThrowsExactlyAsync(async () => await acceptStalled.WaitAsync(TimeSpan.FromSeconds(20))); + long after = Interlocked.Read(ref delivered); + stop.Cancel(); + try + { + await Task.WhenAll(flood, drain); + } + catch (Exception exception) when (exception is OperationCanceledException or QuicException or ObjectDisposedException) + { + } + + Assert.AreEqual(QuicError.ConnectionTimeout, timedOut.QuicError); + Assert.IsTrue(after > before, "the busy peer kept moving data while the other handshake timed out"); + } + + [TestMethod] + public async Task OneBusyPeerDoesNotStarveAnotherOnTheSameListener() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(60)); + Task acceptBusy = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection busy = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection busyServer = await acceptBusy; + Task acceptQuiet = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection quiet = await ManagedQuicConnection.ConnectAsync(Client(listener.LocalEndPoint), cancel.Token); + await using ManagedQuicConnection quietServer = await acceptQuiet; + + using var stop = new CancellationTokenSource(); + Task drain = Task.Run(async () => + { + ManagedQuicStream inbound = await busyServer.AcceptInboundStreamAsync(cancel.Token); + var buffer = new byte[64 * 1024]; + while (!stop.IsCancellationRequested && await inbound.ReadAsync(buffer, cancel.Token) > 0) + { + } + }, cancel.Token); + await using ManagedQuicStream busyStream = await busy.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + Task flood = Task.Run(async () => + { + var chunk = new byte[8 * 1024]; + while (!stop.IsCancellationRequested) + { + await busyStream.WriteAsync(chunk, cancel.Token); + await Task.Yield(); + } + }, cancel.Token); + + await using ManagedQuicStream quietStream = await quiet.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + var request = new byte[100]; + await quietStream.WriteAsync(request, cancel.Token); + ManagedQuicStream quietInbound = await quietServer.AcceptInboundStreamAsync(cancel.Token); + var echo = new byte[100]; + for (int i = 0; i < 40; i++) + { + if (i > 0) + { + await quietStream.WriteAsync(request, cancel.Token); + } + + await ReadExactlyAsync(quietInbound, echo, cancel.Token); + await quietInbound.WriteAsync(echo, cancel.Token); + await ReadExactlyAsync(quietStream, echo, cancel.Token); + } + + stop.Cancel(); + try + { + await Task.WhenAll(flood, drain); + } + catch (Exception exception) when (exception is OperationCanceledException or QuicException or ObjectDisposedException) + { + } + } + + [TestMethod] + public async Task APeerThatRebindsItsSourceAddressKeepsItsConnection() + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await Listen(certificate, TimeSpan.FromSeconds(10)); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(60)); + using var relay = new RebindingRelay(listener.LocalEndPoint); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(relay.FrontEnd), cancel.Token); + await using ManagedQuicConnection server = await accepted; + + await using ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + var request = new byte[100]; + await outbound.WriteAsync(request, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + var echo = new byte[100]; + for (int i = 0; i < 10; i++) + { + if (i > 0) + { + await outbound.WriteAsync(request, cancel.Token); + } + + await ReadExactlyAsync(inbound, echo, cancel.Token); + await inbound.WriteAsync(echo, cancel.Token); + await ReadExactlyAsync(outbound, echo, cancel.Token); + } + + IPEndPoint before = relay.ServerSideEndPoint; + relay.Rebind(); + Assert.AreNotEqual(before, relay.ServerSideEndPoint); + + // Both directions keep working from the new source address, for small exchanges and for a transfer. + for (int i = 0; i < 10; i++) + { + await outbound.WriteAsync(request, cancel.Token); + await ReadExactlyAsync(inbound, echo, cancel.Token); + await inbound.WriteAsync(echo, cancel.Token); + await ReadExactlyAsync(outbound, echo, cancel.Token); + } + + const int total = 128 * 1024; + Task read = ReadAllAsync(inbound, total, cancel.Token); + await SendOnAsync(outbound, total, seed: 7, cancel.Token); + AssertPattern(await read, seed: 7); + Task back = ReadAllAsync(outbound, total, cancel.Token); + await SendOnAsync(inbound, total, seed: 9, cancel.Token); + AssertPattern(await back, seed: 9); + } + + private static async Task CaptureInitialAsync(CancellationToken cancellationToken) + { + using var sink = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + sink.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + ManagedQuicClientConnectionOptions options = Client((IPEndPoint)sink.LocalEndPoint!); + options.HandshakeTimeout = TimeSpan.FromMilliseconds(300); + Task connect = Task.Run(async () => + { + try + { + await using ManagedQuicConnection never = await ManagedQuicConnection.ConnectAsync(options, cancellationToken); + } + catch (QuicException) + { + } + }, cancellationToken); + var buffer = new byte[2048]; + SocketReceiveFromResult received = await sink.ReceiveFromAsync(buffer, SocketFlags.None, new IPEndPoint(IPAddress.Any, 0), cancellationToken); + await connect; + return buffer.AsSpan(0, received.ReceivedBytes).ToArray(); + } + + private static async Task SendAsync(ManagedQuicConnection connection, int total, int seed, CancellationToken cancellationToken) + { + await using ManagedQuicStream stream = await connection.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancellationToken); + await SendOnAsync(stream, total, seed, cancellationToken); + await stream.CompleteWritesAsync(cancellationToken); + } + + private static async Task SendOnAsync(ManagedQuicStream stream, int total, int seed, CancellationToken cancellationToken) + { + var chunk = new byte[8 * 1024]; + for (int offset = 0; offset < total; offset += chunk.Length) + { + int count = Math.Min(chunk.Length, total - offset); + for (int i = 0; i < count; i++) + { + chunk[i] = Pattern(seed, offset + i); + } + + await stream.WriteAsync(chunk.AsMemory(0, count), cancellationToken); + } + } + + private static async Task ReceiveAsync(ManagedQuicConnection server, int total, CancellationToken cancellationToken) + { + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancellationToken); + return await ReadAllAsync(inbound, total, cancellationToken); + } + + private static async Task ReadAllAsync(ManagedQuicStream stream, int total, CancellationToken cancellationToken) + { + var all = new byte[total]; + await ReadExactlyAsync(stream, all, cancellationToken); + return all; + } + + private static async Task ReadExactlyAsync(ManagedQuicStream stream, byte[] buffer, CancellationToken cancellationToken) + { + int read = 0; + while (read < buffer.Length) + { + int count = await stream.ReadAsync(buffer.AsMemory(read), cancellationToken); + if (count == 0) + { + throw new System.IO.EndOfStreamException("The stream ended after " + read + " of " + buffer.Length + " bytes."); + } + + read += count; + } + } + + private static byte Pattern(int seed, int index) => (byte)((index * 31) + (index >> 8) + seed); + + private static void AssertPattern(byte[] bytes, int seed) + { + for (int i = 0; i < bytes.Length; i++) + { + if (bytes[i] != Pattern(seed, i)) + { + Assert.Fail("Byte " + i + " of " + bytes.Length + " does not belong to stream " + seed + "."); + } + } + } + + private static ManagedQuicClientConnectionOptions Client(IPEndPoint remote) => new() + { + RemoteEndPoint = remote, + HandshakeTimeout = TimeSpan.FromSeconds(5), + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "example.test" }, + }; + + private static ValueTask Listen(X509Certificate2 certificate, TimeSpan handshakeTimeout) => + ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + HandshakeTimeout = handshakeTimeout, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } + + /// + /// A UDP relay between one client and a listener. The client sees one fixed address. The listener sees the relay's + /// server-side socket, and moves that to a new socket, the way a NAT mapping changes. + /// + private sealed class RebindingRelay : IDisposable + { + private readonly IPEndPoint _listener; + + private readonly Socket _front = new(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + + private readonly CancellationTokenSource _stop = new(); + + private readonly List _sockets = []; + + private readonly object _gate = new(); + + private Socket _current; + + private EndPoint? _client; + + internal RebindingRelay(IPEndPoint listener) + { + _listener = listener; + _front.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + FrontEnd = (IPEndPoint)_front.LocalEndPoint!; + _current = NewServerSide(); + _ = ForwardFromClientAsync(); + } + + internal IPEndPoint FrontEnd { get; } + + internal IPEndPoint ServerSideEndPoint + { + get + { + lock (_gate) + { + return (IPEndPoint)_current.LocalEndPoint!; + } + } + } + + internal void Rebind() + { + lock (_gate) + { + _current = NewServerSide(); + } + } + + public void Dispose() + { + _stop.Cancel(); + _front.Dispose(); + lock (_gate) + { + foreach (Socket socket in _sockets) + { + socket.Dispose(); + } + } + + _stop.Dispose(); + } + + private Socket NewServerSide() + { + var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + socket.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + lock (_gate) + { + _sockets.Add(socket); + } + + _ = ForwardFromServerAsync(socket); + return socket; + } + + private async Task ForwardFromClientAsync() + { + var buffer = new byte[65536]; + try + { + while (!_stop.IsCancellationRequested) + { + SocketReceiveFromResult received = await _front.ReceiveFromAsync(buffer, SocketFlags.None, new IPEndPoint(IPAddress.Any, 0), _stop.Token); + _client = received.RemoteEndPoint; + Socket current; + lock (_gate) + { + current = _current; + } + + await current.SendToAsync(buffer.AsMemory(0, received.ReceivedBytes), SocketFlags.None, _listener, _stop.Token); + } + } + catch (Exception exception) when (exception is OperationCanceledException or ObjectDisposedException or SocketException) + { + } + } + + private async Task ForwardFromServerAsync(Socket socket) + { + var buffer = new byte[65536]; + try + { + while (!_stop.IsCancellationRequested) + { + SocketReceiveFromResult received = await socket.ReceiveFromAsync(buffer, SocketFlags.None, new IPEndPoint(IPAddress.Any, 0), _stop.Token); + EndPoint? client = _client; + if (client is not null) + { + await _front.SendToAsync(buffer.AsMemory(0, received.ReceivedBytes), SocketFlags.None, client, _stop.Token); + } + } + } + catch (Exception exception) when (exception is OperationCanceledException or ObjectDisposedException or SocketException) + { + } + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicLossEdgeTests.cs b/tests/Titanium.Quic.Tests/QuicLossEdgeTests.cs new file mode 100644 index 000000000..a09ffc31c --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicLossEdgeTests.cs @@ -0,0 +1,270 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicLossEdgeTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly byte[] Payload = [0x01]; + + [TestMethod] + public void ASampleIgnoresTheDelayUntilTheHandshakeIsConfirmed() + { + var loss = new QuicLossRecovery(new QuicNewReno()); + loss.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + loss.OnPacketSent(QuicPacketKind.OneRtt, 1, 0, Now, Payload); + var one = Range(0); + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 1, TimeSpan.FromSeconds(1), one, 1, Now + TimeSpan.FromMilliseconds(100))); + Assert.AreEqual(QuicLossRecovery.InitialRtt, loss.SmoothedRtt); + Assert.AreEqual(1, loss.InFlight); + + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.FromSeconds(1), one, 1, Now + TimeSpan.FromMilliseconds(100))); + Assert.AreEqual(TimeSpan.FromMilliseconds(100), loss.SmoothedRtt); + + var again = new QuicLossRecovery(new QuicNewReno()); + again.HandshakeConfirmed = true; + again.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + Assert.IsTrue(again.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, one, 1, Now + TimeSpan.FromMilliseconds(50))); + again.OnPacketSent(QuicPacketKind.OneRtt, 1, 1200, Now + TimeSpan.FromMilliseconds(50), Payload); + Assert.IsTrue(again.OnAck(QuicPacketKind.OneRtt, 1, TimeSpan.FromMilliseconds(40), one, 1, Now + TimeSpan.FromMilliseconds(250))); + Assert.AreEqual(TimeSpan.FromTicks(656250), again.SmoothedRtt); + } + + [TestMethod] + public void ThePacketThresholdAndAProbeAreExact() + { + var controller = new QuicNewReno(); + var loss = new QuicLossRecovery(controller); + for (ulong number = 0; number < 4; number++) + { + loss.OnPacketSent(QuicPacketKind.OneRtt, number, 1200, Now, Payload); + } + + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 3, TimeSpan.Zero, Range(0), 1, Now)); + Assert.AreEqual(1, loss.DeclaredLost); + Assert.AreEqual(2, loss.InFlight); + Assert.AreEqual(1, loss.Pending.Count); + Assert.AreEqual(6600L, controller.CongestionWindow); + + var pmtu = new QuicLossRecovery(new QuicNewReno()); + pmtu.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, [9], pmtu: true); + pmtu.OnPacketSent(QuicPacketKind.OneRtt, 5, 1200, Now, [5]); + pmtu.OnPacketSent(QuicPacketKind.OneRtt, 3, 1200, Now, [3]); + Assert.AreEqual(2400L, pmtu.BytesInFlight); + pmtu.OnTimeout(Now); + Assert.AreEqual(1, pmtu.Pending.Count); + CollectionAssert.AreEqual(new byte[] { 3 }, pmtu.Pending[0].Payload); + + Assert.IsTrue(pmtu.OnAck(QuicPacketKind.OneRtt, 3, TimeSpan.Zero, Range(0), 1, Now)); + CollectionAssert.AreEqual(new ulong[] { 0 }, pmtu.LostPmtu.ToArray()); + Assert.AreEqual(13200L, pmtu.Controller.CongestionWindow); + + var acked = new QuicLossRecovery(new QuicNewReno()); + acked.OnPacketSent(QuicPacketKind.OneRtt, 4, 1200, Now, [4], pmtu: true); + Assert.AreEqual(0L, acked.BytesInFlight); + Assert.IsTrue(acked.OnAck(QuicPacketKind.OneRtt, 4, TimeSpan.Zero, Range(0), 1, Now)); + CollectionAssert.AreEqual(new ulong[] { 4 }, acked.AckedPmtu.ToArray()); + Assert.AreEqual(12000L, acked.CongestionWindow); + } + + [TestMethod] + public void TheProbeTimeoutDoublesAndStopsAtTheShiftCap() + { + var loss = new QuicLossRecovery(new QuicNewReno()); + TimeSpan plain = loss.CurrentProbeTimeout(); + loss.HandshakeConfirmed = true; + TimeSpan confirmed = loss.CurrentProbeTimeout(); + Assert.AreEqual(QuicLossRecovery.MaxAckDelay, confirmed - plain); + loss.HandshakeConfirmed = false; + + loss.OnPacketSent(QuicPacketKind.Initial, 0, 1200, Now, Payload); + Assert.AreEqual(Now + plain, loss.Timeout); + loss.OnTimeout(Now + plain); + Assert.AreEqual(1, loss.Pending.Count); + Assert.AreEqual(Now + plain + TimeSpan.FromTicks(plain.Ticks * 2), loss.Timeout); + + DateTimeOffset clock = Now; + for (int i = 0; i < 15; i++) + { + loss.OnTimeout(clock); + } + + DateTimeOffset capped = loss.Timeout!.Value; + loss.OnTimeout(clock); + Assert.AreEqual(capped, loss.Timeout); + + var idle = new QuicLossRecovery(new QuicNewReno()); + idle.OnTimeout(Now); + Assert.IsNull(idle.Timeout); + Assert.AreEqual(0, idle.Pending.Count); + } + + [TestMethod] + public void RangesSpacesAndTheSendWindowStayInsideTheBounds() + { + var controller = new QuicNewReno(); + var loss = new QuicLossRecovery(controller); + Assert.IsFalse(loss.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, Range(0), 0, Now)); + loss.OnPacketSent(QuicPacketKind.Initial, 0, 100, Now, Payload); + loss.OnPacketSent(QuicPacketKind.Handshake, 0, 100, Now, Payload); + loss.OnPacketSent(QuicPacketKind.OneRtt, 0, 100, Now, Payload); + Assert.AreEqual(3, loss.InFlight); + Assert.IsTrue(loss.OnAck(QuicPacketKind.Handshake, 0, TimeSpan.Zero, Range(0), 1, Now)); + Assert.AreEqual(2, loss.InFlight); + loss.DiscardInitial(); + Assert.AreEqual(1, loss.InFlight); + Assert.AreEqual(100L, loss.BytesInFlight); + Assert.IsNotNull(loss.Timeout); + + var rejected = new QuicLossRecovery(new QuicNewReno()); + rejected.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + rejected.OnPacketSent(QuicPacketKind.OneRtt, 2, 1200, Now, Payload); + Assert.IsFalse(rejected.OnAck(QuicPacketKind.OneRtt, 2, TimeSpan.Zero, Range(1), 1, Now)); + var hole = new QuicAckRange[2]; + hole[0] = new QuicAckRange { Length = 0 }; + hole[1] = new QuicAckRange { Gap = 0, Length = 0 }; + var kept = new QuicLossRecovery(new QuicNewReno()); + kept.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + kept.OnPacketSent(QuicPacketKind.OneRtt, 1, 1200, Now, Payload); + kept.OnPacketSent(QuicPacketKind.OneRtt, 2, 1200, Now, Payload); + Assert.IsTrue(kept.OnAck(QuicPacketKind.OneRtt, 2, TimeSpan.Zero, hole, 2, Now)); + Assert.AreEqual(1, kept.InFlight); + + var wide = new QuicLossRecovery(new QuicNewReno()); + for (ulong number = 0; number <= 64; number++) + { + wide.OnPacketSent(QuicPacketKind.OneRtt, number, 1, Now, Payload); + } + + Assert.IsTrue(wide.OnAck(QuicPacketKind.OneRtt, 64, TimeSpan.Zero, Range(64), 1, Now)); + Assert.AreEqual(0, wide.InFlight); + + controller = new QuicNewReno(); + var paused = new QuicLossRecovery(controller); + paused.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + Assert.IsTrue(paused.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, Range(0), 1, Now, grow: false)); + Assert.AreEqual(12000L, controller.CongestionWindow); + Assert.IsTrue(paused.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, Range(0), 1, Now)); + Assert.AreEqual(12000L, controller.CongestionWindow); + + var grown = new QuicNewReno(); + var credit = new QuicLossRecovery(grown); + credit.OnPacketSent(QuicPacketKind.OneRtt, 0, 12000, Now, Payload); + Assert.IsFalse(credit.Allows(1)); + Assert.IsTrue(credit.Allows(0)); + Assert.IsTrue(credit.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, Range(0), 1, Now)); + Assert.AreEqual(24000L, grown.CongestionWindow); + Assert.IsTrue(credit.Allows(16384, QuicPacketKind.Handshake)); + Assert.IsFalse(credit.Allows(16385, QuicPacketKind.Handshake)); + Assert.IsTrue(credit.Allows(24000)); + Assert.IsFalse(credit.Allows(24001)); + + var wideWindow = new QuicNewReno(); + var capped = new QuicLossRecovery(wideWindow); + ulong sent = 0; + foreach (int burst in new[] { 12000, 24000, 48000 }) + { + capped.OnPacketSent(QuicPacketKind.OneRtt, sent, burst, Now, Payload); + Assert.IsTrue(capped.OnAck(QuicPacketKind.OneRtt, sent, TimeSpan.Zero, Range(sent), 1, Now)); + sent++; + } + + Assert.AreEqual(96000L, wideWindow.CongestionWindow); + Assert.IsTrue(capped.Allows(QuicFlow.ApplicationFlightCap)); + Assert.IsFalse(capped.Allows(QuicFlow.ApplicationFlightCap + 1)); + Assert.IsTrue(capped.Allows(QuicFlow.ReassemblyCap, QuicPacketKind.Initial)); + Assert.IsFalse(capped.Allows(QuicFlow.ReassemblyCap + 1, QuicPacketKind.Initial)); + } + + [TestMethod] + public void ASecondRangeAndAScheduledLossStayInsideTheBounds() + { + var unsent = new QuicLossRecovery(new QuicNewReno()); + unsent.OnPacketSent(QuicPacketKind.OneRtt, 0, 100, Now, Payload); + Assert.IsFalse(unsent.OnAck(QuicPacketKind.OneRtt, 5, TimeSpan.Zero, Range(0), 1, Now)); + + var overflow = new QuicLossRecovery(new QuicNewReno()); + overflow.OnPacketSent(QuicPacketKind.OneRtt, 5, 100, Now, Payload); + var tooFar = new QuicAckRange[2]; + tooFar[0] = new QuicAckRange { Length = 0 }; + tooFar[1] = new QuicAckRange { Gap = 10, Length = 0 }; + Assert.IsFalse(overflow.OnAck(QuicPacketKind.OneRtt, 5, TimeSpan.Zero, tooFar, 2, Now)); + tooFar[1] = new QuicAckRange { Gap = 0, Length = 4 }; + Assert.IsFalse(overflow.OnAck(QuicPacketKind.OneRtt, 5, TimeSpan.Zero, tooFar, 2, Now)); + tooFar[1] = new QuicAckRange { Gap = 0, Length = 0 }; + Assert.IsFalse(overflow.OnAck(QuicPacketKind.OneRtt, 5, TimeSpan.Zero, tooFar, 2, Now)); + + var discarded = new QuicLossRecovery(new QuicNewReno()); + discarded.OnPacketSent(QuicPacketKind.Initial, 0, 100, Now, Payload); + Assert.IsNotNull(discarded.Timeout); + discarded.DiscardInitial(); + Assert.IsNull(discarded.Timeout); + Assert.AreEqual(0L, discarded.BytesInFlight); + + var scheduled = new QuicLossRecovery(new QuicNewReno()); + for (ulong number = 0; number < 4; number++) + { + scheduled.OnPacketSent(QuicPacketKind.OneRtt, number, 100, Now, Payload); + } + + Assert.IsTrue(scheduled.OnAck(QuicPacketKind.OneRtt, 3, TimeSpan.Zero, Range(0), 1, Now)); + scheduled.OnTimeout(Now + TimeSpan.FromMilliseconds(1)); + Assert.AreEqual(3, scheduled.DeclaredLost); + Assert.AreEqual(2, scheduled.Pending.Count); + + var early = new QuicLossRecovery(new QuicNewReno()); + for (ulong number = 0; number < 4; number++) + { + early.OnPacketSent(QuicPacketKind.OneRtt, number, 100, Now, Payload); + early.OnPacketSent(QuicPacketKind.Initial, number, 100, Now + TimeSpan.FromHours(1), Payload); + } + + Assert.IsTrue(early.OnAck(QuicPacketKind.OneRtt, 3, TimeSpan.Zero, Range(0), 1, Now)); + Assert.IsTrue(early.OnAck(QuicPacketKind.Initial, 3, TimeSpan.Zero, Range(0), 1, Now + TimeSpan.FromHours(1))); + int before = early.DeclaredLost; + early.OnTimeout(Now + TimeSpan.FromMilliseconds(1)); + Assert.IsTrue(early.DeclaredLost > before); + + var between = new QuicNewReno(); + var spaced = new QuicLossRecovery(between); + DateTimeOffset sample = Now + TimeSpan.FromMilliseconds(50); + spaced.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, Payload); + Assert.IsTrue(spaced.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, Range(0), 1, sample)); + DateTimeOffset first = sample + TimeSpan.FromMilliseconds(10); + DateTimeOffset middle = first + TimeSpan.FromSeconds(5); + DateTimeOffset later = first + TimeSpan.FromSeconds(10); + spaced.OnPacketSent(QuicPacketKind.OneRtt, 1, 1200, first, Payload); + spaced.OnPacketSent(QuicPacketKind.OneRtt, 2, 1200, middle, Payload); + Assert.IsTrue(spaced.OnAck(QuicPacketKind.OneRtt, 2, TimeSpan.Zero, Range(0), 1, middle)); + for (ulong number = 3; number <= 6; number++) + { + spaced.OnPacketSent(QuicPacketKind.OneRtt, number, 1200, later, Payload); + } + + Assert.IsTrue(spaced.OnAck(QuicPacketKind.OneRtt, 6, TimeSpan.Zero, Range(0), 1, later)); + Assert.AreNotEqual(between.MinimumWindow, between.CongestionWindow); + + var grown = new QuicNewReno(); + var wide = new QuicLossRecovery(grown); + for (ulong number = 0; number <= 69; number++) + { + wide.OnPacketSent(QuicPacketKind.OneRtt, number, 1, Now, Payload); + } + + var ranges = new QuicAckRange[2]; + ranges[0] = new QuicAckRange { Length = 63 }; + ranges[1] = new QuicAckRange { Gap = 0, Length = 4 }; + Assert.IsTrue(wide.OnAck(QuicPacketKind.OneRtt, 69, TimeSpan.Zero, ranges, 2, Now)); + Assert.AreEqual(0, wide.InFlight); + Assert.AreEqual(1, wide.DeclaredLost); + Assert.AreEqual(6034L, grown.CongestionWindow); + } + + private static QuicAckRange[] Range(ulong length) + { + return [new QuicAckRange { Length = length }]; + } +} diff --git a/tests/Titanium.Quic.Tests/QuicLossTests.cs b/tests/Titanium.Quic.Tests/QuicLossTests.cs new file mode 100644 index 000000000..1a2f0ed74 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicLossTests.cs @@ -0,0 +1,134 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicLossTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void ADroppedPacketIsRetransmitted() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + byte[] buffer = new byte[16384]; + Assert.IsTrue(client.PollTransmit(Now, buffer, out _) > 0); + TimeSpan timeout = ProbeTimeout(); + Assert.AreEqual(Now + timeout, client.NextTimeout()); + Assert.IsFalse(client.HandleTimeout(Now + timeout - TimeSpan.FromMilliseconds(1))); + Assert.IsTrue(client.HandleTimeout(Now + timeout)); + Assert.IsTrue(client.PollTransmit(Now + timeout, buffer, out _) > 0); + } + + [TestMethod] + public void AReorderedPacketIsNotDeclaredLost() + { + var controller = new QuicNewReno(); + var loss = new QuicLossRecovery(controller); + byte[] payload = [0x01]; + loss.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, payload); + loss.OnPacketSent(QuicPacketKind.OneRtt, 1, 1200, Now, payload); + loss.OnPacketSent(QuicPacketKind.OneRtt, 2, 1200, Now, payload); + var ranges = new QuicAckRange[1]; + ranges[0] = new QuicAckRange { Length = 0 }; + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 2, TimeSpan.Zero, ranges, 1, Now)); + Assert.AreEqual(0, loss.DeclaredLost); + Assert.AreEqual(2, loss.InFlight); + Assert.IsTrue(controller.CongestionWindow > controller.MinimumWindow); + } + + [TestMethod] + public void PersistentCongestionShrinksTheWindow() + { + var controller = new QuicNewReno(); + var loss = new QuicLossRecovery(controller); + byte[] payload = [0x01]; + loss.OnPacketSent(QuicPacketKind.OneRtt, 0, 1200, Now, payload); + var ranges = new QuicAckRange[1]; + ranges[0] = new QuicAckRange { Length = 0 }; + DateTimeOffset sample = Now + TimeSpan.FromMilliseconds(50); + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 0, TimeSpan.Zero, ranges, 1, sample)); + + DateTimeOffset first = sample + TimeSpan.FromMilliseconds(10); + DateTimeOffset later = first + TimeSpan.FromSeconds(10); + loss.OnPacketSent(QuicPacketKind.OneRtt, 1, 1200, first, payload); + for (ulong number = 2; number <= 5; number++) + { + loss.OnPacketSent(QuicPacketKind.OneRtt, number, 1200, later, payload); + } + + Assert.IsTrue(loss.OnAck(QuicPacketKind.OneRtt, 5, TimeSpan.Zero, ranges, 1, later)); + Assert.IsTrue(loss.DeclaredLost >= 2); + Assert.AreEqual(controller.MinimumWindow, controller.CongestionWindow); + } + + [TestMethod] + public void AnAckOfAnUnsentPacketCloses() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + byte[] frame = new byte[32]; + var ranges = new QuicAckRange[1]; + ranges[0] = new QuicAckRange { Length = 0 }; + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = 5, + AckRangeCount = 1, + }; + int framed = QuicFrameWriter.Write(in ack, ranges, frame); + using var send = QuicPacketProtector.FromInitial(ServerId, client: false); + byte[] packet = new byte[1500]; + int written = QuicPackets.SealLong(packet, QuicPacketKind.Initial, ClientId, ServerId, 0, frame.AsSpan(0, framed), send, 1200); + Assert.IsTrue(written > 0); + client.HandleDatagram(Now, packet.AsSpan(0, written), Path); + Assert.IsTrue(client.IsClosed); + Assert.AreEqual(QuicFrameReader.ProtocolViolation, client.CloseError); + } + + private static TimeSpan ProbeTimeout() + { + long rtt = QuicLossRecovery.InitialRtt.Ticks; + long variance = Math.Max(4 * (rtt / 2), QuicLossRecovery.Granularity.Ticks); + return TimeSpan.FromTicks(rtt + variance); + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[256]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicNewRenoTests.cs b/tests/Titanium.Quic.Tests/QuicNewRenoTests.cs new file mode 100644 index 000000000..266fc3479 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicNewRenoTests.cs @@ -0,0 +1,48 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicNewRenoTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + [TestMethod] + public void SlowStartLossAndRecoveryStayInsideTheWindow() + { + var reno = new QuicNewReno(); + Assert.AreEqual(12000, reno.CongestionWindow); + Assert.AreEqual(2 * QuicNewReno.MaxDatagramSize, reno.MinimumWindow); + reno.OnSent(1000); + Assert.AreEqual(1000, reno.BytesInFlight); + reno.OnAcked(1000, Now, Now, grow: true); + Assert.AreEqual(0, reno.BytesInFlight); + Assert.AreEqual(13000, reno.CongestionWindow); + reno.OnAcked(100, Now, Now, grow: false); + Assert.AreEqual(0, reno.BytesInFlight); + Assert.AreEqual(13000, reno.CongestionWindow); + + reno.OnSent(12000); + reno.OnLost(1200, Now, Now, persistentCongestion: false); + Assert.AreEqual(6500, reno.CongestionWindow); + reno.OnLost(100, Now, Now + TimeSpan.FromMilliseconds(1), persistentCongestion: false); + Assert.AreEqual(6500, reno.CongestionWindow); + reno.OnAcked(100, Now, Now + TimeSpan.FromMilliseconds(1), grow: true); + Assert.AreEqual(6500, reno.CongestionWindow); + + DateTimeOffset later = Now + TimeSpan.FromMilliseconds(2); + reno.OnAcked(1200, later, later, grow: true); + long avoided = 6500 + (QuicNewReno.MaxDatagramSize * 1200L / 6500); + Assert.AreEqual(avoided, reno.CongestionWindow); + reno.OnLost(100000, Now, later, persistentCongestion: false); + Assert.AreEqual(0, reno.BytesInFlight); + Assert.AreEqual(avoided, reno.CongestionWindow); + + reno.OnLost(100, later, later, persistentCongestion: true); + Assert.AreEqual(reno.MinimumWindow, reno.CongestionWindow); + reno.OnDiscarded(20000); + Assert.AreEqual(0, reno.BytesInFlight); + Assert.AreEqual(reno.MinimumWindow, reno.CongestionWindow); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicNumberRangesTests.cs b/tests/Titanium.Quic.Tests/QuicNumberRangesTests.cs new file mode 100644 index 000000000..ee50c49e6 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicNumberRangesTests.cs @@ -0,0 +1,108 @@ +using System; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicNumberRangesTests +{ + [TestMethod] + public void AnEmptySetContainsNothing() + { + var ranges = new QuicNumberRanges(); + Assert.IsFalse(ranges.ContainsAll(0, 0)); + Assert.IsFalse(ranges.ContainsAll(0, 10)); + } + + [TestMethod] + public void NumbersSentInOrderStayInOneRange() + { + var ranges = new QuicNumberRanges(); + for (ulong number = 0; number < 100_000; number++) + { + ranges.Add(number); + } + + Assert.AreEqual(1, ranges.RangeCount); + Assert.IsTrue(ranges.ContainsAll(0, 99_999)); + Assert.IsTrue(ranges.ContainsAll(40_000, 40_000)); + Assert.IsFalse(ranges.ContainsAll(0, 100_000)); + Assert.IsFalse(ranges.ContainsAll(100_000, 100_000)); + } + + [TestMethod] + public void AHoleSplitsTheRangeUntilItIsFilled() + { + var ranges = new QuicNumberRanges(); + ranges.Add(0); + ranges.Add(1); + ranges.Add(3); + ranges.Add(4); + Assert.AreEqual(2, ranges.RangeCount); + Assert.IsTrue(ranges.ContainsAll(0, 1)); + Assert.IsTrue(ranges.ContainsAll(3, 4)); + Assert.IsFalse(ranges.ContainsAll(0, 4)); + Assert.IsFalse(ranges.ContainsAll(2, 2)); + ranges.Add(2); + Assert.AreEqual(1, ranges.RangeCount); + Assert.IsTrue(ranges.ContainsAll(0, 4)); + } + + [TestMethod] + public void AddingTheSameNumberTwiceChangesNothing() + { + var ranges = new QuicNumberRanges(); + ranges.Add(5); + ranges.Add(5); + ranges.Add(6); + ranges.Add(6); + ranges.Add(5); + Assert.AreEqual(1, ranges.RangeCount); + Assert.IsTrue(ranges.ContainsAll(5, 6)); + Assert.IsFalse(ranges.ContainsAll(4, 6)); + } + + [TestMethod] + public void TheEdgesOfTheNumberSpaceAreHandled() + { + var ranges = new QuicNumberRanges(); + ranges.Add(ulong.MaxValue); + ranges.Add(ulong.MaxValue - 1); + ranges.Add(0); + Assert.AreEqual(2, ranges.RangeCount); + Assert.IsTrue(ranges.ContainsAll(ulong.MaxValue - 1, ulong.MaxValue)); + Assert.IsTrue(ranges.ContainsAll(0, 0)); + Assert.IsFalse(ranges.ContainsAll(0, 1)); + } + + [TestMethod] + public void RandomOrderMatchesAHashSet() + { + var random = new Random(20261129); + for (int round = 0; round < 200; round++) + { + var ranges = new QuicNumberRanges(); + var reference = new HashSet(); + for (int i = 0; i < 300; i++) + { + ulong number = (ulong)random.Next(0, 400); + ranges.Add(number); + reference.Add(number); + } + + for (int probe = 0; probe < 400; probe++) + { + ulong low = (ulong)random.Next(0, 400); + ulong high = low + (ulong)random.Next(0, 12); + bool expected = true; + for (ulong number = low; number <= high; number++) + { + expected &= reference.Contains(number); + } + + Assert.AreEqual(expected, ranges.ContainsAll(low, high), $"round {round} range {low}..{high}"); + } + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicPacketHeaderTests.cs b/tests/Titanium.Quic.Tests/QuicPacketHeaderTests.cs new file mode 100644 index 000000000..eff7ea065 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicPacketHeaderTests.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicPacketHeaderTests +{ + [TestMethod] + public void LongHeadersRoundTripEachType() + { + byte[] initial = LongPacket(0x00, token: [9, 9], packetNumber: [1, 2], payload: [3, 4, 5]); + AssertPacket(initial, QuicPacketKind.Initial, destination: [0xAA], source: [0xBB], packetNumber: [1, 2], payload: [3, 4, 5], token: [9, 9]); + + byte[] zeroRtt = LongPacket(0x01, token: null, packetNumber: [4], payload: [5]); + AssertPacket(zeroRtt, QuicPacketKind.ZeroRtt, destination: [0xAA], source: [0xBB], packetNumber: [4], payload: [5], token: []); + + byte[] handshake = LongPacket(0x02, token: null, packetNumber: [6, 7, 8, 9], payload: [10]); + AssertPacket(handshake, QuicPacketKind.Handshake, destination: [0xAA], source: [0xBB], packetNumber: [6, 7, 8, 9], payload: [10], token: []); + + byte[] tag = new byte[16]; + tag[0] = 0x7E; + byte[] retry = Retry([1, 2, 3], tag); + AssertPacket(retry, QuicPacketKind.Retry, destination: [0xAA], source: [0xBB], packetNumber: [], payload: [], token: [1, 2, 3]); + var reader = new QuicDatagramReader(retry, shortDestinationIdLength: 0); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + CollectionAssert.AreEqual(tag, packet.IntegrityTag.ToArray()); + Assert.IsFalse(reader.TryRead(out _)); + } + + [TestMethod] + public void ShortHeaderUsesTheSuppliedConnectionIdLength() + { + byte[] datagram = [0x46, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; + var reader = new QuicDatagramReader(datagram, shortDestinationIdLength: 8); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + Assert.AreEqual(QuicPacketKind.OneRtt, packet.Kind); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 }, packet.DestinationConnectionId.ToArray()); + CollectionAssert.AreEqual(new byte[] { 9, 10, 11 }, packet.PacketNumber.ToArray()); + Assert.AreEqual(0, packet.Payload.Length); + Assert.IsTrue(packet.FixedBit); + Assert.IsFalse(packet.Spin); + Assert.IsTrue(packet.KeyPhase); + Assert.IsFalse(reader.TryRead(out _)); + } + + [TestMethod] + public void CoalescedInitialAndHandshakeStopBeforeAShortHeader() + { + var bytes = new List(); + bytes.AddRange(LongPacket(0x00, token: [], packetNumber: [1], payload: [2])); + bytes.AddRange(LongPacket(0x02, token: null, packetNumber: [3], payload: [4])); + bytes.AddRange(new byte[] { 0x41, 9, 8, 7 }); + var reader = new QuicDatagramReader(bytes.ToArray(), shortDestinationIdLength: 1); + Assert.IsTrue(reader.TryRead(out QuicPacket initial)); + Assert.AreEqual(QuicPacketKind.Initial, initial.Kind); + CollectionAssert.AreEqual(new byte[] { 2 }, initial.Payload.ToArray()); + Assert.IsTrue(reader.TryRead(out QuicPacket handshake)); + Assert.AreEqual(QuicPacketKind.Handshake, handshake.Kind); + CollectionAssert.AreEqual(new byte[] { 4 }, handshake.Payload.ToArray()); + Assert.IsTrue(reader.TryRead(out QuicPacket oneRtt)); + Assert.AreEqual(QuicPacketKind.OneRtt, oneRtt.Kind); + CollectionAssert.AreEqual(new byte[] { 9 }, oneRtt.DestinationConnectionId.ToArray()); + CollectionAssert.AreEqual(new byte[] { 8, 7 }, oneRtt.PacketNumber.ToArray()); + Assert.IsFalse(reader.TryRead(out _)); + } + + [TestMethod] + public void VersionNegotiationCarriesSupportedVersions() + { + var bytes = new List { 0x80, 0, 0, 0, 0, 1, 0xAA, 1, 0xBB }; + bytes.AddRange(new byte[] { 0, 0, 0, 1, 0x6b, 0x33, 0x43, 0xcf }); + var reader = new QuicDatagramReader(bytes.ToArray(), shortDestinationIdLength: 0); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + Assert.AreEqual(QuicPacketKind.VersionNegotiation, packet.Kind); + Assert.AreEqual(0u, packet.Version); + CollectionAssert.AreEqual(new byte[] { 0xAA }, packet.DestinationConnectionId.ToArray()); + CollectionAssert.AreEqual(new byte[] { 0xBB }, packet.SourceConnectionId.ToArray()); + CollectionAssert.AreEqual(new byte[] { 0, 0, 0, 1, 0x6b, 0x33, 0x43, 0xcf }, packet.SupportedVersions.ToArray()); + Assert.IsFalse(reader.TryRead(out _)); + } + + [TestMethod] + public void VersionNegotiationAllowsAConnectionIdLongerThanTwenty() + { + var bytes = new List { 0x80, 0, 0, 0, 0, 21 }; + bytes.AddRange(new byte[21]); + bytes.Add(0); + bytes.AddRange(new byte[] { 0, 0, 0, 1 }); + Assert.IsTrue(new QuicDatagramReader(bytes.ToArray(), 0).TryRead(out QuicPacket packet)); + Assert.AreEqual(21, packet.DestinationConnectionId.Length); + } + + [TestMethod] + public void HeaderEdgesKeepTheLengthAndTheBits() + { + Assert.ThrowsExactly(() => new QuicDatagramReader([0x40], -1)); + Assert.ThrowsExactly(() => new QuicDatagramReader([0x40], 21)); + + byte[] cid = new byte[20]; + cid[0] = 0x11; + var shortHeader = new List { 0x40 }; + shortHeader.AddRange(cid); + shortHeader.Add(0x05); + Assert.IsTrue(new QuicDatagramReader(shortHeader.ToArray(), 20).TryRead(out QuicPacket packet)); + Assert.AreEqual(20, packet.DestinationConnectionId.Length); + Assert.AreEqual(1, packet.PacketNumber.Length); + Assert.IsFalse(packet.Spin); + Assert.IsFalse(packet.KeyPhase); + Assert.IsFalse(new QuicDatagramReader(shortHeader.ToArray().AsSpan(0, shortHeader.Count - 1), 20).TryRead(out _)); + + Assert.IsTrue(new QuicDatagramReader([0x00, 0x01], 0).TryRead(out packet)); + Assert.IsFalse(packet.FixedBit); + Assert.IsTrue(new QuicDatagramReader([0x60, 0x09, 0x01], 1).TryRead(out packet)); + Assert.IsTrue(packet.Spin); + Assert.IsFalse(packet.KeyPhase); + + var versions = new List { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; + Assert.IsTrue(new QuicDatagramReader(versions.ToArray(), 0).TryRead(out packet)); + Assert.AreEqual(4, packet.SupportedVersions.Length); + Assert.IsFalse(new QuicDatagramReader(versions.GetRange(0, versions.Count - 2).ToArray(), 0).TryRead(out _)); + versions.AddRange(new byte[] { 0, 2 }); + Assert.IsFalse(new QuicDatagramReader(versions.ToArray(), 0).TryRead(out _)); + + byte[] unknown = LongPacket(0x00, token: [], packetNumber: [1], payload: [2]); + unknown[4] = 2; + Assert.IsFalse(new QuicDatagramReader(unknown, 0).TryRead(out _)); + + byte[] probe = new byte[1200]; + probe[0] = 0xC0; + probe[1] = 0x57; + probe[2] = 0x41; + probe[3] = 0x49; + probe[4] = 0x54; + byte[] reply = new byte[64]; + Assert.IsTrue(QuicDatagramReader.TryVersionNegotiation(probe, reply, out int written)); + Assert.AreEqual(11, written); + Assert.AreEqual(0, reply[1]); + Assert.AreEqual(0, reply[4]); + CollectionAssert.AreEqual(new byte[] { 0, 0, 0, 1 }, reply.AsSpan(7, 4).ToArray()); + Assert.IsFalse(QuicDatagramReader.TryVersionNegotiation(probe.AsSpan(0, 1199), reply, out _)); + + var long20 = new List { 0xE0, 0, 0, 0, 1, 20 }; + long20.AddRange(new byte[20]); + long20.Add(0); + long20.Add(1); + long20.Add(9); + Assert.IsTrue(new QuicDatagramReader(long20.ToArray(), 0).TryRead(out packet)); + Assert.AreEqual(20, packet.DestinationConnectionId.Length); + + var longSource = new List { 0xE0, 0, 0, 0, 1, 0, 21 }; + longSource.AddRange(new byte[21]); + Assert.IsFalse(new QuicDatagramReader(longSource.ToArray(), 0).TryRead(out _)); + + Assert.IsTrue(new QuicDatagramReader([0xE1, 0, 0, 0, 1, 0, 0, 2, 0x11, 0x22], 0).TryRead(out packet)); + Assert.AreEqual(2, packet.PacketNumber.Length); + Assert.AreEqual(0, packet.Payload.Length); + Assert.IsFalse(new QuicDatagramReader([0xE1, 0, 0, 0, 1, 0, 0, 1, 0x11, 0x22], 0).TryRead(out _)); + } + + [TestMethod] + public void TruncatedAndOversizedHeadersAreRejected() + { + Assert.IsFalse(new QuicDatagramReader([0xC0, 0, 0, 0], 0).TryRead(out _)); + byte[] initial = LongPacket(0x00, token: [], packetNumber: [1, 2], payload: [3]); + Assert.IsFalse(new QuicDatagramReader(initial.AsSpan(0, initial.Length - 1), 0).TryRead(out _)); + var oversized = new List { 0xC0, 0, 0, 0, 1, 21 }; + oversized.AddRange(new byte[21]); + oversized.Add(0); + Assert.IsFalse(new QuicDatagramReader(oversized.ToArray(), 0).TryRead(out _)); + Assert.IsFalse(new QuicDatagramReader([], 0).TryRead(out _)); + } + + private static void AssertPacket(byte[] datagram, QuicPacketKind kind, byte[] destination, byte[] source, byte[] packetNumber, byte[] payload, byte[] token) + { + var reader = new QuicDatagramReader(datagram, shortDestinationIdLength: 0); + Assert.IsTrue(reader.TryRead(out QuicPacket packet)); + Assert.AreEqual(kind, packet.Kind); + Assert.AreEqual(QuicDatagramReader.Version1, packet.Version); + CollectionAssert.AreEqual(destination, packet.DestinationConnectionId.ToArray()); + CollectionAssert.AreEqual(source, packet.SourceConnectionId.ToArray()); + CollectionAssert.AreEqual(packetNumber, packet.PacketNumber.ToArray()); + CollectionAssert.AreEqual(payload, packet.Payload.ToArray()); + CollectionAssert.AreEqual(token, packet.Token.ToArray()); + Assert.IsFalse(reader.TryRead(out _)); + } + + private static byte[] LongPacket(byte type, byte[]? token, byte[] packetNumber, byte[] payload) + { + var bytes = new List + { + (byte)(0xC0 | (type << 4) | (packetNumber.Length - 1)), + 0, 0, 0, 1, + 1, 0xAA, + 1, 0xBB, + }; + if (token is not null) + { + bytes.AddRange(Var(token.Length)); + bytes.AddRange(token); + } + + bytes.AddRange(Var(packetNumber.Length + payload.Length)); + bytes.AddRange(packetNumber); + bytes.AddRange(payload); + return bytes.ToArray(); + } + + private static byte[] Retry(byte[] token, byte[] tag) + { + var bytes = new List { 0xF0, 0, 0, 0, 1, 1, 0xAA, 1, 0xBB }; + bytes.AddRange(token); + bytes.AddRange(tag); + return bytes.ToArray(); + } + + private static byte[] Var(int value) + { + var buffer = new byte[8]; + int written = QuicVarInt.Encode((ulong)value, buffer); + return buffer.AsSpan(0, written).ToArray(); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicPacketNumberTests.cs b/tests/Titanium.Quic.Tests/QuicPacketNumberTests.cs new file mode 100644 index 000000000..8b6dc9e8b --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicPacketNumberTests.cs @@ -0,0 +1,84 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicPacketNumberTests +{ + [TestMethod] + public void AppendixExamplesSelectTheStatedWidth() + { + var buffer = new byte[4]; + Assert.IsTrue(QuicPacketNumber.TryEncode(0xac5c02, 0xabe8b3, buffer, out int written)); + Assert.AreEqual(2, written); + CollectionAssert.AreEqual(new byte[] { 0x5c, 0x02 }, buffer.AsSpan(0, written).ToArray()); + + Assert.IsTrue(QuicPacketNumber.TryEncode(0xace8fe, 0xabe8b3, buffer, out written)); + Assert.AreEqual(3, written); + CollectionAssert.AreEqual(new byte[] { 0xac, 0xe8, 0xfe }, buffer.AsSpan(0, written).ToArray()); + } + + [TestMethod] + public void AppendixDecodeRecoversTheFullNumber() + { + Assert.IsTrue(QuicPacketNumber.TryDecode(0xa82f30ea, [0x9b, 0x32], out ulong full)); + Assert.AreEqual(0xa82f9b32UL, full); + } + + [TestMethod] + public void TwoByteBoundaryReconstructsOnEitherSide() + { + Assert.IsTrue(QuicPacketNumber.TryDecode(0xFFFF, [0x00, 0x00], out ulong ahead)); + Assert.AreEqual(0x10000UL, ahead); + Assert.IsTrue(QuicPacketNumber.TryDecode(0x10000, [0xFF, 0xFF], out ulong behind)); + Assert.AreEqual(0xFFFFUL, behind); + } + + [TestMethod] + public void FirstPacketNumberIsZeroWhenNothingHasBeenProcessed() + { + Assert.IsTrue(QuicPacketNumber.TryEncode(0, null, new byte[4], out int written)); + Assert.AreEqual(1, written); + Assert.IsTrue(QuicPacketNumber.TryDecode(null, [0], out ulong full)); + Assert.AreEqual(0UL, full); + } + + [TestMethod] + public void ANumberOutsideTheWindowIsRejected() + { + Assert.IsFalse(QuicPacketNumber.TryDecode(null, [], out _)); + Assert.IsFalse(QuicPacketNumber.TryDecode(null, new byte[5], out _)); + Assert.IsFalse(QuicPacketNumber.TryDecode(QuicPacketNumber.MaxValue, [0], out _)); + Assert.IsFalse(QuicPacketNumber.TryDecode(QuicPacketNumber.MaxValue - 1, [0x00], out _)); + Assert.IsFalse(QuicPacketNumber.TryEncode(1UL << 32, 0, new byte[8], out _)); + Assert.IsFalse(QuicPacketNumber.TryEncode(QuicPacketNumber.MaxValue + 1, null, new byte[8], out _)); + } + + [TestMethod] + public void EncodeFitsTheExactWidthAndRejectsAnEqualAck() + { + Assert.IsFalse(QuicPacketNumber.TryEncode(5, 5, new byte[4], out _)); + Assert.IsTrue(QuicPacketNumber.TryEncode(5, 4, new byte[1], out int written)); + Assert.AreEqual(1, written); + Assert.IsFalse(QuicPacketNumber.TryEncode(256, 0, new byte[1], out _)); + Assert.IsTrue(QuicPacketNumber.TryEncode(256, 0, new byte[2], out written)); + Assert.AreEqual(2, written); + Assert.IsTrue(QuicPacketNumber.TryDecode(4, [5], out ulong full)); + Assert.AreEqual(5UL, full); + } + + [TestMethod] + public void EncodedNumbersDecodeBackToTheSameValue() + { + ulong[] numbers = [1, 63, 256, 0x734f, 0x10000, 0xa82f9b32]; + var buffer = new byte[4]; + foreach (ulong number in numbers) + { + ulong? acked = number == 0 ? null : number - 1; + Assert.IsTrue(QuicPacketNumber.TryEncode(number, acked, buffer, out int written), number.ToString()); + Assert.IsTrue(QuicPacketNumber.TryDecode(acked, buffer.AsSpan(0, written), out ulong decoded), number.ToString()); + Assert.AreEqual(number, decoded); + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicPacketProtectorTests.cs b/tests/Titanium.Quic.Tests/QuicPacketProtectorTests.cs new file mode 100644 index 000000000..9f51d8788 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicPacketProtectorTests.cs @@ -0,0 +1,98 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicPacketProtectorTests +{ + private static readonly byte[] DestinationId = Convert.FromHexString("8394c8f03e515708"); + + private static readonly byte[] SourceId = [0x51, 0x51, 0x51, 0x51]; + + private static readonly byte[] Payload = [0x01, 0x02, 0x03, 0x04]; + + [TestMethod] + public void AShortPacketRoundTripsAndRejectsAShortBuffer() + { + using var protector = QuicPacketProtector.FromInitial(DestinationId, client: true); + byte[] wide = new byte[64]; + int written = QuicPackets.SealShort(wide, DestinationId, 0x0201, Payload, protector); + Assert.AreEqual("488394C8F03E515708796BCF948CAE233B638AE58CA8BB6F06FBAC23F62C54", Convert.ToHexString(wide.AsSpan(0, written))); + byte[] exact = wide[..written]; + byte[] fitted = new byte[written]; + Assert.AreEqual(written, QuicPackets.SealShort(fitted, DestinationId, 0x0201, Payload, protector)); + CollectionAssert.AreEqual(exact, fitted); + Assert.AreEqual(0, QuicPackets.SealShort(new byte[written - 1], DestinationId, 0x0201, Payload, protector)); + Assert.AreEqual(0, QuicPackets.SealShort(new byte[written], DestinationId, 0x0201, ReadOnlySpan.Empty, protector)); + + int offset = 1 + DestinationId.Length; + byte[] plain = new byte[Payload.Length]; + Assert.IsTrue(protector.Open(exact, offset, largest: 0, out ulong number, plain, out int plainLength)); + Assert.AreEqual(0x0201UL, number); + Assert.AreEqual(Payload.Length, plainLength); + CollectionAssert.AreEqual(Payload, plain[..plainLength]); + + byte[] damaged = (byte[])exact.Clone(); + damaged[^1] ^= 0x01; + Assert.IsFalse(protector.Open(damaged, offset, largest: 0, out _, plain, out _)); + Assert.IsFalse(protector.Open(exact, packetNumberOffset: 0, largest: 0, out _, plain, out _)); + Assert.IsFalse(protector.Open(exact.AsSpan(0, offset + 19), offset, largest: 0, out _, plain, out _)); + Assert.IsFalse(protector.Open(exact, offset, QuicPacketNumber.MaxValue, out _, plain, out _)); + Assert.IsFalse(protector.Open((byte[])exact.Clone(), offset, largest: 0, out _, new byte[Payload.Length - 1], out _)); + + byte[] direct = new byte[written]; + direct[0] = 0x41; + Assert.AreEqual(written, protector.Seal(direct, 1 + DestinationId.Length + 2, 0x0201, Payload)); + Assert.AreEqual(0, protector.Seal(new byte[written - 1], 1 + DestinationId.Length + 2, 0x0201, Payload)); + + byte[] two = [0xAB, 0xCD]; + byte[] tiny = new byte[1 + DestinationId.Length + 2 + two.Length + 16]; + Assert.AreEqual(tiny.Length, QuicPackets.SealShort(tiny, DestinationId, 0x0201, two, protector)); + Assert.IsTrue(protector.Open(tiny, offset, largest: 0, out ulong tinyNumber, new byte[two.Length], out int tinyLength)); + Assert.AreEqual(0x0201UL, tinyNumber); + Assert.AreEqual(two.Length, tinyLength); + + byte[] header = new byte[32]; + Assert.AreEqual(0, protector.Seal(header, headerLength: 0, packetNumber: 1, Payload)); + header[0] = 0x00; + Assert.AreEqual(0, protector.Seal(header, headerLength: 1, packetNumber: 1, Payload)); + + protector.Dispose(); + protector.Dispose(); + Assert.ThrowsExactly(() => protector.Seal(header, 1, 1, Payload)); + } + + [TestMethod] + public void ALongPacketPadsToTheMinimumAndCarriesAToken() + { + using var protector = QuicPacketProtector.FromSecret(new byte[32]); + byte[] initial = new byte[256]; + int bare = QuicPackets.SealLong(initial, QuicPacketKind.Initial, DestinationId, SourceId, 0x0302, Payload, protector, minimumDatagram: 0); + Assert.AreEqual("C100000001088394C8F03E51570804515151510016D58CAA7475044467EF51033490BF0654C909E24285F4", Convert.ToHexString(initial.AsSpan(0, bare))); + byte[] plain = new byte[Payload.Length]; + Assert.IsTrue(protector.Open(initial.AsSpan(0, bare), bare - Payload.Length - 16 - 2, largest: 0, out ulong number, plain, out int plainLength)); + Assert.AreEqual(0x0302UL, number); + Assert.AreEqual(Payload.Length, plainLength); + CollectionAssert.AreEqual(Payload, plain); + byte[] token = [0xAA, 0xBB]; + byte[] tokenPacket = new byte[256]; + int withToken = QuicPackets.SealLong(tokenPacket, QuicPacketKind.Initial, DestinationId, SourceId, 7, Payload, protector, 0, token); + Assert.AreEqual("C900000001088394C8F03E515708045151515102AABB1644E3FFD6FB7A11FF42596F6A9E5B84F247E87B91FF00", Convert.ToHexString(tokenPacket.AsSpan(0, withToken))); + byte[] handshakePacket = new byte[256]; + int handshake = QuicPackets.SealLong(handshakePacket, QuicPacketKind.Handshake, DestinationId, SourceId, 7, Payload, protector, 0); + Assert.AreEqual("EC00000001088394C8F03E5157080451515151160DC5FFD6FB7A5A2BC402BF7020DA2CBFDC256AA3B845", Convert.ToHexString(handshakePacket.AsSpan(0, handshake))); + byte[] fittedLong = new byte[bare]; + Assert.AreEqual(bare, QuicPackets.SealLong(fittedLong, QuicPacketKind.Initial, DestinationId, SourceId, 0x0302, Payload, protector, 0)); + + int padded = QuicPackets.SealLong(new byte[2048], QuicPacketKind.Initial, DestinationId, SourceId, 7, Payload, protector, 1200); + Assert.IsTrue(padded >= 1200); + Assert.AreEqual(0, QuicPackets.SealLong(new byte[32], QuicPacketKind.Handshake, DestinationId, SourceId, 7, Payload, protector, 0)); + + byte[] crowded = new byte[64]; + Assert.IsTrue(QuicPackets.SealLong(new byte[256], QuicPacketKind.Handshake, DestinationId, SourceId, 9, crowded, protector, 0) > 0); + Assert.IsTrue(QuicPackets.SealShort(new byte[128], new byte[20], 1, Payload, protector) > 0); + Assert.IsTrue(QuicPackets.SealShort(new byte[64], ReadOnlySpan.Empty, 1, Payload, protector) > 0); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicPacketReplayWindowTests.cs b/tests/Titanium.Quic.Tests/QuicPacketReplayWindowTests.cs new file mode 100644 index 000000000..9c60c794f --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicPacketReplayWindowTests.cs @@ -0,0 +1,60 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicPacketReplayWindowTests +{ + [TestMethod] + public void AFirstNumberIsAcceptedAndRepeatsAreNot() + { + var window = new QuicPacketReplayWindow(); + Assert.IsTrue(window.TryAccept(7)); + Assert.AreEqual(7UL, window.Largest); + Assert.IsFalse(window.TryAccept(7)); + Assert.AreEqual(7UL, window.Largest); + } + + [TestMethod] + public void AnOutOfOrderNumberIsNewUntilItRepeats() + { + var window = new QuicPacketReplayWindow(); + Assert.IsTrue(window.TryAccept(5)); + Assert.IsTrue(window.TryAccept(3)); + Assert.IsTrue(window.TryAccept(4)); + Assert.IsFalse(window.TryAccept(3)); + Assert.IsFalse(window.TryAccept(4)); + Assert.AreEqual(5UL, window.Largest); + } + + [TestMethod] + public void ANumberOlderThanTheWindowIsRejected() + { + var window = new QuicPacketReplayWindow(); + Assert.IsTrue(window.TryAccept(QuicPacketReplayWindow.Span + 10)); + Assert.IsFalse(window.TryAccept(1)); + Assert.IsTrue(window.TryAccept(QuicPacketReplayWindow.Span + 9)); + } + + [TestMethod] + public void AJumpForwardBeyondTheWindowForgetsTheOlderNumbers() + { + var window = new QuicPacketReplayWindow(); + Assert.IsTrue(window.TryAccept(0)); + Assert.IsTrue(window.TryAccept(1000)); + Assert.IsFalse(window.TryAccept(0)); + Assert.IsTrue(window.TryAccept(999)); + Assert.IsFalse(window.TryAccept(999)); + } + + [TestMethod] + public void ResetClearsTheWindow() + { + var window = new QuicPacketReplayWindow(); + Assert.IsTrue(window.TryAccept(4)); + window.Reset(); + Assert.IsNull(window.Largest); + Assert.IsTrue(window.TryAccept(0)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicParityGuardTests.cs b/tests/Titanium.Quic.Tests/QuicParityGuardTests.cs new file mode 100644 index 000000000..135c4fc29 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicParityGuardTests.cs @@ -0,0 +1,121 @@ +#pragma warning disable CA1416 // The test names the BCL stream type. It does not open a platform listener. +using System; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +/// +/// Detects a bulk transfer whose cost grows with how many bytes the connection has already moved. +/// The unit job skips TestCategory=Perf. +/// +[TestClass] +[DoNotParallelize] +public sealed class QuicParityGuardTests +{ + [TestMethod] + [TestCategory("Perf")] + [Timeout(180000)] + public async Task BulkEcho_DoesNotGetMoreExpensiveAsTheConnectionLives() + { + const int bytes = 64 * 1024; + const int groups = 4; + const int perGroup = 50; + var payload = new byte[bytes]; + var clientReceived = new byte[bytes]; + var serverReceived = new byte[bytes]; + using X509Certificate2 certificate = Certificate(); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(150)); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + AssertEphemeral(listener.LocalEndPoint.Port); + Task accepted = listener.AcceptConnectionAsync(cancel.Token).AsTask(); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = listener.LocalEndPoint, + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }, cancel.Token); + await using ManagedQuicConnection server = await accepted; + AssertEphemeral(client.LocalEndPoint.Port); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancel.Token); + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(cancel.Token); + Task echo = Echo(inbound, serverReceived, bytes, groups * perGroup, cancel.Token); + var allocated = new long[groups]; + var ticks = new long[groups]; + for (int group = 0; group < groups; group++) + { + long beforeBytes = GC.GetTotalAllocatedBytes(precise: true); + var watch = System.Diagnostics.Stopwatch.StartNew(); + for (int i = 0; i < perGroup; i++) + { + await WriteAndRead(outbound, payload, clientReceived, cancel.Token); + } + + watch.Stop(); + allocated[group] = GC.GetTotalAllocatedBytes(precise: true) - beforeBytes; + ticks[group] = watch.ElapsedTicks; + } + + await echo; + Assert.IsTrue(allocated[3] <= allocated[0] * 11 / 10, "last group allocated " + allocated[3] + " bytes, first group " + allocated[0]); + Assert.IsTrue(ticks[3] <= Math.Max(ticks[0], 1) * 11 / 10, "last group took " + ticks[3] + " ticks, first group " + ticks[0]); + } + + private static async Task Echo(ManagedQuicStream inbound, byte[] buffer, int bytes, int rounds, CancellationToken cancellationToken) + { + for (int i = 0; i < rounds; i++) + { + await ReadExact(inbound, buffer, bytes, cancellationToken); + await inbound.WriteAsync(buffer.AsMemory(0, bytes), cancellationToken); + } + } + + private static async Task WriteAndRead(ManagedQuicStream stream, byte[] payload, byte[] received, CancellationToken cancellationToken) + { + await stream.WriteAsync(payload, cancellationToken); + await ReadExact(stream, received, payload.Length, cancellationToken); + } + + private static async Task ReadExact(ManagedQuicStream stream, byte[] buffer, int count, CancellationToken cancellationToken) + { + int offset = 0; + while (offset < count) + { + int read = await stream.ReadAsync(buffer.AsMemory(offset, count - offset), cancellationToken); + if (read == 0) + { + Assert.Fail("stream " + stream.Id + " read 0 bytes at offset " + offset + " of " + count + "; " + stream.CloseDiagnostics()); + } + + offset += read; + } + } + + private static void AssertEphemeral(int port) + { + Assert.AreNotEqual(0, port); + Assert.AreNotEqual(8000, port); + Assert.AreNotEqual(8866, port); + Assert.AreNotEqual(9080, port); + Assert.AreNotEqual(9464, port); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicPathMtuTests.cs b/tests/Titanium.Quic.Tests/QuicPathMtuTests.cs new file mode 100644 index 000000000..5fe15a60f --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicPathMtuTests.cs @@ -0,0 +1,249 @@ +using System; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicPathMtuTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void APathOf1400SettlesBetween1200And1400() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + Pump(client, server); + Assert.IsTrue(client.HandshakeComplete); + Assert.AreEqual(QuicPathMtu.Base, client.PathMtu); + Search(client, 1400); + Assert.IsTrue(client.PathMtu > QuicPathMtu.Base); + Assert.IsTrue(client.PathMtu <= 1400); + client.ReportTunnelMaximum(1300); + Assert.IsTrue(client.PathMtu <= 1300); + Assert.IsTrue(client.PathMtu >= QuicPathMtu.Base); + LoseConfirmation(client); + Assert.AreEqual(QuicPathMtu.Base, client.PathMtu); + } + + [TestMethod] + public void TheSearchClampsToTheBaseAndStopsAtTheLimit() + { + var clamped = new QuicPathMtu(); + clamped.SetMaximum(QuicPathMtu.Base - 1); + Assert.AreEqual(QuicPathMtu.Base, clamped.Ceiling); + Assert.AreEqual(0, clamped.BeginProbe(confirm: false)); + clamped.Acknowledge(); + clamped.Lose(); + clamped.Cancel(); + Assert.AreEqual(QuicPathMtu.Base, clamped.Ceiling); + + var search = new QuicPathMtu(); + search.SetMaximum(2000); + search.SetMaximum(4000); + int size = search.BeginProbe(confirm: false); + Assert.AreEqual(1200 + ((2000 - 1200) / 2), size); + Assert.AreEqual(0, search.BeginProbe(confirm: false)); + search.Cancel(); + Assert.AreEqual(size, search.BeginProbe(confirm: false)); + search.Acknowledge(); + Assert.AreEqual(size, search.Ceiling); + + int raised = search.BeginProbe(confirm: false); + Assert.IsTrue(raised > size); + Assert.IsTrue(raised <= 2000); + search.Lose(); + int afterLoss = search.BeginProbe(confirm: false); + Assert.IsTrue(afterLoss > search.Ceiling); + Assert.IsTrue(afterLoss < raised); + search.Cancel(); + + int confirm = search.BeginProbe(confirm: true); + Assert.AreEqual(search.Ceiling, confirm); + search.Lose(); + Assert.AreEqual(QuicPathMtu.Base, search.Ceiling); + + var lowered = new QuicPathMtu(); + lowered.SetMaximum(2000); + int settled = lowered.BeginProbe(confirm: false); + lowered.Acknowledge(); + Assert.AreEqual(settled, lowered.Ceiling); + lowered.SetMaximum(1300); + Assert.AreEqual(1300, lowered.Ceiling); + Assert.AreEqual(0, lowered.BeginProbe(confirm: false)); + + var confirmation = new QuicPathMtu(); + confirmation.SetMaximum(2000); + int heldProbe = confirmation.BeginProbe(confirm: false); + confirmation.Acknowledge(); + int held = confirmation.BeginProbe(confirm: true); + Assert.AreEqual(heldProbe, held); + confirmation.SetMaximum(held - 50); + confirmation.Lose(); + Assert.AreEqual(QuicPathMtu.Base, confirmation.Ceiling); + + var inflight = new QuicPathMtu(); + inflight.SetMaximum(2000); + inflight.BeginProbe(confirm: false); + inflight.SetMaximum(1500); + inflight.Acknowledge(); + Assert.AreEqual(1500, inflight.Ceiling); + + var tight = new QuicPathMtu(); + tight.SetMaximum(QuicPathMtu.Base + 2); + Assert.AreEqual(QuicPathMtu.Base + 1, tight.BeginProbe(confirm: false)); + tight.Lose(); + Assert.AreEqual(0, tight.BeginProbe(confirm: false)); + } + + [TestMethod] + public void DontFragmentIsSetWhereTheSocketSupportsIt() + { + using var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + if (OperatingSystem.IsWindows()) + { + Assert.IsTrue(QuicDatagramSocket.TryEnableDontFragment(socket)); + Assert.IsTrue(socket.DontFragment); + } + else + { + bool before = socket.DontFragment; + bool enabled = QuicDatagramSocket.TryEnableDontFragment(socket); + if (enabled) + { + Assert.IsTrue(socket.DontFragment); + } + else + { + Assert.AreEqual(before, socket.DontFragment); + } + } + + try + { + using var ipv6 = new Socket(AddressFamily.InterNetworkV6, SocketType.Dgram, ProtocolType.Udp); + Assert.IsFalse(QuicDatagramSocket.TryEnableDontFragment(ipv6)); + } + catch (SocketException) + { + } + } + + private static void Search(QuicConnectionCore client, int mtu) + { + byte[] buffer = new byte[65536]; + DateTimeOffset time = Now; + for (int step = 0; step < 40; step++) + { + Drain(client, time, buffer); + if (!client.SendPathMtuProbe()) + { + return; + } + + int size = client.PollTransmit(time, buffer, out _); + Assert.IsTrue(size > 0); + ulong probe = client.LastSentApplication; + if (size <= mtu) + { + client.AcknowledgeApplication(probe, time); + continue; + } + + ulong newest = 0; + for (int extra = 0; extra < 3; extra++) + { + client.SendKeepAlive(); + Assert.IsTrue(client.PollTransmit(time, buffer, out _) > 0); + newest = client.LastSentApplication; + } + + client.AcknowledgeApplication(newest, time + TimeSpan.FromMilliseconds(1)); + } + } + + private static void LoseConfirmation(QuicConnectionCore client) + { + byte[] buffer = new byte[65536]; + DateTimeOffset time = Now + TimeSpan.FromSeconds(2); + Drain(client, time, buffer); + Assert.IsTrue(client.SendPathMtuProbe(confirm: true)); + int size = client.PollTransmit(time, buffer, out _); + Assert.IsTrue(size > QuicPathMtu.Base); + ulong newest = 0; + for (int extra = 0; extra < 3; extra++) + { + client.SendKeepAlive(); + Assert.IsTrue(client.PollTransmit(time, buffer, out _) > 0); + newest = client.LastSentApplication; + } + + client.AcknowledgeApplication(newest, time + TimeSpan.FromMilliseconds(1)); + } + + private static void Drain(QuicConnectionCore client, DateTimeOffset time, byte[] buffer) + { + while (client.PollTransmit(time, buffer, out _) > 0) + { + } + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 16; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicReceiveWaitTests.cs b/tests/Titanium.Quic.Tests/QuicReceiveWaitTests.cs new file mode 100644 index 000000000..5f9330eac --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicReceiveWaitTests.cs @@ -0,0 +1,67 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicReceiveWaitTests +{ + [TestMethod] + public void Arm_WithoutTimer_KeepsTheSameSourceAcrossIterations() + { + using var outer = new CancellationTokenSource(); + using var wait = new QuicReceiveWait(outer.Token); + wait.Arm(null); + CancellationToken first = wait.Token; + wait.Arm(TimeSpan.FromMinutes(5)); + wait.Arm(null); + Assert.AreEqual(first, wait.Token); + Assert.IsFalse(wait.Token.IsCancellationRequested); + } + + [TestMethod] + public async Task Arm_AfterTheTimerFired_ReplacesTheSource() + { + using var outer = new CancellationTokenSource(); + using var wait = new QuicReceiveWait(outer.Token); + wait.Arm(TimeSpan.FromMilliseconds(10)); + await Task.Delay(Timeout.Infinite, wait.Token).ContinueWith(_ => { }, TaskScheduler.Default); + Assert.IsTrue(wait.Token.IsCancellationRequested); + Assert.IsFalse(outer.IsCancellationRequested); + wait.Arm(null); + Assert.IsFalse(wait.Token.IsCancellationRequested); + } + + [TestMethod] + public void Token_FollowsTheOuterToken() + { + using var outer = new CancellationTokenSource(); + using var wait = new QuicReceiveWait(outer.Token); + wait.Arm(null); + outer.Cancel(); + Assert.IsTrue(wait.Token.IsCancellationRequested); + } + + [TestMethod] + public void Token_FollowsTheOuterTokenAfterTheSourceWasReplaced() + { + using var outer = new CancellationTokenSource(); + using var wait = new QuicReceiveWait(outer.Token); + wait.Arm(TimeSpan.FromMilliseconds(1)); + SpinWait.SpinUntil(() => wait.Token.IsCancellationRequested, TimeSpan.FromSeconds(5)); + wait.Arm(null); + Assert.IsFalse(wait.Token.IsCancellationRequested); + outer.Cancel(); + Assert.IsTrue(wait.Token.IsCancellationRequested); + } + + [TestMethod] + public void Constructor_WithAnUncancellableToken_Works() + { + using var wait = new QuicReceiveWait(CancellationToken.None); + wait.Arm(null); + Assert.IsFalse(wait.Token.IsCancellationRequested); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicRetryTests.cs b/tests/Titanium.Quic.Tests/QuicRetryTests.cs new file mode 100644 index 000000000..f8a10a099 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicRetryTests.cs @@ -0,0 +1,74 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicRetryTests +{ + private static readonly byte[] OriginalDestinationConnectionId = Convert.FromHexString("8394c8f03e515708"); + + private static readonly byte[] Sample = Convert.FromHexString( + "ff000000010008f067a5502a4262b5746f6b656e04a265ba2eff4d829058fb3f0f2496ba"); + + [TestMethod] + public void PublishedKeyMatchesTheExpandLabel() + { + byte[] secret = Convert.FromHexString("d9c9943e6101fd200021506bcc02814c73030f25c79d71ce876eca876e6fca8e"); + var key = new byte[16]; + var iv = new byte[12]; + var unused = new byte[16]; + QuicInitial.DeriveTraffic(HashAlgorithmName.SHA256, secret, key, iv, unused); + CollectionAssert.AreEqual(QuicRetry.Key.ToArray(), key); + CollectionAssert.AreEqual(QuicRetry.Nonce.ToArray(), iv); + } + + [TestMethod] + public void AppendixRetrySampleVerifies() + { + var tag = new byte[16]; + Assert.IsTrue(QuicRetry.TryWriteTag(OriginalDestinationConnectionId, Sample[..^16], tag)); + CollectionAssert.AreEqual(Sample[^16..], tag); + Assert.IsTrue(QuicRetry.TryVerify(OriginalDestinationConnectionId, Sample)); + } + + [TestMethod] + public void AFlippedTagIsDiscarded() + { + byte[] packet = (byte[])Sample.Clone(); + packet[^1] ^= 0x01; + Assert.IsFalse(QuicRetry.TryVerify(OriginalDestinationConnectionId, packet)); + } + + [TestMethod] + public void ADifferentOriginalDestinationConnectionIdIsDiscarded() + { + byte[] other = (byte[])OriginalDestinationConnectionId.Clone(); + other[0] ^= 0x01; + Assert.IsFalse(QuicRetry.TryVerify(other, Sample)); + } + + [TestMethod] + public void ShortInputsAndTheConnectionIdLimitAreEdges() + { + var tag = new byte[16]; + ReadOnlySpan body = Sample.AsSpan(0, Sample.Length - 16); + Assert.IsFalse(QuicRetry.TryWriteTag(OriginalDestinationConnectionId, body, tag.AsSpan(0, 15))); + Assert.IsFalse(QuicRetry.TryVerify(OriginalDestinationConnectionId, Sample.AsSpan(0, 15))); + + Assert.IsTrue(QuicRetry.TryWriteTag(OriginalDestinationConnectionId, ReadOnlySpan.Empty, tag)); + Assert.IsTrue(QuicRetry.TryVerify(OriginalDestinationConnectionId, tag)); + + byte[] twenty = new byte[20]; + Assert.IsTrue(QuicRetry.TryWriteTag(twenty, body, tag)); + byte[] packet = new byte[body.Length + tag.Length]; + body.CopyTo(packet); + tag.CopyTo(packet.AsSpan(body.Length)); + Assert.IsTrue(QuicRetry.TryVerify(twenty, packet)); + + byte[] tooLong = new byte[21]; + Assert.IsFalse(QuicRetry.TryWriteTag(tooLong, body, tag)); + Assert.IsFalse(QuicRetry.TryVerify(tooLong, Sample)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicSimulatorTests.cs b/tests/Titanium.Quic.Tests/QuicSimulatorTests.cs new file mode 100644 index 000000000..3605256c6 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicSimulatorTests.cs @@ -0,0 +1,282 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicSimulatorTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void ADroppedDatagramIsRetransmittedAndTheHandshakeCompletes() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var sim = new QuicSimulator { DropCount = 1 }; + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, idle: false)); + server.StartServer(ServerId, certificate, Parameters(client: false, idle: false)); + byte[] buffer = new byte[16384]; + int first = client.PollTransmit(Now, buffer, out _); + Assert.IsTrue(first > 0); + sim.Submit(toServer: true, buffer.AsSpan(0, first), Now); + DateTimeOffset? due = client.NextTimeout(); + Assert.IsTrue(due.HasValue); + DateTimeOffset retryAt = due.Value; + Assert.IsTrue(client.HandleTimeout(retryAt)); + int again = client.PollTransmit(retryAt, buffer, out _); + Assert.IsTrue(again > 0); + sim.Submit(toServer: true, buffer.AsSpan(0, again), retryAt); + Assert.IsTrue(Pump(client, server, sim, retryAt, 24)); + } + + [TestMethod] + public void ReorderedDatagramsStillCompleteTheHandshake() + { + var sim = new QuicSimulator(); + using var pair = Open(sim); + Assert.IsTrue(Pump(pair.Client, pair.Server, sim, Now, 24)); + sim.Reorder = true; + byte[] buffer = new byte[16384]; + pair.Client.SendKeepAlive(); + int first = pair.Client.PollTransmit(Now, buffer, out _); + Assert.IsTrue(first > 0); + sim.Submit(toServer: true, buffer.AsSpan(0, first), Now); + pair.Client.SendKeepAlive(); + int second = pair.Client.PollTransmit(Now, buffer, out _); + Assert.IsTrue(second > 0); + sim.Submit(toServer: true, buffer.AsSpan(0, second), Now); + sim.Deliver(pair.Server, toServer: true, Now, Path); + Assert.IsFalse(pair.Client.IsClosed); + Assert.IsFalse(pair.Server.IsClosed); + } + + [TestMethod] + public void ADuplicatedDatagramDoesNotCloseTheConnection() + { + using var pair = Open(new QuicSimulator { Duplicate = true }); + Assert.IsTrue(Pump(pair.Client, pair.Server, pair.Sim, Now, 24)); + Assert.IsFalse(pair.Client.IsClosed); + } + + [TestMethod] + public void ADelayedDatagramIsDeliveredWhenTheClockAdvances() + { + var sim = new QuicSimulator { Delay = TimeSpan.FromMilliseconds(200) }; + using var pair = Open(sim); + DateTimeOffset time = Now; + bool done = false; + for (int i = 0; i < 16 && !done; i++) + { + done = Pump(pair.Client, pair.Server, sim, time, 1); + time += sim.Delay; + } + + Assert.IsTrue(done); + } + + [TestMethod] + public void AnIdleConnectionTimesOutWhenTheSimulatorClockAdvances() + { + using var pair = Open(new QuicSimulator(), idle: true); + Assert.IsTrue(Pump(pair.Client, pair.Server, pair.Sim, Now, 24)); + Assert.IsFalse(pair.Client.IdleTimedOut); + Assert.IsTrue(pair.Client.HandleTimeout(Now + TimeSpan.FromMilliseconds(5000))); + Assert.IsTrue(pair.Client.IdleTimedOut); + } + + [TestMethod] + public void EveryEighthDatagramIsDropped() + { + var sim = new QuicSimulator { LossEvery = 8 }; + var qlog = new QuicQlog { Enabled = true }; + sim.Qlog = qlog; + byte[] datagram = new byte[1200]; + for (int i = 0; i < 8; i++) + { + sim.Submit(toServer: true, datagram, Now); + } + + using var server = new QuicConnectionCore(); + sim.Deliver(server, toServer: true, Now, Path); + Assert.AreEqual(1, qlog.Events.FindAll(static name => name == "packet_dropped").Count); + Assert.AreEqual(7, qlog.Events.FindAll(static name => name == "packet_received").Count); + } + + [TestMethod] + public void AnMtuOf1400DropsTheOversizedDatagram() + { + var sim = new QuicSimulator { Mtu = 1400 }; + var qlog = new QuicQlog { Enabled = true }; + sim.Qlog = qlog; + sim.Submit(toServer: true, new byte[1500], Now); + sim.Submit(toServer: true, new byte[1200], Now); + using var server = new QuicConnectionCore(); + sim.Deliver(server, toServer: true, Now, Path); + Assert.IsTrue(qlog.Events.Contains("packet_dropped")); + Assert.IsTrue(qlog.Events.Contains("packet_received")); + var silent = new QuicQlog(); + silent.Write("packet_received"); + Assert.AreEqual(0, silent.Events.Count); + } + + [TestMethod] + public void ExactSizeDirectionDelayAndLossAreEdges() + { + var sized = new QuicSimulator { Mtu = 1200, Qlog = new QuicQlog { Enabled = true } }; + sized.Submit(toServer: true, ReadOnlySpan.Empty, Now); + sized.Submit(toServer: true, new byte[1200], Now); + sized.Submit(toServer: true, new byte[1201], Now); + Assert.AreEqual(Now, sized.NextDelivery()); + using var server = new QuicConnectionCore(); + sized.Deliver(server, toServer: false, Now, Path); + Assert.AreEqual(0, Count(sized.Qlog, "packet_received")); + sized.Deliver(server, toServer: true, Now, Path); + Assert.AreEqual(1, Count(sized.Qlog, "packet_received")); + Assert.AreEqual(2, Count(sized.Qlog, "packet_dropped")); + + var later = new QuicSimulator { Delay = TimeSpan.FromMilliseconds(5), Qlog = new QuicQlog { Enabled = true } }; + later.Submit(toServer: true, new byte[100], Now + TimeSpan.FromMilliseconds(50)); + later.Submit(toServer: true, new byte[100], Now); + Assert.AreEqual(Now + later.Delay, later.NextDelivery()); + later.Deliver(server, toServer: true, Now, Path); + Assert.AreEqual(0, Count(later.Qlog, "packet_received")); + later.Deliver(server, toServer: true, Now + later.Delay, Path); + Assert.AreEqual(1, Count(later.Qlog, "packet_received")); + + var duplicated = new QuicSimulator { Duplicate = true, Qlog = new QuicQlog { Enabled = true } }; + duplicated.Submit(toServer: true, new byte[50], Now); + duplicated.Deliver(server, toServer: true, Now, Path); + Assert.AreEqual(2, Count(duplicated.Qlog, "packet_received")); + + var hole = new QuicSimulator { Blackhole = true, Qlog = new QuicQlog { Enabled = true } }; + hole.Submit(toServer: true, new byte[50], Now); + Assert.AreEqual(1, Count(hole.Qlog, "packet_dropped")); + Assert.IsNull(hole.NextDelivery()); + + var every = new QuicSimulator { LossEvery = 1, Qlog = new QuicQlog { Enabled = true } }; + every.Submit(toServer: true, new byte[50], Now); + Assert.AreEqual(1, Count(every.Qlog, "packet_dropped")); + Assert.IsNull(every.NextDelivery()); + + var corrupt = new QuicSimulator { CorruptCount = 1, Qlog = new QuicQlog { Enabled = true } }; + corrupt.Submit(toServer: true, new byte[50], Now); + Assert.AreEqual(0, corrupt.Qlog!.Events.Count); + Assert.AreEqual(Now, corrupt.NextDelivery()); + + var reorder = new QuicSimulator { Reorder = true }; + reorder.Submit(toServer: true, new byte[40], Now); + reorder.Submit(toServer: false, new byte[40], Now); + reorder.Submit(toServer: true, new byte[40], Now); + Assert.AreEqual(Now, reorder.NextDelivery()); + } + + private static int Count(QuicQlog? qlog, string name) + { + return qlog is null ? 0 : qlog.Events.FindAll(item => item == name).Count; + } + + private static bool Pump(QuicConnectionCore client, QuicConnectionCore server, QuicSimulator sim, DateTimeOffset time, int steps) + { + byte[] buffer = new byte[16384]; + for (int step = 0; step < steps; step++) + { + while (client.PollTransmit(time, buffer, out _) is int count && count > 0) + { + sim.Submit(toServer: true, buffer.AsSpan(0, count), time); + } + + while (server.PollTransmit(time, buffer, out _) is int count && count > 0) + { + sim.Submit(toServer: false, buffer.AsSpan(0, count), time); + } + + sim.Deliver(server, toServer: true, time, Path); + sim.Deliver(client, toServer: false, time, Path); + if (client.HandshakeComplete && server.HandshakeComplete) + { + return true; + } + } + + return client.HandshakeComplete && server.HandshakeComplete; + } + + private static Pair Open(QuicSimulator sim, bool idle = false) + { + var certificate = Certificate(); + var client = new QuicConnectionCore(); + var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true, idle)); + server.StartServer(ServerId, certificate, Parameters(client: false, idle)); + return new Pair(client, server, sim, certificate); + } + + private static byte[] Parameters(bool client, bool idle) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + if (idle) + { + parameters.MaxIdleTimeout = 5000; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } + + private sealed class Pair : IDisposable + { + internal Pair(QuicConnectionCore client, QuicConnectionCore server, QuicSimulator sim, X509Certificate2 certificate) + { + Client = client; + Server = server; + Sim = sim; + _certificate = certificate; + } + + internal QuicConnectionCore Client { get; } + + internal QuicConnectionCore Server { get; } + + internal QuicSimulator Sim { get; } + + private readonly X509Certificate2 _certificate; + + public void Dispose() + { + Client.Dispose(); + Server.Dispose(); + _certificate.Dispose(); + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicSoakTests.cs b/tests/Titanium.Quic.Tests/QuicSoakTests.cs new file mode 100644 index 000000000..0cb01b62e --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicSoakTests.cs @@ -0,0 +1,287 @@ +#pragma warning disable CA1416 // The test names the BCL stream type. It does not open a platform listener. +#pragma warning disable CA2022 // The server reads until the peer closes, which is a short count. +using System; +using System.Collections.Concurrent; +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +[DoNotParallelize] +public sealed class QuicSoakTests +{ + private const int InFlightCap = 32; + + [TestMethod] + [TestCategory("Slow")] + [Timeout(2700000)] + public async Task ThirtyMinutesOfConnectionsStayBounded() + { + int seconds = 1800; + string? configured = Environment.GetEnvironmentVariable("TITANIUM_SOAK_SECONDS"); + if (int.TryParse(configured, System.Globalization.NumberStyles.Integer, System.Globalization.CultureInfo.InvariantCulture, out int parsed) && parsed > 0) + { + seconds = parsed; + } + + using X509Certificate2 certificate = Certificate(); + ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = new IPEndPoint(IPAddress.Loopback, 0), + HandshakeTimeout = TimeSpan.FromSeconds(15), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions { ServerCertificate = certificate }, + }), + }); + using var stop = new CancellationTokenSource(); + var errors = new ConcurrentQueue(); + var servers = new ConcurrentBag(); + Task accept = AcceptLoop(listener, stop.Token, errors, servers); + for (int i = 0; i < 4; i++) + { + await Exchange(listener.LocalEndPoint, stop.Token); + } + + GC.Collect(); + long baseline = GC.GetTotalMemory(true); + int inFlight = 0; + int maxInFlight = 0; + int completed = 0; + int aborted = 0; + int reset = 0; + int delayed = 0; + using var gate = new SemaphoreSlim(InFlightCap); + DateTime deadline = DateTime.UtcNow.AddSeconds(seconds); + Task slow = SlowLoris(listener.LocalEndPoint, deadline, errors); + + while (DateTime.UtcNow < deadline && errors.IsEmpty) + { + if (!await gate.WaitAsync(TimeSpan.FromSeconds(1))) + { + continue; + } + int current = Interlocked.Increment(ref inFlight); + int seen = Volatile.Read(ref maxInFlight); + while (current > seen && Interlocked.CompareExchange(ref maxInFlight, current, seen) != seen) + { + seen = Volatile.Read(ref maxInFlight); + } + + int kind = Random.Shared.Next(3); + _ = Task.Run(async () => + { + try + { + if (kind == 0) + { + await Exchange(listener.LocalEndPoint, stop.Token); + Interlocked.Increment(ref completed); + } + else if (kind == 1) + { + await Abort(listener.LocalEndPoint, stop.Token); + Interlocked.Increment(ref aborted); + } + else + { + await ResetDuringHandshake(listener.LocalEndPoint, stop.Token); + Interlocked.Increment(ref reset); + } + } + catch (Exception ex) when (Expected(ex)) + { + if (kind == 2) + { + Interlocked.Increment(ref reset); + } + else if (kind == 1) + { + Interlocked.Increment(ref aborted); + } + else + { + Interlocked.Increment(ref delayed); + } + } + catch (Exception ex) + { + errors.Enqueue(ex.ToString()); + } + finally + { + Interlocked.Decrement(ref inFlight); + gate.Release(); + } + }); + } + + DateTime drain = DateTime.UtcNow.AddMinutes(2); + while (Volatile.Read(ref inFlight) > 0 && DateTime.UtcNow < drain) + { + await Task.Delay(50); + } + + await slow; + stop.Cancel(); + try + { + await accept; + } + catch (Exception ex) when (Expected(ex)) + { + } + + try + { + await Task.WhenAll(servers.ToArray()); + } + catch (Exception ex) when (Expected(ex)) + { + } + + await listener.DisposeAsync(); + GC.Collect(); + GC.WaitForPendingFinalizers(); + long after = GC.GetTotalMemory(true); + string counts = completed + " completed, " + aborted + " aborted, " + reset + " reset, " + delayed + " delayed"; + Assert.AreEqual(0, errors.Count, errors.TryPeek(out string? first) ? first : string.Empty); + Assert.AreEqual(0, Volatile.Read(ref inFlight), counts); + Assert.IsTrue(Volatile.Read(ref maxInFlight) <= InFlightCap, counts); + Assert.IsTrue(completed > 0, counts); + Assert.IsTrue(aborted > 0, counts); + Assert.IsTrue(reset > 0, counts); + Assert.IsTrue(after < baseline + (64L * 1024L * 1024L), after + " against " + baseline); + } + + private static async Task AcceptLoop(ManagedQuicListener listener, CancellationToken token, ConcurrentQueue errors, ConcurrentBag servers) + { + try + { + while (!token.IsCancellationRequested) + { + ManagedQuicConnection server; + try + { + server = await listener.AcceptConnectionAsync(token); + } + catch (QuicException) + { + continue; + } + + servers.Add(Serve(server, token, errors)); + } + } + catch (Exception ex) when (Expected(ex)) + { + } + } + + private static async Task Serve(ManagedQuicConnection server, CancellationToken token, ConcurrentQueue errors) + { + try + { + await using (server) + { + ManagedQuicStream inbound = await server.AcceptInboundStreamAsync(token); + var buffer = new byte[256]; + while (true) + { + int count = await inbound.ReadAsync(buffer, token); + if (count == 0) + { + break; + } + } + + await server.CloseAsync(0, token); + } + } + catch (Exception ex) when (Expected(ex)) + { + } + catch (Exception ex) + { + errors.Enqueue(ex.ToString()); + } + } + + private static async Task Exchange(IPEndPoint remote, CancellationToken token) + { + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(remote), token); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, token); + await outbound.WriteAsync(new byte[] { 7, 8, 9, 10 }, token); + await client.CloseAsync(0, token); + } + + private static async Task Abort(IPEndPoint remote, CancellationToken token) + { + ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(remote), token); + try + { + await client.CloseAsync(1, token); + } + finally + { + await client.DisposeAsync(); + } + } + + private static async Task ResetDuringHandshake(IPEndPoint remote, CancellationToken token) + { + using var handshake = CancellationTokenSource.CreateLinkedTokenSource(token); + ValueTask connecting = ManagedQuicConnection.ConnectAsync(Client(remote), handshake.Token); + handshake.Cancel(); + ManagedQuicConnection client = await connecting; + await client.DisposeAsync(); + } + + private static async Task SlowLoris(IPEndPoint remote, DateTime deadline, ConcurrentQueue errors) + { + try + { + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(Client(remote), CancellationToken.None); + ManagedQuicStream outbound = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, CancellationToken.None); + var one = new byte[] { 1 }; + while (DateTime.UtcNow < deadline) + { + await outbound.WriteAsync(one); + await Task.Delay(1000); + } + + await client.CloseAsync(0); + } + catch (Exception ex) when (Expected(ex)) + { + } + catch (Exception ex) + { + errors.Enqueue(ex.ToString()); + } + } + + private static ManagedQuicClientConnectionOptions Client(IPEndPoint remote) => new() + { + RemoteEndPoint = remote, + HandshakeTimeout = TimeSpan.FromSeconds(15), + ClientAuthenticationOptions = new SslClientAuthenticationOptions { TargetHost = "localhost" }, + }; + + private static bool Expected(Exception exception) => + exception is OperationCanceledException or QuicException or ObjectDisposedException; + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicStreamPacketSizeTests.cs b/tests/Titanium.Quic.Tests/QuicStreamPacketSizeTests.cs new file mode 100644 index 000000000..439c579f7 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicStreamPacketSizeTests.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicStreamPacketSizeTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public void FullStreamPacketsFillThePathDatagram() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + client.StartClient(Path, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + Pump(client, server); + Assert.IsTrue(client.HandshakeComplete); + + byte[] data = new byte[8000]; + RandomNumberGenerator.Fill(data); + Assert.AreEqual(data.Length, client.SendStream(0, data)); + var sizes = new List(); + byte[] buffer = new byte[16384]; + int count; + while ((count = client.PollTransmit(Now, buffer, out PathInfo path)) > 0) + { + sizes.Add(count); + server.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + Assert.IsTrue(sizes.Count >= 6); + int ceiling = client.PathMtu; + foreach (int size in sizes) + { + Assert.IsTrue(size <= ceiling, "A packet of " + size + " bytes is over the path datagram of " + ceiling + "."); + } + + // The first packets carry only data, so each is exactly one path datagram. + Assert.AreEqual(ceiling, sizes[0]); + Assert.AreEqual(ceiling, sizes[1]); + CollectionAssert.AreEqual(data, server.ReceivedStream); + } + + private static void Pump(QuicConnectionCore left, QuicConnectionCore right) + { + byte[] buffer = new byte[16384]; + for (int i = 0; i < 16; i++) + { + int count = left.PollTransmit(Now, buffer, out PathInfo path); + if (count > 0) + { + right.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + + count = right.PollTransmit(Now, buffer, out path); + if (count > 0) + { + left.HandleDatagram(Now, buffer.AsSpan(0, count), path); + } + } + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicTimerAdvanceTests.cs b/tests/Titanium.Quic.Tests/QuicTimerAdvanceTests.cs new file mode 100644 index 000000000..48b2701b3 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicTimerAdvanceTests.cs @@ -0,0 +1,131 @@ +using System; +using System.Net; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +/// +/// A receive loop that reads NextTimeout() after HandleTimeout(now) must never find a deadline that +/// is still due. If it did, the loop would spin or fall back to a sleep. +/// +[TestClass] +public sealed class QuicTimerAdvanceTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly PathInfo Path = new([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + + [TestMethod] + public void TheLossTimerAdvancesPastNow() + { + var core = new QuicConnectionCore(); + var buffer = new byte[2048]; + core.MarkAddressValidated(Path); + for (ulong number = 0; number < 2; number++) + { + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, QuicPacketKind.OneRtt, number, payload: [1])); + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + } + + // Packet 1 is acknowledged while packet 0 is not, so packet 0 is lost once the time threshold passes. + Assert.AreEqual(0, core.PollTransmit(Now + TimeSpan.FromMilliseconds(20), buffer, out _)); + InjectAck(core, largest: 1); + DateTimeOffset due = core.NextTimeout() ?? throw new AssertFailedException("The loss timer was not armed."); + Assert.IsTrue(due > Now + TimeSpan.FromMilliseconds(20)); + AssertAdvances(core, due); + } + + [TestMethod] + public void TheProbeTimerAdvancesPastNow() + { + var core = new QuicConnectionCore(); + var buffer = new byte[2048]; + core.MarkAddressValidated(Path); + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, QuicPacketKind.OneRtt, number: 0, payload: [1])); + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + DateTimeOffset due = core.NextTimeout() ?? throw new AssertFailedException("The probe timer was not armed."); + AssertAdvances(core, due); + + // Each later probe backs off again, and each deadline is still in the future. + for (int i = 0; i < 4; i++) + { + due = core.NextTimeout() ?? throw new AssertFailedException("The probe timer stopped."); + AssertAdvances(core, due); + } + } + + [TestMethod] + public void TheIdleTimerClearsOnceTheConnectionTimesOut() + { + var local = new IPEndPoint(IPAddress.Loopback, 9); + var remote = new IPEndPoint(IPAddress.Loopback, 10); + var core = new QuicConnectionCore(); + byte[] id = QuicConnectionSession.NewConnectionId(); + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = id, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamDataUni = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + MaxIdleTimeout = 1, + }; + byte[] encoded = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, encoded); + core.StartClient(QuicConnectionSession.PathOf(local, remote), id, id, encoded.AsSpan(0, written)); + var buffer = new byte[8192]; + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + DateTimeOffset due = core.NextTimeout() ?? throw new AssertFailedException("A timer was not armed."); + DateTimeOffset later = due + TimeSpan.FromHours(1); + Assert.IsTrue(core.HandleTimeout(later)); + Assert.IsTrue(core.IdleTimedOut); + Assert.IsNull(core.NextTimeout()); + } + + [TestMethod] + public void TheAckPacedTimerAdvancesPastNow() + { + var core = new QuicConnectionCore(); + var buffer = new byte[65535]; + core.MarkAddressValidated(Path); + for (int i = 0; i < 9; i++) + { + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: (ulong)i, payload: [1])); + } + + Assert.IsTrue(core.TryStageTransmit(Path, new byte[200], track: true, number: 9, payload: [1])); + for (int i = 0; i < 10; i++) + { + Assert.IsTrue(core.PollTransmit(Now, buffer, out _) > 0); + } + + // The window is full. Data stays staged until an ACK opens it, so only the pacing deadline remains. + Assert.IsTrue(core.TryStageTransmit(Path, new byte[1200], track: true, number: 10, payload: [1])); + Assert.AreEqual(0, core.PollTransmit(Now, buffer, out _)); + DateTimeOffset due = core.NextTimeout() ?? throw new AssertFailedException("The pacing deadline was not armed."); + AssertAdvances(core, due); + } + + private static void AssertAdvances(QuicConnectionCore core, DateTimeOffset now) + { + core.HandleTimeout(now); + DateTimeOffset? next = core.NextTimeout(); + Assert.IsTrue(next is null || next.Value > now, "The next deadline " + next + " is not past " + now + "."); + } + + private static void InjectAck(QuicConnectionCore core, ulong largest) + { + Span frame = stackalloc byte[16]; + var ranges = new QuicAckRange[1]; + var ack = new QuicFrame + { + Kind = QuicFrameKind.Ack, + LargestAcknowledged = largest, + AckRangeCount = 1, + }; + int written = QuicFrameWriter.Write(in ack, ranges, frame); + core.InjectApplicationPayload(frame[..written]); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicTraceabilityTests.cs b/tests/Titanium.Quic.Tests/QuicTraceabilityTests.cs new file mode 100644 index 000000000..f9656241d --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicTraceabilityTests.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicTraceabilityTests +{ + [TestMethod] + public void EveryNamedTestExists() + { + string path = FindTraceability(); + var rows = new HashSet(StringComparer.Ordinal); + foreach (string line in File.ReadAllLines(path)) + { + if (!line.StartsWith("| RFC ", StringComparison.Ordinal) || line.Contains("---", StringComparison.Ordinal)) + { + continue; + } + + string[] cells = line.Split('|'); + if (cells.Length < 6) + { + continue; + } + + string testId = cells[4].Trim(); + if (testId.Length == 0 || testId.Equals("Test id", StringComparison.Ordinal)) + { + continue; + } + + rows.Add(testId); + } + + Assert.IsTrue(rows.Count > 0, path); + var methods = new HashSet(StringComparer.Ordinal); + foreach (Type type in typeof(QuicTraceabilityTests).Assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + methods.Add(type.Name + "." + method.Name); + } + } + + foreach (string testId in rows) + { + Assert.IsTrue(methods.Contains(testId), testId); + } + } + + private static string FindTraceability() + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "src", "Titanium.Quic", "design", "TRACEABILITY.md"); + if (File.Exists(candidate)) + { + return candidate; + } + + dir = dir.Parent; + } + + throw new FileNotFoundException("TRACEABILITY.md"); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicTransportParameterTests.cs b/tests/Titanium.Quic.Tests/QuicTransportParameterTests.cs new file mode 100644 index 000000000..66f26635a --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicTransportParameterTests.cs @@ -0,0 +1,235 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicTransportParameterTests +{ + [TestMethod] + public void ClientParametersRoundTrip() + { + var written = new QuicTransportParameters + { + InitialSourceConnectionId = [0xaa], + MaxIdleTimeout = 30_000, + MaxUdpPayloadSize = 1452, + InitialMaxData = 1000, + InitialMaxStreamDataBidiLocal = 100, + InitialMaxStreamDataBidiRemote = 200, + InitialMaxStreamDataUni = 50, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 2, + AckDelayExponent = 10, + MaxAckDelay = 20, + DisableActiveMigration = true, + ActiveConnectionIdLimit = 4, + MaxDatagramFrameSize = 65535, + GreaseQuicBit = true, + }; + QuicTransportParameters read = RoundTrip(written, fromServer: false, retryReceived: false); + Assert.AreEqual(0xaa, read.InitialSourceConnectionId![0]); + Assert.IsNull(read.OriginalDestinationConnectionId); + Assert.IsNull(read.RetrySourceConnectionId); + Assert.IsNull(read.StatelessResetToken); + Assert.IsFalse(read.HasPreferredAddress); + Assert.AreEqual(30_000UL, read.MaxIdleTimeout); + Assert.AreEqual(1452UL, read.MaxUdpPayloadSize); + Assert.AreEqual(1000UL, read.InitialMaxData); + Assert.AreEqual(100UL, read.InitialMaxStreamDataBidiLocal); + Assert.AreEqual(200UL, read.InitialMaxStreamDataBidiRemote); + Assert.AreEqual(50UL, read.InitialMaxStreamDataUni); + Assert.AreEqual(4UL, read.InitialMaxStreamsBidi); + Assert.AreEqual(2UL, read.InitialMaxStreamsUni); + Assert.AreEqual(10UL, read.AckDelayExponent); + Assert.AreEqual(20UL, read.MaxAckDelay); + Assert.IsTrue(read.DisableActiveMigration); + Assert.AreEqual(4UL, read.ActiveConnectionIdLimit); + Assert.AreEqual(65535UL, read.MaxDatagramFrameSize); + Assert.IsTrue(read.GreaseQuicBit); + } + + [TestMethod] + public void ServerParametersRoundTripIncludingPreferredAddress() + { + byte[] reset = new byte[16]; + reset[0] = 0x7e; + var written = Server(retry: false); + written.StatelessResetToken = reset; + written.HasPreferredAddress = true; + written.PreferredAddress.IPv4 = [192, 0, 2, 1]; + written.PreferredAddress.IPv4Port = 443; + written.PreferredAddress.IPv6[0] = 0x20; + written.PreferredAddress.IPv6[1] = 0x01; + written.PreferredAddress.IPv6[15] = 0x01; + written.PreferredAddress.IPv6Port = 443; + written.PreferredAddress.ConnectionId = [0xdd]; + written.PreferredAddress.StatelessResetToken[1] = 0x11; + QuicTransportParameters read = RoundTrip(written, fromServer: true, retryReceived: false); + CollectionAssert.AreEqual(new byte[] { 0xbb }, read.OriginalDestinationConnectionId); + CollectionAssert.AreEqual(new byte[] { 0xcc }, read.InitialSourceConnectionId); + CollectionAssert.AreEqual(reset, read.StatelessResetToken); + Assert.IsNull(read.RetrySourceConnectionId); + Assert.IsTrue(read.HasPreferredAddress); + CollectionAssert.AreEqual(new byte[] { 192, 0, 2, 1 }, read.PreferredAddress.IPv4); + Assert.AreEqual((ushort)443, read.PreferredAddress.IPv4Port); + Assert.AreEqual(0x20, read.PreferredAddress.IPv6[0]); + Assert.AreEqual(0x01, read.PreferredAddress.IPv6[15]); + Assert.AreEqual((ushort)443, read.PreferredAddress.IPv6Port); + CollectionAssert.AreEqual(new byte[] { 0xdd }, read.PreferredAddress.ConnectionId); + Assert.AreEqual(0x11, read.PreferredAddress.StatelessResetToken[1]); + } + + [TestMethod] + public void MissingRequiredParametersAreRejected() + { + Assert.IsFalse(Read(new QuicTransportParameters(), fromServer: false, retryReceived: false)); + var server = Server(retry: false); + server.InitialSourceConnectionId = null; + Assert.IsFalse(Read(server, fromServer: true, retryReceived: false)); + server = Server(retry: false); + server.OriginalDestinationConnectionId = null; + Assert.IsFalse(Read(server, fromServer: true, retryReceived: false)); + Assert.IsFalse(Read(Server(retry: false), fromServer: true, retryReceived: true)); + var client = new QuicTransportParameters + { + InitialSourceConnectionId = [0xaa], + OriginalDestinationConnectionId = [0xbb], + }; + Assert.IsFalse(Read(client, fromServer: false, retryReceived: false)); + } + + [TestMethod] + public void ADuplicateParameterIsRejected() + { + byte[] once = Parameter(0x0f, [0xaa]); + byte[] twice = new byte[once.Length * 2]; + once.CopyTo(twice, 0); + once.CopyTo(twice, once.Length); + Assert.IsFalse(QuicTransportParametersCodec.TryRead(twice, fromServer: false, retryReceived: false, out _, out ulong error)); + Assert.AreEqual(QuicTransportParametersCodec.TransportParameterError, error); + } + + [TestMethod] + public void AGreaseParameterIsIgnored() + { + byte[] grease = Parameter(27, [0x01, 0x02]); + byte[] source = Parameter(0x0f, [0xaa]); + byte[] combined = new byte[grease.Length + source.Length]; + grease.CopyTo(combined, 0); + source.CopyTo(combined, grease.Length); + Assert.IsTrue(QuicTransportParametersCodec.TryRead(combined, fromServer: false, retryReceived: false, out QuicTransportParameters read, out _)); + CollectionAssert.AreEqual(new byte[] { 0xaa }, read.InitialSourceConnectionId); + Assert.IsFalse(read.GreaseQuicBit); + } + + [TestMethod] + public void NumericAndLengthEdgesStayInsideTheSpec() + { + Assert.IsFalse(ReadInteger(0x03, 1199, out _)); + Assert.IsTrue(ReadInteger(0x03, 1200, out QuicTransportParameters read)); + Assert.AreEqual(1200UL, read.MaxUdpPayloadSize); + Assert.IsTrue(ReadInteger(0x0a, 20, out read)); + Assert.AreEqual(20UL, read.AckDelayExponent); + Assert.IsFalse(ReadInteger(0x0a, 21, out _)); + Assert.IsTrue(ReadInteger(0x0b, (1UL << 14) - 1, out read)); + Assert.AreEqual((1UL << 14) - 1, read.MaxAckDelay); + Assert.IsFalse(ReadInteger(0x0b, 1UL << 14, out _)); + Assert.IsTrue(ReadInteger(0x0e, 2, out read)); + Assert.AreEqual(2UL, read.ActiveConnectionIdLimit); + Assert.IsFalse(ReadInteger(0x0e, 1, out _)); + Assert.IsTrue(ReadInteger(0x08, QuicTransportParametersCodec.MaxStreamsLimit, out read)); + Assert.AreEqual(QuicTransportParametersCodec.MaxStreamsLimit, read.InitialMaxStreamsBidi); + Assert.IsFalse(ReadInteger(0x08, QuicTransportParametersCodec.MaxStreamsLimit + 1, out _)); + Assert.IsFalse(ReadWithSource(Parameter(0x02, new byte[15]))); + Assert.IsFalse(QuicTransportParametersCodec.TryRead(Parameter(0x0f, new byte[21]), fromServer: false, retryReceived: false, out _, out _)); + Assert.IsTrue(QuicTransportParametersCodec.TryRead(Parameter(0x0f, new byte[20]), fromServer: false, retryReceived: false, out read, out _)); + Assert.AreEqual(20, read.InitialSourceConnectionId!.Length); + Assert.IsFalse(ReadWithSource(Parameter(0x0c, [0x00]))); + Assert.IsFalse(ReadWithSource([0x01, 0x02, 0x00])); + + var parameters = new QuicTransportParameters { InitialSourceConnectionId = [0xaa] }; + byte[] wide = new byte[64]; + int written = QuicTransportParametersCodec.Write(parameters, wide); + Assert.IsTrue(written > 1); + Assert.AreEqual(written, QuicTransportParametersCodec.Write(parameters, wide.AsSpan(0, written))); + Assert.AreEqual(0, QuicTransportParametersCodec.Write(parameters, wide.AsSpan(0, written - 1))); + } + + [TestMethod] + public void RetrySourceIsRequiredOnlyAfterARetry() + { + QuicTransportParameters withRetry = Server(retry: true); + Assert.IsTrue(QuicTransportParametersCodec.TryRead(Encode(withRetry), fromServer: true, retryReceived: true, out QuicTransportParameters read, out _)); + CollectionAssert.AreEqual(new byte[] { 0xee }, read.RetrySourceConnectionId); + Assert.IsFalse(QuicTransportParametersCodec.TryRead(Encode(withRetry), fromServer: true, retryReceived: false, out _, out ulong error)); + Assert.AreEqual(QuicTransportParametersCodec.TransportParameterError, error); + } + + private static QuicTransportParameters Server(bool retry) + { + var parameters = new QuicTransportParameters + { + OriginalDestinationConnectionId = [0xbb], + InitialSourceConnectionId = [0xcc], + }; + if (retry) + { + parameters.RetrySourceConnectionId = [0xee]; + } + + return parameters; + } + + private static QuicTransportParameters RoundTrip(QuicTransportParameters written, bool fromServer, bool retryReceived) + { + Assert.IsTrue(QuicTransportParametersCodec.TryRead(Encode(written), fromServer, retryReceived, out QuicTransportParameters read, out ulong error)); + Assert.AreEqual(0UL, error); + return read; + } + + private static bool Read(QuicTransportParameters written, bool fromServer, bool retryReceived) + { + bool ok = QuicTransportParametersCodec.TryRead(Encode(written), fromServer, retryReceived, out _, out ulong error); + Assert.AreEqual(QuicTransportParametersCodec.TransportParameterError, error); + return ok; + } + + private static bool ReadInteger(ulong id, ulong value, out QuicTransportParameters read) + { + byte[] number = new byte[8]; + int count = QuicVarInt.Encode(value, number); + return ReadWithSource(Parameter(id, number[..count]), out read); + } + + private static bool ReadWithSource(byte[] parameter) + { + return ReadWithSource(parameter, out _); + } + + private static bool ReadWithSource(byte[] parameter, out QuicTransportParameters read) + { + byte[] source = Parameter(0x0f, [0xaa]); + byte[] combined = new byte[parameter.Length + source.Length]; + parameter.CopyTo(combined, 0); + source.CopyTo(combined, parameter.Length); + return QuicTransportParametersCodec.TryRead(combined, fromServer: false, retryReceived: false, out read, out _); + } + + private static byte[] Encode(QuicTransportParameters parameters) + { + var buffer = new byte[256]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + Assert.IsTrue(written > 0); + return buffer[..written]; + } + + private static byte[] Parameter(ulong id, byte[] value) + { + var buffer = new byte[16 + value.Length]; + int at = QuicVarInt.Encode(id, buffer); + at += QuicVarInt.Encode((ulong)value.Length, buffer.AsSpan(at)); + value.CopyTo(buffer.AsSpan(at)); + return buffer[..(at + value.Length)]; + } +} diff --git a/tests/Titanium.Quic.Tests/QuicUdpOffloadTests.cs b/tests/Titanium.Quic.Tests/QuicUdpOffloadTests.cs new file mode 100644 index 000000000..609c2476a --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicUdpOffloadTests.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Quic.UdpOffload; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicUdpOffloadTests +{ + [TestMethod] + public async Task ABatchArrivesAsSeparateDatagrams() + { + using var left = new UdpSocketTransport(); + using var right = new UdpSocketTransport(); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(5)); + ReadOnlyMemory[] payloads = [new byte[] { 9, 8 }, new byte[] { 7 }, new byte[] { 6, 5, 4 }]; + var buffers = new byte[3][]; + var pending = new ValueTask[3]; + for (int i = 0; i < payloads.Length; i++) + { + buffers[i] = new byte[16]; + pending[i] = right.ReceiveAsync(buffers[i], cancel.Token); + } + + int sent = await left.SendBatchAsync(payloads, right.LocalEndpoint, cancel.Token); + Assert.AreEqual(6, sent); + for (int i = 0; i < payloads.Length; i++) + { + UdpReceived received = await pending[i]; + Assert.AreEqual(payloads[i].Length, received.Count); + CollectionAssert.AreEqual(payloads[i].ToArray(), buffers[i].AsSpan(0, received.Count).ToArray()); + } + } + + [TestMethod] + public async Task AFlightWhoseLastDatagramIsShorterArrivesIntact() + { + // Equal-sized datagrams and a shorter last one are what a flight of full packets looks like. Where the segmented send is + // used, the kernel must cut it into the same datagrams that were handed in. + using var left = new UdpSocketTransport(); + using var right = new UdpSocketTransport(); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(10)); + int[] sizes = [1200, 1200, 1200, 1200, 1200, 700]; + var payloads = new ReadOnlyMemory[sizes.Length]; + var buffers = new byte[sizes.Length][]; + var pending = new ValueTask[sizes.Length]; + for (int i = 0; i < sizes.Length; i++) + { + var bytes = new byte[sizes[i]]; + for (int j = 0; j < bytes.Length; j++) + { + bytes[j] = (byte)((i * 41) + j); + } + + payloads[i] = bytes; + buffers[i] = new byte[2048]; + pending[i] = right.ReceiveAsync(buffers[i], cancel.Token); + } + + int sent = await left.SendBatchAsync(payloads, right.LocalEndpoint, cancel.Token); + Assert.AreEqual(sizes.Sum(), sent); + for (int i = 0; i < sizes.Length; i++) + { + UdpReceived received = await pending[i]; + Assert.AreEqual(sizes[i], received.Count, "datagram " + i); + CollectionAssert.AreEqual(payloads[i].ToArray(), buffers[i].AsSpan(0, received.Count).ToArray(), "datagram " + i); + } + } + + [TestMethod] + public void LinuxEnablesTheBatchAfterTheProbe() + { + if (!OperatingSystem.IsLinux() || Environment.GetEnvironmentVariable("TITANIUM_UDP_OFFLOAD") == "0") + { + Assert.IsFalse(UdpOffloadBatch.IsEnabled); + return; + } + + Assert.IsTrue(UdpOffloadBatch.IsEnabled); + } + + [TestMethod] + public void OffloadImportsAreTheSocketBatchCalls() + { + Assembly assembly = typeof(UdpOffloadBatch).Assembly; + var found = new List(); + foreach (Type type in assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)) + { + if (!method.Attributes.HasFlag(MethodAttributes.PinvokeImpl)) + { + continue; + } + + string name = method.GetCustomAttribute()?.EntryPoint ?? method.Name; + found.Add(name); + } + } + + found.Sort(StringComparer.Ordinal); + CollectionAssert.AreEqual(new[] { "recvmmsg", "sendmmsg" }, found.ToArray()); + foreach (AssemblyName referenced in assembly.GetReferencedAssemblies()) + { + string name = referenced.Name ?? string.Empty; + Assert.IsFalse(name.Contains("Cryptography", StringComparison.Ordinal), name); + Assert.IsFalse(name.Contains("Process", StringComparison.Ordinal), name); + } + } +} diff --git a/tests/Titanium.Quic.Tests/QuicUdpTransportTests.cs b/tests/Titanium.Quic.Tests/QuicUdpTransportTests.cs new file mode 100644 index 000000000..eb5e27b15 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicUdpTransportTests.cs @@ -0,0 +1,195 @@ +using System; +using System.Net; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicUdpTransportTests +{ + private static readonly DateTimeOffset Now = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero); + + private static readonly byte[] ClientId = [0xC1, 0xC1, 0xC1, 0xC1]; + + private static readonly byte[] ServerId = [0x51, 0x51, 0x51, 0x51]; + + [TestMethod] + public async Task TwoLoopbackSocketsExchangeOneDatagram() + { + using var left = new UdpSocketTransport(); + using var right = new UdpSocketTransport(); + AssertEphemeral(left.LocalEndpoint.Port); + AssertEphemeral(right.LocalEndpoint.Port); + Assert.IsTrue(left.MaximumDatagramSize >= 1200); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(5)); + byte[] payload = [1, 2, 3, 4]; + byte[] buffer = new byte[2048]; + ValueTask pending = right.ReceiveAsync(buffer, cancel.Token); + int sent = await left.SendAsync(payload, right.LocalEndpoint, cancel.Token); + UdpReceived received = await pending; + Assert.AreEqual(payload.Length, sent); + Assert.AreEqual(payload.Length, received.Count); + Assert.AreEqual(1, buffer[0]); + Assert.AreEqual(4, buffer[3]); + Assert.AreEqual(left.LocalEndpoint.Port, received.Remote.Port); + Assert.AreEqual(IPAddress.Loopback, received.Remote.Address); + + // Not-ECT always works. A sender must never mark CE, so the guard rejects it rather + // than depending on whether the handle happens to be privileged. + Assert.IsTrue(left.TrySetEcn(0)); + Assert.IsFalse(left.TrySetEcn(3)); + Assert.IsFalse(left.TrySetEcn(4)); + Assert.IsTrue(left.TrySetEcn(0)); + } + + [TestMethod] + public async Task BatchSizeFamilyAndAnOversizedDatagramAreEdges() + { + using var left = new UdpSocketTransport(); + using var right = new UdpSocketTransport(); + Assert.AreEqual(65507, left.MaximumDatagramSize); + Assert.IsFalse(left.DatagramPending); + using var cancel = new CancellationTokenSource(TimeSpan.FromSeconds(5)); + await Assert.ThrowsExactlyAsync( + () => left.SendAsync(new byte[left.MaximumDatagramSize + 1], right.LocalEndpoint, cancel.Token).AsTask()); + + byte[] first = [9]; + byte[] second = [8, 7]; + ReadOnlyMemory[] batch = [first, second]; + byte[] firstBuffer = new byte[16]; + byte[] secondBuffer = new byte[16]; + ValueTask pendingFirst = right.ReceiveAsync(firstBuffer, cancel.Token); + ValueTask pendingSecond = right.ReceiveAsync(secondBuffer, cancel.Token); + int sent = await left.SendBatchAsync(batch, right.LocalEndpoint, cancel.Token); + Assert.AreEqual(first.Length + second.Length, sent); + UdpReceived gotFirst = await pendingFirst; + UdpReceived gotSecond = await pendingSecond; + Assert.AreEqual(first.Length, gotFirst.Count); + Assert.AreEqual(second.Length, gotSecond.Count); + Assert.AreEqual(0, await left.SendBatchAsync(ReadOnlyMemory>.Empty, right.LocalEndpoint, cancel.Token)); + + await left.SendAsync(first, right.LocalEndpoint, cancel.Token); + // macOS loopback does not report the datagram on the same turn the send completes. + var pendingDeadline = DateTime.UtcNow + TimeSpan.FromSeconds(1); + while (!right.DatagramPending && DateTime.UtcNow < pendingDeadline) + { + await Task.Delay(5); + } + + Assert.IsTrue(right.DatagramPending); + + using var left6 = new UdpSocketTransport(new IPEndPoint(IPAddress.IPv6Loopback, 0)); + using var right6 = new UdpSocketTransport(new IPEndPoint(IPAddress.IPv6Loopback, 0)); + Assert.AreEqual(65527, left6.MaximumDatagramSize); + byte[] payload = [5, 6]; + byte[] buffer = new byte[32]; + ValueTask pending = right6.ReceiveAsync(buffer, cancel.Token); + int sent6 = await left6.SendAsync(payload, right6.LocalEndpoint, cancel.Token); + UdpReceived got = await pending; + Assert.AreEqual(payload.Length, sent6); + Assert.AreEqual(payload.Length, got.Count); + Assert.AreEqual(left6.LocalEndpoint.Port, got.Remote.Port); + Assert.AreEqual(IPAddress.IPv6Loopback, got.Remote.Address); + + byte[] exact = new byte[left.MaximumDatagramSize]; + exact[0] = 1; + exact[^1] = 2; + try + { + Assert.AreEqual(exact.Length, await left.SendAsync(exact, right.LocalEndpoint, cancel.Token)); + } + catch (SocketException ex) when (ex.SocketErrorCode == SocketError.MessageSize) + { + // The property is the UDP protocol maximum. macOS loopback refuses a datagram + // that large (EMSGSIZE) even with fragmentation allowed; 9216 is the size it sends. + Assert.IsTrue(OperatingSystem.IsMacOS(), ex.SocketErrorCode + " " + ex.Message); + byte[] fits = new byte[9216]; + Assert.AreEqual(fits.Length, await left.SendAsync(fits, right.LocalEndpoint, cancel.Token)); + } + Assert.IsTrue(left6.TrySetEcn(0)); + left.Dispose(); + await Assert.ThrowsExactlyAsync( + () => left.SendAsync(first, right.LocalEndpoint, cancel.Token).AsTask()); + } + + [TestMethod] + public void InjectDeliversTheDatagramAndTheCallbackSeesTheReply() + { + using X509Certificate2 certificate = Certificate(); + using var client = new QuicConnectionCore(); + using var server = new QuicConnectionCore(); + var clientPath = new PathInfo([10, 0, 0, 1], 443, [10, 0, 0, 2], 50000); + client.StartClient(clientPath, ClientId, ServerId, Parameters(client: true)); + server.StartServer(ServerId, certificate, Parameters(client: false)); + byte[] outbound = new byte[16384]; + int count = client.PollTransmit(Now, outbound, out _); + Assert.IsTrue(count > 0); + var virtualPath = new PathInfo([127, 0, 0, 1], 1, [127, 0, 0, 2], 2); + var capture = new Capture(); + byte[] reply = new byte[16384]; + int replies = QuicDatagramInject.Deliver(server, Now, outbound.AsSpan(0, count), virtualPath, reply, ref capture); + Assert.IsTrue(replies > 0); + Assert.IsTrue(capture.Count > 0); + Assert.IsTrue(capture.Length > 0); + Assert.IsTrue(capture.Path.Equals(virtualPath)); + Assert.AreEqual(count, server.BytesReceived(virtualPath)); + } + + private static void AssertEphemeral(int port) + { + Assert.AreNotEqual(0, port); + Assert.AreNotEqual(8000, port); + Assert.AreNotEqual(8866, port); + Assert.AreNotEqual(9080, port); + Assert.AreNotEqual(9464, port); + } + + private struct Capture : IQuicOutbound + { + public int Count; + + public int Length; + + public PathInfo Path; + + public void OnDatagram(ReadOnlySpan datagram, PathInfo path) + { + Count++; + Length = datagram.Length; + Path = path; + } + } + + private static byte[] Parameters(bool client) + { + var parameters = new QuicTransportParameters + { + InitialSourceConnectionId = client ? ClientId : ServerId, + InitialMaxData = 1 << 20, + InitialMaxStreamDataBidiLocal = 1 << 20, + InitialMaxStreamDataBidiRemote = 1 << 20, + InitialMaxStreamsBidi = 4, + InitialMaxStreamsUni = 4, + }; + if (!client) + { + parameters.OriginalDestinationConnectionId = ServerId; + } + + byte[] buffer = new byte[512]; + int written = QuicTransportParametersCodec.Write(parameters, buffer); + return buffer[..written]; + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} diff --git a/tests/Titanium.Quic.Tests/QuicVarIntTests.cs b/tests/Titanium.Quic.Tests/QuicVarIntTests.cs new file mode 100644 index 000000000..939dd60a1 --- /dev/null +++ b/tests/Titanium.Quic.Tests/QuicVarIntTests.cs @@ -0,0 +1,81 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Quic.Tests; + +[TestClass] +public sealed class QuicVarIntTests +{ + [TestMethod] + public void BoundariesRoundTripInTheShortestForm() + { + AssertRoundTrip(0, 1); + AssertRoundTrip(63, 1); + AssertRoundTrip(64, 2); + AssertRoundTrip(16_383, 2); + AssertRoundTrip(16_384, 4); + AssertRoundTrip(1_073_741_823, 4); + AssertRoundTrip(1_073_741_824, 8); + AssertRoundTrip(QuicVarInt.MaxValue, 8); + } + + [TestMethod] + public void LongerEncodingStillDecodes() + { + byte[] encoded = [0x40, 0x19]; + Assert.IsTrue(QuicVarInt.TryDecode(encoded, out ulong value, out int consumed)); + Assert.AreEqual(25UL, value); + Assert.AreEqual(2, consumed); + } + + [TestMethod] + public void TruncatedBufferDoesNotDecode() + { + Assert.IsFalse(QuicVarInt.TryDecode([], out _, out _)); + Assert.IsFalse(QuicVarInt.TryDecode([0x40], out _, out _)); + Assert.IsFalse(QuicVarInt.TryDecode([0x80, 0x00, 0x00], out _, out _)); + Assert.IsFalse(QuicVarInt.TryDecode([0xC0, 0, 0, 0, 0, 0, 0], out _, out _)); + } + + [TestMethod] + public void ValuePastTheMaximumIsRejected() + { + Assert.ThrowsExactly(() => QuicVarInt.Encode(QuicVarInt.MaxValue + 1, new byte[8])); + } + + [TestMethod] + public void EncodeFitsTheExactLength() + { + AssertExact(64, 2); + AssertExact(16_384, 4); + AssertExact(1_073_741_824, 8); + } + + [TestMethod] + public void ShortDestinationWritesNothing() + { + var destination = new byte[1]; + Assert.AreEqual(0, QuicVarInt.Encode(64, destination)); + Assert.AreEqual(0, destination[0]); + } + + private static void AssertExact(ulong value, int length) + { + byte[] exact = new byte[length]; + Assert.AreEqual(length, QuicVarInt.Encode(value, exact)); + Assert.AreEqual(0, QuicVarInt.Encode(value, exact.AsSpan(0, length - 1))); + Assert.IsTrue(QuicVarInt.TryDecode(exact, out ulong decoded, out int consumed)); + Assert.AreEqual(value, decoded); + Assert.AreEqual(length, consumed); + } + + private static void AssertRoundTrip(ulong value, int expectedLength) + { + var buffer = new byte[8]; + int written = QuicVarInt.Encode(value, buffer); + Assert.AreEqual(expectedLength, written); + Assert.IsTrue(QuicVarInt.TryDecode(buffer.AsSpan(0, written), out ulong decoded, out int consumed)); + Assert.AreEqual(value, decoded); + Assert.AreEqual(written, consumed); + } +} diff --git a/tests/Titanium.Quic.Tests/StrongNameKey.snk b/tests/Titanium.Quic.Tests/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/tests/Titanium.Quic.Tests/StrongNameKey.snk differ diff --git a/tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj b/tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj new file mode 100644 index 000000000..2f8f6b047 --- /dev/null +++ b/tests/Titanium.Quic.Tests/Titanium.Quic.Tests.csproj @@ -0,0 +1,21 @@ + + + net10.0 + enable + disable + false + true + StrongNameKey.snk + true + true + Titanium.Quic.Tests + + + + + + + + + + diff --git a/tests/Titanium.Tls.Tests/ArchitectureTests.cs b/tests/Titanium.Tls.Tests/ArchitectureTests.cs new file mode 100644 index 000000000..751619b7a --- /dev/null +++ b/tests/Titanium.Tls.Tests/ArchitectureTests.cs @@ -0,0 +1,46 @@ +using System; +using System.Reflection; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class ArchitectureTests +{ + [TestMethod] + public void HostRuns() + { + Assert.AreEqual("Titanium.Tls", AssemblyMarker.Name); + } + + [TestMethod] + public void LibraryDoesNotReferenceTheProxyAndDoesNotPInvoke() + { + AssertLibrary(typeof(AssemblyMarker).Assembly); + } + + internal static void AssertLibrary(Assembly assembly) + { + foreach (AssemblyName referenced in assembly.GetReferencedAssemblies()) + { + string name = referenced.Name ?? string.Empty; + Assert.IsFalse( + name.StartsWith("Titanium.Web.Proxy", StringComparison.Ordinal), + name); + } + + byte[]? token = assembly.GetName().GetPublicKeyToken(); + Assert.IsNotNull(token); + Assert.IsTrue(token!.Length > 0, assembly.GetName().Name); + + foreach (Type type in assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)) + { + Assert.IsFalse( + method.Attributes.HasFlag(MethodAttributes.PinvokeImpl), + type.FullName + "." + method.Name); + } + } + } +} diff --git a/tests/Titanium.Tls.Tests/BoundaryLimitTests.cs b/tests/Titanium.Tls.Tests/BoundaryLimitTests.cs new file mode 100644 index 000000000..c04d6da22 --- /dev/null +++ b/tests/Titanium.Tls.Tests/BoundaryLimitTests.cs @@ -0,0 +1,71 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class BoundaryLimitTests +{ + [TestMethod] + public void CertificateListsOfZeroOneAndOneHundredParse() + { + AssertEntries(0); + AssertEntries(1); + AssertEntries(100); + } + + [TestMethod] + public void CertificateListPastOneHundredIsDecodeError() + { + Assert.IsFalse(HandshakeMessages.TryReadCertificate(CertificateMessage(101), out _, out HandshakeAlert alert)); + Assert.AreEqual(HandshakeAlert.DecodeError, alert); + } + + [TestMethod] + public void CertificateEntryPastTheBufferIsDecodeError() + { + byte[] message = CertificateMessage(1); + message[8] = 0x01; + Assert.IsFalse(HandshakeMessages.TryReadCertificate(message, out _, out HandshakeAlert alert)); + Assert.AreEqual(HandshakeAlert.DecodeError, alert); + } + + private static void AssertEntries(int count) + { + Assert.IsTrue(HandshakeMessages.TryReadCertificate(CertificateMessage(count), out CertificateView view, out HandshakeAlert alert), alert.ToString()); + int seen = 0; + TlsReader reader = new(view.CertificateList); + while (reader.Remaining > 0) + { + Assert.IsTrue(reader.TryReadVector24(out ReadOnlySpan certificate)); + Assert.AreEqual(1, certificate.Length); + Assert.IsTrue(reader.TryReadVector16(out ReadOnlySpan extensions)); + Assert.AreEqual(0, extensions.Length); + seen++; + } + + Assert.AreEqual(count, seen); + } + + private static byte[] CertificateMessage(int entries) + { + int listLength = entries * 6; + int bodyLength = 4 + listLength; + var message = new byte[4 + bodyLength]; + message[0] = (byte)HandshakeType.Certificate; + message[1] = (byte)(bodyLength >> 16); + message[2] = (byte)(bodyLength >> 8); + message[3] = (byte)bodyLength; + message[5] = (byte)(listLength >> 16); + message[6] = (byte)(listLength >> 8); + message[7] = (byte)listLength; + for (int i = 0; i < entries; i++) + { + int at = 8 + (i * 6); + message[at + 2] = 1; + message[at + 3] = 0x30; + } + + return message; + } +} diff --git a/tests/Titanium.Tls.Tests/ChainValidationTests.cs b/tests/Titanium.Tls.Tests/ChainValidationTests.cs new file mode 100644 index 000000000..ffd7d9f3d --- /dev/null +++ b/tests/Titanium.Tls.Tests/ChainValidationTests.cs @@ -0,0 +1,414 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class ChainValidationTests +{ + private static readonly DateTimeOffset NotBefore = DateTimeOffset.UtcNow.AddDays(-2); + private static readonly DateTimeOffset NotAfter = DateTimeOffset.UtcNow.AddYears(1); + private const string ServerAuth = "1.3.6.1.5.5.7.3.1"; + + [TestMethod] + public void TrustedHierarchyMatchesTheHostname() + { + using X509Certificate2 root = Authority("CN=Test Root"); + using X509Certificate2 intermediate = Issue(root, "CN=Test Intermediate", ca: true, dns: null, eku: null, NotBefore, NotAfter); + using X509Certificate2 leaf = Issue(intermediate, "CN=other", ca: false, dns: "localhost", eku: ServerAuth, NotBefore, NotAfter); + var trust = new X509Certificate2Collection(root); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(null, null, leaf, intermediate), "localhost", trust, serverCertificate: true); + Assert.AreEqual(SslPolicyErrors.None, check.Errors, Status(check.Chain)); + } + + [TestMethod] + public void NameInTheCommonNameIsIgnoredWhenASanExists() + { + using X509Certificate2 root = Authority("CN=Test Root"); + using X509Certificate2 leaf = Issue(root, "CN=localhost", ca: false, dns: "www.example.com", eku: ServerAuth, NotBefore, NotAfter); + var trust = new X509Certificate2Collection(root); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(null, null, leaf), "localhost", trust, serverCertificate: true); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateNameMismatch, check.Errors, Status(check.Chain)); + } + + [TestMethod] + public void CommonNameIsUsedWhenTheCertificateHasNoSan() + { + using X509Certificate2 root = Authority("CN=Test Root"); + using X509Certificate2 leaf = Issue(root, "CN=localhost", ca: false, dns: null, eku: ServerAuth, NotBefore, NotAfter); + var trust = new X509Certificate2Collection(root); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(null, null, leaf), "localhost", trust, serverCertificate: true); + Assert.AreEqual(SslPolicyErrors.None, check.Errors, Status(check.Chain)); + } + + [TestMethod] + public void ExpiredWrongEkuUntrustedAndIncompleteChainsFail() + { + using X509Certificate2 root = Authority("CN=Test Root"); + using X509Certificate2 intermediate = Issue(root, "CN=Test Intermediate", ca: true, dns: null, eku: null, NotBefore, NotAfter); + using X509Certificate2 expired = Issue(intermediate, "CN=localhost", ca: false, dns: "localhost", eku: ServerAuth, NotBefore, NotBefore.AddDays(1)); + using X509Certificate2 wrongEku = Issue(intermediate, "CN=localhost", ca: false, dns: "localhost", eku: "1.3.6.1.5.5.7.3.3", NotBefore, NotAfter); + using X509Certificate2 selfSigned = Authority("CN=localhost"); + using X509Certificate2 missingLeaf = Issue(intermediate, "CN=localhost", ca: false, dns: "localhost", eku: ServerAuth, NotBefore, NotAfter); + var trust = new X509Certificate2Collection(root); + using TlsCertificateCheck expiredCheck = TlsChainValidator.Evaluate(CertificateList(null, null, expired, intermediate), "localhost", trust, serverCertificate: true); + using TlsCertificateCheck ekuCheck = TlsChainValidator.Evaluate(CertificateList(null, null, wrongEku, intermediate), "localhost", trust, serverCertificate: true); + using TlsCertificateCheck untrusted = TlsChainValidator.Evaluate(CertificateList(null, null, selfSigned), "localhost", trust, serverCertificate: true); + using TlsCertificateCheck missing = TlsChainValidator.Evaluate(CertificateList(null, null, missingLeaf), "localhost", trust, serverCertificate: true); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateChainErrors, expiredCheck.Errors, Status(expiredCheck.Chain)); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateChainErrors, ekuCheck.Errors, Status(ekuCheck.Chain)); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateChainErrors, untrusted.Errors, Status(untrusted.Chain)); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateChainErrors, missing.Errors, Status(missing.Chain)); + } + + [TestMethod] + public void EmptyListIsNotAvailableAndStapledBytesAreCopied() + { + using TlsCertificateCheck empty = TlsChainValidator.Evaluate([], "localhost", new X509Certificate2Collection(), serverCertificate: true); + Assert.AreEqual(SslPolicyErrors.RemoteCertificateNotAvailable, empty.Errors); + using X509Certificate2 root = Authority("CN=Test Root"); + using X509Certificate2 leaf = Issue(root, "CN=localhost", ca: false, dns: "localhost", eku: ServerAuth, NotBefore, NotAfter); + byte[] status = [1, 2, 3]; + byte[] timestamps = [9, 8]; + var trust = new X509Certificate2Collection(root); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(status, timestamps, leaf), "localhost", trust, serverCertificate: true); + CollectionAssert.AreEqual(status, check.StapledStatus); + CollectionAssert.AreEqual(timestamps, check.SignedCertificateTimestamps); + Assert.AreEqual(SslPolicyErrors.None, check.Errors, Status(check.Chain)); + } + + [TestMethod] + public void HandshakeRecordsChainErrorsForASelfSignedCertificate() + { + using HandshakePair pair = HandshakePair.Run(); + Assert.IsTrue(pair.Client.ServerCertificateErrors.HasFlag(SslPolicyErrors.RemoteCertificateChainErrors)); + } + + [TestMethod] + public void PolicyErrorsMatchSslStream() + { + PlatformSsl.RequireTls13(); + using X509Certificate2 certificate = Authority("CN=localhost"); + SslPolicyErrors streamErrors = CaptureSslStreamErrors(certificate, "localhost"); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(null, null, certificate), "localhost", trustAnchors: null, serverCertificate: true); + Assert.AreEqual(streamErrors, check.Errors); + } + + [TestMethod] + public void RejectionMessageMatchesSslStream() + { + PlatformSsl.RequireTls13(); + using X509Certificate2 certificate = Authority("CN=localhost"); + string invalid = CaptureRejection(certificate, "localhost", callback: false); + using TlsCertificateCheck check = TlsChainValidator.Evaluate(CertificateList(null, null, certificate), "localhost", trustAnchors: null, serverCertificate: true); + AuthenticationException rejectedByUs = Assert.ThrowsException(() => TlsCertificateDecision.ThrowIfRejected(check.Errors, null, null, certificate, check.Chain)); + Assert.AreEqual(invalid, rejectedByUs.Message); + string rejected = CaptureRejection(certificate, "localhost", callback: true); + AuthenticationException callbackRejected = Assert.ThrowsException(() => TlsCertificateDecision.ThrowIfRejected(SslPolicyErrors.RemoteCertificateChainErrors, (_, _, _, _) => false, null, certificate, chain: null)); + Assert.AreEqual(rejected, callbackRejected.Message); + } + + [TestMethod] + public void ClientCertificateMustChainToTheSuppliedAnchor() + { + using X509Certificate2 serverCertificate = ServerHandshakeTests.Certificate(); + using X509Certificate2 root = Authority("CN=Client Root"); + using X509Certificate2 clientCertificate = ClientLeaf(root); + var trust = new X509Certificate2Collection(root); + Assert.AreEqual(TlsEngineState.Connected, FinishWithClientCertificate(serverCertificate, clientCertificate, trust, out _)); + Assert.AreEqual(TlsEngineState.Closed, FinishWithClientCertificate(serverCertificate, clientCertificate, new X509Certificate2Collection(), out byte alert)); + Assert.AreEqual(23, alert); + } + + [TestMethod] + public void ClientCertificatePausesForTheCallback() + { + using X509Certificate2 serverCertificate = ServerHandshakeTests.Certificate(); + using X509Certificate2 root = Authority("CN=Client Root"); + using X509Certificate2 clientCertificate = ClientLeaf(root); + var trust = new X509Certificate2Collection(root); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost") { LocalCertificate = clientCertificate }; + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection + { + Certificate = serverCertificate, + RequestClientCertificate = true, + ClientTrustAnchors = trust, + ClientCertificateCallback = static (_, _, _, _) => false, + }, output); + client.Advance(output.Bytes.ToArray(), out _, output); + client.Resume(true, output); + server.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual(TlsEngineState.WaitClientCertificateDecision, server.State); + Assert.IsNotNull(server.RemoteCertificate); + server.Resume(false, output); + Assert.AreEqual((byte)42, server.LastLocalAlert); + } + + [TestMethod] + public void RejectedSchemesDoNotVerify() + { + byte[] content = "handshake"u8.ToArray(); + using ECDsa p256 = ECDsa.Create(ECCurve.NamedCurves.nistP256); + using ECDsa p384 = ECDsa.Create(ECCurve.NamedCurves.nistP384); + using X509Certificate2 ecdsa = SelfSigned(p256, "CN=localhost"); + using X509Certificate2 wider = SelfSigned(p384, "CN=localhost"); + byte[] ecdsaSignature = p256.SignData(content, HashAlgorithmName.SHA256, DSASignatureFormat.Rfc3279DerSequence); + Assert.IsTrue(TlsCertificateVerifier.Verify(ecdsa, 0x0403, content, ecdsaSignature)); + Assert.IsFalse(TlsCertificateVerifier.Verify(ecdsa, 0x0503, content, ecdsaSignature)); + Assert.IsFalse(TlsCertificateVerifier.Verify(wider, 0x0403, content, p384.SignData(content, HashAlgorithmName.SHA256, DSASignatureFormat.Rfc3279DerSequence))); + Assert.IsFalse(TlsCertificateVerifier.Verify(ecdsa, 0x0203, content, ecdsaSignature)); + + using RSA rsa = RSA.Create(2048); + using RSA small = RSA.Create(1024); + using X509Certificate2 rsaCertificate = SelfSigned(rsa, "CN=localhost"); + using X509Certificate2 smallCertificate = SelfSigned(small, "CN=localhost"); + byte[] pss = rsa.SignData(content, HashAlgorithmName.SHA256, RSASignaturePadding.Pss); + Assert.IsTrue(TlsCertificateVerifier.Verify(rsaCertificate, 0x0804, content, pss)); + Assert.IsFalse(TlsCertificateVerifier.Verify(rsaCertificate, 0x0401, content, rsa.SignData(content, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1))); + Assert.IsFalse(TlsCertificateVerifier.Verify(rsaCertificate, 0x0201, content, pss)); + Assert.IsFalse(TlsCertificateVerifier.Verify(rsaCertificate, 0x0809, content, pss)); + Assert.IsFalse(TlsCertificateVerifier.Verify(smallCertificate, 0x0804, content, small.SignData(content, HashAlgorithmName.SHA256, RSASignaturePadding.Pss))); + } + + private static SslPolicyErrors CaptureSslStreamErrors(X509Certificate2 certificate, string host) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task server = Task.Run(() => + { + using TcpClient client = listener.AcceptTcpClient(); + using var stream = new SslStream(client.GetStream()); + stream.AuthenticateAsServer(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + }); + }); + SslPolicyErrors seen = SslPolicyErrors.None; + using (var tcp = new TcpClient(IPAddress.Loopback.ToString(), port)) + using (var stream = new SslStream(tcp.GetStream())) + { + stream.AuthenticateAsClient(new SslClientAuthenticationOptions + { + TargetHost = host, + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + RemoteCertificateValidationCallback = (_, _, _, errors) => + { + seen = errors; + return true; + }, + }); + } + + server.GetAwaiter().GetResult(); + return seen; + } + + private static string CaptureRejection(X509Certificate2 certificate, string host, bool callback) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task server = Task.Run(() => + { + using TcpClient client = listener.AcceptTcpClient(); + using var stream = new SslStream(client.GetStream()); + stream.AuthenticateAsServer(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + }); + }); + string? message = null; + try + { + using var tcp = new TcpClient(IPAddress.Loopback.ToString(), port); + using var stream = new SslStream(tcp.GetStream()); + var options = new SslClientAuthenticationOptions + { + TargetHost = host, + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + }; + if (callback) + { + options.RemoteCertificateValidationCallback = (_, _, _, _) => false; + } + + stream.AuthenticateAsClient(options); + } + catch (AuthenticationException exception) + { + message = exception.Message; + } + + try + { + server.GetAwaiter().GetResult(); + } + catch (Exception) + { + } + + Assert.IsNotNull(message); + return message; + } + + private static TlsEngineState FinishWithClientCertificate(X509Certificate2 serverCertificate, X509Certificate2 clientCertificate, X509Certificate2Collection trust, out byte alert) + { + alert = 0; + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost") { LocalCertificate = clientCertificate }; + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = serverCertificate, RequestClientCertificate = true, ClientTrustAnchors = trust }, output); + client.Advance(output.Bytes.ToArray(), out _, output); + client.Resume(true, output); + server.Advance(output.Bytes.ToArray(), out _, output); + if (output.Bytes.Length > 0) + { + alert = output.Bytes[0]; + } + + return server.State; + } + + private static X509Certificate2 ClientLeaf(X509Certificate2 issuer) + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=client", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.2") }, false)); + request.CertificateExtensions.Add(new X509BasicConstraintsExtension(false, false, 0, true)); + using RSA? issuerKey = issuer.GetRSAPrivateKey(); + using X509Certificate2 issued = request.Create(issuer.SubjectName, X509SignatureGenerator.CreateForRSA(issuerKey!, RSASignaturePadding.Pkcs1), NotBefore, NotAfter, [1, 2, 3, 4]); + using X509Certificate2 withKey = issued.CopyWithPrivateKey(key); + return Persist(withKey); + } + + private static X509Certificate2 Authority(string subject) + { + using RSA key = RSA.Create(2048); + var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509BasicConstraintsExtension(true, false, 0, true)); + request.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(request.PublicKey, false)); + using X509Certificate2 created = request.CreateSelfSigned(NotBefore, NotAfter); + return Persist(created); + } + + private static X509Certificate2 Issue(X509Certificate2 issuer, string subject, bool ca, string? dns, string? eku, DateTimeOffset notBefore, DateTimeOffset notAfter) + { + using RSA key = RSA.Create(2048); + var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + request.CertificateExtensions.Add(new X509BasicConstraintsExtension(ca, false, 0, true)); + request.CertificateExtensions.Add(new X509SubjectKeyIdentifierExtension(request.PublicKey, false)); + if (dns is not null) + { + var names = new SubjectAlternativeNameBuilder(); + names.AddDnsName(dns); + request.CertificateExtensions.Add(names.Build()); + } + + if (eku is not null) + { + var oids = new OidCollection { new Oid(eku) }; + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(oids, false)); + } + + using X509Certificate2 issued = request.Create(issuer, notBefore, notAfter, [1, 2, 3, (byte)subject.Length]); + using X509Certificate2 withKey = issued.CopyWithPrivateKey(key); + return Persist(withKey); + } + + private static X509Certificate2 Persist(X509Certificate2 certificate) + { + byte[] pfx = certificate.Export(X509ContentType.Pfx); + return X509CertificateLoader.LoadPkcs12(pfx, password: null, X509KeyStorageFlags.Exportable); + } + + private static X509Certificate2 SelfSigned(AsymmetricAlgorithm key, string subject) + { + CertificateRequest request = key switch + { + ECDsa ecdsa => new CertificateRequest(subject, ecdsa, HashAlgorithmName.SHA256), + RSA rsa => new CertificateRequest(subject, rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1), + _ => throw new ArgumentException("Expected an RSA or ECDSA key.", nameof(key)), + }; + return request.CreateSelfSigned(NotBefore, NotAfter); + } + + private static byte[] CertificateList(byte[]? statusRequest, byte[]? timestamps, params X509Certificate2[] certificates) + { + var list = new System.Collections.Generic.List(); + for (int i = 0; i < certificates.Length; i++) + { + byte[] der = certificates[i].RawData; + list.Add((byte)(der.Length >> 16)); + list.Add((byte)(der.Length >> 8)); + list.Add((byte)der.Length); + list.AddRange(der); + if (i == 0 && (statusRequest is not null || timestamps is not null)) + { + var extensions = new System.Collections.Generic.List(); + AddExtension(extensions, 5, statusRequest); + AddExtension(extensions, 18, timestamps); + list.Add((byte)(extensions.Count >> 8)); + list.Add((byte)extensions.Count); + list.AddRange(extensions); + } + else + { + list.Add(0); + list.Add(0); + } + } + + return list.ToArray(); + } + + private static void AddExtension(System.Collections.Generic.List destination, ushort type, byte[]? body) + { + if (body is null) + { + return; + } + + destination.Add((byte)(type >> 8)); + destination.Add((byte)type); + destination.Add((byte)(body.Length >> 8)); + destination.Add((byte)body.Length); + destination.AddRange(body); + } + + private static string Status(X509Chain? chain) + { + if (chain is null) + { + return "no chain"; + } + + var text = new System.Text.StringBuilder(); + foreach (X509ChainStatus status in chain.ChainStatus) + { + text.Append(status.Status).Append(' ').Append(status.StatusInformation); + } + + return text.Length == 0 ? "empty status" : text.ToString(); + } +} diff --git a/tests/Titanium.Tls.Tests/ChromeFingerprintDriftTests.cs b/tests/Titanium.Tls.Tests/ChromeFingerprintDriftTests.cs new file mode 100644 index 000000000..17a943137 --- /dev/null +++ b/tests/Titanium.Tls.Tests/ChromeFingerprintDriftTests.cs @@ -0,0 +1,147 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +/// +/// Local check that an installed Chrome still produces the pinned ClientHello shape. +/// It does not run unless TITANIUM_CHROME_DRIFT=1, so a normal suite does not launch a browser. +/// +[TestClass] +public sealed class ChromeFingerprintDriftTests +{ + [TestMethod] + [TestCategory("Explicit")] + public void InstalledChromeMatchesThePinnedInvariants() + { + if (!string.Equals(Environment.GetEnvironmentVariable("TITANIUM_CHROME_DRIFT"), "1", StringComparison.Ordinal)) + { + return; + } + + string chrome = FindChrome(); + byte[] pinned = File.ReadAllBytes(FindPinned()); + for (int i = 0; i < 8; i++) + { + byte[] hello = Capture(chrome); + ChromeHelloInvariants.AssertMatch(pinned, hello); + } + } + + private static byte[] Capture(string chrome) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + string profile = Path.Combine(Path.GetTempPath(), "twp-chrome-drift-" + Guid.NewGuid().ToString("n")); + Directory.CreateDirectory(profile); + using var process = new Process(); + process.StartInfo.FileName = chrome; + process.StartInfo.ArgumentList.Add("--user-data-dir=" + profile); + process.StartInfo.ArgumentList.Add("--no-first-run"); + process.StartInfo.ArgumentList.Add("--no-default-browser-check"); + process.StartInfo.ArgumentList.Add("--disable-sync"); + process.StartInfo.ArgumentList.Add("--disable-background-networking"); + process.StartInfo.ArgumentList.Add("--ignore-certificate-errors"); + process.StartInfo.ArgumentList.Add("https://localhost:" + port + "/"); + process.StartInfo.UseShellExecute = false; + process.Start(); + try + { + Task accept = listener.AcceptTcpClientAsync(); + if (!accept.Wait(TimeSpan.FromSeconds(20))) + { + Assert.Fail("Chrome did not connect."); + } + + using TcpClient client = accept.Result; + using NetworkStream stream = client.GetStream(); + stream.ReadTimeout = 5000; + var header = new byte[5]; + ReadExact(stream, header); + int length = (header[3] << 8) | header[4]; + Assert.AreEqual(22, header[0]); + Assert.IsTrue(length > 0 && length <= 16384); + var body = new byte[length]; + ReadExact(stream, body); + var record = new byte[5 + length]; + header.CopyTo(record, 0); + body.CopyTo(record, 5); + return record; + } + finally + { + listener.Stop(); + if (!process.HasExited) + { + process.Kill(entireProcessTree: true); + } + + try + { + Directory.Delete(profile, recursive: true); + } + catch (IOException) + { + } + } + } + + private static void ReadExact(Stream stream, byte[] buffer) + { + int got = 0; + while (got < buffer.Length) + { + int n = stream.Read(buffer, got, buffer.Length - got); + if (n <= 0) + { + Assert.Fail("Chrome closed before the ClientHello was complete."); + } + + got += n; + } + } + + private static string FindChrome() + { + string[] candidates = + [ + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Google", "Chrome", "Application", "chrome.exe"), + Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Google", "Chrome", "Application", "chrome.exe"), + ]; + foreach (string candidate in candidates) + { + if (File.Exists(candidate)) + { + return candidate; + } + } + + Assert.Fail("Chrome is not installed."); + return ""; + } + + private static string FindPinned() + { + var dir = new DirectoryInfo(AppContext.BaseDirectory); + while (dir is not null) + { + string path = Path.Combine(dir.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", "captures", "chrome", "158.0.8127.89", "tcp", "hello-001.bin"); + if (File.Exists(path)) + { + return path; + } + + dir = dir.Parent; + } + + Assert.Fail("The pinned ClientHello is missing."); + return ""; + } +} diff --git a/tests/Titanium.Tls.Tests/ChunkingChaosTests.cs b/tests/Titanium.Tls.Tests/ChunkingChaosTests.cs new file mode 100644 index 000000000..9e564f77f --- /dev/null +++ b/tests/Titanium.Tls.Tests/ChunkingChaosTests.cs @@ -0,0 +1,338 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class ChunkingChaosTests +{ + [TestMethod] + [Timeout(60000)] + public async Task OneByteReadsStillEcho() + { + await Echo(64, maxChunk: 1, seed: 1); + } + + [TestMethod] + [Timeout(60000)] + public async Task FullRecordSurvivesShortReads() + { + await Echo(TlsRecordProtector.MaxPlaintext, maxChunk: 3, seed: 2); + } + + [TestMethod] + public async Task EmptyWriteDoesNotCloseTheRecordLayer() + { + (TlsStream client, TlsStream server, TcpListener listener) open = await Open(maxChunk: 1, seed: 3); + await using TlsStream client = open.client; + await using TlsStream server = open.server; + using TcpListener listener = open.listener; + await client.WriteAsync(ReadOnlyMemory.Empty); + await client.WriteAsync(new byte[] { 7 }); + byte[] got = new byte[1]; + Assert.AreEqual(1, await server.ReadAsync(got)); + Assert.AreEqual(7, got[0]); + } + + [TestMethod] + [Timeout(30000)] + public async Task CampaignSelfTestCatchesAFlippedRecord() + { + using X509Certificate2 certificate = Certificate(); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task server = Task.Run(async () => + { + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using var stream = new TlsStream(accepted.GetStream()); + try + { + await stream.AuthenticateAsServerAsync(ServerOptions(certificate)); + _ = await stream.ReadAsync(new byte[16]); + return null; + } + catch (Exception error) + { + return error; + } + }); + + using var tcp = new TcpClient(); + tcp.Connect(IPAddress.Loopback, port); + var corrupt = new CorruptOnceStream(tcp.GetStream()); + await using var client = new TlsStream(corrupt); + await client.AuthenticateAsClientAsync(ClientOptions()); + corrupt.Arm(); + await client.WriteAsync(new byte[16]); + Exception? caught = await server; + // The flipped record is rejected as bad_record_mac. The server surfaces that as the + // alert itself, or as an IOException whose inner exception is the alert, depending on + // whether the socket had already closed. + var alert = caught as TlsAlertException ?? (caught as IOException)?.InnerException as TlsAlertException; + Assert.IsNotNull(alert, caught is null ? "server read returned" : caught.GetType().FullName); + Assert.AreEqual(20, alert.Description); + } + + [TestMethod] + public void RandomInputsDoNotThrow() + { + var random = new Random(8446); + for (int i = 0; i < 200; i++) + { + var data = new byte[random.Next(0, 512)]; + random.NextBytes(data); + TlsFuzzTarget.Handshake(data); + } + } + + private static async Task Echo(int bytes, int maxChunk, int seed) + { + (TlsStream client, TlsStream server, TcpListener listener) open = await Open(maxChunk, seed); + await using TlsStream client = open.client; + await using TlsStream server = open.server; + using TcpListener listener = open.listener; + var payload = new byte[bytes]; + payload.AsSpan().Fill(0x3C); + var received = new byte[bytes]; + Task read = ReadExact(server, received); + await client.WriteAsync(payload); + Assert.AreEqual(bytes, await read); + await server.WriteAsync(received); + var echoed = new byte[bytes]; + Assert.AreEqual(bytes, await ReadExact(client, echoed)); + CollectionAssert.AreEqual(payload, echoed); + } + + private static async Task<(TlsStream Client, TlsStream Server, TcpListener Listener)> Open(int maxChunk, int seed) + { + using X509Certificate2 certificate = Certificate(); + var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task accept = Accept(listener, certificate, maxChunk, seed + 1); + var tcp = new TcpClient(); + tcp.Connect(IPAddress.Loopback, port); + var client = new TlsStream(new ChunkingStream(tcp.GetStream(), new Random(seed), maxChunk)); + await client.AuthenticateAsClientAsync(ClientOptions()); + return (client, await accept, listener); + } + + private static async Task Accept(TcpListener listener, X509Certificate2 certificate, int maxChunk, int seed) + { + TcpClient accepted = await listener.AcceptTcpClientAsync(); + var stream = new TlsStream(new ChunkingStream(accepted.GetStream(), new Random(seed), maxChunk)); + await stream.AuthenticateAsServerAsync(ServerOptions(certificate)); + return stream; + } + + private static async Task ReadExact(Stream stream, byte[] buffer) + { + int offset = 0; + while (offset < buffer.Length) + { + int read = await stream.ReadAsync(buffer.AsMemory(offset)); + if (read == 0) + { + break; + } + + offset += read; + } + + return offset; + } + + private static SslClientAuthenticationOptions ClientOptions() => new() + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }; + + private static SslServerAuthenticationOptions ServerOptions(X509Certificate2 certificate) => new() + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }; + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(2)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + private sealed class ChunkingStream : Stream + { + private readonly Stream _inner; + private readonly Random _random; + private readonly int _maxChunk; + + internal ChunkingStream(Stream inner, Random random, int maxChunk) + { + _inner = inner; + _random = random; + _maxChunk = maxChunk; + } + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => true; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) => Read(buffer.AsSpan(offset, count)); + + public override int Read(Span buffer) + { + if (buffer.IsEmpty) + { + return 0; + } + + int count = _random.Next(1, Math.Min(buffer.Length, _maxChunk) + 1); + return _inner.Read(buffer[..count]); + } + + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + if (buffer.IsEmpty) + { + return new ValueTask(0); + } + + int count = _random.Next(1, Math.Min(buffer.Length, _maxChunk) + 1); + return _inner.ReadAsync(buffer[..count], cancellationToken); + } + + public override void Write(byte[] buffer, int offset, int count) => Write(buffer.AsSpan(offset, count)); + + public override void Write(ReadOnlySpan buffer) + { + int offset = 0; + while (offset < buffer.Length) + { + int count = _random.Next(1, Math.Min(buffer.Length - offset, _maxChunk) + 1); + _inner.Write(buffer.Slice(offset, count)); + offset += count; + } + } + + public override async ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + int offset = 0; + while (offset < buffer.Length) + { + int count = _random.Next(1, Math.Min(buffer.Length - offset, _maxChunk) + 1); + await _inner.WriteAsync(buffer.Slice(offset, count), cancellationToken).ConfigureAwait(false); + offset += count; + } + } + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); + + protected override void Dispose(bool disposing) + { + if (disposing) + { + _inner.Dispose(); + } + } + } + + private sealed class CorruptOnceStream : Stream + { + private readonly Stream _inner; + private int _armed; + + internal CorruptOnceStream(Stream inner) => _inner = inner; + + internal void Arm() => _armed = 1; + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => true; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() + { + } + + public override int Read(byte[] buffer, int offset, int count) => _inner.Read(buffer, offset, count); + + public override int Read(Span buffer) => _inner.Read(buffer); + + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + => _inner.ReadAsync(buffer, cancellationToken); + + public override void Write(byte[] buffer, int offset, int count) => Write(buffer.AsSpan(offset, count)); + + public override void Write(ReadOnlySpan buffer) => WriteCore(buffer); + + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + WriteCore(buffer.Span); + return ValueTask.CompletedTask; + } + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); + + protected override void Dispose(bool disposing) + { + if (disposing) + { + _inner.Dispose(); + } + } + + private void WriteCore(ReadOnlySpan buffer) + { + if (Interlocked.CompareExchange(ref _armed, 2, 1) == 1 && buffer.Length > 0) + { + byte[] copy = buffer.ToArray(); + copy[copy.Length / 2] ^= 1; + _inner.Write(copy); + return; + } + + _inner.Write(buffer); + } + } +} diff --git a/tests/Titanium.Tls.Tests/ClientHandshakeTests.cs b/tests/Titanium.Tls.Tests/ClientHandshakeTests.cs new file mode 100644 index 000000000..0761fe3fe --- /dev/null +++ b/tests/Titanium.Tls.Tests/ClientHandshakeTests.cs @@ -0,0 +1,1260 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class ClientHandshakeTests +{ + [TestMethod] + public void FixedEntropyMakesTheClientHelloRepeatable() + { + byte[] script = new byte[96]; + script.AsSpan().Fill(0x11); + byte[] first = Hello(script); + byte[] second = Hello(script); + CollectionAssert.AreEqual(first, second); + Assert.AreEqual(22, first[0]); + Assert.AreEqual(0x0301, (first[1] << 8) | first[2]); + Assert.AreEqual(1, first[5]); + Assert.AreEqual(0x0303, (first[9] << 8) | first[10]); + CollectionAssert.AreEqual(script.AsSpan(0, 32).ToArray(), first.AsSpan(11, 32).ToArray()); + Assert.AreEqual(32, first[43]); + Assert.IsTrue(first.AsSpan(5).IndexOf(new byte[] { 0x13, 0x01 }) > 0); + Assert.IsTrue(first.AsSpan(5).IndexOf(new byte[] { 0x03, 0x04 }) > 0); + } + + [TestMethod] + public void FullHandshakeAgreesOnTheClientFinished() + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + byte[] flight = server.Flight(); + client.Advance(flight, out int consumed, output); + Assert.AreEqual(flight.Length, consumed); + Assert.AreEqual(TlsEventKind.ServerCertificateReceived, output.Event(0).Kind); + Assert.AreEqual(TlsEngineState.WaitCertificateDecision, client.State); + client.Resume(true, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + Assert.AreEqual(TlsEventKind.HandshakeCompleted, output.Event(0).Kind); + server.VerifyClientFinished(output.Bytes.ToArray()); + } + + [TestMethod] + public void IgnoredPreSharedKeyFallsBackToAFullHandshake() + { + var cache = new MemoryTlsSessionCache(); + var psk = new byte[32]; + psk.AsSpan().Fill(0x22); + cache.Store("localhost", "tls", new TlsResumptionTicket([7], 60, 5, [0], psk, 0x1301, 100)); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 101 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + Assert.AreEqual(0x0029, ReadLastExtension(output.Bytes.ToArray())); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + byte[] flight = server.Flight(); + client.Advance(flight, out _, output); + client.Resume(true, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + server.VerifyClientFinished(output.Bytes.ToArray()); + } + + [TestMethod] + public void CertificateRequestSendsAnEmptyClientCertificate() + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + (byte[] verify, byte[] finished) = server.CertificateRequestProof(); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateRequestMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + Assert.AreEqual(TlsEngineState.WaitCertificateDecision, client.State); + client.Resume(true, output); + client.Advance(server.Encrypted(verify), out _, output); + client.Advance(server.Encrypted(finished), out _, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + byte[][] messages = server.ClientHandshakeMessages(output.Bytes.ToArray()); + CollectionAssert.AreEqual(new byte[] { 11, 0, 0, 4, 0, 0, 0, 0 }, messages[0]); + Assert.AreEqual(20, messages[1][0]); + } + + [TestMethod] + public void NewSessionTicketIsStored() + { + var cache = new MemoryTlsSessionCache(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 200 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + byte[] flight = server.Flight(); + client.Advance(flight, out _, output); + client.Resume(true, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + client.Advance(server.EncryptedApplication( + [ + 4, 0, 0, 16, + 0, 0, 0, 60, + 0, 0, 0, 1, + 1, 0, + 0, 2, 9, 9, + 0, 0, + ]), out _, output); + Assert.AreEqual(TlsEventKind.TicketReceived, output.Event(0).Kind); + Assert.IsTrue(cache.TryGet("localhost", "tls", 200, out TlsResumptionTicket stored)); + CollectionAssert.AreEqual(new byte[] { 9, 9 }, stored.Ticket); + Assert.AreEqual(60u, stored.LifetimeSeconds); + } + + [TestMethod] + public void RejectedCertificateCloses() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.Flight(), out _, output); + client.Resume(false, output); + Assert.AreEqual(42, server.ClientAlert(output.Bytes.ToArray(), application: false)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void HelloRetryReplacesTheKeyShareOnce() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] session = SessionId(output.Bytes.ToArray()); + client.Advance(Record(HelloRetry(session, 0x0017, cookie: null)), out _, output); + Assert.AreEqual(TlsEngineState.WaitServerHelloOrHrr, client.State); + Assert.AreEqual(0x0017, KeyShareGroup(output.Bytes.ToArray())); + client.Advance(Record(HelloRetry(session, 0x0017, cookie: [1])), out _, output); + AssertAlert(output, 10); + } + + [TestMethod] + public void HelloRetryWithoutAChangeIsIllegal() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] session = SessionId(output.Bytes.ToArray()); + client.Advance(Record(HelloRetry(session, 0x001D, cookie: null)), out _, output); + AssertAlert(output, 47); + using var again = new TlsEngine(TlsRole.Client); + again.Advance([], out _, output); + byte[] againSession = SessionId(output.Bytes.ToArray()); + again.Advance(Record(HelloRetry(againSession, 0x001D, cookie: [1, 2])), out _, output); + AssertAlert(output, 47); + } + + [DataTestMethod] + [DataRow((ushort)0x1302)] + [DataRow((ushort)0x1303)] + [DataRow((ushort)0xC02B)] + [DataRow((ushort)0x0000)] + public void HelloRetryNamingACipherTheHelloDidNotOfferIsIllegal(ushort cipher) + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] session = SessionId(output.Bytes.ToArray()); + client.Advance(Record(HelloRetry(session, 0x0017, cookie: null, cipher)), out _, output); + AssertAlert(output, 47); + } + + [TestMethod] + public void HelloRetryForAnUnlistedGroupIsIllegal() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] session = SessionId(output.Bytes.ToArray()); + client.Advance(Record(HelloRetry(session, 0x0117, cookie: null)), out _, output); + AssertAlert(output, 47); + } + + [TestMethod] + public void ClientHelloEncodesWideServerNameAndProtocolList() + { + string name = new string('a', 256); + string[] protocols = new string[130]; + Array.Fill(protocols, "a"); + using var client = new TlsEngine(TlsRole.Client, serverName: name) { ApplicationProtocols = protocols }; + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] sni = ExtensionBody(output.Bytes.ToArray(), 0x0000); + Assert.AreEqual(0x01, sni[0]); + Assert.AreEqual(0x03, sni[1]); + Assert.AreEqual(0x01, sni[3]); + Assert.AreEqual(0x00, sni[4]); + byte[] alpn = ExtensionBody(output.Bytes.ToArray(), 0x0010); + Assert.AreEqual(0x01, alpn[0]); + Assert.AreEqual(0x04, alpn[1]); + } + + [TestMethod] + public void SelectedProtocolMustBeOneOfferedName() + { + Assert.AreEqual(47, SelectedProtocolAlert(["http/1.1"], "h2")); + Assert.AreEqual(47, SelectedProtocolAlert(["http/1.1"], "http/1.1", "h2")); + Assert.AreEqual(110, SelectedProtocolAlert([], "h2")); + } + + [TestMethod] + public void WideTicketStillProducesAConsistentClientHello() + { + byte[] identity = new byte[900]; + identity[0] = 0xAB; + var cache = new MemoryTlsSessionCache(); + cache.Store("localhost", "tls", new TlsResumptionTicket(identity, 60, 0, [0], new byte[32], 0x1301, 1_000)); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 1_000 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + int recordLength = (output.Bytes[3] << 8) | output.Bytes[4]; + Assert.AreEqual(output.Bytes.Length, 5 + recordLength); + Assert.IsTrue(output.Bytes.Length > 900); + } + + [TestMethod] + public void OversizedTicketIsDroppedInsteadOfCorruptingTheHello() + { + var cache = new MemoryTlsSessionCache(); + cache.Store("localhost", "tls", new TlsResumptionTicket(new byte[3000], 60, 0, [0], new byte[32], 0x1301, 1_000)); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 1_000 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + Assert.IsFalse(cache.TryGet("localhost", "tls", 1_000, out _)); + int recordLength = (output.Bytes[3] << 8) | output.Bytes[4]; + Assert.AreEqual(output.Bytes.Length, 5 + recordLength); + Assert.IsTrue(output.Bytes.Length < 3000); + } + + [TestMethod] + public void RepeatingOneTicketDoesNotGrowTheCacheQueue() + { + var cache = new MemoryTlsSessionCache(); + for (int i = 0; i < 1000; i++) + { + cache.Store("localhost", "tls", new TlsResumptionTicket([(byte)i], 60, 0, [0], new byte[32], 0x1301, 1_000)); + } + + Assert.AreEqual(1, cache.QueuedKeys); + Assert.IsTrue(cache.TryGet("localhost", "tls", 1_000, out TlsResumptionTicket stored)); + Assert.AreEqual(231, stored.Ticket[0]); + } + + [TestMethod] + public void NinthNewSessionTicketIsNotStored() + { + var cache = new MemoryTlsSessionCache(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 200 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.Flight(), out _, output); + client.Resume(true, output); + for (int i = 1; i <= 9; i++) + { + client.Advance(server.EncryptedApplication( + [ + 4, 0, 0, 15, + 0, 0, 0, 60, + 0, 0, 0, 1, + 1, 0, + 0, 1, (byte)i, + 0, 0, + ]), out _, output); + } + + Assert.IsTrue(cache.TryGet("localhost", "tls", 200, out TlsResumptionTicket stored)); + Assert.AreEqual(8, stored.Ticket[0]); + } + + private static byte SelectedProtocolAlert(string[] offered, params string[] selected) + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost") { ApplicationProtocols = offered.Length == 0 ? null : offered }; + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.Encrypted(AlpnExtensions(selected)), out _, output); + return client.LastLocalAlert; + } + + private static byte[] AlpnExtensions(params string[] names) + { + int list = 0; + foreach (string name in names) + { + list += 1 + name.Length; + } + + int extensionBody = 2 + list; + int block = 4 + extensionBody; + int body = 2 + block; + var message = new byte[4 + body]; + message[0] = 8; + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + message[4] = (byte)(block >> 8); + message[5] = (byte)block; + message[7] = 16; + message[9] = (byte)extensionBody; + message[11] = (byte)list; + int at = 12; + foreach (string name in names) + { + message[at++] = (byte)name.Length; + foreach (char letter in name) + { + message[at++] = (byte)letter; + } + } + + return message; + } + + [TestMethod] + public void PreSharedKeyEncodesAWideIdentityAndAge() + { + byte[] identity = new byte[256]; + identity[0] = 0xAB; + var psk = new byte[32]; + var cache = new MemoryTlsSessionCache(); + cache.Store("localhost", "tls", new TlsResumptionTicket(identity, 60, 0x01020304, [0], psk, 0x1301, 1_000)); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 1_000 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] body = ExtensionBody(output.Bytes.ToArray(), 0x0029); + Assert.AreEqual(0x01, body[0]); + Assert.AreEqual(0x06, body[1]); + Assert.AreEqual(0x01, body[2]); + Assert.AreEqual(0x00, body[3]); + Assert.AreEqual(0xAB, body[4]); + int ageAt = 4 + identity.Length; + Assert.AreEqual(0x01, body[ageAt]); + Assert.AreEqual(0x02, body[ageAt + 1]); + Assert.AreEqual(0x03, body[ageAt + 2]); + Assert.AreEqual(0x04, body[ageAt + 3]); + } + + [TestMethod] + public void ServerHelloNegativesFailClosed() + { + AssertAlert(Feed(static (session, random) => ServerHello(session, random, 0x1302, includeVersion: true, includeShare: true)), 47); + AssertAlert(Feed(static (session, random) => ServerHello(session, random, 0x1301, includeVersion: true, includeShare: false)), 109); + byte[] wrongSession = new byte[32]; + wrongSession[0] = 9; + AssertAlert(Feed(static (_, random) => ServerHello(new byte[32], random, 0x1301, includeVersion: true, includeShare: true), wrongSession), 47); + Assert.ThrowsException(() => Feed(static (session, random) => ServerHello(session, random, 0x1301, includeVersion: false, includeShare: true))); + byte[] sentinel = new byte[32]; + Downgrade().CopyTo(sentinel.AsSpan(24)); + AssertAlert(Feed(static (session, random) => ServerHello(session, random, 0x1301, includeVersion: false, includeShare: true), sentinel), 47); + } + + [TestMethod] + public void UnexpectedMessageIsRejectedInEachClientState() + { + byte[] types = [1, 2, 4, 5, 8, 11, 13, 15, 20, 24, 25]; + foreach (byte type in types) + { + if (type == 2) + { + continue; + } + + AssertAlert(FeedMessage(null, type), 10); + } + + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + Assert.AreEqual(TlsEngineState.WaitEncryptedExtensions, client.State); + client.Advance(server.Encrypted(Finished(20)), out _, output); + Assert.AreEqual(10, server.ClientAlert(output.Bytes.ToArray(), application: false)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void LaterClientStatesRejectEveryOtherHandshakeType() + { + byte[] types = [1, 2, 4, 5, 8, 11, 13, 15, 20, 24, 25]; + foreach (byte type in types) + { + if (type != 8) + { + Reject("hello", type, static (client, server, output) => client.Advance(server.ServerHelloRecord(), out _, output)); + } + + if (type is not 11 and not 13) + { + Reject("extensions", type, static (client, server, output) => + { + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + }); + } + + if (type != 11) + { + Reject("request", type, static (client, server, output) => + { + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateRequestMessage(), out _, output); + }); + } + + if (type != 15) + { + Reject("verify", type, static (client, server, output) => + { + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + }); + } + + if (type != 20) + { + Reject("finished", type, static (client, server, output) => + { + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + client.Advance(server.EncryptedCertificateVerifyMessage(), out _, output); + }); + } + + if (type is not 4 and not 24) + { + Reject("connected", type, static (client, server, output) => + { + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + client.Advance(server.EncryptedCertificateVerifyMessage(), out _, output); + client.Advance(server.EncryptedFinishedMessage(), out _, output); + }, application: true); + } + } + } + + [TestMethod] + public void EmptyKeyUpdateIsIllegal() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + client.Advance(server.EncryptedCertificateVerifyMessage(), out _, output); + client.Advance(server.EncryptedFinishedMessage(), out _, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + client.Advance(server.EncryptedApplication([24, 0, 0, 0]), out _, output); + Assert.AreEqual(47, server.ClientAlert(output.Bytes.ToArray(), application: true)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void UnsolicitedEncryptedExtensionIsRejected() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.Encrypted([8, 0, 0, 6, 0, 4, 0, 0, 0, 0]), out _, output); + Assert.AreEqual(110, server.ClientAlert(output.Bytes.ToArray(), application: false)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void WrongFinishedIsDecryptError() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + client.Advance(server.EncryptedCertificateVerifyMessage(), out _, output); + client.Advance(server.EncryptedWrongFinished(), out _, output); + Assert.AreEqual(51, server.ClientAlert(output.Bytes.ToArray(), application: false)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void SecondChangeCipherSpecIsUnexpected() + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] change = [20, 3, 3, 0, 1, 1]; + client.Advance(change, out _, output); + Assert.AreEqual(TlsEngineState.WaitServerHelloOrHrr, client.State); + client.Advance(change, out _, output); + AssertAlert(output, 10); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void KeyUpdateFloodCloses() + { + (TlsEngine client, ScriptedServer server, TlsOutput output) = Connected(); + using (client) + using (server) + { + for (int i = 0; i < TlsEngine.MaxKeyUpdates; i++) + { + client.Advance(server.EncryptedKeyUpdate(), out _, output); + Assert.AreEqual(TlsEngineState.Connected, client.State, i.ToString()); + } + + client.Advance(server.EncryptedKeyUpdate(), out _, output); + Assert.AreEqual(10, server.ClientAlert(output.Bytes.ToArray(), application: true)); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + } + + [TestMethod] + public void HandshakeAfterCloseNotifyIsIgnored() + { + (TlsEngine client, ScriptedServer server, TlsOutput output) = Connected(); + using (client) + using (server) + { + client.Advance(server.EncryptedAlert(1, 0), out _, output); + Assert.AreEqual(TlsEngineState.Closed, client.State); + client.Advance(server.EncryptedApplication([24, 0, 0, 1, 0]), out int consumed, output); + Assert.AreEqual(0, consumed); + Assert.AreEqual(TlsEngineState.Closed, client.State); + Assert.AreEqual(0, output.Bytes.Length); + } + } + + private static (TlsEngine Client, ScriptedServer Server, TlsOutput Output) Connected() + { + var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + var server = ScriptedServer.Accept(output.Bytes.ToArray()); + client.Advance(server.ServerHelloRecord(), out _, output); + client.Advance(server.EncryptedExtensionsMessage(), out _, output); + client.Advance(server.EncryptedCertificateMessage(), out _, output); + client.Resume(true, output); + client.Advance(server.EncryptedCertificateVerifyMessage(), out _, output); + client.Advance(server.EncryptedFinishedMessage(), out _, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + return (client, server, output); + } + + [TestMethod] + public void ExpiredTicketIsNotOffered() + { + var cache = new MemoryTlsSessionCache(); + cache.Store("", "tls", new TlsResumptionTicket([9, 9], 10, 1, [0], new byte[32], 0x1301, 100)); + using var client = new TlsEngine(TlsRole.Client, cache: cache) { UnixTimeSeconds = 1000 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + Assert.AreNotEqual((ushort)0x0029, ReadLastExtension(output.Bytes.ToArray())); + } + + [TestMethod] + public void ResumptionOffersAPreSharedKey() + { + var cache = new MemoryTlsSessionCache(); + var psk = new byte[32]; + psk.AsSpan().Fill(0x22); + cache.Store("localhost", "tls", new TlsResumptionTicket([7, 7, 7], 60, 5, [0, 1], psk, 0x1301, 100)); + byte[] script = new byte[96]; + script.AsSpan().Fill(0x31); + using var client = new TlsEngine(TlsRole.Client, entropy: new FixedEntropy(script), serverName: "localhost", cache: cache) { UnixTimeSeconds = 101 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] hello = output.Bytes.ToArray(); + Assert.IsTrue(hello.AsSpan().IndexOf(new byte[] { 0x00, 0x29 }) > 0); + Assert.AreEqual(0x0029, ReadLastExtension(hello)); + } + + private static void Reject(string stage, byte type, Action reach, bool application = false) + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + using var server = ScriptedServer.Accept(output.Bytes.ToArray()); + reach(client, server, output); + Assert.AreNotEqual(TlsEngineState.Closed, client.State, stage + " " + type + " " + (output.Bytes.Length < 7 ? output.Bytes.Length : output.Bytes[6])); + byte[] message = [type, 0, 0, 0]; + client.Advance(application ? server.EncryptedApplication(message) : server.Encrypted(message), out _, output); + Assert.AreEqual(10, server.ClientAlert(output.Bytes.ToArray(), application), stage + " " + type + " " + client.State); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + private static byte[] Hello(byte[] script) + { + using var client = new TlsEngine(TlsRole.Client, entropy: new FixedEntropy(script)); + var output = new TlsOutput(); + client.Advance([], out _, output); + return output.Bytes.ToArray(); + } + + private static byte[] Feed(Func hello, byte[]? random = null) + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] session = SessionId(output.Bytes.ToArray()); + byte[] chosen = random ?? new byte[32]; + if (random is null) + { + chosen[0] = 1; + } + + try + { + client.Advance(Record(hello(session, chosen)), out _, output); + } + catch (TlsVersionNotSupportedException) + { + Assert.AreEqual(TlsEngineState.Closed, client.State); + throw; + } + + return output.Bytes.ToArray(); + } + + private static byte[] FeedMessage(byte[]? prefix, byte type) + { + using var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + if (prefix is not null) + { + client.Advance(prefix, out _, output); + } + + client.Advance(Record([type, 0, 0, 0]), out _, output); + return output.Bytes.ToArray(); + } + + private static void AssertAlert(TlsOutput output, byte description) + { + Assert.AreEqual(7, output.Bytes.Length); + Assert.AreEqual(21, output.Bytes[0]); + Assert.AreEqual(description, output.Bytes[6]); + } + + private static void AssertAlert(byte[] alert, byte description) + { + Assert.AreEqual(7, alert.Length); + Assert.AreEqual(21, alert[0]); + Assert.AreEqual(description, alert[6]); + } + + private static byte[] Record(byte[] handshake) + { + var record = new byte[5 + handshake.Length]; + record[0] = 22; + record[1] = 3; + record[2] = 3; + record[3] = (byte)(handshake.Length >> 8); + record[4] = (byte)handshake.Length; + handshake.CopyTo(record, 5); + return record; + } + + private static byte[] SessionId(byte[] record) + { + var id = new byte[32]; + record.AsSpan(44, 32).CopyTo(id); + return id; + } + + private static ushort KeyShareGroup(byte[] record) + { + ReadOnlySpan hello = record.AsSpan(5); + int extensions = ExtensionStart(hello); + TlsReader reader = new(hello[extensions..]); + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (type == ExtensionType.KeyShare) + { + return (ushort)((body[2] << 8) | body[3]); + } + } + + return 0; + } + + private static ushort ReadLastExtension(byte[] record) + { + ReadOnlySpan hello = record.AsSpan(5); + int extensions = ExtensionStart(hello); + TlsReader reader = new(hello[extensions..]); + ushort last = 0; + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out _)) + { + last = type; + } + + return last; + } + + private static byte[] ExtensionBody(byte[] record, ushort type) + { + ReadOnlySpan hello = record.AsSpan(5); + TlsReader reader = new(hello[ExtensionStart(hello)..]); + while (reader.TryReadUInt16(out ushort found) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (found == type) + { + return body.ToArray(); + } + } + + Assert.Fail("The ClientHello is missing extension " + type.ToString("x4") + "."); + return []; + } + + private static int ExtensionStart(ReadOnlySpan hello) + { + int offset = 4 + 2 + 32; + offset += 1 + hello[offset]; + offset += 2 + ((hello[offset] << 8) | hello[offset + 1]); + offset += 1 + hello[offset]; + offset += 2; + return offset; + } + + private static byte[] HelloRetry(byte[] session, ushort group, byte[]? cookie, ushort cipher = 0x1301) + { + var random = new byte[32]; + Convert.FromHexString("CF21AD74E59A6111BE1D8C021E65B891C2A211167ABB8C5E079E09E2C8A8339C").CopyTo(random); + var body = new System.Collections.Generic.List(); + body.Add(2); + Add24(body, 0); + body.Add(3); + body.Add(3); + body.AddRange(random); + body.Add(32); + body.AddRange(session); + body.Add((byte)(cipher >> 8)); + body.Add((byte)cipher); + body.Add(0); + var extensions = new System.Collections.Generic.List(); + AddExtension(extensions, 0x002B, [0x03, 0x04]); + AddExtension(extensions, 0x0033, [(byte)(group >> 8), (byte)group]); + if (cookie is not null) + { + AddExtension(extensions, 44, cookie); + } + + body.Add((byte)(extensions.Count >> 8)); + body.Add((byte)extensions.Count); + body.AddRange(extensions); + Patch24(body, 1, body.Count - 4); + return body.ToArray(); + } + + private static byte[] ServerHello(byte[] session, byte[] random, ushort cipher, bool includeVersion, bool includeShare) + { + var body = new System.Collections.Generic.List { 2, 0, 0, 0, 3, 3 }; + body.AddRange(random); + body.Add(32); + body.AddRange(session); + body.Add((byte)(cipher >> 8)); + body.Add((byte)cipher); + body.Add(0); + var extensions = new System.Collections.Generic.List(); + if (includeVersion) + { + AddExtension(extensions, 0x002B, [0x03, 0x04]); + } + + if (includeShare) + { + var share = new byte[36]; + share[1] = 0x1D; + share[3] = 32; + share.AsSpan(4).Fill(0x44); + AddExtension(extensions, 0x0033, share); + } + + body.Add((byte)(extensions.Count >> 8)); + body.Add((byte)extensions.Count); + body.AddRange(extensions); + Patch24(body, 1, body.Count - 4); + return body.ToArray(); + } + + private static byte[] Finished(byte type) + { + return [type, 0, 0, 0]; + } + + private static byte[] Downgrade() + { + return [0x44, 0x4F, 0x57, 0x4E, 0x47, 0x52, 0x44, 0x01]; + } + + private static void AddExtension(System.Collections.Generic.List destination, ushort type, byte[] body) + { + destination.Add((byte)(type >> 8)); + destination.Add((byte)type); + destination.Add((byte)(body.Length >> 8)); + destination.Add((byte)body.Length); + destination.AddRange(body); + } + + private static void Add24(System.Collections.Generic.List destination, int value) + { + destination.Add((byte)(value >> 16)); + destination.Add((byte)(value >> 8)); + destination.Add((byte)value); + } + + private static void Patch24(System.Collections.Generic.List destination, int at, int value) + { + destination[at] = (byte)(value >> 16); + destination[at + 1] = (byte)(value >> 8); + destination[at + 2] = (byte)value; + } +} + +internal sealed class ScriptedServer : IDisposable +{ + private readonly TranscriptStore _transcript = new(HashAlgorithmName.SHA256); + private readonly TlsKeySchedule _schedule = new(HashAlgorithmName.SHA256); + private readonly ECDsa _key; + private readonly X509Certificate2 _certificate; + private readonly TlsRecordProtector _write; + private TlsRecordProtector _application; + private readonly byte[] _clientHandshake = new byte[32]; + private readonly byte[] _clientApplication = new byte[32]; + private readonly byte[] _serverApplicationSecret; + private readonly byte[] _serverHello; + private readonly byte[] _payload; + private readonly byte[] _verify; + private readonly byte[] _finished; + private readonly byte[] _clientHello; + private readonly byte[] _serverHelloMessage; + private readonly byte[] _serverHandshake; + private bool _disposed; + + private ScriptedServer( + ECDsa key, + X509Certificate2 certificate, + TlsRecordProtector write, + TlsRecordProtector application, + byte[] serverHello, + byte[] payload, + byte[] verify, + byte[] finished, + byte[] clientHello, + byte[] serverHelloMessage, + byte[] serverHandshake, + byte[] serverApplication) + { + _key = key; + _certificate = certificate; + _write = write; + _application = application; + _serverApplicationSecret = serverApplication; + _serverHello = serverHello; + _payload = payload; + _verify = verify; + _finished = finished; + _clientHello = clientHello; + _serverHelloMessage = serverHelloMessage; + _serverHandshake = serverHandshake; + } + + internal static ScriptedServer Accept(byte[] clientRecord) + { + byte[] handshake = clientRecord.AsSpan(5, ((clientRecord[3] << 8) | clientRecord[4])).ToArray(); + Assert.IsTrue(HandshakeMessages.TryReadClientHello(handshake, out ClientHelloView hello, out _)); + byte[] clientShare = KeyShare(hello.Extensions); + var scalar = new byte[32]; + scalar.AsSpan().Fill(0x27); + var serverShare = new byte[32]; + var secret = new byte[32]; + X25519.PublicKey(scalar, serverShare); + X25519.ScalarMult(scalar, clientShare, secret); + var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append(handshake); + byte[] serverHello = ServerHelloMessage(hello.SessionId.ToArray(), serverShare); + transcript.Append(serverHello); + var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly([]); + schedule.AdvanceToHandshake(secret); + Span hash = stackalloc byte[32]; + transcript.CurrentHash(hash); + var serverHs = new byte[32]; + var clientHs = new byte[32]; + schedule.HandshakeTrafficSecret(false, hash, serverHs); + schedule.HandshakeTrafficSecret(true, hash, clientHs); + var ecdsa = ECDsa.Create(ECCurve.NamedCurves.nistP256)!; + var request = new CertificateRequest("CN=localhost", ecdsa, HashAlgorithmName.SHA256); + X509Certificate2 certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + byte[] ee = [8, 0, 0, 2, 0, 0]; + byte[] certificateMessage = CertificateMessage(certificate.RawData); + transcript.Append(ee); + transcript.Append(certificateMessage); + transcript.CurrentHash(hash); + byte[] verify = CertificateVerify(ecdsa, hash); + transcript.Append(verify); + transcript.CurrentHash(hash); + Span finishedKey = stackalloc byte[32]; + Span verifyData = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, serverHs, finishedKey); + HMACSHA256.HashData(finishedKey, hash, verifyData); + var finished = new byte[36]; + finished[0] = 20; + finished[3] = 32; + verifyData.CopyTo(finished.AsSpan(4)); + transcript.Append(finished); + var payload = new byte[ee.Length + certificateMessage.Length + verify.Length + finished.Length]; + int offset = 0; + Copy(ee, payload, ref offset); + Copy(certificateMessage, payload, ref offset); + Copy(verify, payload, ref offset); + Copy(finished, payload, ref offset); + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, serverHs, key, iv); + var protector = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + transcript.CurrentHash(hash); + schedule.AdvanceToMaster(); + var serverApplication = new byte[32]; + schedule.ApplicationTrafficSecret(false, hash, serverApplication); + var clientApp = new byte[32]; + schedule.ApplicationTrafficSecret(true, hash, clientApp); + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, serverApplication, key, iv); + var application = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + var serverHelloRecord = new byte[5 + serverHello.Length]; + serverHelloRecord[0] = 22; + serverHelloRecord[1] = 3; + serverHelloRecord[2] = 3; + serverHelloRecord[3] = (byte)(serverHello.Length >> 8); + serverHelloRecord[4] = (byte)serverHello.Length; + serverHello.CopyTo(serverHelloRecord, 5); + var server = new ScriptedServer(ecdsa, certificate, protector, application, serverHelloRecord, payload, verify, finished, handshake, serverHello, serverHs, serverApplication); + server._transcript.Dispose(); + transcript.CurrentHash(hash); + server._transcript.Dispose(); + ReplaceTranscript(server, transcript); + clientHs.CopyTo(server._clientHandshake); + clientApp.CopyTo(server._clientApplication); + server._schedule.Dispose(); + ReplaceSchedule(server, schedule); + return server; + } + + internal byte[] ServerHelloRecord() => _serverHello; + + internal byte[] Flight() + { + byte[] encrypted = Encrypted(_payload); + var flight = new byte[_serverHello.Length + 6 + encrypted.Length]; + _serverHello.CopyTo(flight, 0); + int at = _serverHello.Length; + flight[at] = 20; + flight[at + 1] = 3; + flight[at + 2] = 3; + flight[at + 4] = 1; + flight[at + 5] = 1; + encrypted.CopyTo(flight, at + 6); + return flight; + } + + internal byte[] EncryptedExtensionsMessage() => Encrypted([8, 0, 0, 2, 0, 0]); + + internal byte[] EncryptedCertificateRequestMessage() => Encrypted(CertificateRequestMessageBytes); + + private static readonly byte[] CertificateRequestMessageBytes = + [ + 13, 0, 0, 18, + 0, + 0, 15, + 0, 13, 0, 4, 0, 2, 4, 3, + 0, 27, 0, 3, 2, 0, 1, + ]; + + internal byte[] EncryptedCertificateMessage() => Encrypted(CertificateMessage(_certificate.RawData)); + + internal byte[] EncryptedCertificateVerifyMessage() => Encrypted(_verify); + + internal byte[] EncryptedFinishedMessage() => Encrypted(_finished); + + internal (byte[] Verify, byte[] Finished) CertificateRequestProof() + { + byte[] extensions = [8, 0, 0, 2, 0, 0]; + byte[] request = CertificateRequestMessageBytes; + byte[] certificate = CertificateMessage(_certificate.RawData); + using var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append(_clientHello); + transcript.Append(_serverHelloMessage); + transcript.Append(extensions); + transcript.Append(request); + transcript.Append(certificate); + Span hash = stackalloc byte[32]; + transcript.CurrentHash(hash); + byte[] verify = CertificateVerify(_key, hash); + transcript.Append(verify); + transcript.CurrentHash(hash); + Span finishedKey = stackalloc byte[32]; + Span verifyData = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, _serverHandshake, finishedKey); + HMACSHA256.HashData(finishedKey, hash, verifyData); + var finished = new byte[36]; + finished[0] = 20; + finished[3] = 32; + verifyData.CopyTo(finished.AsSpan(4)); + return (verify, finished); + } + + internal byte[][] ClientHandshakeMessages(byte[] records) + { + var messages = new System.Collections.Generic.List(); + int offset = records.Length > 0 && records[0] == 20 ? 6 : 0; + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, _clientHandshake, key, iv); + using var read = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + while (offset + 5 <= records.Length) + { + int length = 5 + ((records[offset + 3] << 8) | records[offset + 4]); + var record = new byte[length]; + records.AsSpan(offset, length).CopyTo(record); + byte content = read.Unprotect(record, out int contentLength); + Assert.AreEqual(22, content); + messages.Add(record.AsSpan(5, contentLength).ToArray()); + offset += length; + } + + return messages.ToArray(); + } + + internal byte[] EncryptedApplication(byte[] handshake) + { + var encrypted = new byte[handshake.Length + 64]; + int written = _application.Protect(22, handshake, encrypted); + return encrypted.AsSpan(0, written).ToArray(); + } + + internal byte[] EncryptedWrongFinished() + { + byte[] finished = (byte[])_finished.Clone(); + finished[^1] ^= 0xFF; + return Encrypted(finished); + } + + internal byte[] EncryptedAlert(byte level, byte description) + { + var encrypted = new byte[64]; + int written = _application.Protect(21, [level, description], encrypted); + return encrypted.AsSpan(0, written).ToArray(); + } + + internal byte[] EncryptedKeyUpdate() + { + byte[] record = EncryptedApplication([24, 0, 0, 1, 0]); + Span next = stackalloc byte[32]; + TlsKeySchedule.NextTrafficSecret(HashAlgorithmName.SHA256, _serverApplicationSecret, next); + next.CopyTo(_serverApplicationSecret); + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, _serverApplicationSecret, key, iv); + _application.Dispose(); + _application = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + return record; + } + + internal byte ClientAlert(byte[] record, bool application) + { + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, application ? _clientApplication : _clientHandshake, key, iv); + using var read = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + var copy = new byte[record.Length]; + record.CopyTo(copy, 0); + byte content = read.Unprotect(copy, out int contentLength); + Assert.AreEqual(21, content); + Assert.AreEqual(2, contentLength); + return copy[6]; + } + + internal byte[] Encrypted(byte[] handshake) + { + var encrypted = new byte[handshake.Length + 64]; + int written = _write.Protect(22, handshake, encrypted); + return encrypted.AsSpan(0, written).ToArray(); + } + + internal void VerifyClientFinished(byte[] records) + { + int offset = records[0] == 20 ? 6 : 0; + int length = 5 + ((records[offset + 3] << 8) | records[offset + 4]); + var record = new byte[length]; + records.AsSpan(offset, length).CopyTo(record); + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, _clientHandshake, key, iv); + using var read = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + byte content = read.Unprotect(record, out int contentLength); + Assert.AreEqual(22, content); + ReadOnlySpan finished = record.AsSpan(5, contentLength); + Span hash = stackalloc byte[32]; + _transcript.CurrentHash(hash); + Span finishedKey = stackalloc byte[32]; + Span expected = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, _clientHandshake, finishedKey); + HMACSHA256.HashData(finishedKey, hash, expected); + Assert.IsTrue(finished.Length >= 36); + Assert.IsTrue(CryptographicOperations.FixedTimeEquals(expected, finished.Slice(4, 32))); + } + + public void Dispose() + { + if (_disposed) + { + return; + } + + _disposed = true; + _key.Dispose(); + _certificate.Dispose(); + _write.Dispose(); + _application.Dispose(); + _transcript.Dispose(); + _schedule.Dispose(); + } + + private static void ReplaceTranscript(ScriptedServer server, TranscriptStore transcript) + { + typeof(ScriptedServer).GetField("_transcript", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)! + .SetValue(server, transcript); + } + + private static void ReplaceSchedule(ScriptedServer server, TlsKeySchedule schedule) + { + typeof(ScriptedServer).GetField("_schedule", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)! + .SetValue(server, schedule); + } + + private static byte[] KeyShare(ReadOnlySpan extensions) + { + TlsReader reader = new(extensions); + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (type == ExtensionType.KeyShare) + { + return body.Slice(6, 32).ToArray(); + } + } + + throw new InvalidOperationException("The ClientHello has no X25519 share."); + } + + private static byte[] ServerHelloMessage(byte[] session, byte[] share) + { + var random = new byte[32]; + random[0] = 0x21; + var keyShare = new byte[36]; + keyShare[1] = 0x1D; + keyShare[3] = 32; + share.CopyTo(keyShare.AsSpan(4)); + var extensions = new System.Collections.Generic.List(); + Add(extensions, 0x002B, [0x03, 0x04]); + Add(extensions, 0x0033, keyShare); + var body = new System.Collections.Generic.List { 2, 0, 0, 0, 3, 3 }; + body.AddRange(random); + body.Add(32); + body.AddRange(session); + body.Add(0x13); + body.Add(0x01); + body.Add(0); + body.Add((byte)(extensions.Count >> 8)); + body.Add((byte)extensions.Count); + body.AddRange(extensions); + body[1] = (byte)((body.Count - 4) >> 16); + body[2] = (byte)((body.Count - 4) >> 8); + body[3] = (byte)(body.Count - 4); + return body.ToArray(); + } + + private static byte[] CertificateMessage(byte[] der) + { + var entry = new byte[3 + der.Length + 2]; + entry[0] = (byte)(der.Length >> 16); + entry[1] = (byte)(der.Length >> 8); + entry[2] = (byte)der.Length; + der.CopyTo(entry, 3); + var message = new byte[4 + 1 + 3 + entry.Length]; + message[0] = 11; + int body = 1 + 3 + entry.Length; + message[1] = (byte)(body >> 16); + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + message[5] = (byte)(entry.Length >> 16); + message[6] = (byte)(entry.Length >> 8); + message[7] = (byte)entry.Length; + entry.CopyTo(message, 8); + return message; + } + + private static byte[] CertificateVerify(ECDsa key, ReadOnlySpan hash) + { + Span content = stackalloc byte[64 + 33 + 1 + 32]; + content[..64].Fill(0x20); + "TLS 1.3, server CertificateVerify"u8.CopyTo(content[64..]); + hash.CopyTo(content[(64 + 34)..]); + byte[] signature = key.SignData(content, HashAlgorithmName.SHA256, DSASignatureFormat.Rfc3279DerSequence); + var message = new byte[4 + 2 + 2 + signature.Length]; + message[0] = 15; + int body = 2 + 2 + signature.Length; + message[2] = (byte)(body >> 8); + message[3] = (byte)body; + message[4] = 0x04; + message[5] = 0x03; + message[6] = (byte)(signature.Length >> 8); + message[7] = (byte)signature.Length; + signature.CopyTo(message, 8); + return message; + } + + private static void Add(System.Collections.Generic.List destination, ushort type, byte[] body) + { + destination.Add((byte)(type >> 8)); + destination.Add((byte)type); + destination.Add((byte)(body.Length >> 8)); + destination.Add((byte)body.Length); + destination.AddRange(body); + } + + private static void Copy(byte[] source, byte[] destination, ref int offset) + { + source.CopyTo(destination, offset); + offset += source.Length; + } +} diff --git a/tests/Titanium.Tls.Tests/CorpusRunnerTests.cs b/tests/Titanium.Tls.Tests/CorpusRunnerTests.cs new file mode 100644 index 000000000..bc5638cef --- /dev/null +++ b/tests/Titanium.Tls.Tests/CorpusRunnerTests.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class CorpusRunnerTests +{ + [TestMethod] + public void TruncationsAndMutationsStayInsideTheDocumentedResult() + { + string directory = Path.Combine(AppContext.BaseDirectory, "fuzz", "corpus", "tls-handshake"); + string[] files = Directory.GetFiles(directory, "*.hex"); + Assert.IsTrue(files.Length > 0, directory); + var types = new HashSet(); + var random = new Random(8446); + foreach (string file in files) + { + CorpusFile seed = CorpusFile.Load(file); + if (seed.Body.Length > 5 && seed.Body[0] == 22) + { + types.Add(seed.Body[5]); + } + + TlsFuzzTarget.Handshake(seed.Body); + for (int length = 0; length < seed.Body.Length; length++) + { + TlsFuzzTarget.Handshake(seed.Body.AsSpan(0, length).ToArray()); + } + + if (seed.Body.Length == 0) + { + continue; + } + + byte[] mutant = (byte[])seed.Body.Clone(); + for (int i = 0; i < 16; i++) + { + mutant[random.Next(mutant.Length)] = (byte)random.Next(256); + TlsFuzzTarget.Handshake(mutant); + } + } + + byte[] required = [1, 2, 4, 5, 8, 11, 13, 15, 20, 24]; + foreach (byte type in required) + { + Assert.IsTrue(types.Contains(type), type.ToString()); + } + } +} + +internal sealed class CorpusFile +{ + private CorpusFile(string expect, byte[] body) + { + Expect = expect; + Body = body; + } + + internal string Expect { get; } + + internal byte[] Body { get; } + + internal static CorpusFile Load(string path) + { + string text = File.ReadAllText(path); + string expect = "reject"; + foreach (string line in text.Split('\n')) + { + const string marker = "# expect:"; + if (line.StartsWith(marker, StringComparison.Ordinal)) + { + expect = line[marker.Length..].Trim(); + } + } + + return new CorpusFile(expect, HexVectors.Parse(text)); + } +} diff --git a/tests/Titanium.Tls.Tests/Ed25519OpenSslTests.cs b/tests/Titanium.Tls.Tests/Ed25519OpenSslTests.cs new file mode 100644 index 000000000..d98f3f8da --- /dev/null +++ b/tests/Titanium.Tls.Tests/Ed25519OpenSslTests.cs @@ -0,0 +1,71 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class Ed25519OpenSslTests +{ + [TestMethod] + public void VerifyMatchesOpenSslSignatures() + { + if (!OpenSslOracle.Require(new Version(3, 0))) + { + Assert.Inconclusive("OpenSSL 3 was not found."); + return; + } + + string openssl = OpenSslOracle.Find() ?? throw new InvalidOperationException("OpenSSL was not found."); + string dir = Path.Combine(Path.GetTempPath(), "twp-ed25519-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(dir); + try + { + string keyPath = Path.Combine(dir, "key.der"); + string publicPath = Path.Combine(dir, "pub.der"); + string messagePath = Path.Combine(dir, "msg.bin"); + string signaturePath = Path.Combine(dir, "sig.bin"); + Run(openssl, $"genpkey -algorithm ED25519 -outform DER -out \"{keyPath}\""); + Run(openssl, $"pkey -in \"{keyPath}\" -inform DER -pubout -outform DER -out \"{publicPath}\""); + byte[] publicKey = File.ReadAllBytes(publicPath); + Assert.AreEqual(44, publicKey.Length); + publicKey = publicKey[^32..]; + byte[] message = new byte[48]; + for (int i = 0; i < 8; i++) + { + RandomNumberGenerator.Fill(message); + File.WriteAllBytes(messagePath, message); + Run(openssl, $"pkeyutl -sign -inkey \"{keyPath}\" -keyform DER -rawin -in \"{messagePath}\" -out \"{signaturePath}\""); + byte[] signature = File.ReadAllBytes(signaturePath); + Assert.AreEqual(64, signature.Length); + Assert.IsTrue(Ed25519Verifier.Verify(publicKey, message, signature), "sample " + i); + signature[20] ^= 0xFF; + Assert.IsFalse(Ed25519Verifier.Verify(publicKey, message, signature), "sample " + i); + } + } + finally + { + Directory.Delete(dir, recursive: true); + } + } + + private static void Run(string openssl, string arguments) + { + ProcessStartInfo start = new() + { + FileName = openssl, + Arguments = arguments, + RedirectStandardError = true, + UseShellExecute = false, + }; + using Process process = Process.Start(start) ?? throw new InvalidOperationException("OpenSSL did not start."); + string error = process.StandardError.ReadToEnd(); + if (!process.WaitForExit(10000) || process.ExitCode != 0) + { + throw new InvalidOperationException("OpenSSL Ed25519 command failed. " + error); + } + } +} diff --git a/tests/Titanium.Tls.Tests/Ed25519Tests.cs b/tests/Titanium.Tls.Tests/Ed25519Tests.cs new file mode 100644 index 000000000..296e7cbaf --- /dev/null +++ b/tests/Titanium.Tls.Tests/Ed25519Tests.cs @@ -0,0 +1,75 @@ +using System; +using System.Globalization; +using System.IO; +using System.Numerics; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class Ed25519Tests +{ + [TestMethod] + public void Rfc8032Section71Verifies() + { + AssertVerified("d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", "", "e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b"); + AssertVerified("3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c", "72", "92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00"); + AssertVerified("fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025", "af82", "6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a"); + string[] vector = File.ReadAllLines(FindFixture("rfc8032-ed25519-1024.txt")); + Assert.IsTrue(Ed25519Verifier.Verify( + Convert.FromHexString(vector[0]["PUBLIC ".Length..]), + Convert.FromHexString(vector[1]["MESSAGE ".Length..]), + Convert.FromHexString(vector[2]["SIGNATURE ".Length..]))); + } + + [TestMethod] + public void RejectsLengthsCanonicalSSmallOrderAndFips() + { + byte[] publicKey = Convert.FromHexString("3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c"); + byte[] signature = Convert.FromHexString("92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00"); + byte[] message = Convert.FromHexString("72"); + Assert.IsFalse(Ed25519Verifier.Verify(publicKey, message, signature[..63])); + Assert.IsFalse(Ed25519Verifier.Verify(publicKey[..31], message, signature)); + signature[0] ^= 0x01; + Assert.IsFalse(Ed25519Verifier.Verify(publicKey, message, signature)); + signature[0] ^= 0x01; + BigInteger order = (BigInteger.One << 252) + BigInteger.Parse("27742317777372353535851937790883648493", CultureInfo.InvariantCulture); + BigInteger s = new(signature.AsSpan(32), isUnsigned: true, isBigEndian: false); + signature.AsSpan(32).Clear(); + Assert.IsTrue((s + order).TryWriteBytes(signature.AsSpan(32), out _, isUnsigned: true, isBigEndian: false)); + Assert.IsFalse(Ed25519Verifier.Verify(publicKey, message, signature)); + byte[] identity = new byte[32]; + identity[0] = 1; + Assert.IsFalse(Ed25519Verifier.Verify(identity, message, signature)); + signature = Convert.FromHexString("92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00"); + Assert.IsFalse(Ed25519Verifier.Verify(publicKey, message, signature, TlsAlgorithmPolicy.FipsApprovedOnly)); + Assert.IsTrue(Ed25519Verifier.VerifyScheme(SignatureScheme.Ed25519, publicKey, message, signature)); + Assert.IsFalse(Ed25519Verifier.VerifyScheme((SignatureScheme)0, publicKey, message, signature)); + } + + private static void AssertVerified(string publicKey, string message, string signature) + { + Assert.IsTrue(Ed25519Verifier.Verify( + Convert.FromHexString(publicKey), + Convert.FromHexString(message), + Convert.FromHexString(signature))); + } + + private static string FindFixture(string name) + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", name); + if (File.Exists(candidate)) + { + return candidate; + } + + dir = dir.Parent; + } + + Assert.Fail(name + " was not found."); + return string.Empty; + } +} diff --git a/tests/Titanium.Tls.Tests/EngineTests.cs b/tests/Titanium.Tls.Tests/EngineTests.cs new file mode 100644 index 000000000..84ee6ae3e --- /dev/null +++ b/tests/Titanium.Tls.Tests/EngineTests.cs @@ -0,0 +1,173 @@ +using System; +using System.Reflection; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class EngineTests +{ + [TestMethod] + public void StubHandshakeReachesConnected() + { + var client = new TlsEngine(TlsRole.Client); + var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out int consumed, output); + Assert.AreEqual(0, consumed); + byte[] hello = output.Bytes.ToArray(); + Assert.AreEqual(22, hello[0]); + Assert.AreEqual(1, hello[5]); + + server.Advance(hello, out consumed, output); + Assert.AreEqual(hello.Length, consumed); + Assert.AreEqual(TlsEventKind.ClientHelloReceived, output.Event(0).Kind); + Assert.AreEqual(TlsEngineState.WaitClientHelloDecision, server.State); + + using X509Certificate2 certificate = Certificate(); + server.Resume(_ => new TlsServerSelection { Certificate = certificate }, output); + Assert.IsTrue(output.Bytes.Length > 0); + Assert.AreEqual(TlsEngineState.WaitFinished, server.State); + client.Dispose(); + server.Dispose(); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } + + [TestMethod] + public void IllegalTransitionSendsUnexpectedMessage() + { + var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + client.Advance(HandshakeRecord(11), out _, output); + AssertAlert(output, (byte)TlsRecordAlert.UnexpectedMessage); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void ClosedEngineRejectsFurtherInput() + { + var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + client.Advance(HandshakeRecord(11), out _, output); + client.Advance(HandshakeRecord(2), out int consumed, output); + Assert.AreEqual(0, consumed); + Assert.AreEqual(0, output.Bytes.Length); + Assert.AreEqual(0, output.EventCount); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void OversizedHandshakeMessageIsRejected() + { + var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + var record = new byte[9]; + record[0] = 22; + record[1] = 3; + record[2] = 3; + record[4] = 4; + record[5] = 2; + record[6] = 2; + record[8] = 1; + client.Advance(record, out _, output); + AssertAlert(output, (byte)HandshakeAlert.DecodeError); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void EmptyApplicationRecordBeforeTheHandshakeIsRejected() + { + var client = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + client.Advance([], out _, output); + client.Advance([23, 3, 3, 0, 0], out _, output); + AssertAlert(output, (byte)TlsRecordAlert.UnexpectedMessage); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void TooManyProtectedEmptyRecordsAreRejected() + { + using HandshakePair pair = HandshakePair.Run(); + var output = new TlsOutput(); + var record = new byte[64]; + for (int i = 0; i < TlsEngine.MaxEmptyRecords; i++) + { + int written = pair.Client.ProtectApplication([], record); + pair.Server.Advance(record.AsSpan(0, written), out int consumed, output); + Assert.AreEqual(written, consumed, i.ToString()); + Assert.AreEqual(TlsEngineState.Connected, pair.Server.State); + } + + int last = pair.Client.ProtectApplication([], record); + pair.Server.Advance(record.AsSpan(0, last), out _, output); + Assert.AreEqual(TlsEngineState.Closed, pair.Server.State); + Assert.AreEqual((byte)TlsRecordAlert.UnexpectedMessage, pair.Server.LastLocalAlert); + } + + [TestMethod] + public void BufferedByteCapIsEnforced() + { + var client = new TlsEngine(TlsRole.Client, maxBufferedBytes: 20); + var output = new TlsOutput(); + client.Advance([], out _, output); + var record = new byte[21]; + record[0] = 22; + record[1] = 3; + record[2] = 3; + record[4] = 16; + client.Advance(record, out _, output); + AssertAlert(output, (byte)TlsRecordAlert.RecordOverflow); + Assert.AreEqual(TlsEngineState.Closed, client.State); + } + + [TestMethod] + public void EngineMethodsDoNotReturnTasks() + { + MethodInfo[] methods = typeof(TlsEngine).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly); + Assert.IsTrue(methods.Length > 0); + foreach (MethodInfo method in methods) + { + Assert.IsFalse(typeof(Task).IsAssignableFrom(method.ReturnType), method.Name); + Assert.IsFalse(method.ReturnType.IsGenericType && method.ReturnType.Name.StartsWith("ValueTask", StringComparison.Ordinal), method.Name); + } + } + + [TestMethod] + public void CryptoExecutionPolicyStaysInlineUntilValidation() + { + Assert.AreEqual(CryptoOffloadReason.None, CryptoExecutionPolicy.Revocation(false)); + Assert.AreEqual(CryptoOffloadReason.OnlineRevocation, CryptoExecutionPolicy.Revocation(true)); + Assert.AreEqual(CryptoOffloadReason.None, CryptoExecutionPolicy.Signing(true)); + Assert.AreEqual(CryptoOffloadReason.ExternalPrivateKey, CryptoExecutionPolicy.Signing(false)); + Assert.AreEqual(Environment.ProcessorCount * 4, CryptoExecutionPolicy.HandshakeConcurrencyLimit(Environment.ProcessorCount)); + int calls = 0; + CryptoExecutionPolicy.Run(CryptoOffloadReason.OnlineRevocation, () => calls++); + Assert.AreEqual(1, calls); + } + + private static byte[] HandshakeRecord(byte type) + { + return [22, 3, 3, 0, 4, type, 0, 0, 0]; + } + + private static void AssertAlert(TlsOutput output, byte description) + { + Assert.AreEqual(7, output.Bytes.Length); + Assert.AreEqual(21, output.Bytes[0]); + Assert.AreEqual(2, output.Bytes[5]); + Assert.AreEqual(description, output.Bytes[6]); + } +} diff --git a/tests/Titanium.Tls.Tests/FingerprintProfileTests.cs b/tests/Titanium.Tls.Tests/FingerprintProfileTests.cs new file mode 100644 index 000000000..309338ee1 --- /dev/null +++ b/tests/Titanium.Tls.Tests/FingerprintProfileTests.cs @@ -0,0 +1,411 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO; +using System.IO.Compression; +using System.Linq; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class FingerprintProfileTests +{ + [TestMethod] + public void Ja3AndJa4MatchThePublishedExamples() + { + Assert.AreEqual("ada70206e40642a3e4461f35503241d5", Ja3.Hash("769,47-53-5-10-49161-49162-49171-49172-50-56-19-4,0-10-11,23-24-25,0")); + Assert.AreEqual("de350869b8c85de67a350c8d186f11e6", Ja3.Hash("769,4-5-10-9-100-98-3-6-19-18-99,,,")); + Assert.AreEqual("8daaf6152771", Ja4.CipherHash("002f,0035,009c,009d,1301,1302,1303,c013,c014,c02b,c02c,c02f,c030,cca8,cca9")); + Assert.AreEqual("e5627efa2ab1", Ja4.ExtensionHash("0005,000a,000b,000d,0012,0015,0017,001b,0023,002b,002d,0033,4469,ff01_0403,0804,0401,0503,0805,0501,0806,0601")); + Assert.AreEqual("6d807ffa2a79", Ja4.ExtensionHash("0005,000a,000b,000d,0012,0015,0017,001b,0023,002b,002d,0033,4469,ff01")); + } + + [TestMethod] + public void GeneratedChromeHellosMatchTheCapturedShape() + { + byte[] captured = File.ReadAllBytes(Find("hello-001.bin")); + string ja4 = Ja4.Fingerprint(captured); + string ja3Fields = Ja3.Describe(captured); + var profile = new ChromeFingerprintProfile(new SystemEntropy(), TlsFingerprintFidelity.Full); + var seen = new int[17, 17]; + var middle = new HashSet(); + for (int i = 0; i < 1000; i++) + { + byte[] hello = Build(profile, ChromeContext()); + Assert.AreEqual(ja4, Ja4.Fingerprint(hello), i.ToString()); + AssertSameSets(ja3Fields, Ja3.Describe(hello)); + ushort[] types = ExtensionTypes(hello); + Assert.AreEqual(19, types.Length); + Assert.IsTrue(Grease.IsGrease(types[0])); + Assert.IsTrue(Grease.IsGrease(types[^1])); + Assert.AreNotEqual(types[0], types[^1]); + AssertSameGrease(hello); + for (int slot = 0; slot < 17; slot++) + { + middle.Add(types[slot + 1]); + seen[Index(types[slot + 1]), slot]++; + } + } + + Assert.AreEqual(17, middle.Count); + for (int extension = 0; extension < 17; extension++) + { + for (int slot = 0; slot < 17; slot++) + { + Assert.IsTrue(seen[extension, slot] > 0, extension + ":" + slot); + } + } + } + + [TestMethod] + public void ConstantExtensionBodiesMatchTheCapture() + { + byte[] captured = File.ReadAllBytes(Find("hello-001.bin")); + byte[] generated = Build(new ChromeFingerprintProfile(new CountingEntropy(), TlsFingerprintFidelity.Full), ChromeContext()); + ChromeHelloInvariants.AssertMatch(captured, generated); + } + + [TestMethod] + public void HelloRetryRequestKeepsExtensionOrder() + { + var profile = new ChromeFingerprintProfile(new CountingEntropy(), TlsFingerprintFidelity.Full); + ClientHelloContext firstContext = ChromeContext(); + byte[] first = Build(profile, firstContext); + var secondContext = ChromeContext(); + secondContext.HelloRetryState = firstContext.HelloRetryState; + byte[] second = Build(profile, secondContext); + CollectionAssert.AreEqual(ExtensionTypes(first), ExtensionTypes(second)); + // RFC 8446 section 4.1.2: the retry keeps the random and the legacy session id. + CollectionAssert.AreEqual(first.AsSpan(11, 32).ToArray(), second.AsSpan(11, 32).ToArray()); + CollectionAssert.AreEqual(first.AsSpan(43, 33).ToArray(), second.AsSpan(43, 33).ToArray()); + } + + [TestMethod] + public void ResumedHelloPutsPreSharedKeyLast() + { + var profile = new ChromeFingerprintProfile(new CountingEntropy(), TlsFingerprintFidelity.Full); + byte[] hello = Build(profile, ChromeContext(resume: true)); + ushort[] types = ExtensionTypes(hello); + Assert.AreEqual(ExtensionType.PreSharedKey, types[^1]); + Assert.IsTrue(Grease.IsGrease(types[^2])); + } + + [TestMethod] + public void ReducedFidelityOmitsTheHybridShare() + { + var profile = new ChromeFingerprintProfile(new CountingEntropy(), TlsFingerprintFidelity.ReducedNoPostQuantum); + byte[] hello = Build(profile, new ClientHelloContext + { + ServerName = "localhost", + KeyShares = new Dictionary { [0x001D] = new byte[32] }, + }); + Assert.IsFalse(JaHello.ReadList16(ExtensionBody(hello, ExtensionType.SupportedGroups)).Contains((ushort)0x11EC)); + Assert.IsFalse(ExtensionBody(hello, ExtensionType.KeyShare).IndexOf(new byte[] { 0x11, 0xEC }) >= 0); + Assert.IsTrue(JaHello.ReadList16(ExtensionBody(hello, ExtensionType.SupportedGroups)).Contains((ushort)0x001D)); + } + + [TestMethod] + public void SyntheticTemplatesCoverOrderGreasePaddingAndRecords() + { + var fixedProfile = new TemplateFingerprintProfile(Sample(ExtensionOrderPolicy.Fixed), new CountingEntropy()); + byte[] left = Build(fixedProfile, new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + byte[] right = Build(new TemplateFingerprintProfile(Sample(ExtensionOrderPolicy.Fixed), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + CollectionAssert.AreEqual(ExtensionTypes(left), ExtensionTypes(right)); + + var grouped = new TemplateFingerprintProfile(Grouped(), new CountingEntropy()); + bool swapped = false; + for (int i = 0; i < 30; i++) + { + ushort[] types = ExtensionTypes(Build(grouped, new ClientHelloContext { KeyShares = Shares(0x001D, 32) })); + Assert.IsTrue(types[0] is 1 or 2); + Assert.IsTrue(types[1] is 1 or 2); + Assert.IsTrue(types[2] is 3 or 4); + Assert.IsTrue(types[3] is 3 or 4); + swapped |= types[0] == 2; + } + + Assert.IsTrue(swapped); + byte[] plain = Build(new TemplateFingerprintProfile(Sample(grease: false), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + foreach (ushort extension in ExtensionTypes(plain)) + { + Assert.IsFalse(Grease.IsGrease(extension)); + } + + byte[] padded = Build(new TemplateFingerprintProfile(Sample(padding: PaddingPolicy.PadToLength, target: 200), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + Assert.IsTrue(padded.Length >= 200); + Assert.IsTrue(ExtensionTypes(padded).Contains(ExtensionType.Padding)); + byte[] unpadded = Build(new TemplateFingerprintProfile(Sample(padding: PaddingPolicy.PadWithinBand, target: 200, bandMin: 400, bandMax: 500), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + Assert.IsFalse(ExtensionTypes(unpadded).Contains(ExtensionType.Padding)); + + byte[] split = Build(new TemplateFingerprintProfile(Sample(split: true), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32) }); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(split, out ReadOnlySpan firstRecord, out _, out _)); + ReadOnlySpan rest = split.AsSpan(5 + firstRecord.Length); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(rest, out ReadOnlySpan secondRecord, out _, out _)); + var reassembler = new HandshakeReassembler(); + Assert.IsTrue(reassembler.TryAppend(firstRecord, out _)); + Assert.IsTrue(reassembler.TryAppend(secondRecord, out _)); + var body = new byte[split.Length]; + Assert.IsTrue(reassembler.TryTake(body, out HandshakeType messageType, out int length, out bool needMore, out _)); + Assert.AreEqual(HandshakeType.ClientHello, messageType); + Assert.IsFalse(needMore); + Assert.IsTrue(length > 0); + + byte[] opaque = Build(new TemplateFingerprintProfile(Opaque(), new CountingEntropy()), new ClientHelloContext { KeyShares = Shares(0x001D, 32, 0x0017, 65) }); + CollectionAssert.AreEqual(new byte[] { 0x00, 0x01 }, ExtensionBody(opaque, 28).ToArray()); + Assert.IsTrue(JaHello.ReadList16(ExtensionBody(opaque, ExtensionType.KeyShare)).Count >= 0); + Assert.IsTrue(ExtensionBody(opaque, ExtensionType.KeyShare).IndexOf(new byte[] { 0x00, 0x1D }) >= 0); + Assert.IsTrue(ExtensionBody(opaque, ExtensionType.KeyShare).IndexOf(new byte[] { 0x00, 0x17 }) >= 0); + } + + [TestMethod] + public void ImplementedTls12CipherIsRejected() + { + ClientHelloTemplate template = Sample(); + template.Ciphers[0] = new AdvertisedCode(0xC02B, implemented: true); + Assert.ThrowsException(() => new TemplateFingerprintProfile(template).BuildClientHello(new ClientHelloContext(), new ArrayBufferWriter())); + } + + [TestMethod] + public void ProductCodeOutsideTheChromeProfileDoesNotNameChrome() + { + foreach (string file in Directory.GetFiles(FindSource(), "*.cs", SearchOption.AllDirectories)) + { + if (file.Contains(Path.Combine("Fingerprint", "Profiles"), StringComparison.OrdinalIgnoreCase)) + { + continue; + } + + string text = File.ReadAllText(file); + Assert.IsFalse(text.Contains("Chrome", StringComparison.Ordinal), file); + } + } + + private static void AssertSameGrease(byte[] hello) + { + ReadOnlySpan groups = ExtensionBody(hello, ExtensionType.SupportedGroups); + ReadOnlySpan shares = ExtensionBody(hello, ExtensionType.KeyShare); + ushort groupGrease = JaHello.ReadU16(groups, 2); + ushort shareGrease = JaHello.ReadU16(shares, 2); + Assert.IsTrue(Grease.IsGrease(shareGrease)); + Assert.AreEqual(groupGrease, shareGrease); + } + + private static void AssertSameSets(string captured, string generated) + { + string[] left = captured.Split(','); + string[] right = generated.Split(','); + Assert.IsTrue(SameSet(left[1], right[1])); + Assert.IsTrue(SameSet(left[3], right[3])); + Assert.IsTrue(SameSet(left[4], right[4])); + } + + private static bool SameSet(string left, string right) + { + string[] a = left.Length == 0 ? [] : left.Split('-'); + string[] b = right.Length == 0 ? [] : right.Split('-'); + Array.Sort(a, StringComparer.Ordinal); + Array.Sort(b, StringComparer.Ordinal); + return a.AsSpan().SequenceEqual(b); + } + + private static int Index(ushort type) + { + ushort[] order = + [ + ExtensionType.ExtendedMasterSecret, ExtensionType.ApplicationSettings, ExtensionType.ApplicationLayerProtocolNegotiation, + ExtensionType.SupportedVersions, ExtensionType.KeyShare, ExtensionType.SessionTicket, ExtensionType.SignedCertificateTimestamp, + ExtensionType.SignatureAlgorithms, ExtensionType.RenegotiationInfo, ExtensionType.ServerName, ExtensionType.PskKeyExchangeModes, + ExtensionType.CompressCertificate, ExtensionType.StatusRequest, ExtensionType.SupportedGroups, ExtensionType.EncryptedClientHello, + 0xCA34, ExtensionType.EcPointFormats, + ]; + return Array.IndexOf(order, type); + } + + private static ClientHelloContext ChromeContext(bool resume = false) + { + return new ClientHelloContext + { + ServerName = "localhost", + KeyShares = Shares(0x11EC, 1216, 0x001D, 32), + SessionTicket = resume ? [1, 2, 3, 4] : null, + PskBinder = resume ? new byte[32] : null, + }; + } + + private static Dictionary Shares(ushort group, int length, ushort group2 = 0, int length2 = 0) + { + var shares = new Dictionary { [group] = new byte[length] }; + if (length2 > 0) + { + shares[group2] = new byte[length2]; + } + + return shares; + } + + private static byte[] Build(TlsFingerprintProfile profile, ClientHelloContext context) + { + var writer = new ArrayBufferWriter(); + profile.BuildClientHello(context, writer); + return writer.WrittenSpan.ToArray(); + } + + private static ReadOnlySpan Payload(byte[] record) + { + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(record, out ReadOnlySpan payload, out _, out _)); + return payload; + } + + private static ushort[] ExtensionTypes(byte[] record) + { + Assert.IsTrue(HandshakeMessages.TryReadClientHello(Payload(record), out ClientHelloView hello, out HandshakeAlert alert), alert.ToString()); + var types = new List(); + JaHello.Walk(hello.Extensions, (type, _) => types.Add(type)); + return types.ToArray(); + } + + private static ReadOnlySpan ExtensionBody(byte[] record, ushort wanted) + { + Assert.IsTrue(HandshakeMessages.TryReadClientHello(Payload(record), out ClientHelloView hello, out _)); + var reader = new TlsReader(hello.Extensions); + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (type == wanted) + { + return body; + } + } + + return default; + } + + private static ClientHelloTemplate Sample(ExtensionOrderPolicy order = ExtensionOrderPolicy.Fixed, PaddingPolicy padding = PaddingPolicy.None, int target = 0, int bandMin = 0, int bandMax = 0, bool split = false, bool grease = false) + { + return new ClientHelloTemplate + { + Name = "sample", + Version = "0", + Order = order, + Padding = padding, + PaddingTarget = target, + PaddingBandMin = bandMin, + PaddingBandMax = bandMax, + SplitAcrossRecords = split, + ExtensionGreaseValuesDiffer = grease, + Ciphers = grease ? [new AdvertisedCode(0, grease: true), new AdvertisedCode(0x1301, implemented: true)] : [new AdvertisedCode(0x1301, implemented: true)], + Groups = [new AdvertisedCode(0x001D, implemented: true)], + Versions = [new AdvertisedCode(0x0304, implemented: true)], + SignatureAlgorithms = [], + KeyShares = [new KeyShareSlot(0x001D, 32)], + ApplicationProtocols = ["h2"], + Extensions = + [ + new ExtensionSpec { Type = ExtensionType.ServerName, Kind = ExtensionKind.ServerName, Implemented = true, Fixed = true }, + new ExtensionSpec { Type = ExtensionType.KeyShare, Kind = ExtensionKind.KeyShare, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.SupportedVersions, Kind = ExtensionKind.Versions, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.SupportedGroups, Kind = ExtensionKind.NamedGroups, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.Padding, Kind = ExtensionKind.Padding, Implemented = true }, + ], + }; + } + + private static ClientHelloTemplate Grouped() + { + ClientHelloTemplate template = Sample(ExtensionOrderPolicy.Groups); + template.Extensions = + [ + new ExtensionSpec { Type = 1, Kind = ExtensionKind.Empty, PermuteGroup = 0 }, + new ExtensionSpec { Type = 2, Kind = ExtensionKind.Empty, PermuteGroup = 0 }, + new ExtensionSpec { Type = 3, Kind = ExtensionKind.Empty, PermuteGroup = 1 }, + new ExtensionSpec { Type = 4, Kind = ExtensionKind.Empty, PermuteGroup = 1 }, + new ExtensionSpec { Type = ExtensionType.KeyShare, Kind = ExtensionKind.KeyShare, Implemented = true, Fixed = true }, + new ExtensionSpec { Type = ExtensionType.SupportedVersions, Kind = ExtensionKind.Versions, Implemented = true, Fixed = true }, + ]; + return template; + } + + private static ClientHelloTemplate Opaque() + { + ClientHelloTemplate template = Sample(); + template.KeyShares = [new KeyShareSlot(0x001D, 32), new KeyShareSlot(0x0017, 65)]; + template.Extensions = + [ + new ExtensionSpec { Type = 28, Kind = ExtensionKind.Constant, ConstantBody = [0x00, 0x01] }, + new ExtensionSpec { Type = ExtensionType.KeyShare, Kind = ExtensionKind.KeyShare, Implemented = true }, + new ExtensionSpec { Type = ExtensionType.SupportedVersions, Kind = ExtensionKind.Versions, Implemented = true }, + ]; + return template; + } + + private static string Find(string name) + { + DirectoryInfo? directory = new(AppContext.BaseDirectory); + while (directory is not null) + { + string candidate = Path.Combine(directory.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", "captures", "chrome", "158.0.8127.89", "tcp", name); + if (File.Exists(candidate)) + { + return candidate; + } + + directory = directory.Parent; + } + + throw new FileNotFoundException(name); + } + + private static string FindSource() + { + DirectoryInfo? directory = new(AppContext.BaseDirectory); + while (directory is not null) + { + string candidate = Path.Combine(directory.FullName, "src", "Titanium.Tls"); + if (Directory.Exists(candidate)) + { + return candidate; + } + + directory = directory.Parent; + } + + throw new DirectoryNotFoundException("Titanium.Tls"); + } +} + +[TestClass] +public sealed class CertificateCompressionTests +{ + [TestMethod] + public void BrotliRoundTripRejectsAMismatchAndATruncatedInput() + { + byte[] plain = Encoding.ASCII.GetBytes("certificate-bytes"); + var compressed = new byte[64]; + Assert.IsTrue(BrotliEncoder.TryCompress(plain, compressed, out int written)); + compressed = compressed[..written]; + var output = new byte[plain.Length]; + Assert.IsTrue(CertificateCompression.TryDecompress(CertificateCompression.Brotli, compressed, plain.Length, 131072, output, out int decoded, out _)); + Assert.AreEqual(plain.Length, decoded); + CollectionAssert.AreEqual(plain, output); + Assert.IsFalse(CertificateCompression.TryDecompress(CertificateCompression.Brotli, compressed, plain.Length + 1, 131072, new byte[plain.Length + 1], out _, out HandshakeAlert mismatch)); + Assert.AreEqual(HandshakeAlert.DecodeError, mismatch); + Assert.IsFalse(CertificateCompression.TryDecompress(CertificateCompression.Brotli, compressed, plain.Length, plain.Length - 1, output, out _, out _)); + Assert.IsFalse(CertificateCompression.TryDecompress(CertificateCompression.Brotli, compressed[..^1], plain.Length, 131072, output, out _, out _)); + } +} + +internal sealed class CountingEntropy : IEntropySource +{ + private byte _value = 1; + + public void Fill(Span destination) + { + for (int i = 0; i < destination.Length; i++) + { + destination[i] = _value; + _value = (byte)(_value == 255 ? 1 : _value + 1); + } + } +} diff --git a/tests/Titanium.Tls.Tests/FinishedTimingTests.cs b/tests/Titanium.Tls.Tests/FinishedTimingTests.cs new file mode 100644 index 000000000..e33da6dca --- /dev/null +++ b/tests/Titanium.Tls.Tests/FinishedTimingTests.cs @@ -0,0 +1,46 @@ +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class FinishedTimingTests +{ + [TestMethod] + [TestCategory("TimingSideChannel")] + public void EqualAndUnequalFinishedPrefixesTakeTheSameShape() + { + byte[] left = new byte[32]; + byte[] right = new byte[32]; + left.AsSpan().Fill(0xA5); + left.AsSpan().CopyTo(right); + byte[] early = (byte[])right.Clone(); + early[0] ^= 0xFF; + const int iterations = 4000; + long equal = Time(left, right, iterations); + long unequal = Time(left, early, iterations); + long slower = Math.Max(equal, unequal); + long faster = Math.Max(1, Math.Min(equal, unequal)); + Assert.IsTrue(slower < faster * 5, equal + " vs " + unequal); + } + + private static long Time(byte[] left, byte[] right, int iterations) + { + bool match = CryptographicOperations.FixedTimeEquals(left, right); + var watch = Stopwatch.StartNew(); + int ones = 0; + for (int i = 0; i < iterations; i++) + { + if (CryptographicOperations.FixedTimeEquals(left, right) == match) + { + ones++; + } + } + + watch.Stop(); + Assert.AreEqual(iterations, ones); + return watch.ElapsedTicks; + } +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/MANIFEST.md b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/MANIFEST.md new file mode 100644 index 000000000..61c4d682e --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/MANIFEST.md @@ -0,0 +1,7 @@ +Chrome 158.0.8127.89 on Windows x64, captured 26 November 2026. + +These files are the first TLS record Chrome sent to `https://localhost/` from a fresh profile. They contain a ClientHello: random bytes and public key shares only. There are no private keys, cookies, or session secrets. + +`tcp/hello-001.bin` through `tcp/hello-050.bin` are the 50 TCP captures. QUIC Initial datagrams are not in this set: with `--enable-quic` and `--origin-to-force-quic-on`, Chrome sent no UDP datagram to the loopback listener. + +Regenerate with `tools/managed-stack/Capture-ClientHello.ps1`. Summarize with `tools/managed-stack/Summarize-ClientHello.ps1`. diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-001.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-001.bin new file mode 100644 index 000000000..04e34f59e Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-001.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-002.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-002.bin new file mode 100644 index 000000000..088603630 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-002.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-003.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-003.bin new file mode 100644 index 000000000..0bd8736bd Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-003.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-004.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-004.bin new file mode 100644 index 000000000..6eeb3a897 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-004.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-005.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-005.bin new file mode 100644 index 000000000..5d5da8db4 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-005.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-006.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-006.bin new file mode 100644 index 000000000..542a8d42f Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-006.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-007.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-007.bin new file mode 100644 index 000000000..30fe044df Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-007.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-008.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-008.bin new file mode 100644 index 000000000..a70bd85c7 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-008.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-009.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-009.bin new file mode 100644 index 000000000..3969e21ce Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-009.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-010.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-010.bin new file mode 100644 index 000000000..2abf7e8ef Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-010.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-011.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-011.bin new file mode 100644 index 000000000..dc944b719 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-011.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-012.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-012.bin new file mode 100644 index 000000000..2150d70e2 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-012.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-013.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-013.bin new file mode 100644 index 000000000..c4a33a0f2 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-013.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-014.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-014.bin new file mode 100644 index 000000000..9203ff8a7 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-014.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-015.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-015.bin new file mode 100644 index 000000000..e8cbe022e Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-015.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-016.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-016.bin new file mode 100644 index 000000000..558c90a9d Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-016.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-017.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-017.bin new file mode 100644 index 000000000..f27199c3f Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-017.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-018.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-018.bin new file mode 100644 index 000000000..ce9270d10 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-018.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-019.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-019.bin new file mode 100644 index 000000000..776c18e66 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-019.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-020.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-020.bin new file mode 100644 index 000000000..d9e1d35f2 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-020.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-021.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-021.bin new file mode 100644 index 000000000..c2681fd79 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-021.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-022.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-022.bin new file mode 100644 index 000000000..d67222704 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-022.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-023.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-023.bin new file mode 100644 index 000000000..2bcef0345 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-023.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-024.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-024.bin new file mode 100644 index 000000000..1207687fe Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-024.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-025.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-025.bin new file mode 100644 index 000000000..64b56ec93 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-025.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-026.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-026.bin new file mode 100644 index 000000000..e64113953 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-026.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-027.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-027.bin new file mode 100644 index 000000000..b87b26949 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-027.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-028.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-028.bin new file mode 100644 index 000000000..a554864e9 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-028.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-029.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-029.bin new file mode 100644 index 000000000..e97a27085 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-029.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-030.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-030.bin new file mode 100644 index 000000000..c34e509f6 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-030.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-031.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-031.bin new file mode 100644 index 000000000..a3ca3529a Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-031.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-032.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-032.bin new file mode 100644 index 000000000..540647f57 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-032.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-033.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-033.bin new file mode 100644 index 000000000..ed8cce0f7 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-033.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-034.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-034.bin new file mode 100644 index 000000000..e439d5d4f Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-034.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-035.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-035.bin new file mode 100644 index 000000000..e4dc47e60 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-035.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-036.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-036.bin new file mode 100644 index 000000000..60e8d039e Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-036.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-037.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-037.bin new file mode 100644 index 000000000..535c59622 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-037.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-038.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-038.bin new file mode 100644 index 000000000..d00f7c71f Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-038.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-039.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-039.bin new file mode 100644 index 000000000..db8aff66f Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-039.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-040.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-040.bin new file mode 100644 index 000000000..408b21e16 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-040.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-041.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-041.bin new file mode 100644 index 000000000..efbecbdfd Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-041.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-042.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-042.bin new file mode 100644 index 000000000..1632b6c0a Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-042.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-043.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-043.bin new file mode 100644 index 000000000..059953c11 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-043.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-044.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-044.bin new file mode 100644 index 000000000..4a75ff9d4 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-044.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-045.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-045.bin new file mode 100644 index 000000000..63bcdf3c9 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-045.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-046.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-046.bin new file mode 100644 index 000000000..2b8d34a06 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-046.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-047.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-047.bin new file mode 100644 index 000000000..403a798bc Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-047.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-048.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-048.bin new file mode 100644 index 000000000..8ac641782 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-048.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-049.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-049.bin new file mode 100644 index 000000000..ecb99d699 Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-049.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-050.bin b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-050.bin new file mode 100644 index 000000000..f71f80abb Binary files /dev/null and b/tests/Titanium.Tls.Tests/Fixtures/captures/chrome/158.0.8127.89/tcp/hello-050.bin differ diff --git a/tests/Titanium.Tls.Tests/Fixtures/rfc8032-ed25519-1024.txt b/tests/Titanium.Tls.Tests/Fixtures/rfc8032-ed25519-1024.txt new file mode 100644 index 000000000..9137f1074 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/rfc8032-ed25519-1024.txt @@ -0,0 +1,3 @@ +PUBLIC 278117fc144c72340f67d0f2316e8386ceffbf2b2428c9c51fef7c597f1d426e +MESSAGE 08b8b2b733424243760fe426a4b54908632110a66c2f6591eabd3345e3e4eb98fa6e264bf09efe12ee50f8f54e9f77b1e355f6c50544e23fb1433ddf73be84d879de7c0046dc4996d9e773f4bc9efe5738829adb26c81b37c93a1b270b20329d658675fc6ea534e0810a4432826bf58c941efb65d57a338bbd2e26640f89ffbc1a858efcb8550ee3a5e1998bd177e93a7363c344fe6b199ee5d02e82d522c4feba15452f80288a821a579116ec6dad2b3b310da903401aa62100ab5d1a36553e06203b33890cc9b832f79ef80560ccb9a39ce767967ed628c6ad573cb116dbefefd75499da96bd68a8a97b928a8bbc103b6621fcde2beca1231d206be6cd9ec7aff6f6c94fcd7204ed3455c68c83f4a41da4af2b74ef5c53f1d8ac70bdcb7ed185ce81bd84359d44254d95629e9855a94a7c1958d1f8ada5d0532ed8a5aa3fb2d17ba70eb6248e594e1a2297acbbb39d502f1a8c6eb6f1ce22b3de1a1f40cc24554119a831a9aad6079cad88425de6bde1a9187ebb6092cf67bf2b13fd65f27088d78b7e883c8759d2c4f5c65adb7553878ad575f9fad878e80a0c9ba63bcbcc2732e69485bbc9c90bfbd62481d9089beccf80cfe2df16a2cf65bd92dd597b0707e0917af48bbb75fed413d238f5555a7a569d80c3414a8d0859dc65a46128bab27af87a71314f318c782b23ebfe808b82b0ce26401d2e22f04d83d1255dc51addd3b75a2b1ae0784504df543af8969be3ea7082ff7fc9888c144da2af58429ec96031dbcad3dad9af0dcbaaaf268cb8fcffead94f3c7ca495e056a9b47acdb751fb73e666c6c655ade8297297d07ad1ba5e43f1bca32301651339e22904cc8c42f58c30c04aafdb038dda0847dd988dcda6f3bfd15c4b4c4525004aa06eeff8ca61783aacec57fb3d1f92b0fe2fd1a85f6724517b65e614ad6808d6f6ee34dff7310fdc82aebfd904b01e1dc54b2927094b2db68d6f903b68401adebf5a7e08d78ff4ef5d63653a65040cf9bfd4aca7984a74d37145986780fc0b16ac451649de6188a7dbdf191f64b5fc5e2ab47b57f7f7276cd419c17a3ca8e1b939ae49e488acba6b965610b5480109c8b17b80e1b7b750dfc7598d5d5011fd2dcc5600a32ef5b52a1ecc820e308aa342721aac0943bf6686b64b2579376504ccc493d97e6aed3fb0f9cd71a43dd497f01f17c0e2cb3797aa2a2f256656168e6c496afc5fb93246f6b1116398a346f1a641f3b041e989f7914f90cc2c7fff357876e506b50d334ba77c225bc307ba537152f3f1610e4eafe595f6d9d90d11faa933a15ef1369546868a7f3a45a96768d40fd9d03412c091c6315cf4fde7cb68606937380db2eaaa707b4c4185c32eddcdd306705e4dc1ffc872eeee475a64dfac86aba41c0618983f8741c5ef68d3a101e8a3b8cac60c905c15fc910840b94c00a0b9d0 +SIGNATURE 0aab4c900501b3e24d7cdf4663326a3a87df5e4843b2cbdb67cbf6e460fec350aa5371b1508f9f4528ecea23c436d94b5e8fcd4f681e30a6ac00a9704a188a03 diff --git a/tests/Titanium.Tls.Tests/Fixtures/rfc8448-server-handshake.hex b/tests/Titanium.Tls.Tests/Fixtures/rfc8448-server-handshake.hex new file mode 100644 index 000000000..a837ce031 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/rfc8448-server-handshake.hex @@ -0,0 +1 @@ +080000240022000a00140012001d00170018001901000101010201030104001c00024001000000000b0001b9000001b50001b0308201ac30820115a003020102020102300d06092a864886f70d01010b0500300e310c300a06035504031303727361301e170d3136303733303031323335395a170d3236303733303031323335395a300e310c300a0603550403130372736130819f300d06092a864886f70d010101050003818d0030818902818100b4bb498f8279303d980836399b36c6988c0c68de55e1bdb826d3901a2461eafd2de49a91d015abbc9a95137ace6c1af19eaa6af98c7ced43120998e187a80ee0ccb0524b1b018c3e0b63264d449a6d38e22a5fda430846748030530ef0461c8ca9d9efbfae8ea6d1d03e2bd193eff0ab9a8002c47428a6d35a8d88d79f7f1e3f0203010001a31a301830090603551d1304023000300b0603551d0f0404030205a0300d06092a864886f70d01010b05000381810085aad2a0e5b9276b908c65f73a7267170618a54c5f8a7b337d2df7a594365417f2eae8f8a58c8f8172f9319cf36b7fd6c55b80f21a03015156726096fd335e5e67f2dbf102702e608ccae6bec1fc63a42a99be5c3eb7107c3c54e9b9eb2bd5203b1c3b84e0a8b2f759409ba3eac9d91d402dcc0cc8f8961229ac9187b42b4de100000f000084080400805a747c5d88fa9bd2e55ab085a61015b7211f824cd484145ab3ff52f1fda8477b0b7abc90db78e2d33a5c141a078653fa6bef780c5ea248eeaaa785c4f394cab6d30bbe8d4859ee511f602957b15411ac027671459e46445c9ea58c181e818e95b8c3fb0bf3278409d3be152a3da5043e063dda65cdf5aea20d53dfacd42f74f3140000209b9b141d906337fbd2cbdce71df4deda4ab42c309572cb7fffee5454b78f0718 \ No newline at end of file diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/aes_gcm_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/aes_gcm_test.json new file mode 100644 index 000000000..223f53cad --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/aes_gcm_test.json @@ -0,0 +1,5018 @@ +{ + "algorithm": "AES-GCM", + "schema": "aead_test_schema_v1.json", + "numberOfTests": 316, + "header": [ + "Test vectors of type AeadTest test authenticated encryption with additional data.", + "The test vectors are intended for testing both encryption and decryption.", + "Test vectors with \"result\" : \"valid\" are valid encryptions.", + "Test vectors with \"result\" : \"invalid\" are using invalid parameters", + "or contain an invalid ciphertext or tag." + ], + "notes": { + "CounterWrap": { + "bugType": "AUTH_BYPASS", + "description": "The counter for GCM is reduced modulo 2**32. This test vector contains values such that the GCM counter wraps around.", + "effect": "When the size of the IV is not 12 bytes then detecting incorrect encryptions leaks the information that the GHASH of the IV was close to a multiple of 2**32. Combining this information from multiple incorrect encryptions allows to recover the authentication key." + }, + "Ktv": { + "bugType": "BASIC", + "description": "Known test vector." + }, + "LongIv": { + "bugType": "FUNCTIONALITY", + "description": "GCM allows long IVs. Such IVs are compressed using GHASH to generate the CTR values. Some implementations restrict the range of the IV sizes.", + "effect": "If IV sizes other than 12 bytes are supported then the correctness of the implementation is critical. An incorrect implementation of long IVs can (and probably does) leak the authentication key." + }, + "ModifiedTag": { + "bugType": "AUTH_BYPASS", + "description": "The test vector contains a ciphertext with a modified tag. The test vector was obtained by manipulating a valid ciphertext. The purpose of the test is to check whether the verification fully checks the tag.", + "effect": "Failing to fully verify a tag reduces the security level of an encryption." + }, + "Pseudorandom": { + "bugType": "FUNCTIONALITY", + "description": "The test vector contains pseudorandomly generated inputs. The goal of the test vector is to check the correctness of the implementation for various sizes of the input parameters. Some libraries do not support all the parameter sizes. In particular the size of the IV is often restricted." + }, + "SmallIv": { + "bugType": "WEAK_PARAMS", + "description": "GCM leaks the authentication key if the same IV is used twice. Hence short IV sizes are typically discouraged or generated with a special construction such as the one described in Section 8.2 of NIST SP 800-38d. Some libraries may reject small IV sizes." + }, + "SpecialCase": { + "bugType": "EDGE_CASE", + "description": "The test vector contains special cases for iv and tag." + }, + "ZeroLengthIv": { + "bugType": "AUTH_BYPASS", + "description": "GCM does not allow an IV of length 0. Encrypting with an IV of length 0 leaks the authentication key. Hence using an IV of length 0 is insecure even if the key itself is only used for a single encryption.", + "cves": [ + "CVE-2017-7822" + ] + } + }, + "testGroups": [ + { + "ivSize": 96, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 1, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "5b9604fe14eadba931b0ccf34843dab9", + "iv": "028318abc1824029138141a2", + "aad": "", + "msg": "001d0c231287c1182784554ca3a21908", + "ct": "26073cc1d851beff176384dc9896d5ff", + "tag": "0a3ea7a5487cb5f7d70fb6c58d038554", + "result": "valid" + }, + { + "tcId": 2, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "5b9604fe14eadba931b0ccf34843dab9", + "iv": "921d2507fa8007b7bd067d34", + "aad": "00112233445566778899aabbccddeeff", + "msg": "001d0c231287c1182784554ca3a21908", + "ct": "49d8b9783e911913d87094d1f63cc765", + "tag": "1e348ba07cca2cf04c618cb4d43a5b92", + "result": "valid" + }, + { + "tcId": 3, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "aa023d0478dcb2b2312498293d9a9129", + "iv": "0432bc49ac34412081288127", + "aad": "aac39231129872a2", + "msg": "2035af313d1346ab00154fea78322105", + "ct": "eea945f3d0f98cc0fbab472a0cf24e87", + "tag": "4bb9b4812519dadf9e1232016d068133", + "result": "valid" + }, + { + "tcId": 4, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bedcfb5a011ebc84600fcb296c15af0d", + "iv": "438a547a94ea88dce46c6c85", + "aad": "", + "msg": "", + "ct": "", + "tag": "960247ba5cde02e41a313c4c0136edc3", + "result": "valid" + }, + { + "tcId": 5, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "384ea416ac3c2f51a76e7d8226346d4e", + "iv": "b30c084727ad1c592ac21d12", + "aad": "", + "msg": "35", + "ct": "54", + "tag": "7c1e4ae88bb27e5638343cb9fd3f6337", + "result": "valid" + }, + { + "tcId": 6, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cae31cd9f55526eb038241fc44cac1e5", + "iv": "b5e006ded553110e6dc56529", + "aad": "", + "msg": "d10989f2c52e94ad", + "ct": "a036ead03193903f", + "tag": "3b626940e0e9f0cbea8e18c437fd6011", + "result": "valid" + }, + { + "tcId": 7, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "dd6197cd63c963919cf0c273ef6b28bf", + "iv": "ecb0c42f7000ef0e6f95f24d", + "aad": "", + "msg": "4dcc1485365866e25ac3f2ca6aba97", + "ct": "8a9992388e735f80ee18f4a63c10ad", + "tag": "1486a91cccf92c9a5b00f7b0e034891c", + "result": "valid" + }, + { + "tcId": 8, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ffdf4228361ea1f8165852136b3480f7", + "iv": "0e1666f2dc652f7708fb8f0d", + "aad": "", + "msg": "25b12e28ac0ef6ead0226a3b2288c800", + "ct": "f7bd379d130477176b8bb3cb23dbbbaa", + "tag": "1ee6513ce30c7873f59dd4350a588f42", + "result": "valid" + }, + { + "tcId": 9, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c15ed227dd2e237ecd087eaaaad19ea4", + "iv": "965ff6643116ac1443a2dec7", + "aad": "", + "msg": "fee62fde973fe025ad6b322dcdf3c63fc7", + "ct": "0de51fe4f7f2d1f0f917569f5c6d1b009c", + "tag": "6cd8521422c0177e83ef1b7a845d97db", + "result": "valid" + }, + { + "tcId": 10, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a8ee11b26d7ceb7f17eaa1e4b83a2cf6", + "iv": "fbbc04fd6e025b7193eb57f6", + "aad": "", + "msg": "c08f085e6a9e0ef3636280c11ecfadf0c1e72919ffc17eaf", + "ct": "7cd9f4e4f365704fff3b9900aa93ba54b672bac554275650", + "tag": "f4eb193241226db017b32ec38ca47217", + "result": "valid" + }, + { + "tcId": 11, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "28ff3def08179311e2734c6d1c4e2871", + "iv": "32bcb9b569e3b852d37c766a", + "aad": "c3", + "msg": "dfc61a20df8505b53e3cd59f25770d5018add3d6", + "ct": "f58d453212c2c8a436e9283672f579f119122978", + "tag": "5901131d0760c8715901d881fdfd3bc0", + "result": "valid" + }, + { + "tcId": 12, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e63a43216c08867210e248859eb5e99c", + "iv": "9c3a4263d983456658aad4b1", + "aad": "834afdc5c737186b", + "msg": "b14da56b0462dc05b871fc815273ff4810f92f4b", + "ct": "bf864616c2347509ca9b10446379b9bdbb3b8f64", + "tag": "a97d25b490390b53c5db91f6ee2a15b8", + "result": "valid" + }, + { + "tcId": 13, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "38449890234eb8afab0bbf82e2385454", + "iv": "33e90658416e7c1a7c005f11", + "aad": "4020855c66ac4595058395f367201c4c", + "msg": "f762776bf83163b323ca63a6b3adeac1e1357262", + "ct": "a6f2ef3c7ef74a126dd2d5f6673964e27d5b34b6", + "tag": "b8bbdc4f5014bc752c8b4e9b87f650a3", + "result": "valid" + }, + { + "tcId": 14, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6a68671dfe323d419894381f85eb63fd", + "iv": "9f0d85b605711f34cd2a35ba", + "aad": "76eb5f147250fa3c12bff0a6e3934a0b16860cf11646773b", + "msg": "0fc67899c3f1bbe196d90f1eca3797389230aa37", + "ct": "bd64802cfebaeb487d3a8f76ce943a37b3472dd5", + "tag": "fce9a5b530c7d7af718be1ec0ae9ed4d", + "result": "valid" + }, + { + "tcId": 15, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bb571c160132b0c8d5d190d0bc356ddc", + "iv": "2596c440cf0232950ec66bc4", + "aad": "", + "msg": "053be1b6190a717fc74c879e6fd62dc44628495507e50d662271dee795a4ad26e0c4f86cb6b20ac6bd9d682d2d8a05c9dad875a6911b49ea0af4f17c97a5f2", + "ct": "b1cfad142a462f3656e0921627fd41d4f1fa8e2f8bd94bb51fdcf06f606296f7d2885337bed7a4ca6ddb4a9fc7fdb2476b5f7fa5220e1d6752a5e7c31c916c", + "tag": "a231b617352ffdb63d32d69d99e7d629", + "result": "valid" + }, + { + "tcId": 16, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e12260fcd355a51a0d01bb1f6fa538c2", + "iv": "5dfc37366f5688275147d3f9", + "aad": "", + "msg": "d902deeab175c008329a33bfaccd5c0eb3a6a152a1510e7db04fa0aff7ce4288530db6a80fa7fea582aa7d46d7d56e708d2bb0c5edd3d26648d336c3620ea55e", + "ct": "d33bf6722fc29384fad75f990248b9528e0959aa67ec66869dc3996c67a2d559e7d77ce5955f8cad2a4df5fdc3acccafa7bc0def53d848111256903e5add0420", + "tag": "8bc833de510863b4b432c3cbf45aa7cc", + "result": "valid" + }, + { + "tcId": 17, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "97ec85a69a05131cd4ff643972f6d8f9", + "iv": "9189e0eedcc413a0ba1e63d2", + "aad": "", + "msg": "10acefa6f3959faecb5cfdaee8aaf09d4381b2b147e0b13450c26ee07f29edaa9a1f1af4e2d111dea7ff681a19fc3a4fd66df6a17985b06543a3b6c0e4e51a54b7", + "ct": "eefdf89997244e065ff19ac2374dc92ee76899ddcbe7c834dcc657242fc0f6dd38272373ba9b549316a36f1522e1cab246157875898c966eec563d57eca5c7d32d", + "tag": "23aaa2c6b680fcaaeb2c7a55726d4bc0", + "result": "valid" + }, + { + "tcId": 18, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "65d38f0b268f180d6ba548d509111dde", + "iv": "e14dfc27394ac846c2373ea7", + "aad": "", + "msg": "1fa76d7995dc996a5f5dabaa4be401be14f4d4706a213a4dd725df386ec147a6be074947c733094f47a7222552376740aa8348a0ae1c7f2d972a0ad664f8b8ec81dfc9af078b61daea5dde874fd73775b4cd65acf069ada0b2b9bfbb4a9817ba41d4dcaff7653df5c8cd9ce7f59eec92ae9e61314e03ef48839810ea825520", + "ct": "40dc9b139e888f1811391134b15e914826414a99db512a0632dc4c56d70f7b7991e9945a2025890e951699cf6b2ccee093c9a6a752b98ff696240126759f480299c1dd82aa2c4f462a4a8ad1ad0c7a755f07908c9c0d336d57dbdebc940bbae28ba0336dccaf6bfdc93623686f9487ef0884d100b6b98949afbd4217dc4640", + "tag": "4218d6ac98c0444bc64ecbe1d763136a", + "result": "valid" + }, + { + "tcId": 19, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3c55f88e9faa0d68ab50d02b47161276", + "iv": "d767c48d2037b4bd2c231bbd", + "aad": "", + "msg": "5d6add48e7a5704e54f9c2829a9b4283dce0d3a65b133eba3793c4fbfa1d8e3a2539d0d4f3de381598ce5b2360173fbd149476c31692c5d6e872fce40219378949c2e70b5f1b9f0a1d5f38352ad814b2a035bb3f3f26425d831a2f7a5e65c5dfcd91a315c2b24f53a662605ea40857dd980e9be5cdad000c569f2d204d4bd3b0", + "ct": "17d72d90bd23e076d8364a87ecb9ac58acc5de4629bfd590409b8bf1fcd3a2f602731b4614cec15e773ea65a65e7210994256bf5450a25acb527269c065f2e2f2279d1fe8b3eda98dcf87b348f1528377bbdd258355d46e035330483d8097e80c7de9bbb606ddf723f2909217ffdd18e8bdbd7b08062f1dcba960e5c0d290f5f", + "tag": "090b8c2ec98e4116186d0e5fbefeb9c2", + "result": "valid" + }, + { + "tcId": 20, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "62b3881832d428b6f900cacfa0fc5cd8", + "iv": "f4cb98cc99e7bc424a98384e", + "aad": "", + "msg": "0b91dd36a6fa967a257b267d12cbc20b56ed615b205d044a04b4ae8aaa365bd29a3b8f47a0828ef63324d1ff924c68090abaaad78df602edee0621b823f94c35ada7b62d81f21dd9945d1abb4ef882cfab12c2e4cec705df3d669183fe681753503a99a871637953537ef479b1f62de7819dbb5c950de7722090942d38129aefa7", + "ct": "00574615883e222657bdf34e9327888f5d532d086581834c62adf54c7fee46927ca27cba193d86c6140b3610a2cd16ba295814b5b7d6a1c8d3f039e0e8f8d7942b0616a9b9f0012884311b0c370f9dd6b9a3d8b6ff36177683c0dd858850dd29993b3eec89a2ab8068038e2c86a2e71b5cacdb38ad69ac0580e29a6f7813c17258", + "tag": "88b99f768364ff9e95a94ccbbc1b166e", + "result": "valid" + }, + { + "tcId": 21, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "8aeaa2591a452e626b9a6468b623bdfc", + "iv": "b90f446f68aea588d843d01a", + "aad": "", + "msg": "f0721c3b68d905092cada6d568df3a2da39573c7bb0e9a4ed159a2634237f9e788488c06fe8a7e1e01d1a1c985543ecf90f3d32e57d33c3df6c165b7edc6fbcf8bf2d043d1b7c0060309a29565a004ea3214d4e4f7dedeac2d74576c019b5fa000d025917af6f86310942102a34d92781972d4f1f57bbdd6f9b08cc979a358aacf6cb62334bfc916c249f18bcee644a8907ef576b41437098bdf0069767fb5ed1c0f1385e5895e4a5d70f5941a93014333436a7af465ec1038fdfa006410a0871225d64848e6c59ac23f176df663ee2171c9eaec0477f9ebd280880d9f2967a2e791cc998f6b23518ca97bbc6405d6ced3373ebf3d208c2a909274460a614a", + "ct": "7bb36313569ff8b5c58e41b17a78fa5d780073bee20b55f004532288e7f0a9475076364d8922d389ecd189f597a8a677cb2484513ed7afe2d0691717cd0ac0e27bf7e2257dd7e4ffc0bbf59e92d258e1116fac9bfc84a2df728bdd7ab221754dd341f7229e030dce06474d00f99a5e457943bd9e8f345bcbb5407690d072dfb0113b64bc0e658eeb7226409a5898dd27d995a0be021f351091f9b907ae3a9625f240dee2bf4bb15eb4f30f4abf1ff25ca5536def969d2588188fecacfc7dc75f5c676ca7851f9e805f498372c6b98f5c7d12403723619f80ce5badfe5844643d5631d4998ee0426a2b29159cae2590dc81646c78be5c9e8ffe056aa0d3552e", + "tag": "fc62295c70d140dbc354fdbc8003eb41", + "result": "valid" + }, + { + "tcId": 22, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e88d95eabe88fcf158fae858af951221", + "iv": "a65834a9d231b34709383e9a", + "aad": "", + "msg": "2decaccc8b424fa4963890ece15b3fc281b6215780ff6baee57edcd25afe260ff80ed4f25cc04d2802a1e90a2e6e96d1ee73a4a53dcf60025d484054d146f275ab34c33b102001a07d804cc94a40fd78c16780d1b648487fac035386e5d25c2b9edbf7a52d102d1943958c009eb6d88e00a3227c4c788e445003fabb4dbefccd3fe1716d916446fee2111615d560ecc59d7bd288268ab321e7002545887183fe023fdec2a6d3b73b94d1548cee19638d31d2c5a32b15d2aae3f42950a787115e200b00022d4929105da0b4d10ccb0b3886b3169b32ac5df7a637c23362e2d4ed9c137f35bbd578c2cda0377e0f1e64f7d31e9ef4d7603ea1363523758385c761", + "ct": "9b3833c356f83d19f59ac4770c9586aad457810f9dc55112cc6b87e94d8dc71184b227a14500c0a8619d544435db4c001467ef2acba95007299d717fadc0c0717c4c8e748d03ffe2cf2fd06f0009b0e6590f956c212a2c926d5679bdbb79d87636ae9faefa5c8330c570e84b94626f87d6a53b121574f74c9e3211d9451811e9940db5e74d128364328fb8f40f850a25c3e7ba4fdeb0ef6a639060a11d1c32ae0531d2518f905952c9814236b00b9393fd31f8c0522f8e3072b864a3a5cebe1ceb15585c9042f3f5b95390c62d8c1b513550defd21b481fcfbd9fdd6c262ff6ed4e0a6051be309788a763e567107f039e988757f96ad95436792a3bd26f38590", + "tag": "4f4c265edd3158c641ce9555b58650db", + "result": "valid" + }, + { + "tcId": 23, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a294e70fa2ac10a1fb00c588b888b673", + "iv": "dfe20d1c4350e6235d987af1", + "aad": "", + "msg": "6ed1d7d618d158741f52078006f28494ba72a2454f27160ae8722793fcebc538ebc2f67c3ace3e0fe7c47b9e74e081182b47c930144e3fc80d0ad50611c3afcfe2dbc5279edbbba087c0e390355f3daffcd25ad4dea007c284ad92e7fcbecb438fb60623ff89a599dca2aac141b26651386ca55b739b94901ef6db609c344d8acf4544568e31bb09361112754b1c0c6a3c875bd9453b0ee0081412151398a294ecad75add521611db5288b60ac3c0128f6e94366b69e659e6aa66f058a3a3571064edbb0f05c11e5dde938fb46c3935dd5193a4e5664688f0ae67c29b7cc49a7963140f82e311a20c98cd34fbcab7b4b515ae86557e62099e3fc37b9595c85a75c", + "ct": "5bc6dbafc401101c7a08c81d6c2791aa147ce093aad172be18379c747384a54a41a747ba955cade8fdfb8967aa808b43fee3d757cc80f11163b800e5e59df932757f76c40b3d9cba449aaf11e4f80e003b1f384eafa4f76e81b13c09ec1ad88e7650c750d442fe46d225a373e8a1b564b4915a5c6c513cfdfa22d929d5741ca5ebefaedcba636c7c3bbef18863fdc126b4b451611049c35d814fc2eb7e4b8f1a8995ecb4a3c86652a068c0b2a3e1c5941d59c210b458d5d5d3b06420ec2053465ccceca7c20f67404985460379e2ee806a46e8409dfab2e0dd67ea3cf46d5ad4eb78756827358c3ef1fdbd07c33834f3d9eca3ff13b744a01059a6c17a315a8fd4", + "tag": "c7587e7da41bed682c37377ea4324029", + "result": "valid" + }, + { + "tcId": 24, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4a30eac07b788b7354a90e6448f56676", + "iv": "c359d567616b6384ac20a43f", + "aad": "", + "msg": "9a17b9d1dbe666f7431cbdd3b3173948c7ac13f268e12807256d2e5831ae67a14116144910b38368934571daff9d4004ba959b3cae2669e6eed49e750ca228415c6f7d1c1f2d3dbb02f4dfa49483a7f80fbcc1cb01d22c67817cc7a2bd2714eb62cdf8fb884a66ed245167cdb22e0dbc7b153e648714dfe83414696cffa892daf5af8820d562bdf55f76be5584a34b7e349d10d76c6e68305835b551a41ebf48e068320d875334a6a2d3108b1e93f7aa8da485d7a5470d805e0dd38c09feaa0f494d0572de314a287439f48aee5a2fa8e9850c6127ee88d50c5e8a2ac3eaa7b2fdd1589813fb3affa6589831df132bd576fbed21717e2b6766e593ed74dab35da125c433763ea90234dc6f01d37be14c78b8861be1fb4c8296b3faee65b6ef8a9daa6884e936359346f2da9f6981f9d64f676767641ada628aa8c7129326bd4ee57e515a2f78ba18c595b9bc1d0f49068734a67e635554eee688816061e904a4e05125d0e7797305451a7c3a1a3c507daedb990c12ca290a0f554aa8e834653aa21a0469d3b0c08ee512b323cb193779c9fe2f2b3f03794cd42f0220031d0c8eeb9c73a3283a599bc78da3b5b41b243edf082b23801a15d9956fca60f35acfb65c4d06d28aff81a1ca98c6faf8645be920bd87c03c054a0469b292ae34d05860e8d9b061300370463dcd5fcd6fb1d6b1acc9b4eb25cabd9de4e61d44922fcc", + "ct": "3e13588d5a014dcc1cbf46bd6c3f06dfbef1464649e79a9bcbd99484686d72653827882dba803a5683f82a9bdfec6b44b29b7c13f3f2b5dbc675780540f6a8a08e45f59fa88021095f8b3db5f10bc21721a56d65a589216cbc5b1915cbe7e2f8612a9d24b30ecde2a296a96f48ad1160720537312208e9b6824e6413f2084f229dc6e953c4b8a054e3c368ef1f70dd9cf276caa4cc251e475f507a2bd072b7f4a1311302f617e2cc594eb6a0c49ac173db07831945f5129a38e45135beb97b39393f73d0977e324820533f3dd752051996543a0620ebba50288923f1d0181badb2204c7469e8b4b5d14a984c3f0f3d34bb383416149e0a0ca14f4f6dfe58902a48ecd3bdbc02a8c84bb303e83491824b2ca976991b229d715af2bf4ba3385d7d93e3ada52f12317b73e2939628d7589810d6a278d4c24e907b4ffce0d177b040e9dce97b63c9b8c1743ad6febd0c9a273f648b91ba5b5719159785db770c664290e93d69ba14757d8bba68f0f93a136031a97c72f2be6bf9e15237e998395930b4d1f87b57a5fa65494dc8feb761bdaffed4b3bf0073e9244abb4a3a7e15e2d52a3bb8446766f0e7563702a943dd16d5db9dbecb0044e462bed17eab81b312aa4f32415db8f09bc0cc2db7406f4f67862af986b965237913d119ca85b8d64b4e610034891f78433f370fbe6c9996a69d0de308ed685f4339f9b67fa5ec100e", + "tag": "58743a6d49272df201d81dcccdaf76fa", + "result": "valid" + }, + { + "tcId": 25, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fc8e6d2c7f42cab59375327285cc3398", + "iv": "49e1e00c48eaf1b5b9d2cb45", + "aad": "", + "msg": "2121b06990dcde2885739032622fd70294174074bffdf40b01f3554d5d87242da61673fe9b1687771ff1cc330d7b8a5138f6598d8160ec90a4816a6dbab310f2c99ab19c49d8a5d04eed4b93cd76159766548e136517ecfb6aa7ad51e5ff6d083c0e53533692388e651ea9cba94693118e4699926476fea785d2cac0213aa68ae0a366923532d333ef133b490a4667606f7294db8c6a4530407409b51e803493d46638fba151b2031f8208d595b4e4ae55db66cd7c328753cfa0f644438b0bff4f87d9b7c5648e5d2e8057e0b20d550cf1d0aa13900647c332909b50f8ecb1ee148342aac705b28215900030bfd90ca1446e3a03ceb2ab71a9ceb3d8f0b4626febf1dcff3c1f5ae0fef4c0f74623ba47eb5fdc42d42a2039f45e5987624d97d0fcfb95f74c478d613b9067f03cb86d6055d5124e6ff3174d136d60fd7a54e7c8fdfff20fb5807c4e356cbfc70df4bf83997855608558dff64b3ea8854481cb24933000489f4b8e9415b22237e916653874549d7687ae71b063ace3ef7e41c705d197c3157dacd3263d61132a4f07b91cb0cd79bc7cfd85f6f8c1f507c33bb910e2e879e0e4d8fedf804134d14d5998b38376d9ac0831d1577510ef3704e3f68acfcb433aa2a751f94fa8b6b312afbeea7f3d1f38784d79db414c7799e011ca4d35779ed17aed7d96df5e1a60ace74692686ede778dfb4beeb42585c8ccdf03cf", + "ct": "51eb448f839802e6d73c5b628eff69b1a449c5b1e709f2fd869c8ebac9725ecc3c9f426f875853cada118f846de1a52f3b36e2446680cdb44241c475b0414590f1ee4bb978db5e88c696d13cadb31ebaa897c24e8204ddaa0e9c6d7865cab9934d6f811288da285eb3a54235e232a6dbb2a7ba36ea72818218a1ed4c96e859d0ead7cc7e3d8993c1005fa55b53d752b4ca2194736d76b9253197281e0c6333048572046b20cce32940eefacdc625adc8419c6a222c61c9a8f248463c37a3c4e688a9d74e9006fd7910769e3b21c7dc0d7ed58f0eeea58e3257c40e17ea42884157e3afc9913757506bd90527dd285bda33ab5a447f90e6f8c9ecff2289fdac6cd28074c3e10bb374337f6c587dacb8cbf7bfab272fcd462c2a06b465a791eab911cab96ae6ccdf382aeb2e9d5ab07e3dc133d7f5b7402bb1b6ccf8ce4815392130073f6c03d3919d8640cd7ba9b7fbbfcb07405093ac408c4acd50d52d7cae06b9f3648b539044e49eb0d526c6323b5932d3cdf118ccb556498f24390d6d2103588c6cc4d118f52e4d66b1bde83a8b7c863e6a373c4cd65d1d1a98535810fbefa8ca38a20830e19ef8fdf8fba1d333655054e6c8a3fdc8403b13b27de07f9dbeef390ee06c058957c1f6e6dae7755090ef1d0afee347671fe69e5a280869040f4f35a6f687c37ee9e6b676a6d58ac198dc86a831ae20fa2e64f416552dfbdc4a", + "tag": "1fba8fdad545d2443d6e79592974f355", + "result": "valid" + }, + { + "tcId": 26, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f01a3c3559c58e80bc832544e069ef29", + "iv": "cd5bc2aed48c3be836d7d786", + "aad": "", + "msg": "0de5aac3f151b526751de8f36010e4394498eba3c8bc790fd4ba96eb2da33e40ddca3cb36fec102ef37a6a5132cd389bbcabbd15e1c9d2700af35f19a01ba3b26843ab50833f252befbbb5529173d51ca364d7d09468b3b68f740a6014b5b824206a6a7118bf144a223f87d76624c138bd24a5fa996f36e316087f3b59c1c71cd74a9184a518c8d9aa8c7243102dd39a93599e7bbe7dcd354d0780253767e9602f2f0cbbab7eae8d8c12cbad163f8fc20d32559f798d2b7285dba6f66dc28d9b3f0a301aa89f5cd1b5a1734fe72c68f98c861d26e7dddaa08a227999f7c98d7315e7c2e3c3f198cdd4cfd62f62389998c7b760106d0a437f5050f74f9ce63948f5494bed71c88be443654ef9eb0c867eede225c1bda181baabd8155360ccae65e54d399a3f7d670d11b53d7bbecda15d53e129ef2be29154e3c21411e6207977e2620007cf4b987dd2c304efe55bc2ef564074cd6e176a97184bff4cad0cd0cb85195c4e8398f27ca0d4d8c4851359eebdb606a213223903513f0db8c0fcc1f3a834738f6c9dd6adb43bdcbd921e7c3cd3b252e319f9e711edf55e8d7f1a320705a3ba77bfa33463a922a9f36b483590c4939fd977ace51c506d2e269b488a7169b696d828458ecb092ae3a9adf63a3a12809da51fc7340fc57db50fa1903f1c7de9ce606f1de3f95538823c04e3bfb6549385643710a2919f2fbd54887bdfb239", + "ct": "c9139d5d6a14936dd5f286d33dee4f20f59a821152aa717274c1af90983a5f83b9016248e715a5d0998d329955f41a0396660d9f22df5f613098bfd3aa30df1922f08dc12c8fdca6d2638a51bfe594b24523b93181712d5205f9c2e5d48741e000ac2128619f6c9745448da294ac281428d6c607f4eedaeea0db12ba1627e56ae152ef2b2310cce829cc276217e31dac22ec8582d7a72b5d64d5583c75f42fc35551607ec57d9d40672d1641b64491fe23ff3eaeb33e2564319c58d69b19c65d1c56165ea2543631b95bd8629a91876c284d0245be6a4f34ad8628f7a4a4dbd3dc13c97a1b3a9108ca6721f38a4b5b00ea09abc2a90c39aed775f3a784f0aa1a0a18b99aebaf60fcc3385c2c9a03aa50e029ab81e5b9e37a0e1cf70d9c1adca56e98289b91d8c250858e30e2c21afe39b90635fbe15540b718c030696d1a4ffbefa8d8ec1acb5633c8f19eb5cf9186e9ec0594fdf1312e62d488fad9a894e19a8e99de578cc295d581645c4fa29a8f12d44859ebb3e2bff351de917189987266bd47ac7223a8d857f7730cef8a312a5164d7b00e0eeda4e21952062d8acefe44e0b89a37d0f5c31c4345bc360c936269f93aa4e00d05278681b39717b9f3445cdf7f98edad185d15fdd027399485428670b430b02702f373e9f86e4a6b33ebe73095427403795022527818b0d3316aef9a276ee8062684b5c16c683a748bdb0dac", + "tag": "d070381db3e8d485e9416c92064180f1", + "result": "valid" + }, + { + "tcId": 27, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5a475f9976ed117ab37a4fffab0592eb", + "iv": "6bce45bea6ad59bd2a08f7b3", + "aad": "e8bb51b694b6b0763e097bad1152f5c762a878a3e7f7a9d78e809838de78567900281b7e4f0f185493fd85e28db79b595541aba7e158b3936490b632355d74", + "msg": "dc6ab0e261412cc709422289ea202021d9298060", + "ct": "35d3ab0534102884ed0db4694a221df1bf94dcdb", + "tag": "d78d2c197deb70ed52933f4fa0b09856", + "result": "valid" + }, + { + "tcId": 28, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c4b03435b91fc52e09eff27e4dc3fb42", + "iv": "5046e7e08f0747e1efccb09e", + "aad": "75fc9078b488e9503dcb568c882c9eec24d80b04f0958c82aac8484f025c90434148db8e9bfe29c7e071b797457cb1695a5e5a6317b83690ba0538fb11e325ca", + "msg": "8e887b224e8b89c82e9a641cf579e6879e1111c7", + "ct": "b6786812574a254eb43b1cb1d1753564c6b520e9", + "tag": "ad8c09610d508f3d0f03cc523c0d5fcc", + "result": "valid" + }, + { + "tcId": 29, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f64d1bc47b081afb21181bdc16ffbcca", + "iv": "2c03293704f79612181609d3", + "aad": "a883d23e25a62b492f1271d3d79b8689dde7250a0575b8175a6b69d48d1b4bc2df1b4dc4a2b1eb506bc0e8c11e7dc2f3d08b475214551df7c53e581ec55c0d0a2d", + "msg": "85b24904bf12ced33d78df7437b36fff83d1e817", + "ct": "b00975863c673f0f19326294ebc4c77f7287c279", + "tag": "ae57622c1d175ebbca77bd4ee812ed89", + "result": "valid" + }, + { + "tcId": 30, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7e0e0cf8c9ac58867ef3e3315d0a4338", + "iv": "a03461bd9ffedb16a65c0389", + "aad": "c70f009be65ade8465cc05b5227963c12c60b68247ae2e431b2445bb6aa69c0a7820177861e5f6e3585269fd15efaf38c3713e6af0e93362d2d9a6e3296712f581563ae3980298f8bb7276859afecc7052fef63b060bc8f219ffe200e14dbde1f0a36233b5994a0b68c4690b437d495ddff991993e75039bcba4c19d7a6f01", + "msg": "de4451316ad820471a43906965af9fa221c0360f", + "ct": "8b9dcbd9c9573509d978db0d910e269612c907bf", + "tag": "61ae3afdb06a01d8ee6f7e739ec30a4e", + "result": "valid" + }, + { + "tcId": 31, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7e37d56e6b1d0172d40d64d6111dd424", + "iv": "517c55c2ec9bfea90addc2bd", + "aad": "8ed8a9be4c3d32a5098434ee5c0c4fc20f78ef5e25ed8b72a840a463e36b67b881e048b5e49f515b2541ad5ce4ebb3a917c16bcdc0dc3cb52bb4ed5a1dffcf1e1866544e8db103b2ad99c6fa6e7de1d8b45bff57ec872f1cfc78b0e4870f6f200ff1291cae033defc3327ba82792ba438e35c4bfbb684fec5ce5e3ae167d01d7", + "msg": "6a7dea03c1bba70be8c73da47d5ee06d72a27430", + "ct": "cfb631790767d0645d8ec6f23bf7fa8b19ce79ee", + "tag": "c5767ddaa747158446231766bd20490c", + "result": "valid" + }, + { + "tcId": 32, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d9218931dc592aef3bffb924c9e0b02c", + "iv": "17d824f4f2f191e9c9dc0a52", + "aad": "76dcb9948575b503fea75cb3d4949bb96ae3d2c1780f185e0fb3cd5b83eb7090be7a966f6146a4db7ef82f8adb9b10158b69d4bb19dffe4c639fe278d0334e68aaf1b68451a8e6778ddbb29aac4b25bcb2ea059601ee2eba439134aecd0ceacd98e388c40114c11969dfd4a16beeaf3d1c7410e99e674894445821e8fcda7b7ba7", + "msg": "29f29bfc5b09ff158d74fbf7532c06aa3afa936c", + "ct": "d0d22cc0893261b105c021f534737599cac3b10d", + "tag": "f55f4ac6d836fc288036a63f53b0ddd4", + "result": "valid" + }, + { + "tcId": 33, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bf2056baaf45c5a00a733b49f10b7dd0", + "iv": "fef1b243b44ba92b47c6626b", + "aad": "1bb3a17907279ebff63593de97a64e5ceaf9e1d407e5a5eec1ce0f62586f0dfddb7a3a83fd164e800bcbc6fb089d6a247dfa444633f4663ae1e0bdf37b50a7a01f506e2220bbdd4b08c59fe60e455bdaeda7e5a0cdb2e6dfca66381a72962fa8a6f9847a87135ccf02a40da5b3b8e91e6e1f31542f85f90bce1de05188fe57355329031c66b3fde18bbdcbd2cbec42ea1d0fc803abed2f15c41d2f122674ea91b7280e818acb7549fe63135d2109b4014ec6002745301bd0ac59ca8e4f8d2fb699347b74e17818e3a57fa69c759312dcfde155b2a558a2385c8adab8a6d57f0f497eaf0833e3d930e83fed88c91e18a74c4f5ff45925a2bbdda22f9a4f1196", + "msg": "7e8c2d8a65f539210c047422ae57549195a08393", + "ct": "1fcc05bf4960fd02475c072f9eee8150994edcb9", + "tag": "f3e092f2415f7f0ce88f37a2495dce48", + "result": "valid" + }, + { + "tcId": 34, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6f8307bb3d83d67866c2fa5b26f9cade", + "iv": "dfe93ed879e4b391ebbbfd37", + "aad": "1d72720dbbc40333e819a4def81f7bae137d8e52dc010ed901a390bf8c0ab6b435b08ef0184888bc83b14b98b59f6c56afd46131c5627b9e2a44f0a12a9a5356d9090c8b19c94f3f8651d49c74276bd9ae1071cad5f5040fbe1e99124ef44f3f813b13dff958e7331b949193bdf558fd14032c54f0e0ae7ac4d2e6a99d82a5da41135f0543ad377d217152497cf86435d24ee0c75997e3863133d322017aec98050b2fbc1dd8542293ae706889e754daf6ff8c91fb6533c5db7375dd3e365e6a18c546fa9463dfdb21d51c9cf23c9284a63cbfad197f376601101cb2f8a67b6e866569218043cd1745d25ecddf609ce2f9a8f76fb883780a393ea18b7624376b", + "msg": "81ebf69754857be5ad7ddf0062f866421089d136", + "ct": "4d8ff72d859bae1114201c419c098476e74eece9", + "tag": "3b2e9e1b378d707bd2a961bd7811f0c7", + "result": "valid" + }, + { + "tcId": 35, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3076741408f734ce25d48f982e8b844b", + "iv": "a2712eac5e06d3cc2864aa8b", + "aad": "18526e4efd995a0bf6405d9f906725c290278958d49554974d8fe025e7860daa225c1285b0573916a4b6741f7cc2e29ce4e525e12f436cb7ce0ad47df3d0f5bd80fb27e47635a4985fdaedf0e821f1c8959985cac49c97a4a02438d92b4afd4c855dcc7ef41ecfc36866334fcc05b2bb93ef13f00c5ea9b921e8a519d77f648e0efe9b5a62305a2ecf7d4999663a6ddfca517f1f36f0899b0bdef9f433c4bb2663c0cc1bb616e7d1949e522bec85485d371d1134c90eede75e865dc7be405b54c33f0acbace6cf780c78035b8035b6ea3f562a8d30a156c199fdafd25be06ee895581195ef125cb4e629e4f18e0bee979d31513896db8466e448e6b4600a316757", + "msg": "414ec6b149e54735302dada888b98b7fdb4c127c", + "ct": "e4d3f4898cb3d9732641d1f8d9d889b2c98af930", + "tag": "76d4fbb69d529b64175b328be00b1068", + "result": "valid" + }, + { + "tcId": 36, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "01842c51b9943da4ec4effc057f8c3e3", + "iv": "0d5bf8ade38ed384861839b8", + "aad": "e2b0c047ee9a7ebde0bc5c2a773f02703f2526226d7fd721a6bdae1d9701da986db6c9bf224f032947bbcc40b269e40c7a4fc1a3d667cf6379843ecc3b9d0664dcde0dfe8d803aa8e14a59cfea1cc58bd93e8a54d5936229a21c497bd75c4534e19480b2a50ae8de0b906f75c1dcf737b5179daf751c3d6f51a1111c4865139393ee95963393a8f98005546759565baf95be2334e57f7c23272c9eca778d9956ee16b187fe309d9e1e699c1a8acdf370fbcab37b1e107934bb156987a282bdef9f9a92758474d808a3e3b191a6476f3e6ed49dc08451e3404e65918fdba33ba8ea3ba09b5669b4be9a64b93bae5de662b8f35d4abbb68118de9d025ebeb599a9cd2b0e35fd82aa0df2d43b60a61512d5af934489302572f928b790e6aadff6b7304b1a4080cc4faf8c698daa3045c945d828d915da6dda0662545f7d85297a36438ea7315a48d9a097140776f3c43d28f522f8afa03000c5a0192b5fb776b3bd06d3d9c52c873fccb0ecd1a8e14187ae2621d2e2848ae30af7ed0758fdbbc497aa69d58441f4d4b8ea13aaac97c4bffc4d07dbc62ae27f00a8db0c5d1bb24042481369f6ccd4df85d9c58a90069897e17ae0334248e13306a936697d2b5dadde5ac6c10b554b6bbd27752101b5df1f1cbb8c0ec1977c4581ab8dcd26a31dff01433785206b6595e3b824b5834295407f5027159eee46189f390537ddce6db5", + "msg": "dfc40cf38738675120f03b12505589b2f02bba68", + "ct": "e4035356a34bb01ea65c7e6d972cb4cec0252a79", + "tag": "1054ef6bc0a5156445cf760a2a65d847", + "result": "valid" + }, + { + "tcId": 37, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "67bd1fe83e4500ddaea721035d4cf7e4", + "iv": "5449b293c849be9941b1fb3e", + "aad": "18b8e9b141288ca891606a88987057fa078efc47c0e270b36985c924506e4f8e4a3d1541d0535f515a370a3400e2408fc92d217f9f37fb0b972a3a7602cac98f8f0231a4d76cf584d9239ee816765cecd28f325b907e0b02b260609c70226a16ecd9bd67a64ea12c4b249c05a90112940200df3e70519a4b9ec136b6f535d4b8b2ae16c5a54cb8c57d87451697e5101e1d09a94d2117b30ce90c3685117e2194a379e7a5754da20179582f97767e633d141185fe3784a44d94210b214768aa51117ed5c880613623e4aabbb647721764a513425b8d90d4189651f1529e688466d8abed49e2a5f0f4493b878d4169848547f591277631f1fed6c97d167f8baa68920a2b0220d2ad5ae65cd09dcbbfab42bc666867378e40fd3ced9719a76659ba22213a5a23e30aeeef995164883299e7dd6fff1617b4287c3197cb3b1abd54b2f0ca573b1a4677a054f1232cd19803633fe57b041c768df7c3506313e7eaa365624833becd768fcc4a31ade932e71ade8ccbf400b3aa2d32891a4a173fb7498c9564c89b70548fd495ac2ea85c4bedb4c9136d1a0a6c1618c4f1aa8e619fef765e1c7410f86cd8ae7d0b7ed28947433cd0ff64f5f9029816d61080237f099aad2f8520f25d7685cc1893b3e8da3aafdb38846b6758ee02b5c5ac899b2c0738453be2a83b879f97cbad8e214786fb2a836c74e06ef190022f4b5557694c254bc7", + "msg": "c259151909cc0480abbae3f7fb6beac92258d37d", + "ct": "2ccc824b0c0b593faeeff2424f3a64b1dcd08c07", + "tag": "e52d78836666333b2fe59ddc5d6f264d", + "result": "valid" + }, + { + "tcId": 38, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e7e0827a582b946828cb6df0d1c4617e", + "iv": "3a403192064a51df71a3554f", + "aad": "053d3468b4d0a5a6a12dff017c40218c2f990158c50a95503130bb92a5d7615973ec8827043b29222e15713fb9a58db90a397d31b16e21b3befd3d66d8990312b3f7ada3f39abbe92e17a1a66d6a290534b3110287915b08f47431a1bfb9c823e54a16b287a57d4c3463c838c462dc7898a3d7f5f653a945744dbb126bd21802e4684ad7dc90391b8b8000343db337145bf17fe31fdc434163ee6ae44ada02de6192bda57018dde5ba1f59721b4583968efe8613816c3502ac1b1ef162d0085f8df37b3436d14cc54684e898fcb695f15a59d7df60eaa028388d7fdca2bbd90e07a1a02281dc85e00d83750bef47fe0256b23ccd83c864e8619b7b7e75c9b24814e6533c4f7855e4fa21de0747c64795aac015ab532d033e205898a7511da32f898daed383a48314db35f75e7bf12c7a99e50eb8dc93f8700624438211cda86423cfde8d183ae5d6ad70133753e40f73652dfd03074fee034ce6d16ccfc0b3341a9ec18e630872f625e04129173313ee22b1cbcbd90ee74c5019173eed3ab2a47f16c8672e449e06e3bec4d05971fe8eba752d5d962e6e7d27408464441b3db18804fc1e5c428e970688d8c55f2980f30a6b86034ad2f79a76ef44c8d816345a6270c15c79deebf3dcbc1a1a968d318b6cccc09ab755cbe0f6ff4c23710935a4ea5bcab51c307454fba56cef1308b7cf0738626964ae7d2b65ad54d52872699b96", + "msg": "65e0007f93225599dfc59107720c503c0158f3f4", + "ct": "336c3b0080eb95480e671366be5508b1fe6ab14e", + "tag": "63278e1781fad93131ecfd619275890c", + "result": "valid" + }, + { + "tcId": 39, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "000000000000000000000000", + "aad": "", + "msg": "ebd4a3e10cf6d41c50aeae007563b072", + "ct": "f62d84d649e56bc8cfedc5d74a51e2f7", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 40, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "ffffffffffffffffffffffff", + "aad": "", + "msg": "d593c4d8224f1b100c35e4f6c4006543", + "ct": "431f31e6840931fd95f94bf88296ff69", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 41, + "comment": "Flipped bit 0 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d9847dbc326a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 42, + "comment": "Flipped bit 1 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "da847dbc326a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 43, + "comment": "Flipped bit 7 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "58847dbc326a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 44, + "comment": "Flipped bit 8 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8857dbc326a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 45, + "comment": "Flipped bit 31 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847d3c326a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 46, + "comment": "Flipped bit 32 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc336a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 47, + "comment": "Flipped bit 33 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc306a06e988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 48, + "comment": "Flipped bit 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a066988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 49, + "comment": "Flipped bit 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e989c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 50, + "comment": "Flipped bit 71 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e908c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 51, + "comment": "Flipped bit 77 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988e77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 52, + "comment": "Flipped bit 80 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77bd3863e6083", + "result": "invalid" + }, + { + "tcId": 53, + "comment": "Flipped bit 96 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3873e6083", + "result": "invalid" + }, + { + "tcId": 54, + "comment": "Flipped bit 97 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3843e6083", + "result": "invalid" + }, + { + "tcId": 55, + "comment": "Flipped bit 103 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3063e6083", + "result": "invalid" + }, + { + "tcId": 56, + "comment": "Flipped bit 120 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3863e6082", + "result": "invalid" + }, + { + "tcId": 57, + "comment": "Flipped bit 121 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3863e6081", + "result": "invalid" + }, + { + "tcId": 58, + "comment": "Flipped bit 126 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3863e60c3", + "result": "invalid" + }, + { + "tcId": 59, + "comment": "Flipped bit 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a06e988c77ad3863e6003", + "result": "invalid" + }, + { + "tcId": 60, + "comment": "Flipped bits 0 and 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d9847dbc326a06e989c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 61, + "comment": "Flipped bits 31 and 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847d3c326a066988c77ad3863e6083", + "result": "invalid" + }, + { + "tcId": 62, + "comment": "Flipped bits 63 and 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d8847dbc326a066988c77ad3863e6003", + "result": "invalid" + }, + { + "tcId": 63, + "comment": "all bits of tag flipped", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "277b8243cd95f9167738852c79c19f7c", + "result": "invalid" + }, + { + "tcId": 64, + "comment": "Tag changed to all zero", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 65, + "comment": "tag changed to all 1", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 66, + "comment": "msbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "5804fd3cb2ea86690847fa5306bee003", + "result": "invalid" + }, + { + "tcId": 67, + "comment": "lsbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "eb156d081ed6b6b55f4612f021d87b39", + "tag": "d9857cbd336b07e889c67bd2873f6182", + "result": "invalid" + } + ] + }, + { + "ivSize": 64, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 68, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "aa023d0478dcb2b2312498293d9a9129", + "iv": "0432bc49ac344120", + "aad": "aac39231129872a2", + "msg": "2035af313d1346ab00154fea78322105", + "ct": "64c36bb3b732034e3a7d04efc5197785", + "tag": "b7d0dd70b00d65b97cfd080ff4b819d1", + "result": "valid" + }, + { + "tcId": 69, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "f3434725c82a7f8bb07df1f8122fb6c9", + "iv": "28e9b7851724bae3", + "aad": "", + "msg": "", + "ct": "", + "tag": "44aca00f42e4199b829a55e69b073d9e", + "result": "valid" + }, + { + "tcId": 70, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "deb62233559b57476602b5adac57c77f", + "iv": "d084547de55bbc15", + "aad": "", + "msg": "d8986df0241ed3297582c0c239c724cb", + "ct": "03e1a168a7e377a913879b296a1b5f9c", + "tag": "3290aa95af505a742f517fabcc9b2094", + "result": "valid" + } + ] + }, + { + "ivSize": 128, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 71, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "2034a82547276c83dd3212a813572bce", + "iv": "3254202d854734812398127a3d134421", + "aad": "1a0293d8f90219058902139013908190bc490890d3ff12a3", + "msg": "02efd2e5782312827ed5d230189a2a342b277ce048462193", + "ct": "64069c2d58690561f27ee199e6b479b6369eec688672bde9", + "tag": "9b7abadd6e69c1d9ec925786534f5075", + "result": "valid" + }, + { + "tcId": 72, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b67b1a6efdd40d37080fbe8f8047aeb9", + "iv": "fa294b129972f7fc5bbd5b96bba837c9", + "aad": "", + "msg": "", + "ct": "", + "tag": "a2cf26481517ec25085c5b17d0786183", + "result": "valid" + }, + { + "tcId": 73, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "209e6dbf2ad26a105445fc0207cd9e9a", + "iv": "9477849d6ccdfca112d92e53fae4a7ca", + "aad": "", + "msg": "01", + "ct": "fd", + "tag": "032df7bba5d8ea1a14f16f70bd0e14ec", + "result": "valid" + }, + { + "tcId": 74, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a549442e35154032d07c8666006aa6a2", + "iv": "5171524568e81d97e8c4de4ba56c10a0", + "aad": "", + "msg": "1182e93596cac5608946400bc73f3a", + "ct": "2f333087bdca58219f9bfc273e45cc", + "tag": "e06d1ef473132957ad37eaef29733ca0", + "result": "valid" + }, + { + "tcId": 75, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cfb4c26f126f6a0acb8e4e220f6c56cd", + "iv": "1275115499ae722268515bf0c164b49c", + "aad": "", + "msg": "09dfd7f080275257cf97e76f966b1ad9", + "ct": "a780bd01c80885156c88a973264c8ee5", + "tag": "2adeffa682c8d8a81fada7d9fcdd2ee2", + "result": "valid" + }, + { + "tcId": 76, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0b11ef3a08c02970f74281c860691c75", + "iv": "95c1dd8c0f1705ece68937901f7add7b", + "aad": "", + "msg": "f693d4edd825dbb0618d91113128880dbebb23e25d00ed1f077d870be9cc7536", + "ct": "7e47e10fe3c6fbfa381770eaf5d48d1482e71e0c44dff1e30ca6f95d92052084", + "tag": "d01444fa5d9c499629d174ff3927a1ac", + "result": "valid" + }, + { + "tcId": 77, + "comment": "J0:000102030405060708090a0b0c0d0e0f", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "f95fde4a751913202aeeee32a0b55753", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "00078d109d92143fcd5df56721b884fac64ac7762cc09eea2a3c68e92a17bdb575f87bda18be564e", + "tag": "152a65045fe674f97627427af5be22da", + "result": "valid" + }, + { + "tcId": 78, + "comment": "J0:00000000000000000000000000000000", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "7b95b8c356810a84711d68150a1b7750", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "84d4c9c08b4f482861e3a9c6c35bc4d91df927374513bfd49f436bd73f325285daef4ff7e13d46a6", + "tag": "213a3cb93855d18e69337eee66aeec07", + "result": "valid" + }, + { + "tcId": 79, + "comment": "J0:ffffffffffffffffffffffffffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "1a552e67cdc4dc1a33b824874ebf0bed", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "948ca37a8e6649e88aeffb1c598f3607007702417ea0e0bc3c60ad5a949886de968cf53ea6462aed", + "tag": "99b381bfa2af9751c39d1b6e86d1be6a", + "result": "valid" + }, + { + "tcId": 80, + "comment": "J0:fffffffffffffffffffffffffffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "dd9d0b4a0c3d681524bffca31d907661", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "64b19314c31af45accdf7e3c4db79f0d948ca37a8e6649e88aeffb1c598f3607007702417ea0e0bc", + "tag": "5281efc7f13ac8e14ccf5dca7bfbfdd1", + "result": "valid" + }, + { + "tcId": 81, + "comment": "J0:fffffffffffffffffffffffffffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "57c5643c4e37b4041db794cfe8e1f0f4", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "2bb69c3e5d1f91815c6b87a0d5bbea7164b19314c31af45accdf7e3c4db79f0d948ca37a8e6649e8", + "tag": "a3ea2c09ee4f8c8a12f45cddf9aeff81", + "result": "valid" + }, + { + "tcId": 82, + "comment": "J0:000102030405060708090a0bffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "99821c2dd5daecded07300f577f7aff1", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "127af9b39ecdfc57bb11a2847c7c2d3d8f938f40f877e0c4af37d0fe9af033052bd537c4ae978f60", + "tag": "07eb2fe4a958f8434d40684899507c7c", + "result": "valid" + }, + { + "tcId": 83, + "comment": "J0:000102030405060708090a0bfffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "5e4a3900142358d1c774d8d124d8d27d", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "0cf6ae47156b14dce03c8a07a2e172b1127af9b39ecdfc57bb11a2847c7c2d3d8f938f40f877e0c4", + "tag": "f145c2dcaf339eede427be934357eac0", + "result": "valid" + }, + { + "tcId": 84, + "comment": "J0:000102030405060708090a0bfffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "d4125676562984c0fe7cb0bdd1a954e8", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "f0c6ffc18bd46df5569185a9afd169eb0cf6ae47156b14dce03c8a07a2e172b1127af9b39ecdfc57", + "tag": "facd0bfe8701b7b4a2ba96d98af52bd9", + "result": "valid" + }, + { + "tcId": 85, + "comment": "J0:000102030405060708090a0b7fffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "b97ec62a5e5900ccf9e4be332e336091", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "d6928e094c06e0a7c4db42184cf7529e95de88b767edebe9b343000be3dab47ea08b744293eed698", + "tag": "a03e729dcfd7a03155655fece8affd7e", + "result": "valid" + }, + { + "tcId": 86, + "comment": "J0:000102030405060708090a0b7ffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "7eb6e3079fa0b4c3eee366177d1c1d1d", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "d82ce58771bf6487116bf8e96421877ed6928e094c06e0a7c4db42184cf7529e95de88b767edebe9", + "tag": "1e43926828bc9a1614c7b1639096c195", + "result": "valid" + }, + { + "tcId": 87, + "comment": "J0:000102030405060708090a0bffff7fff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "0314fcd10fdd675d3c612962c931f635", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "a197a37a5d79697078536bc27fe46cd8d475526d9044aa94f088a054f8e380c64f79414795c61480", + "tag": "f08baddf0b5285c91fc06a67fe4708ca", + "result": "valid" + }, + { + "tcId": 88, + "comment": "J0:000102030405060708090a0bffff7ffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "c4dcd9fcce24d3522b66f1469a1e8bb9", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "149fde9abbd3a43c2548575e0db9fb84a197a37a5d79697078536bc27fe46cd8d475526d9044aa94", + "tag": "62a4b6875c288345d6a454399eac1afa", + "result": "valid" + }, + { + "tcId": 89, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "00000000000000000000000000000000", + "aad": "", + "msg": "bec6fa05c1718b9b84c47345bbed7dcb", + "ct": "45a3f89d02918bfd0c8161658ccc9795", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 90, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff", + "iv": "ffffffffffffffffffffffffffffffff", + "aad": "", + "msg": "4d82639c39d3f3490ee903dd0be7afcf", + "ct": "1cd5a06214235ceb044d4bad7b047312", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + } + ] + }, + { + "ivSize": 96, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 91, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "92ace3e348cd821092cd921aa3546374299ab46209691bc28b8752d17f123c20", + "iv": "00112233445566778899aabb", + "aad": "00000000ffffffff", + "msg": "00010203040506070809", + "ct": "e27abdd2d2a53d2f136b", + "tag": "9a4a2579529301bcfb71c78d4060f52c", + "result": "valid" + }, + { + "tcId": 92, + "comment": "", + "flags": [ + "Ktv" + ], + "key": "29d3a44f8723dc640239100c365423a312934ac80239212ac3df3421a2098123", + "iv": "00112233445566778899aabb", + "aad": "aabbccddeeff", + "msg": "", + "ct": "", + "tag": "2a7d77fa526b8250cb296078926b5020", + "result": "valid" + }, + { + "tcId": 93, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "80ba3192c803ce965ea371d5ff073cf0f43b6a2ab576b208426e11409c09b9b0", + "iv": "4da5bf8dfd5852c1ea12379d", + "aad": "", + "msg": "", + "ct": "", + "tag": "4771a7c404a472966cea8f73c8bfe17a", + "result": "valid" + }, + { + "tcId": 94, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cc56b680552eb75008f5484b4cb803fa5063ebd6eab91f6ab6aef4916a766273", + "iv": "99e23ec48985bccdeeab60f1", + "aad": "", + "msg": "2a", + "ct": "06", + "tag": "633c1e9703ef744ffffb40edf9d14355", + "result": "valid" + }, + { + "tcId": 95, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "51e4bf2bad92b7aff1a4bc05550ba81df4b96fabf41c12c7b00e60e48db7e152", + "iv": "4f07afedfdc3b6c2361823d3", + "aad": "", + "msg": "be3308f72a2c6aed", + "ct": "cf332a12fdee800b", + "tag": "602e8d7c4799d62c140c9bb834876b09", + "result": "valid" + }, + { + "tcId": 96, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "67119627bd988eda906219e08c0d0d779a07d208ce8a4fe0709af755eeec6dcb", + "iv": "68ab7fdbf61901dad461d23c", + "aad": "", + "msg": "51f8c1f731ea14acdb210a6d973e07", + "ct": "43fc101bff4b32bfadd3daf57a590e", + "tag": "ec04aacb7148a8b8be44cb7eaf4efa69", + "result": "valid" + }, + { + "tcId": 97, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "59d4eafb4de0cfc7d3db99a8f54b15d7b39f0acc8da69763b019c1699f87674a", + "iv": "2fcb1b38a99e71b84740ad9b", + "aad": "", + "msg": "549b365af913f3b081131ccb6b825588", + "ct": "f58c16690122d75356907fd96b570fca", + "tag": "28752c20153092818faba2a334640d6e", + "result": "valid" + }, + { + "tcId": 98, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3b2458d8176e1621c0cc24c0c0e24c1e80d72f7ee9149a4b166176629616d011", + "iv": "45aaa3e5d16d2d42dc03445d", + "aad": "", + "msg": "3ff1514b1c503915918f0c0c31094a6e1f", + "ct": "73a6b6f45f6ccc5131e07f2caa1f2e2f56", + "tag": "2d7379ec1db5952d4e95d30c340b1b1d", + "result": "valid" + }, + { + "tcId": 99, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0212a8de5007ed87b33f1a7090b6114f9e08cefd9607f2c276bdcfdbc5ce9cd7", + "iv": "e6b1adf2fd58a8762c65f31b", + "aad": "", + "msg": "10f1ecf9c60584665d9ae5efe279e7f7377eea6916d2b111", + "ct": "0843fff52d934fc7a071ea62c0bd351ce85678cde3ea2c9e", + "tag": "7355fde599006715053813ce696237a8", + "result": "valid" + }, + { + "tcId": 100, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b279f57e19c8f53f2f963f5f2519fdb7c1779be2ca2b3ae8e1128b7d6c627fc4", + "iv": "98bc2c7438d5cd7665d76f6e", + "aad": "c0", + "msg": "fcc515b294408c8645c9183e3f4ecee5127846d1", + "ct": "eb5500e3825952866d911253f8de860c00831c81", + "tag": "ecb660e1fb0541ec41e8d68a64141b3a", + "result": "valid" + }, + { + "tcId": 101, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cdccfe3f46d782ef47df4e72f0c02d9c7f774def970d23486f11a57f54247f17", + "iv": "376187894605a8d45e30de51", + "aad": "956846a209e087ed", + "msg": "e28e0e9f9d22463ac0e42639b530f42102fded75", + "ct": "feca44952447015b5df1f456df8ca4bb4eee2ce2", + "tag": "082e91924deeb77880e1b1c84f9b8d30", + "result": "valid" + }, + { + "tcId": 102, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f32364b1d339d82e4f132d8f4a0ec1ff7e746517fa07ef1a7f422f4e25a48194", + "iv": "5a86a50a0e8a179c734b996d", + "aad": "ab2ac7c44c60bdf8228c7884adb20184", + "msg": "43891bccb522b1e72a6b53cf31c074e9d6c2df8e", + "ct": "43dda832e942e286da314daa99bef5071d9d2c78", + "tag": "c3922583476ced575404ddb85dd8cd44", + "result": "valid" + }, + { + "tcId": 103, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ff0089ee870a4a39f645b0a5da774f7a5911e9696fc9cad646452c2aa8595a12", + "iv": "bc2a7757d0ce2d8b1f14ccd9", + "aad": "972ab4e06390caae8f99dd6e2187be6c7ff2c08a24be16ef", + "msg": "748b28031621d95ee61812b4b4f47d04c6fc2ff3", + "ct": "a929ee7e67c7a2f91bbcec6389a3caf43ab49305", + "tag": "ebec6774b955e789591c822dab739e12", + "result": "valid" + }, + { + "tcId": 104, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6efca98126918ab564d88c6bec02e8998b2be50e3f906ff9adfdd185f373e756", + "iv": "4abd6cfc83bd06b11efaa2a7", + "aad": "", + "msg": "bbec79c086d41e602d090f7e40494d6bf3faa1dc6df0ab8a88ea5d35d426b248c2ad880351e223f6170d37cc9655e10459e59cbd6d1c092ed31d72ccc7af20", + "ct": "97b4c73a4d8b5b21bc4b50dbb70dfa77b1a7bf0bbe7cf16ecf5bb60ba8070acc5740780435ed145a62a613dd9881b721168fbb3f5af385ee5d4f856cf93cba", + "tag": "27ac8c4010d8e81b7051ceb06b30fe2d", + "result": "valid" + }, + { + "tcId": 105, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5b1d1035c0b17ee0b0444767f80a25b8c1b741f4b50a4d3052226baa1c6fb701", + "iv": "d61040a313ed492823cc065b", + "aad": "", + "msg": "d096803181beef9e008ff85d5ddc38ddacf0f09ee5f7e07f1e4079cb64d0dc8f5e6711cd4921a7887de76e2678fdc67618f1185586bfea9d4c685d50e4bb9a82", + "ct": "c7d191b601f86c28b6a1bdef6a57b4f6ee3ae417bc125c381cdf1c4dac184ed1d84f1196206d62cad112b038845720e02c061179a8836f02b93fa7008379a6bf", + "tag": "f15612f6c40f2e0db6dc76fc4822fcfe", + "result": "valid" + }, + { + "tcId": 106, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "81b6b27e5ed90ab99fe6756d4cb41e3f07269687f5afabdb426e29096b5e4466", + "iv": "13e727486031cca21f733375", + "aad": "", + "msg": "9a95a23cfb1e35d89a7597570df0fb0efcbb7429f53bebcbbfa49fa247b251a8508ad497066855d08688576188e4ffb12d1d084dcabec3d57806daf215dcc97edd", + "ct": "7ede7368bca3c93d9f1d7f7750d6e44b1cb92c30e3c9834b0b69efd2470911644ae6f6d75715e13aea8781f8da611a13ac6364c406c1a715b7e97acb22b6e6156e", + "tag": "74e20a93802f43407c8989a37f013802", + "result": "valid" + }, + { + "tcId": 107, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ea1d436f6359caec010789fa94fe08b167c3e497d8917282f47ad2a8f95fd0f1", + "iv": "73fe022202767af834e32126", + "aad": "", + "msg": "adf9b6df5c5cc9473e0bb579f9a6aad396f93d28bf83e98136f978cfb9d501d09ef778c122b43c876c22e40d74a48d908978465a06be9e80891710c8c2690a762bc9eb8bcb2aa2707db149abafb9c17c1f0b68c7adcea98aebf4c6a39e5a8f693133eaaa5bb0b3708720d7b86424101bad56aa190c67d25fe35a4a34e1f4fd", + "ct": "2e6b19520d9c91e41f523bfd80cb3d577df762879b04a586b865280bac651102fa60164b8586f91c02b2151cc2fd29f4c6e92839cdd873be12c1443141f8bcb8754965aec7c0829fb391e56563ba76e896ec81932b5efbad23bb965ebbf8d8fda98f9cbd48f37b2c46db609e40768266c2b36a7810d2b79133f377d0377b41", + "tag": "f9a0eba513904c4a7168d762000f34be", + "result": "valid" + }, + { + "tcId": 108, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d7addd3889fadf8c893eee14ba2b7ea5bf56b449904869615bd05d5f114cf377", + "iv": "8a3ad26b28cd13ba6504e260", + "aad": "", + "msg": "c877a76bf595560772167c6e3bcc705305db9c6fcbeb90f4fea85116038bc53c3fa5b4b4ea0de5cc534fbe1cf9ae44824c6c2c0a5c885bd8c3cdc906f12675737e434b983e1e231a52a275db5fb1a0cac6a07b3b7dcb19482a5d3b06a9317a54826cea6b36fce452fa9b5475e2aaf25499499d8a8932a19eb987c903bd8502fe", + "ct": "53cc8c920a85d1accb88636d08bbe4869bfdd96f437b2ec944512173a9c0fe7a47f8434133989ba77dda561b7e3701b9a83c3ba7660c666ba59fef96598eb621544c63806d509ac47697412f9564eb0a2e1f72f6599f5666af34cffca06573ffb4f47b02f59f21c64363daecb977b4415f19fdda3c9aae5066a57b669ffaa257", + "tag": "5e63374b519e6c3608321943d790cf9a", + "result": "valid" + }, + { + "tcId": 109, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7f7c5804a680f61924966725dba2a80d85267c2e03c7c234b045b24ec8e23528", + "iv": "2d9bf8b636f337d265b0904c", + "aad": "", + "msg": "e2f85fb176840c38345da0f0f8db6cdbc45a123165f244ff5389fe65bf341fa131130751b5c739a9931d5a57b141dc7b5b0c5a2ca07331c2dc04b2657b0289878dea0ef7d5601465b78a65795f0f3181304e58a261feb1d394f3c33cabae189941755d7654bb7bef08c31bd2c5ce1203eebc015ae040da2a851c2ba3c62e699356", + "ct": "d7380d10b22c3ae584531e9e4ee73d387f69dbbb3d3d9fdb4971ed2750b31913f79e4c00cf1b76933bbb75d39d8a6429a2528e9bd60e65fa6ffff9e01a8758e7b58409fa3f370cc32a63aa60a54c36d733e8f6dfccd5c3120d05c6e33140c00562865532b2c689de98769d3386e7a3ae679e404e062536ca046261211a426fb586", + "tag": "753f6c57c0cc2a075e68d082f6e83590", + "result": "valid" + }, + { + "tcId": 110, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "01e75ae803d3045e6b28b7f67937eee2d8d98f77b4892d48ab1f15f57fa88bbe", + "iv": "6902e8f0ef1e9ec60a3e46f0", + "aad": "", + "msg": "32dde3b9bc671fad1265b26cad3d8dd0f099134f6755f98613024e1bd10da9a62bad01a997f973101e855ee1c7e60e6b6aa1df9d80fa567d0ccca0f956680be76ed37c71fdedef560e2523e8c5fdb9516250017304f8ff416b9b8e5d17c1f062ded4616ea9d462ed6ca0dfddb9f5295b7a127c0825ffab56ea4983c01eec867f93e24a18be48ceb540986c530104fd466318eb812eb42fd04355615f92503e53799742cdc71830eaa44aeec914b6ff1cbb4f6f81ab595078331d645c8d083b469731174a706b1666e5e450cb62671067032a566f597b9866b71514a409e38fcabe844964581b3ab5152696b76e49ace66581d21f512e28e077c44948a65260", + "ct": "6323ddbf9eb0463714d5857d1841a9f65529516c2f412956bc835f4f252d22a2ce743f21767fcb28859882b570ca053970b72e86f451ff0c77e87f3a03c0536b3859394fce324442ac197874f81a2ce649b99feb442e23123f7ab361d2ce6768a1badb30c509e79bee9277d378fadaa64e77e26f726df86110526530cd439429b017ae2bcec8cc24f994f5885a8a76fab6339c7054df76aa6f450193a635d21d22f71f1ae6856036e6caaeed8840bbfbc8236c25a31e775cba5f6e189fcbc3e96970ca5378fd5c29a712f5dc17641ad88ab566d8c78fff1bb57f9b2f7c9db838b4307c63e04a73d3ef8121f48932ec318dffaead58a83a7f79bc44a1587990", + "tag": "0c92bb5291e981bf562293877f4ddb5f", + "result": "valid" + }, + { + "tcId": 111, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "dc4dbf811f9509e33a45a8a0743e9391de333f69c56ee4f0fe90ce21c238ee59", + "iv": "1859d3ba4710cdd300baa029", + "aad": "", + "msg": "df91c48591f4cae8c4d659d024dfd0a3535981487764bf19b012713e6ac6d578aa0b3a51d7ac97cd503fdc8682cabdb6a5256e9890458356f39b9749f6ab158112fbe4f91acd333477998b9f0d7cc0be2d40acfa5103adc1b0d0a5cc94733d703e0d8c26e09e9d079fa6a65cf35240a16280826ab7c0d8ac5882c89e58444233c2f60aaae0cbd1a7ed850065242a9378c340232fd86f1fd52a92c960a9a86f529f431acf3aa94133785803f4ac1a22378332daa22dea3d34d2fdb7c308fa44ab93b3fb02f428be22fad6c0b10c138af97b92a199296dd947c93fbc40674c34c5623d26d9c90dc6b3357018b9f9250fb4dd5c11518191a236745a2bd42f863766", + "ct": "9c511d08f244cb6971a39b70639c4a53ae48254fcb3d2eea4796ecc996f1fe26a8e30932258a48fe4237e5bfb0e1320dc591256dc83cd56dbf5d9b377b7805b7fac0497b2f99e3310e9e2cc8009141a82f26f8a02299d64138bb1fe8a1243df3e9fb37b52bd3c2cc19f543b3f4928e5a73730a7a6e6d75919d117d3dfe10e863a9846b2ca260de5dddba7ceac37019e615b89a2ab94df8d1a790749998cb8531fef1ef5f8a28a8ad60e813f7e78412ca4d95b9604a24a16e4a3ca8ee33bfbb7809048014943e5fd7966a7db214e052d1cc546a6da72ec89d1c3398aefdcb881dfc3d800b7323abcd7583e9c8a31f03b6995d4aeac17c5a56d8af492a2b108fe3", + "tag": "17090ce50e35244a59bafc80eba5dae5", + "result": "valid" + }, + { + "tcId": 112, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "317ba331307f3a3d3d82ee1fdab70f62a155af14daf631307a61b187d413e533", + "iv": "a6687cf508356b174625deaa", + "aad": "", + "msg": "32c1d09107c599d3cce4e782179c966c6ef963689d45351dbe0f6f881db273e54db76fc48fdc5d30f089da838301a5f924bba3c044e19b3ed5aa6be87118554004ca30e0324337d987839412bf8f8bbdd537205d4b0e2120e965373235d6cbd2fb3776ba0a384ec1d9b7c631a0379ff997c3f974a6f7bbf4fd23016211f5fc10acadb5e400d2ff0fdfd193f5c6fc6d4f7271dfd1349ed80fbedaebb155b9b02fb3074495d55f9a2455f59bf6f113191a029c6b0ba75d97cdc0c84f131836337f29f9d96ca448eec0cc46d1ca8b3735661979d83302fec08fffcf5e58f12b1e7050657b1b97c64a4e07e317f554f8310b6ccb49f36d48c57816d24952aada711d4f", + "ct": "d7eebc9587aa21136fa38b41cf0e2db03a7ea2ba9eaddf83d33f781093617bf50f49b2bfe2f7173b113912e2e1775f40edfed8b3b0099b9e1c220dd103be6166210b01029feb24ed9e20614eddc3cebe41b0079a9a8c117b596c90288effd3796fbd0c7e8eab00609a64be3ad9597cdbf3a818c260cd938bdf232e4059ae35a2571a838887fc196912179486e046a62227a4caddce38cbbc37587bb9439ec637602b6818c5cbe3c71a7c4143960533dc74174bd315c8db227b69b55bb7fc30ba1d5213a752ec33925043cefbc1a62943ee5f34d5da01799e69094d732aef52f8e036980d0070e22e173c67c4bbcca61cc1eedbd6016516c592144819df13204dee", + "tag": "bf0540d34b20f761101bc608b02458f2", + "result": "valid" + }, + { + "tcId": 113, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4f62e56f7b15035f427849714beb97e6acf88371e1f69b388129bb447273d6b8", + "iv": "137d5c98a92f6dcee4f29d7c", + "aad": "", + "msg": "a147b716b86ac8dac7447d5ba60ee8a4191d2c64a3aa04276aee7bf7dc824962c09ace20a7e614cc9e177b5b11819b8f17008a9408e8cd8bb34b401be35368f492c17629b6467299bfd2ec4d9a7f17dea6f9ca084e871fb7fc78c2bf299b810522062726c5cae14b839722ecff499a2b3f082b6d1bfedb752f84a4e77459c9268d63199315363e9aaa39bea7fbbcc60a5eedc8a1a982ad6fa67c295b932eb3999047e0a99b3823032b6b3b7c4c553970afca50cb4e5ce859c25c598eb682005f17aec5526e26493208483679a23ccef6f7403a3f3055affd531a1cb7d183892dd577d526e8da8aa8b8b980a36e176b8d9293e785ac01bdd4dac8cf8dbdd82926f1e31408284fb3aa01f4414ac7aa7832d2ec02dd2db9b6b4b61d8c1cbb31dac7b6afa8d08b6877e439600c4a6fc07511877df2e9ce3a9538a726002a46c083d98124b185730f3b2aea2a01cb626be809f87b2ac100511c5b8fa0e9d40c9c999ea0aa87aad08cfb62c1ba869178be986156f7622d8c48ad80a552e9d08c36671ae232efefc8619c562e715f04ae52db2ad8e4a09e8c671b12289558117f9562d51beb59e29b10dd9eb232e8fcdb1cfdd14899acd693de14a7c076a4656386e23b06415b2c7a93b166cad1048bc605a49a79df3c03a3380de68a4f013e05e5283745d4078ebe308dc8881ced62ed571a93c69e8aae6e51f5e61e4ff75699aa32", + "ct": "b194e6c8f83e09515d4ea95c00578fdaee8f9d35ad09a560ba81a51accc49416598516c747e16dbc5c44bfd5c790ba59b47a6f573a43b26cdbb240230b1dca00447770c4cf647df2a79eca3f4a8b2de08f9fbc4489c30f6bcfcd096f1aa4177fa281248e8e19e2ea7d1f049b7053947a3a67e946ebbed67466e009b63debceba54cc881e55e2d68f3f584380d6fb7b0e9a3fdbd709adac3a47d6f9a5fcaf03218e18cca5a7a0e340a774cd5c39d7031b63b5b5b896e1e705b4ded099c3c11150738b2107f61f1423fb72ed0a16070cd6f8a18ae90b167b707c23ddc85a1b6ff5a3ec5e654b1446c6eae787c31a94bc9ab5376dfea31bf8dfbdabce45c750111946e64c22d23c46d7ef644ca02c69205d59b1815a6a6e8b14fe7e2d8ad17fc75e656706b67f257523d517d9f8b83150a88359e56d6432859f8f90eaba70cf90f86995afc85c33992591536ba353ae14a6932dc96ad72687ac34c2d4d5c92e51da246f557785df1944d2c3c83536739b7d8475ba39c639df4ce69859c6ffb9e994545699a3a19d53979bfa34fdec856a9f12ac70bdeacf172721496d76d8073a76e8160d99f4b7466e05a8f006cb448d2af7ee308ca19440aaca08f34422da830e476269c829a2b5b64acea4f1143d1857cc2699ea3bf2e076b16e50a9071cf15352189edf278984102ebcc751d46510b816afafdb3fea37a7d49662ff090392", + "tag": "79e64c4c0e8bb3a214955584d2bc8b16", + "result": "valid" + }, + { + "tcId": 114, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6aada828b2273ffb81dc794a8629e305cb646f9d266002bd313427d384838767", + "iv": "00dea4505cd5396f6ba408a5", + "aad": "", + "msg": "1d99ee022f9576ed69af8a7f3945362ab0c4691a4d333a3f5f85cf8d7db7fb8a069b48998cf286ffa4615e87398c3c3c1295d5bee272bdeb5166470a8923f7b79dc92b2a97de34ba87db2907ac84fb23d38f2e1af835f737488fc04fac70432d3a0b02a472f851025803aac692273273e27be1dd9679a4d626997c363ba706a7db1f4cdc07fe3c67fbec0aa8619038e05607d95a5ddc4b403cd6dabc41790adb6cd76eaeac3491c3cd6a8787e0f29c042b4e2afe987674b9495ef55768c696bc6c3df1c1e9a7c0456f478a1a1cc4c3a9b0f2cd3b42db8d0b6aa36dfec3d2c08d1398eeb75db61ae902d2da5a1efac7904b8ae32af1ff942c99769504bb5c56f5819e4f899e8bbacfd4682d82f41e179a9ddf9a0820cc4316f252d1d35597aeda43ab870887e67aabe79f046b03a9a83588994058a07baedbbbf9c01d833732efac89ae8173f902e831d579d31e4a409cef5e494a27bb6367e84fc57642048e44d687ce73dd9e71384182b262d63a715698132f218fc2c3611ed0dbf814799866c8c43b4aa7c13b5a53f9a337627d76bb960f60fa891f0076a538c396500cefd2dd1e4e024f9d83275f9b2c0ce6df41bb6488398fc657dba0efdae0019dd31b03227edc5229aff60cd083c0f0b66675baaf91c3206819a0c985bc3283600e9e6d62c6fab2c6aefd69829c75063c54ad11269ac5ec563ecd870c2af4cde6cec43e", + "ct": "75750a143887ad763c130a637e5d75fc7b53999e8a085a74a5c7e4e2658d03586f36dd67bdd0622992fc440822e63534391a435c934fa7fa19f5196695513ac812e778928a677af37a8bc36a19b7e3ab05e185429aa5e5e17cacdd8971e3c551db83c585324277843c1783771379280d1393eeb26e9e7ff7006d437b7cb0fe373b2dc3238d87badf9edd767ad7b4726a777b99cd1d11f1bc16098b1230a194bd9435caa0730276ebc0c44a923e3a14751e125aa7100cbd682202f9a71bf08e28ae36f55c6fce998a4c474dd5a5d55d25aef332c3b4640e20b222b7305dfc21f60e9f5dd97c1987120ba0b7b7e85ce810f378d401987b824679ffe45ccade89e5ed45176bab9d4a14c5a753d32e113a2aba5dfe65ac75918afed6cb2122cf24971fab932b64e104a8a01c755b4fb86afd49d0ce1a1909192551f579c3587d1a61ba5b0415cf90d572320af3b0c5d5d672d4207228e75322fffb621200fcb53d970f6a74e06bd90d8f9a1cf23c87c07deb14456dc21d84b8f6ca45b8c3af6d6d5c110488c919617c116c25baef4a7a0d47a4b247c94440176dd54a014d639a6139d83498a585b5687cea859dbb32b852690c4dcd23ae4058498ee751aec8aff3b0f1f0efd4bb50636d1182e111a6a98f95f2d55f8f4e75c1ae8a55e851c5095bcd9d1ad86fc79b0bf9ad2f58293a624c2504b30469f7ed1c645549d37177dfcd95", + "tag": "8fba48dab18a4beaddff24252e62083a", + "result": "valid" + }, + { + "tcId": 115, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "afd579aa1accc682aca54e142aa69df09802f020b24a42c41db58f6997edc678", + "iv": "9f79d1da957491069d774496", + "aad": "", + "msg": "bafc6e865c48bd34b7f9329e35cfb286cd4dc31f8316171218bf0471dffd35a330a181697ca5178688dd87efe527924f90d1c78ba40de70952ff44c26efe2159e59358f3931573df9373a73b91ba9592e12140cc009feedd2595e5b6f066b5ef6de99d4c31552cecb0614f1dce990e46e7694382f3cf3ccfcd1ea62e563e5f0dc36cb5a84e0c0b3f1f8f3fa9100f487195ff2e3169ad08136aa8ad566548c9836aa00dbac74716c26e838c1486a0084d3dfd692585e2e5ae7c75caf0e7af60219f96116ae963b4a5899cb30a120daaca7833776692c25ad7c185e6a2d70ce03ff156cd25d76153539d6855773e21142f9ba0313562875f105a2b770a15b533fbf5110dafb69329982ab44ed1b9f321d7b79ae15a19d9f3bd4c504c24b23b812d514c19ae2a347cc18c12ce915a0bad7cc89a8720d4ba5ee0964fe05e4cc59a13f92c670b8655071e216f19ad05f4bbcca6dc7feeb188d6269c58065c98fcbbac183a9abb3811d80cb476544bd74b26991f3df987f0ed0ea6238659ac09a2250fecc0723ffc51647b74bdf454f26e11112c8bbd797f09a3be8251c6b5b319ed9537278cc1abedb32aa10840984b96e8636b289335846ae4fbd4a00f6600d98ebe25885c68d7043ce0dc5229d7e9bd51bea9b8fe0552f40688429c482629ced623f6074858147e73da3ff4ad2ae45c1a1c8a6c5b3b2c3d568a756608179f63b580fd", + "ct": "cd48a6952868f7f7c8941652f6418b374db9afd4be179a948d336ba0d80438af895a21f268364fb1c5c6472f67bd4cb7e464068fe44377fb7cf4985b8428a068f5a1809498228fa8d8053650687afb9ebf3b19b43c38e56845e9350198ae0511efba7ea8bf8159a08f72e4227ec50da5b29dbb18fbf13cd22e13978efb04b02ba1a4b2b1ae171b612929d6772d958af38d3dfb2c11684a907d90b786b46ae494ed1c9da486cc7b54bd9cf2d34be34dd13013bd72e06fdad17ef143d5b857804de4a56409a35a4128fd752440fec02b9304cecce1bc6760d6fb0397bd1609ff303c9a0ea3bc5cc11482f083b6471f2e01d3d99ee23c35c37a62135d9cec9c69e053528448d813afda07fbd406ec74e0df2d1822bbf625392a2d91cc39d85c6de8ba43e5b7cf0ec2e4a0e18837f04b284d6ce6277bb91da9c0c3385bf0570181deeed3ce234e868b2c407a2a7d8d516b83cd86b844c23aaf3bece94a1f843007ccd8bc2859e0d64ba1614c2721bbb66a3a40e3f555a2b37e07fb15b116f69156a4260f1eb19d8140bc2ad3f9fd666ae35814e2fd1cfe178951f5e10cb85495e465773b4248bef9e7781e4a3fb6caf2f44180de42f4bff3772f3e87d8129db770c5e8a953e5a342c885ea1cd45a978792128ce420e63245ff0a1bb0730a7a506771e2a93874e3f1ee9ba9fc0af96a0d34d222d29aebd791416f399052adb295c3c43c", + "tag": "32b276fd0c1da7a823a5af074aecacb5", + "result": "valid" + }, + { + "tcId": 116, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0f112e59cdccd851c3b8e76c9f05a3b7c2e4feca5846afeb351c1cbcace82f04", + "iv": "7147973339d86789a2c9a958", + "aad": "37128be45f0a7f329546e1492c3c9c2d2534d5b1f5147e49ab91221e7c3edea21bbe47bfe3619437ce3c61e6e946c504f348296918219e51bf2c5598589cff", + "msg": "102e5804dda1fb5d656077edb15cadb5d0bdee8c", + "ct": "618ac626ae0e8d06c2fd2fb66be253dc26ed6e38", + "tag": "d8d93ff975cb988f09174dcd439cb6a4", + "result": "valid" + }, + { + "tcId": 117, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2ce6b4c15f85fb2da5cc6c269491eef281980309181249ebf2832bd6d0732d0b", + "iv": "c064fae9173b173fd6f11f34", + "aad": "498d3075b09fed998280583d61bb36b6ce41f130063b80824d1586e143d349b126b16aa10fe57343ed223d6364ee602257fe313a7fc9bf9088f027795b8dc1d3", + "msg": "f8a27a4baf00dc0555d222f2fa4fb42dc666ea3c", + "ct": "aed58d8a252f740dba4bf6d36773bd5b41234bba", + "tag": "01f93d7456aa184ebb49bea472b6d65d", + "result": "valid" + }, + { + "tcId": 118, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "52350da5a572911ee0e0fcedb115af6f4570fbf9c74a11bc184444d6a621d60f", + "iv": "d68ad045c1b9c2923cf5404c", + "aad": "03a94b3841292d9bbf72f413c09167c54ee10537c049afe2bbcec43b18f3890b2fcdd3bb31e6d709274e199c0c4648eb3d8b38e0c1bf7f309443bef6937cde4123", + "msg": "4e6e6dad2c16cfc6e7cac03636a4a6d88bd6a13e", + "ct": "c7764411be13cfeaaece761bd3bb13552f088048", + "tag": "bcc2544e79f34ea1076a12b76441d6fa", + "result": "valid" + }, + { + "tcId": 119, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d058304c0ba039b2e2d08661fd8f6db88779bd5ce580eb766c1d6ab34b94ee94", + "iv": "3c553397fafda0eb06a59f23", + "aad": "cfb1fe1c47e2450109eaed4e1aac9431aa5db1e3b7eeacad3ebc9e8e1f3e0a823f757f619761e61ad05af8cef83104890940cd592137eb7ba5879b95759c8be1525f9a01fc01582d93a2a841336a104d169968c274b5a8c30883b4bd621725f69079bb94a174a3c94db62f2ae746d03200f01c19aaa8a3b89e78b99a62f76f", + "msg": "0a064cd5e49845c4efb60fb343dc03faffa36c49", + "ct": "a7d84ff71dc713161359b757af42c74dddbf53ce", + "tag": "736e48a2b7792acc599baa651629a203", + "result": "valid" + }, + { + "tcId": 120, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "44c8d0cdb8f7e736cfd997c872a5d9c5ef30afbe44b6566606b90aa5e3e8b797", + "iv": "6f39afba021e4c36eb92962e", + "aad": "98d1ca1788cbeb300ea5c6b1eec95eb2347177201400913d45225622b6273eec8a74c3f12c8d5248dabee586229786ff192c4df0c79547f7ad6a92d78d9f8952758635783add2a5977d386e0aef76482211d2c3ae98de4baadb3f8b35b510464755dc75ceb2bf25b233317523f399a6c507db214f085fa2818f0d3702b10952b", + "msg": "2e6f40f9d3725836ac0c858177938fd67be19432", + "ct": "b42428f8094ef7e65c9e8c45ef3e95c28ce07d72", + "tag": "32b25dfbb896d0f9d79c823bdd8e5d06", + "result": "valid" + }, + { + "tcId": 121, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e27e718e4b66c91e221f2a3df9da0013f7e14340006eca50dc30c4cc2ddeb679", + "iv": "b46fed185e8b33215dd474dd", + "aad": "2d2b6247f9c342f8d0432ce0715749d0bac0e2e3f28b785be8dc84b3a0e57a161afde34227277512204ffa4bceb6e0a4d021031b765540f7f613045f74e7e6e4977c04b78b5d3f8d4e420a9748c12d1f9aa5e03a27749be2785dd555a8cf0182c0826f2d60eed3c4059adf8872f3c4d81a963592472965cc0c66102167e4cb1ca2", + "msg": "e39aeaf1d214f78915601fee9a3527d777674651", + "ct": "750232115a5edea7b249a22c0cdae17f725d6f99", + "tag": "4a72d8c30fc7e0f1806d9a817adae14a", + "result": "valid" + }, + { + "tcId": 122, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fc1bfd0b58515c4e7906e2052596bb92de8c879806af47a4c726ff08c9ba47cc", + "iv": "f3da3be574337b8f8c052866", + "aad": "d26f7ff887725228f3109924ed9eaeaa8c103cfcaac1d6e3874d11afd8424fd030fea80547212fe7c8ac9f4ecbe304b62e5bb206ac3a8318a819b9701f494aefd22e84d227922102f5130f0685e88e25115c3ab9e8bb290c0df0715c4adb00a2ecc9bab5bbcc49cec60305a5b04f646b1d0f951673cf1eb4742c1a52beb2cd2f43a2e413e4a9f5679123b4d59f2ae14c27ee84e970cafcbb5a0736ad2636833cb644c9f2fb61a4a09fad511f4c1781c5685f94814d242c5e3eb4abe165732ab0258a2461c56d452ef1cf48b4ff0f331b91c2c71ce1c03877552837a12dfe75f78bf1cd615b3b2b864fd9503a5f5bea652870bce4cad5c726f1c512dae7f5f8", + "msg": "9adfced8e23f7897b66efcc3468d63b87da79a24", + "ct": "1875d3d76930b58361103d64220591feaad5c9a2", + "tag": "223099bb16c30cba134e639ed95615b7", + "result": "valid" + }, + { + "tcId": 123, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7ec20e38aa1b1f018d79903fc1cf6e260cec3733a19ad9e30f60b54e2ea6ebcc", + "iv": "5ccd9cdcf97ac61364687bbb", + "aad": "d9d2ee145b5c31a17dce932538c7e45da1c82abb80b0553251e442dbc5af9c126d3a76a24767c39b229bec8976a0df89fa70ea9ad872aa36d6b8b09aaa54698e7f29c2c2d12efb0b301cfb97076473dfa7ec030350e26839fbb7e1612dad93ff08e1119168c5fca56816c62b042f06d89e5a95da6a615e13ba4cad9f942534c539520d00509d0d4ac6d80c59e769d7e1aa7e12987ee05fb6a19b383c3348df6cbdcff604ef218338910a8e275d9a62b802cb07ec9249c9635e2437f8339dff3e21f79e9eb2acc2bbbadd520a84c58f0ddaaf8c32496d173b6b8c0c274352d40d47bfbd93069abdcc3d21c2cd330a8c16847f0e5299beb6a2d33be746de5c71f2", + "msg": "bab28e0987509b1d6f9cf3aa90030795f125ee44", + "ct": "ce4c58d3c7354d2d27e3bb41a62e5941fb1e39f3", + "tag": "e177391d5e2cefa2f7d35e33a76566aa", + "result": "valid" + }, + { + "tcId": 124, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e40003d6e08ab80b4bfc8400ef112945a901ec64a1b6536ca92665090d608bc4", + "iv": "9f095dafe6f6e0fbafbbe02e", + "aad": "422d5efcffe364905984533f0a579d80b18bda7b29e6e46498effba53c350112c0bbb8dc4ce03bb0c69e1d0baa19f0637108aa4a16b09a281f232839d87b6d0e42be1baa7c67f1be970ea169d3960b9fe0a61f11cd2eb7398c19e641feb43f778e257a397063db5b3a6707e9db62387054f9f9d44f143583e63edad45a00251e5173d7505f22a8bce232e56c2c276a58033ae30d5dbf4e35a862e42af573be38c6406d9b4c7acbf275fe36c0ecf2c4642898a30e6146fac992a16405f98312126b7a3722f5dfb7dd4e4911c1426b2e01d04e9be6db3771100f7d7d4282e4ea585f3646241e807ca64f06a7fa9b7003d710b801d66f517d2d5ebd740872deba13d0", + "msg": "38c3f44bc5765de1f3d1c3684cd09cddefaf298d", + "ct": "d4a79f729487935950ec032e690ab8fe25c4158e", + "tag": "876d2f334f47968b10c103859d436db8", + "result": "valid" + }, + { + "tcId": 125, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "820bb5eb3707e713d5fcfe3c98bb1ba733540ddf44b172746bb950957254adb5", + "iv": "f2b947eae4311254417c5928", + "aad": "f76c06fe9dfa7fffddae7d545977f1944bdb8e48bb8740ff1a9a90c260e1264fdbfa328ed8f183e672892a6d3464c176adab5da8ab3af7c08b71ad135d7b42c3ebd893938f82cb9d200bb50c26e823af951149407bcc05f17fbe8ec275db96a9c7aa230f1347bcf10202d5cb7fb16076f6a78cd620fdd67a9be58f6992e619a8314cb40446b654d1c01c9cc6a92e44a77b015f2cefb9e5284082951bd98ee7e834adf39306bdd4288296c276e63b0dba7b7269c63e0e77f3df0debe8fe36454ed7ab332db77d2d9d7e1832f36e13ac6c88e383dc8533bc624a27ae378758742a63e39d54fec827b19c63c692cdbc6a498ce80c5c112d461cbed6c93a458573c765c759776e7b8e3430ca389991996f895ee16fe538f2de3a902f8423138f05e87e01c1adf2232ce9eff100b39452565c10125b3a852183f8026b1cb8281e9e2e6a0fbdde64d0f4c2984a72f1ae2bfbb409c9de9ad2244860996e1053cc8cdd70511bb265f20561a0337de4891fbf293f705fe040f187ba43bf13fb5e02031f8edce5db10ef5d411a448ce0903dde943d2e199f0e4af2ad3ab2a534f0d6418acbc5ea9340356e11036bf6dec306419177630d36b41a0e646388f6010227a323f9570f43f2f14a8b9fa346ad0459c0c28ce6ca2eed98983bd08db82bfd0945bd4c94bd82a4046876d7a3844a4fb9365284b1511b6fb36a2703abc9b03a6244bf", + "msg": "81c37b34c4369ecc1a9cdd6f1557133e59249165", + "ct": "8d529d8a4f0d7ec4e41d8d361663df53c479ac34", + "tag": "d509e3e1eccfe38f7c63f9a55f42946a", + "result": "valid" + }, + { + "tcId": 126, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "65e18f70f168abaf388104c9b37a9686aebc7743f0e66b84b7c7cc0e3600f655", + "iv": "8d564420fcb9a98e7e07475c", + "aad": "016dde724536eee27187907263e4a62f3b637eaa8ab6f86d0343f66f7f73c6f8c3416cf253532454c045557ed7a371c2d6b8e19e0101e1109cd7227dc5390545ff24484031957749514379a77a33df0fd129f80e9869747b6589fd29a6935aa37b00e2abbbae2b67904726e9fe22143080af18821ff10c5217e845cd6e0ef2513c1d82c14f9d3933f3fd5c6364075aebef6c0f5c97fa343aa192ba8c526b7ad4c71c4c19ad2d5ae05b07176a5e66d486889a2e8f9ef80b9c0680cf887f60137f6266ec335a5f1d74dc41dec1653a96d61b75f4b569b9328f6b2fb40391704f66e058e92dfc15d77599018d74907a9bb8870c5c446e81fa7a764a549f6a417326b52fbbe4f5885e6455be2890c3a8b97a9fd0c92c085edfaf6a4f28dfec0243aa79a71d123282d4e9a0b3497ad569db869e56638e271f1205a52fc38cb74767e4bb2f37bd437083e994395e98454c04092d292c681ade9e398589df6cbf9b3196d12c8153740647af018cab5f9bf3e3db7deea221c73f377b96d368ff8d9ffecb8f44d50b59fafc90f655ec9271c9c1d032cfb0f23720d01981c26296536e66cdb8c390ad1bca90e6b2711170665ad52aaa188f87ca96888d3d932e6c3bf32891cd746308b0d6345ed8cf7c1ad88442326a3892e60afd5c86a2d062a461d8896446154e9148aad5b122437e26a52ba1b620d085af628af5ada9fff664d4a9a230", + "msg": "12d3cc4473970296d2918818fdcf1a570d2d4821", + "ct": "2844b68b9356049934b031b0d6de55b50fab0f46", + "tag": "387bc3a46530bdf24b1cfa67899369ea", + "result": "valid" + }, + { + "tcId": 127, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b15ab816ba505ec42b528066d9119b4b2ee38159ce54a26bc5d661127e05222c", + "iv": "75e3c608a39367dc4aa748d0", + "aad": "005931a2d5c5bcedc716c3f246e21b3a46d2a6b1ce73644653e0cf277efa492f12fb2b83f70bae8737d53cd76254dabca8422d4ff9396c265d57e4fd3d0cd1c38198e229637c7fbfff468fcdb04ca12101865c08bbf55689e1299c5e7a430296c47a874d9956557b2cb32fd3f8073f85fefb6d2005c5d3329e40dcb957f5b01d7f1582ea359b947d5669da8003c009f8ecbfbf094fb8155cf89251ee4a91a43a96e3f6d302e15753dd48dd5e3b87e093021059ec323d38d3ee72290521eefd54cf708aa9e81869b756c3fc3c9a60e12226ac643bf7a91951e5509159b1e298bbfe88fd8ee659cac98c904f68c928403894fc89df100d6f30fd1ce20666815929b6eee39ece510eb53567e35cbe49dcec0f1b80fee861ed0af1cc759d477f306a5e1273e64c7e33554d11d79632006b420e7c71d36fece18d75a8b5773171ed071c26664fc0113277e3356ab30db05ac62ea5b975e36413572dd39e5c22d5c42bc82ab0ab85b54fbfaa527d1344dc3dfb18b941b05bcc5b47d25e18ef936f3918ed87cbf5dfa67989a038e2f747345c4b8d27b101c944f0f1d6fe21cd1a653c17530f9a893d7fd48afafcf12bf005fe044a000e8deaf09bed39ba62784bd5b88ace564806a9b5e0bf40f9f655fdd5bdc4bf568c5abb4b84ec61a85f0038b4f4cc3e75c3b3f99e62b99292d510f690c07c18af41b765fe5a1ee9484cf04c69f3f49c", + "msg": "8b2a6a9604b25d1670b7d869c649a05399b8ada5", + "ct": "371fa70af8a198cb43ddd545e74b806246f7e932", + "tag": "014a0179b81691d09011dcea5739551d", + "result": "valid" + }, + { + "tcId": 128, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "000000000000000000000000", + "aad": "", + "msg": "561008fa07a68f5c61285cd013464eaf", + "ct": "23293e9b07ca7d1b0cae7cc489a973b3", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 129, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "ffffffffffffffffffffffff", + "aad": "", + "msg": "c6152244cea1978d3e0bc274cf8c0b3b", + "ct": "7cb6fc7c6abc009efe9551a99f36a421", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 130, + "comment": "Flipped bit 0 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9de8fef6d8ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 131, + "comment": "Flipped bit 1 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ee8fef6d8ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 132, + "comment": "Flipped bit 7 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "1ce8fef6d8ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 133, + "comment": "Flipped bit 8 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce9fef6d8ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 134, + "comment": "Flipped bit 31 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fe76d8ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 135, + "comment": "Flipped bit 32 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d9ab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 136, + "comment": "Flipped bit 33 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6daab1bf1bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 137, + "comment": "Flipped bit 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1b71bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 138, + "comment": "Flipped bit 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1be887232eab590dd", + "result": "invalid" + }, + { + "tcId": 139, + "comment": "Flipped bit 71 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf13f887232eab590dd", + "result": "invalid" + }, + { + "tcId": 140, + "comment": "Flipped bit 77 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bfa87232eab590dd", + "result": "invalid" + }, + { + "tcId": 141, + "comment": "Flipped bit 80 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887332eab590dd", + "result": "invalid" + }, + { + "tcId": 142, + "comment": "Flipped bit 96 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232ebb590dd", + "result": "invalid" + }, + { + "tcId": 143, + "comment": "Flipped bit 97 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232e8b590dd", + "result": "invalid" + }, + { + "tcId": 144, + "comment": "Flipped bit 103 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf8872326ab590dd", + "result": "invalid" + }, + { + "tcId": 145, + "comment": "Flipped bit 120 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232eab590dc", + "result": "invalid" + }, + { + "tcId": 146, + "comment": "Flipped bit 121 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232eab590df", + "result": "invalid" + }, + { + "tcId": 147, + "comment": "Flipped bit 126 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232eab5909d", + "result": "invalid" + }, + { + "tcId": 148, + "comment": "Flipped bit 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1bf1bf887232eab5905d", + "result": "invalid" + }, + { + "tcId": 149, + "comment": "Flipped bits 0 and 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9de8fef6d8ab1bf1be887232eab590dd", + "result": "invalid" + }, + { + "tcId": 150, + "comment": "Flipped bits 31 and 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fe76d8ab1b71bf887232eab590dd", + "result": "invalid" + }, + { + "tcId": 151, + "comment": "Flipped bits 63 and 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9ce8fef6d8ab1b71bf887232eab5905d", + "result": "invalid" + }, + { + "tcId": 152, + "comment": "all bits of tag flipped", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "631701092754e40e40778dcd154a6f22", + "result": "invalid" + }, + { + "tcId": 153, + "comment": "Tag changed to all zero", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 154, + "comment": "tag changed to all 1", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 155, + "comment": "msbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "1c687e76582b9b713f08f2b26a35105d", + "result": "invalid" + }, + { + "tcId": 156, + "comment": "lsbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "b2061457c0759fc1749f174ee1ccadfa", + "tag": "9de9fff7d9aa1af0be897333ebb491dc", + "result": "invalid" + } + ] + }, + { + "ivSize": 128, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 157, + "comment": "J0:000102030405060708090a0b0c0d0e0f", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "029e0e777db092b12535d043012f09ba", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "f83cee467336e1a09b75f24e9b4385c99c13e6af722256a66129ece961fe803b167bad206f5017fb", + "tag": "09338a42f0acc14f97c064f52f5f1688", + "result": "valid" + }, + { + "tcId": 158, + "comment": "J0:00000000000000000000000000000000", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "f1be3b06b7feac07e7eab629f556047b", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "0b32b648a2c28e9edd7cee08eeeb900034cae7215e5ab1e201bd2eed1032c5a97866ba582a3458a4", + "tag": "90be3606de58bd778fa5beff4a4102bd", + "result": "valid" + }, + { + "tcId": 159, + "comment": "J0:ffffffffffffffffffffffffffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "de9eb63b1daed321a11b7547cc9e223c", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "575e2ecec2b3c72d4e80830d0d859ad9e42c29c4a68d8d9d8d23434de2cd07733be49d62ac1ae085", + "tag": "6e4d6396125a10df5443bd0cbc8566d1", + "result": "valid" + }, + { + "tcId": 160, + "comment": "J0:fffffffffffffffffffffffffffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "40bb0abebc483ff6d5671241ff5d66c6", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "2a818888d1f09f32aa7beedd2869b446575e2ecec2b3c72d4e80830d0d859ad9e42c29c4a68d8d9d", + "tag": "dc481f172545268eff63ab0490403dc3", + "result": "valid" + }, + { + "tcId": 161, + "comment": "J0:fffffffffffffffffffffffffffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "20d5cf305e630a8f49e3bb4bab18abc9", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "96d36b795f8e7edf6a8e0dbcd20d6c072a818888d1f09f32aa7beedd2869b446575e2ecec2b3c72d", + "tag": "8a3a22bf2592958b930292aa47f590e8", + "result": "valid" + }, + { + "tcId": 162, + "comment": "J0:000102030405060708090a0bffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "255358a71a0e5731f6dd6ce28e158ae6", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "cfce3d920f0e01f0bb49a751955b236d1b887baefd25c47f41303c46d5c7bf9ca4c2c45a8f1e6656", + "tag": "2db9dc1b7fd315df1c95432432fcf474", + "result": "valid" + }, + { + "tcId": 163, + "comment": "J0:000102030405060708090a0bfffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "bb76e422bbe8bbe682a10be4bdd6ce1c", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "69a24169792e9a07f6e6f4736fa972dccfce3d920f0e01f0bb49a751955b236d1b887baefd25c47f", + "tag": "82ad967f7ac19084354f69a751443fb2", + "result": "valid" + }, + { + "tcId": 164, + "comment": "J0:000102030405060708090a0bfffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "db1821ac59c38e9f1e25a2eee9930313", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "4e4417a83beac1eb7e24456a05f6ba5569a24169792e9a07f6e6f4736fa972dccfce3d920f0e01f0", + "tag": "472d5dd582dc05ef5fc496b612023cb2", + "result": "valid" + }, + { + "tcId": 165, + "comment": "J0:000102030405060708090a0b7fffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "f7a02ecca03064b2ef3cce9feab79f07", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "6f8e174efca3097299f784efd4caff0bf168c3e5165b9ad3d20062009848044eef8f31f7d2fead05", + "tag": "caff723826df150934aee3201ba175e7", + "result": "valid" + }, + { + "tcId": 166, + "comment": "J0:000102030405060708090a0b7ffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "6985924901d688659b40a999d974dbfd", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "af193090ce3d43a388a1d294a09616906f8e174efca3097299f784efd4caff0bf168c3e5165b9ad3", + "tag": "3b08958be1286c2b4acba02b3674adb2", + "result": "valid" + }, + { + "tcId": 167, + "comment": "J0:000102030405060708090a0bffff7fff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "3f1188546c65ed0fc55e75032c68ee44", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "5deccf838b2cf5f869c90d2a611160b1e578ab8121b93735cba4a1930647b8c4c84bf776333ee45a", + "tag": "c14d52208f0f51b816a48971eaf8ff7e", + "result": "valid" + }, + { + "tcId": 168, + "comment": "J0:000102030405060708090a0bffff7ffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "a13434d1cd8301d8b12212051fabaabe", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "d2cae1684aa407a13a2e2da5357e29f55deccf838b2cf5f869c90d2a611160b1e578ab8121b93735", + "tag": "ea2d018099cd7925c507cef0ceddb0ae", + "result": "valid" + }, + { + "tcId": 169, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "00000000000000000000000000000000", + "aad": "", + "msg": "5c7d3f81d4b5055ed6f8db53614587a4", + "ct": "541b835dc828d541073f7d7d7504ebf5", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 170, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "ffffffffffffffffffffffffffffffff", + "aad": "", + "msg": "6a347ad1190e72ede611044e7475f0eb", + "ct": "a3f36154331c196624564bc395e49c3b", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 171, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fae2a14197c7d1140061fe7c3d11d9f77c79562e3593a99b", + "iv": "bc28433953772d57bbd933100cd47a56", + "aad": "", + "msg": "", + "ct": "", + "tag": "1bb94331f26cad24036cfeff34b89aaf", + "result": "valid" + }, + { + "tcId": 172, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cee9abbc26b63e169f0ced621fe21d95904e75b881d93e6b", + "iv": "1e8259e0a43e571068f701cd2064fc0c", + "aad": "", + "msg": "46", + "ct": "dc", + "tag": "af1f5535b125b34fc466902ea40cb3a2", + "result": "valid" + }, + { + "tcId": 173, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "189f0bd390ba40632586a45c39735c2b87113329c800f394", + "iv": "c84442d6975f0359737de0fa828f958e", + "aad": "", + "msg": "b4bcd7b8eeca3050dd17682c6a914e", + "ct": "2aab5c87dcb4a4dae4e975ddb65aab", + "tag": "6b03b7557c7131e2352e495d54e61aef", + "result": "valid" + }, + { + "tcId": 174, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b0724f15df5b792c2f49bc51df0ac5aad69be0030981613c", + "iv": "13cd526ec77b58f62d48d03f8b88f2b8", + "aad": "", + "msg": "8da3ab9c3d195b04df452ad23953da4d", + "ct": "d127fd2e67c0887d90eb92b91f357d97", + "tag": "eb05bda937faeed27f8833295d4ba559", + "result": "valid" + }, + { + "tcId": 175, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "998750ba784841e40a7c5b03985732b6397e5459a3843954", + "iv": "1d3d62eccd8ac5e896f2654a7f606fc9", + "aad": "", + "msg": "2f60ca3494a958dc3e6ebeb5d0b4e6dda0d0c4331ab9c957f6422a5100878ebf", + "ct": "344c2cea17b06cb3da272e22a22a3a71ee0eaa1959a7facfff464660ddccedd1", + "tag": "bab7fbf499ff06aad5f757b1c1a4fcc0", + "result": "valid" + } + ] + }, + { + "ivSize": 96, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 176, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "000000000000000000000000", + "aad": "", + "msg": "0b4dbbba8982e0f649f8ba85f3aa061b", + "ct": "3f875c9bd7d8511448459468e398c3b2", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 177, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff1021324354657687", + "iv": "ffffffffffffffffffffffff", + "aad": "", + "msg": "1ae93688ef7e2650a9342ad4718b2780", + "ct": "210dabea4364c6d5b3429e7743322936", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 178, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5019eb9fef82e5750b631758f0213e3e5fcca12748b40eb4", + "iv": "ff0ddb0a0d7b36d219da12b5", + "aad": "", + "msg": "", + "ct": "", + "tag": "7971284e6c9e6aac346fe2b7a0a064c2", + "result": "valid" + }, + { + "tcId": 179, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "21218af790428f8024d3e7e1428c9fcf578c216636d60e73", + "iv": "34047bc39b9c608384dff5b8", + "aad": "", + "msg": "e3", + "ct": "fe", + "tag": "2e982e24b81cd120d35a70fe6935e665", + "result": "valid" + }, + { + "tcId": 180, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3a8bf543c480925632118245bcbf5d01522b987a31a33da3", + "iv": "4ebc13cf4636cc7c45e560a7", + "aad": "", + "msg": "53fc72e71b59eeb3", + "ct": "99f2ff1c8a44e5f2", + "tag": "6870f104ddc514477b400336fb01860e", + "result": "valid" + }, + { + "tcId": 181, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "92f4d2672fceec43963ccffb17e6ea7578b11418b06a3b82", + "iv": "6e7ff7f0797685cfc44b05ff", + "aad": "", + "msg": "c3ec16adb184affa8ae9738bffb916", + "ct": "afe8ef41591bfcc00db3c880ceb186", + "tag": "29fff7f285768645c9c8bf7a471c9393", + "result": "valid" + }, + { + "tcId": 182, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bcb6bc5ee6743df1396a34639327b25809ec9c81dd6a0c0e", + "iv": "be0326d23bdc2c64648d13f4", + "aad": "", + "msg": "80474a3a3b809560eee2ce7a7a33ea07", + "ct": "90339dca02ef717f1603994aee6cf6d2", + "tag": "e3d33e01ce64f271783147de226228bc", + "result": "valid" + }, + { + "tcId": 183, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5e1d28213e092536525bbae09e214af4c891e202b2b4fa4f", + "iv": "b6be6cd0681235d826aa28ea", + "aad": "", + "msg": "53d59433a7db7f41b31ccb6d4a2d789965", + "ct": "b98ed6321679941a3e521834296686ad98", + "tag": "9f50c03e055e519712c582ec9db3235b", + "result": "valid" + }, + { + "tcId": 184, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7f672d85e151aa490bc0eec8f66b5e5bee74af11642be3ff", + "iv": "b022067048505b20946216ef", + "aad": "", + "msg": "ef6412c72b03c643fa02565a0ae2378a9311c11a84065f80", + "ct": "addd303651119e52f6170dfc7a915064253d57532987b9ab", + "tag": "fa0484f8baa95f5b7a31c56d1b34c58b", + "result": "valid" + }, + { + "tcId": 185, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "969fed5068541d65418c2c1de8fe1f845e036030496e1272", + "iv": "817fe51c31f2879141a34335", + "aad": "cb", + "msg": "3d8233191a2823bf767e99167b1d4af4f4848458", + "ct": "0d2c3a3c0cc4b40e70ed45e188e356a0e1533b31", + "tag": "92909a80e90540e1878ab59ef300072b", + "result": "valid" + }, + { + "tcId": 186, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fa5b9b41f93f8b682c04ba816c3fecc24eec095b04dd7497", + "iv": "62b9cf1e923bc1138d05d205", + "aad": "2ed8487153e21b12", + "msg": "18159841813a69fc0f8f4229e1678da7c9016711", + "ct": "c7c1cbb85ce2a0a3f32cb9ef01ad45ec1118b66d", + "tag": "253317f98bdab87531ece20475cd9ebb", + "result": "valid" + }, + { + "tcId": 187, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fbfb395662787e2d25a2e7510f818e825936a35114e237c9", + "iv": "3f1a1e02e90a4ba7a1db9df2", + "aad": "74318d8876528243f1944b73eb77e96e", + "msg": "2952a3d64107d5cbb9602239d05a5c5c222cf72b", + "ct": "ecf5e403f19c007c8da7a456caf0a6d75762829b", + "tag": "e0877a100f9dd9d6795f0e74c56a9fab", + "result": "valid" + }, + { + "tcId": 188, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5d8e9c2222316c9ed5ff94513cc957436ae447a6e1a73a29", + "iv": "0802ae86c75a73bf79561521", + "aad": "5ca354a4cb8e4fc9798aa209ad4f739dc7c232fdd1f22584", + "msg": "42b4439e1d2116f834b91c516a26299df279956b", + "ct": "94d844d98b9467daa7e8dde7f4290037354d7fb2", + "tag": "62196638590cef429d6b1d1a59839c02", + "result": "valid" + }, + { + "tcId": 189, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "11b18ea39c38491593fdd5e6e4ab8b4a0129a53f49ed6ca9", + "iv": "0952a70d993188c1dd8891a5", + "aad": "", + "msg": "7153217813c390b8d458be71fad1afb87971ffbca3a9411e3e7abe8b8774f987167acfeb5296e19b408b581ad6cab08c8dc81d40cdbe1c6592fb573bd7a3c6", + "ct": "e46387d0324f3e8ffd287b35e4b21f7e71f62ba75f13c032576ae8344f9d520a6d61ef9f99b9a0dd875d2692203ab668f7962f2ac9294f91106a3884477098", + "tag": "36dce405ee69e41527fb7808230a1123", + "result": "valid" + }, + { + "tcId": 190, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ccbd0f509825a5f358a14aac044ae2826bb2c9eaaaaa077f", + "iv": "9189a71ac359b73c8c08df22", + "aad": "", + "msg": "a1ed1007b52e36ec0f70109c68da72ee7b675c855e3e4956d2dcf9d12f675d6933f677ddcc58face857699d2e3d90adcb8c6c57c9d88b5dfcf356de4c0b63f0e", + "ct": "e9915bc5aea63c8bc014f2ae6a4986b03115ff1f34ad6c0acd74ffca07c453ec3f3ce6902d5ff338c588a34a1c3b30ef753ec7001572cbfeafe690fd00f59b02", + "tag": "fbf19b6b90e2d9df7ead0c3bc6e375a2", + "result": "valid" + }, + { + "tcId": 191, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c0a52b33c0095ecfe1f38e3494e194739ed974b8c7c08a2b", + "iv": "1debe7394ef2a2a59988344f", + "aad": "", + "msg": "7d989848d822a5c6a0fe3e316edc0adfae9dd631da2e5d150bb6aefa041505accecd2ba3a27379989c471bc7213a84ffe5128850e271d518798d199e7b8b657c39", + "ct": "7f16df48f09a349053440fac4b835355c24c95317b82bb8f91bbc1918263300c0a4a20a3fa03c00807b82839ffaf898ce237fee3d04f76f29cddaf44868f691103", + "tag": "6bf342308dba90792545dcb67ea785c5", + "result": "valid" + }, + { + "tcId": 192, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "24777288326e1a2190a318c77188a7912d0ba8d41423a29c", + "iv": "f2f41982fe0f017ae4ea1b06", + "aad": "", + "msg": "60b8beabd7e4a36fd3666e13a4cfad405ad7b0b17a614577ef9e9dc159b2040cfb61cbe9a2a856053cd46a889b8a8fde21db8822d6b346f665e03ac69ce86a15185bbde8cc9abf0ef934fd22523731fa2c3c19c2cb4579e57503b0322dbd29ee30c63045498e402518511f58525626b258703f9d01dc9351bc62ea53c2a9bf", + "ct": "18cab25b5d7c4cdf632216123f74393324bd13dcf0703cac6faadcfc7ed0a7c0e4ad962d9afa1c6357fc20345b9f43dfcbc62b72a7b462b8e713b1c759957be6c624f3e24ff62b27a94009173e721a3a9939bebe78855c842bcdcd51bc196d66aad79da4f09b38137b1a6f2a39456c1b6189cf8957b26b0c21358de69015ed", + "tag": "bfe7ea91f4622d12de15453571d440c4", + "result": "valid" + }, + { + "tcId": 193, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d045c6eb173f440843faec3e9374602a94ee3f7176312208", + "iv": "98e9153daca2522e3162cb15", + "aad": "", + "msg": "3f0b30dc963a82d182c035b5a823060f07c4123792e6cee6bf91fea3c52fa66bb6a93ea6cce9f4813eb95bf18f816c00ad4fb56932827a39efb2fe56804e604a606774ee92ad46cd8c172a0d2bdea2fc99f67cd82c6024c315cfee6dbb8d27f745c9d0ce9bf5d09724f4bed003cf39478348b3304baa4ecc9974fc4f3ff93f95", + "ct": "9663e6f98b2768448e6dd0dd780e145668af5b002257e353213868c9cd9fd3a1e9427530327541775a093123076d34985db3aa248cd55e532609d1a39274c49216ea20fbab719b9c7e310b27877b9a33d1b69ab747afac944d1e97ea789367821c331f00b5d618402bfc57884d18edbd60c4dfe218c08080b8e3479ff84bdfb5", + "tag": "fc2ff62a41bdb79afc369842e4eccabf", + "result": "valid" + }, + { + "tcId": 194, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3493fc8761e9dc247585046f2b78aa7f138ff9a9d47d9b39", + "iv": "87eafe6caead7f916c11ab76", + "aad": "", + "msg": "5338ebccc96896001715fd3a2b88710f6afd6ef479d7332a6cb54a3a46b35682c91f54ed7f4bd501c50d51c3cb6a74d21e269b832d985a30f63b79e82fdfcc21cea5c087e648de740c4c1a327eed5c51acf7c67a5768d985bc93eed979bcc2bba6eacd085389085329db182413b654795fd7b398775ee3628f386951bc39f9405e", + "ct": "745dc7936ac2dd20b5f9ca87c6e7d9d5b7c57a8802d36f153bd81d96c88f1bbb81d807444e211b8e7e069a681fd8dd6c2567dcc32a6b840902c769fb21ee07ddb41a7f67e2fa5c4ecbe6619c47f019ffc32d5033d4769b5a73fe52988edbebd9e965a8b825f6bc500143b456b4089588a5df6e9d56e6188da26a942b5383304709", + "tag": "a7c80b93a0fbbcf48d784de303d1116c", + "result": "valid" + }, + { + "tcId": 195, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0b68b66d5182fa6c3b08edd50a0a7483f025935a0d64abcf", + "iv": "6fa4902beebd20e0e33138a2", + "aad": "", + "msg": "e42ad7f89a187d9959681475515fa117091556097c0d866dea5c87ab45d94b89777938eb381f6f24bd222684be49d0f78223aa48193ce9e9a83d007c26fe4ad4d036040b81021ee4408185ed5f4fd871def6f5501bfb4d5ad5b91cc4c33753e8a8a0b419ff7750178bb305662a5913bf5ac97424114c2a596be64fa84e6ace89f0a5a34e305950b4fa504c5d0cac499ce6c142624a618c2db9ef33878e8c014a58f974356cd6773749942b4c6747aa2e19f68d086c1d3305da85f9f6528b725cfb428b583c727e4c4018c8c197d8fc356079d6f4eb89088925fabb0b02100a647bce9a956fc447f541f4a82ff1d856383ceb3463489def07ff014949d59ada", + "ct": "0e11afe5baa1dcc26fb4ce1a14530129a108edc67b511f979974d31d07974dc6ba4a1e7b9cdcc066e77e70a5147ffdc65b29bc5259226edc9a279f7a4375ddd39e0d3fdbcb084bd4dc26a489d3afc4be4fb20daa00b72fbd662dabe455cd47859bd3d38284bccd8e7f8d320948054f177f75a94e0b13935e5958c159029d776c4d586088b762563e82343fa8a6beda38071bf1cdafce3f503d8fc1a92478b7f630341b0bb12d4e5b59d60eac69c95214decbd49aa684716649752de35466abfa39361486a3572f61e3418d74e6d1192f07438ce541ae96f73daf0efb8c4a5a7bb44a6d0bfc707eb0ff9b62c157f749f3a3a6a58f4cf27146b5d87f501d7f72", + "tag": "ee53092e3b28d61488d9cb59a718a4fa", + "result": "valid" + }, + { + "tcId": 196, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a5e1667400c497a927eddbf37566d295a09e1f061b24af46", + "iv": "c8cac0a02a3b3276c357c2b3", + "aad": "", + "msg": "07133989d3c42b89755d10fb60ec4c1b22521a11a304f00cfd7cc59ab54779178008d05ef2960e1d2b7011fa7a8fb6bb27b0bc54fb509084ed7a5a697b4d72fe24fda3da0a5ac5198bc1db4b91eac9c185ade810038346a2335aa1ccb0eb81d35a07ba0b89b4870cdccd367bc3d7ed1ee3f242308b29debd9f12e4e6dca74a3f42f84899035f899e4d0f9ccd1c30c8b32d21779d555f0a03bd5d5c5e4447a92098a10c72116b97722c7019da23f6320f47edb9c95c1ba6b37acc02d63acc50ddd0d26969256003011d7f4cdc2ab5c24e256da648ed1b0eb56c95c57a7fccdd2345f359c0bce6a2f0f49d7184a0023dd05f2eecbcc70fd0fdbae06f425590db38", + "ct": "841ca3043455e480153af62a17ce904f0843906120229384c9bb2013b441695df24987d37da6b20307fcead58419b11e24f7b5f23a13fdac7555189b645ae973f2725010f779639d870ebf382b0df7aa97e202d9aa3269f4f577b1e1dd001cd1ac6dbdd3968b2f2f586f948d642976baf748121f9720c6a8ac86ab21ecc1dead08f0dbd0f1965cc6bbc4f215a53a630d2848d70c039f9869eac911bc049f8a470f76661bcfd05c07e06317a1163b208b8626eb5616fa5d0ef6b877e4290ec0b0e3eaa50122219a0c60b2fd17629e91962009161b6687a0e6810e0a40c9f7f617d04c0d71e03771ef8da5bc950c7c7dfc61cbacf11b3c143310956c7736c96676", + "tag": "46e921d8fb4fa03183ad427b302c165d", + "result": "valid" + }, + { + "tcId": 197, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e602188abf6a91f3e258838cea6befeffcf6257a509c3e95", + "iv": "9e35d3ef1897c5fe3f647204", + "aad": "", + "msg": "3b9a6edc44848c072341fd4af51ec116ac328f69cc5a3354e49299fb2e5d22fa0084e30b36ecaf54309397b2b498d686087f3457698c3639e73ca18c78c3e021d673986cfc2ceb4d07e66971e976f58f0336f82c7fc0d52d66610f26ca3bfe53c0b01cf7c207306db904c1ad300ab95c56fde820a8edd256f2b9906b312bf7af5ef4a806f618ddfcb67179b03fff80a245c38d8f4cff2875b71a0bf69129caf97121462e0501ec6574ede94706f4a04d2fb301d415c22ea12157d2e919bc7a0169a5ad5c7bb5761a8531abbe77d66a4871b3f27a7170f099044b9fdc50a8cb3b894252a501cc896ac4793bdb478bb1cb99c02341d7238dd8d593cfda02f7d520d7", + "ct": "167183661675677625bed2d5f55f728dab80d7f06f629d99e58b45069fe9d7428e8961561b11245c709ac9ebb5c59ac2a89d8375d8a01d849c7733a1b482529927e3f1a1a53f63a4be08a11c941c634cd40373c42ffb2449c641bc9e39eafbcf9c0fba677e36496f73fc70aa0972224901ab04b0a196ab745262021b2313a8464187fecec43adb406258bddcd8c9d04dc2ae29e65d54a89dd0f1752d6d950dbf7da4dea0a7b9465579503fc8ec4451f4b39878ac4754a1aaf7b0b73fee11213cb8e601fc6039393f72e0e079ee97ecc610241757da2db2f51d5ed121481540eff47287744dac43375c4f48a46af70190453a17c3c78d735ba1d1fc76a330e6cbed", + "tag": "c72035314f43d256f8d845eb696bd943", + "result": "valid" + }, + { + "tcId": 198, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "62d347587ef0d58d6cc3ba2ae7af655704ac4dabc1cfb29c", + "iv": "34e6e296f7625999bc9f02e3", + "aad": "", + "msg": "823a005097d7811a4a81636835716670d7e239fe025978d9453461d8b08955fc9f92f297f0474177e9f730cde714467fd376b370ed96725497083f0fb7de9de1037f5094bb9cce8a7ef3137cfe31824ac1f641af92e2806c92e3c58e662c89cc259b3da66bb278a7dc08de9240eeef7151f88ec465f258ecc01b7a2cdb3e188eeb689813c9fb4199b8ad62cc26af1f52f1f3aa02ef3b605deeb0f20a8f00a9f9ca3d153e51d81ccafa07679b438450d0d46e457d5323d3ad385300930e222517b862ddf8b1253df0e20f51eae676cf83692b6ae6d4cfe35bcf43d2cec2edfb72bf9219e8b05aa61f900c804eba59c1007f2ddadab3e1dab4485e5c77f7a988095c5a447c7cd7ecefa26527dfcf8b4615463f12e3ca6910a8a41b07ac4f58e5219459954131c85f8aa70b943038e1d6e9909bb647707bf26a5ceced87298e4f4e616c0cc1edeb8e0c5a6d214918cd245e5d7d38d8c8ec141ddbba354cd2d9b7dd21132d9e4af58f4b6b69eeab9ac0ebd616f564bb4d5a38232d03e7fe62ed700c7761ba25a784c4b0c4804eb500175eeb8a5843e67104e3d1e3740acd022527cff1c982874fe956872818a73b8ca4782bdbb2d17a564de7070b51e0a89ec1834dfc74f23dffdfc478b92b25b26bc8f8a55267031d98278b691d4d3e6f706670d3a29774cf4517ad832b639f944e101694af6901d021a9a7c63cbcc543854460", + "ct": "ed35bbdc40a2fd2492b1106d118d0c265bec23ba55c5648537fd88a5d2c254e5764602a6e40cd4ba5c0caa4a11414ac1be352c4a7338505d854f34b89fc723d6a3d70369cd1bf2d190065e3d15a4a93fc842e1eb03d580bf500270e88d3f624cf24adbb118ed7ffae73293c8d35fe360ee263ccb41dadc5b75c8024cef1a3b79af12db4641f25e9d9a25dc39064f2f9c5c96c54a9d29c8c9caf7321e27de79c98c77f026f2451a18aca3847e2e92f21440b37445695610020762c656ec2d2067a854c29a69b9d05a0228b389ebf009a7d288ba21724f7733c817a995753359335c928d4426dc2c6d22a61034892fed04a171bd295e31f1f33f5c955fcc2a6ed46051f69f1160298b0de6bbfdb50e10e47d4c7d664c3dd642f615f32ff3246593d29b99395b280aac02d53897baa0f95b919faf94dcf43f38e037acadf56a1f7f1a20de9148ed1527b68c93919ddeb63d386908ed159797a311bf19a72048bb2ff3f4b27d46341aa4aa622cb0cf3adfbdcc42ab211bdec58a72fe36f997c49b147996265bb2ee5555f2ceca4e016af6c069b03f22ad2cab555af4e2dd1409566745e1e89a6dfdb6f8a0e759c09d57768f8b47406a3b9b3246c90fa12e6076b01ad02e7752bf10424a103b3e56633adf55b97f0a18823ef4ac26c92f7cbdbfb54479127fa98c8c5b7325df4a7c2bccdfe07d9200cd953c01d41290c0b157a6c2", + "tag": "8e883570219fc38cfaa09fe270a35604", + "result": "valid" + }, + { + "tcId": 199, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f208e90e0a08f222c8ac3d4a0c8a8185f3f477f1a43ffce6", + "iv": "603ddbeb612b71b1d08ebf40", + "aad": "", + "msg": "bbae93802be4407815f67e4962b9c394b2fc7c94e6c10a42465f453672100be0d358ff7b0b285cbfce15f3a956a8c20f33a9d87b1202b249cf3f2197fd5d7f8bcee80d4160d0a7c1e8ce7434365a9e5aa413b1923d96073eac3f68f8b5a2bbf23a9ae13f7f13d625c40b42ab06771c1ec00960c2465336b855cb554d3db645f0b7ba2f4c64e0f652bd7902843cc43f8aa8681c838dd31573679c3433246a024c6694b2edbe35d12ad0219d556962e68a00b0586a36f1efe721055b3ac81071a6cb62584a979316aadf220c19d3309b6b22415c28f6d9ffeb20c83a85d5da48017b73cf9267d65b32d4cbf6e12a83be27a2c9848b715c8ab7b870a523f5d960273f703557cbf98f4b05b9d9f78bf4dc4475e07222e5fbf52eb47c785a84b9ec48a04bdc3518864cd9d578e94a63bbc595454db1030df7e99c293f0d4b33a6082c90bad953afae04db99a20abab29ca853858e4608de8df48358521eeb5b983ca4aa0dfe3f04bba8993de84c807ad56e5d79b651d5c2c9cca44fe4797de16d713ba45e7897c031b4f9ae85a219c0ec49ab89ab195effd3fb9f4997a3e1a6d066cf4437c4da39f9939eee4b6d52c1776ebc34ce5f45f2f8703de2404e1f97893a07c8997839c35eedc52e1c5a6412d3b6a9356ff0702845594b581004ce837ebf541707dcc11807868d60408c70c7abe996dd602bc81395202d060d4f076a432fad", + "ct": "efe849ef160f3e4c2361dadff9e116534503065f807acfb141ecb9e2c3f6beceaa9c3cca568b646e85f7260dbd20495fc3e9fa535cdbebb24d38b24bbf8ac66f35887132e4c7fb6a7a494f92173f337018cf47c3fea564ca69f59fb40be967aca0d95b99c9aeee4adeca6ecbe327693d635dfb8facf33cdeb26d8bae383a0e09ab761efe6bdfbe40579df2aa7f524b99bb2d8902b45c4e2b4a5f673ea32d883d08f9100f62e7018dca2a8da8142224e62ffb2e9e2dadc47012928d67be5fd2bc0aaaa656ff53e2c20b2f7acbccdb77716326a33ad21c3dcf1994cb2ff103fa104d436b8515b6341fa32c92e24225b4c2eaaf6350384716ecd3959f512967268fd0a81411d01eb4d113ea971f79536b9da12e0543d2e5cb2d944361465e255aeddaa753b62643de5f08ba8936384d6a6292bfa5cb014a55e87321f1f7e2a1ba26b392986570d8bb95cd373c17d9b2409d4a659b428817957505e2903972e99bef504507bdae035af62932693ec5e698c48ceba50e35f700fabddbf99bfee0835a2ab26d1910d96ee5e0de578588a3eeb0b83ff89ad019592d2072b5a9790349c42f17532bba7c4264b44de0117ecf90298780543ce616018fe3b28615cb9713063ea9631f7f6405d2536c0433457f42eeec5b7299db8c51d308ec32184cf21b8e8aebde7248bb672128f64e35e1021eaffb7b78c481bf3ff9f890aa65b4615f25", + "tag": "a2ab3c03129dc8d507b006232a337716", + "result": "valid" + }, + { + "tcId": 200, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "701aea2830752a8cb9821af7b43895d39c2431ec877ace03", + "iv": "a21c680b6e9e40c5b0686f09", + "aad": "", + "msg": "a3b7e43f27027c7ce0fd944fe706d89f917b442411cdafdcd74b7f428b7962b9e31b80c957e3f0dc17e6639624c0d0a069cc684b50e700fbc126f17951ee31a388b8966bfd792d2cbe67a0ed2752062813eb7e6138f8d333a1b6721c3d3fabe96060575e9876cec095317090724e1334fa291b90cb926237e331f719290740c7e7e4432976c52203d617b307798810c99df55f0a3fd1fed1b929fa1fcb007465942d9ae3c1d96430916ed15f92623c181461d607a2977b494af88d62f4e3d8485d4600c3e1a09aae4ab743a74e87647db92ab8477f2a8d76193574c8555036330eaca69a12b15d66591d98b8fc08ba06035a549051484af9b3baf9cc366a1dea63885202a6dde3aafcb3c7350f7b2fa4beaab7d5ec7983627ee70677310faaa0cf5ed3afe71c8cb2c3eea9c6416946f28dfb8cb6e618243bef4258a042b36ddd6afe755e982bc49d3017eee040c2cd255e820acd278ee866db3fa2a836bbca9107e55ae55953e2db0a62d9fc245ec589411d1c70b84d974af8798bd4b15d4c95339a96765f7b1283a6c67ebc04075ece478d40408259a25f8291ef9e2f2e5017de2377578c42067228fe70562ee00acd61855efeca0c37f1aa449c0568cc36b8eb2c138d978d8b8e2881acec5af7fe04e595bf615fede74f4948266a9404ee6f1a1241cd08c11ef4d037951dd9780752544518474fbc2d4e3355a72a7c80c703f9", + "ct": "9d5d5a513e89c0cd140635993c13ec73435f3574aa10c9b80714c34997f2efafa5539e7ef45b36602b164719eda8d799a40a0775edf743e546e915142622dbbeba210d72af782bb26b11df3b9f5aa7bd1a16cfb37d16aa9bf1160dc7fc6901cc851d8443bda743a84d5cef58c8164b3bb9c75fe2abaf247814e2be0ace469aeeb467f2196ceca29c4bfd874e9a58725c7c5d03ca45bde67fcb65fa9b01a9d86c8ef6c84a5e014c99fdfcab0660bc2cea6de79b9bd135d74f24473d283c2b8c92ec2416a609109f21de6992e3c9e5c7ff67d97789e240125575b07b087b3b985b71ad1fa81a8af6a2df6eae7cbc4c911e3e02e1ff3140c01c38a2d7ce18464592150b3a3c00a96ae02f089c12a8e29e400eb55cf739f78e1e9c4513df3821af2df51af476174d8180045ac2ceb3e3579d947983d3ff5bf414ce83ba3bf55349535bc1fffbec73f01acb4aaffd679fc101385cdd5649a78e953a14ddd385c5ea3ec0d060b98f7ddefe2b6669980020bba05e6238bcc650896d0350adefdd00f741fb06043510730da47a5455c278168067ef4e8579f63f7b2fb7e4c2a0fe84e6c03ea2e4a7b138e7598f8ce8ced831b1f5e5a88e0d665f3b7b61705cc50b19080f82bc652fe80f2e8f7fee8d2eee55788b86c1e56d5018023ebf7a23708edd974cfe6963f3eb9b92af9b1e2912377810461ed6c941e79873babf7bfa65b13c4f326d", + "tag": "1a72a5eb33bdc848cd5f9f9379334955", + "result": "valid" + }, + { + "tcId": 201, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "856b07ff0afa13819eef43f5dd4a81f7bed2a9c7089cbf06", + "iv": "901007f757eb3bf0bfd1e03e", + "aad": "03a47b930053a4abb40c661eabfcf19ec269f4913a5a18513eb67243b184b2e946fae1838b35c6f086f8227e4d353620684008827b9720f450c3977ebe8622", + "msg": "b03092f7ad0d36d7e00784652e4ce12eaae65006", + "ct": "998a3879df7667ff9465bc21d588f66bf8c1c12e", + "tag": "978b9e5bb49f18f9f46caf5936a67e85", + "result": "valid" + }, + { + "tcId": 202, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "55a4ca526443357ac7c896d9a67cf7d467f6921d69002d3a", + "iv": "dba233ccbc7992e64e82cfa3", + "aad": "df737cd77d31eb9097a17c31b4c92889ef1f32b7464e2620e9007192ea675b9ad6910527ffecee2452be0248fab75608c7fdca08e86580322aac1d6a11b96ecf", + "msg": "4e56d1ea538cf49cad49959e884eb540c846556c", + "ct": "3f57ec1b414f74818fead9f35aa1679402c3e750", + "tag": "97b89b291419e32cf654ea630a3ad014", + "result": "valid" + }, + { + "tcId": 203, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ef97a39d45a5054df344d818eb156377d4fa5124274f2f2f", + "iv": "d0278d7ba51e31ebf8f70fca", + "aad": "66f612f2b99e74db949c1caf3cfbe1dde9646da8497861c37f46dc43bfff08df3aec09b229a5c8b9d8b8901f22dfa3aa1f955dba7aa2e883bd0a2ac510b501a038", + "msg": "b491a47f1082581642f8053f66017740e898028f", + "ct": "139bd08a98f92d510c9b4297c49268b22248130f", + "tag": "712117f40aa46db99677a1b78aa5b81b", + "result": "valid" + }, + { + "tcId": 204, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e430ffe62cf0028ca50bacd8ac020d5420aff345b71a98d8", + "iv": "2b5dd5d7b0e26fb51fa1e0ff", + "aad": "625d9a344276ac8b4f62f49bf274a19f8086976741c79e04ef1499c7f4f4b8203dedc6b02e3d49d6c5bc67a973fb125793ab8999f565a41414a6de06f9adf1165f6ade260f447e028a48ad65044d013153ae96e7063732d1ba3a3783fc0905e9a28fa23a5c49ab2cba016d20c6df704bada62a243d76dbaf17a98457793893", + "msg": "56a1c5580ec785da046fa16bd039a4737eb88c7b", + "ct": "21ab90dda8190ee814206fbf89e49e8334d81878", + "tag": "5ee3bd42fbcc55f7c5cd462c6fa991c6", + "result": "valid" + }, + { + "tcId": 205, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f381d0ffd3373a1aa02edd1d7fa748e91908fe534bef73d2", + "iv": "10aaec0de4ad75376be9fd41", + "aad": "7739aad7399d9c0f0a3c95b403888f0072d94acb76ff576e05f4a063120b84e722b4d5cd43a58e4abab444cb8ced112f3dbd8993b831c39b4edb76e92eb33ee24c5922b56552685f3b0f4cf22e0e11628f6a3d33eff9def7ec527112dfafcf122814e3d1aaf66c3f970526511088bffef8101d1cef833268ff80387df30557f7", + "msg": "653a3f033c2775e08fef73cf80f5e2699fb360cb", + "ct": "5565c6d09c4c924d61c0ef808fb0ea144ffb4738", + "tag": "12b72ec1d9c32fb22c13c40b33796fa9", + "result": "valid" + }, + { + "tcId": 206, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f8ce769a34f48d24a2076860e7d18ab5f4f2a528e2280da2", + "iv": "8d7f8676115266f5d1a0e91f", + "aad": "7b6dccc150563e845434c2bca29f3f9d7841628f00c9474e0620017f7fa8e2500362fd7cf3cd162395b14a520de484c305fe2f6be6309174edc3e14fd5aeccfba6dcae183428613ed9d6df3f01d5db538245c8ae8ff50f30ba3d428510cad3289b462805ea1029133c64af457e46ff512b19580d5dfd0d5a01e42d0fa628c2f729", + "msg": "507596e9236f4d9ebcdeb0ed75dcc7ff7e52b155", + "ct": "9ed3ee2562d36b18853a0860cec49c2389d90811", + "tag": "65d59cf532847093e4c4810d1b552540", + "result": "valid" + }, + { + "tcId": 207, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4b726f49036f5ef872000a34ca09a8528a1eea7e0563a55e", + "iv": "ae05124d76b056fcce5c8b37", + "aad": "95df74132def5ae8adb6b3b6cc918a9f7c9072f2df639d269abc3c551cbd6ab245f57a8e97095a580d473aadbff50f1d871e766fec329100b45fa3571b4904b4f5e4e0d1bd25910f457dd1f01bbf82ff59a2138af16756d64fa9d82089ccd6baa18c16d0381dddbc469ccc54405e853fcecf3b2285247dee886639edaafbaad58edb8e1287c17da2f449681988f1e575c8c6e99e2a2aeefbf7e6e1fcac86adf9b1c1349be7fe29f0f71d7cbe8740e09d296a4718b41250b6fbfc68cc52061c0530fd79e15c5b0ef013a977781f7a63ed513892b8d105b1064eeacf1524de4c50ab85c223d47de35eafb9e931cf426dc455866ea88f49d51003b82bf5efc7e6", + "msg": "e1dd0b94db0a9f7fd6b2c4a6d652e0e2664896dc", + "ct": "b57c958e548442114387f4cfec8fe0dcce934c9b", + "tag": "0acf8955d654b84874201a21542d1b2a", + "result": "valid" + }, + { + "tcId": 208, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f8ac92d206df1da3ada5e906806252a78262e51e00a7ce0b", + "iv": "2c933d7590ff4058e22f7e5b", + "aad": "ff2771b5c817a5e1326cb907d5384db2861a3295109e678b553ba14a5a99005fe0d6dc6d73178b75d348b6d9c1a8b6983e20cf2b23161cc88b02752cba166f36ebb433d7b429ff5f590758d3ba5696f7268caa55b0e5fbfff498aa77ec79115c679b7df6b118cf4c51a3185f9d6177de145be885ca5e1b355a4a21b6b0b7928c6e70d6cfee65a3d17758e08012f088b28e381e8abc6e15471d580036bb3e78ae1f976caa660ead300c4d0f50d04fa07088643361ac8c634d4c375827be900d62f860f9089c5dbc5ad02f9cab9dd49a324c960b259ab839de45896c6049eb71f4a056d937a90afac1f52e7c73c24ca341306c32a016cbe40c7478de24ec8c7f6f", + "msg": "44ac8c525484528958ecfee09ed44ec0df828a61", + "ct": "971445256332bf87268538e10bb470f11df912e5", + "tag": "41a6af58f67c6cc4fc6f55189f68cdac", + "result": "valid" + }, + { + "tcId": 209, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "8f27b1c3b3d7023c76ee66c768a3e92d4971e25f729d8788", + "iv": "12444040caede67285e490d7", + "aad": "58fd02ac23ec7fa5b9460f60bfc85b4bebba70039a8f83261d6cc4f560107c10bc69548a5d6152882fb465fd59fb8164d7c94523c3dd4206d33064f5191bd31f0c48fe03d7460e995c93175b57cb03f58711adc94632031c4305272367b4289c725d9cb7ae9ba996b3a079174508c1eae8162a0bac446c1e53fe0c402b6912dfd6702addccada30a5c010fc22c2c75e43226378ec7f4b3b71ccc71f32ab1adc877cc7b0a180c75d385c0f71a0b291a1cccf4be47e272249d61ffbf059c4f7be74eba07d5e1be3a7438458a611fe58cee4f946e25dee03e6485235566f20ed555be32cd57a94e522d2168eae23c4587371a2d145f418c59e7bbc464a3bd88b8919b", + "msg": "0df6e750092b9ac576dde66006a4cab2116eee21", + "ct": "c6877b03552e97d9a1e6557f90dc7adde15a2f43", + "tag": "2536272bee7446820041854e10b49a03", + "result": "valid" + }, + { + "tcId": 210, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "9755eb909e1c30c2c11d3f106107e7b573c25b9fdb8bc19a", + "iv": "a82a5f561431c689e7c4dc0b", + "aad": "e12f568134513a0ea75837571321e6355f7078970184400b1297db21b0cd34c6677852a3079a31f2ae83781270b36a97a28da391605f02b40754501871675616a9a9047f7e3865295120d5d3d329ebcc7a4e24ef8db3efe615c2a9102dfa7a49c370f333c62ac196fb4949c64409492712e3b423faf621443e6d07e76738497e301d41c26a414e8d08ff118d65b6a2d6768d18883c52466b5af58cf8335904a2ebb1c02673c80c285d6771067b0db6e6e93156405bb2f5b61b5be80df0db6ae5fa8a9fc69db80be215a0ae17b808f6a00c52555b4b3188e71ea38ff08583b6cabd0b3f86b44f2a494cf54bb41320bdcd8bebd1e8b566435e9f6b2949e2152c5f721d0490db80f564164dbc6f394933dadd7b98ef28b04f54064f9ab84ea7f6fd92f3bb071eee8b3b924ea9f182e707a06f80c6129485c648a7aec6e00cdbb1ae41fd91273fb8370ea5ac9b19a7fe000b4f45a586dd04e793565226931300eaf900b99d50b7a68e7fc517b581412b2b193cc5d8b02cab61027ceee8701718eae5847b674d68d371775ebd40135a24962165f2f7dbfd7069ad1d8c88f2d2e13bf049e847f6e5198037a90d196d49ee04b08e210ab9967b376cf875b6cc66d77e70a82a0f7f06e20cb2d469b59f2b59e5ed0f27907955d4e4826b5b6ba98d7cb30f1804c6c4350101dc790684811774afc1bdc6a84bae3bd3e2dfe08180f0a509", + "msg": "f8007e074951f11f55e10736b5dd17abff63e87a", + "ct": "a86df5408463e8baa3198eb8b931a2298cebb097", + "tag": "673da04c8ee1bbf2f7be33c7be2d09a5", + "result": "valid" + }, + { + "tcId": 211, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d4090019a07de8ff31e98fd1898ffbd8c1001f58269a6433", + "iv": "65aeaa5ed2c63afd95ff522a", + "aad": "37df311edab4303e9b10dc83a90e8562c55aeb9ab98564437468c6b41d3e08898079c9d818e1ca0f0249ec36c183d26678828f0536cb06a8748709330877155ca9a7f87629868c126b3dfba262e0e5ec2e493ea51e4566a94d825c47792634c8d9944666001e12ad2399a4dded6e2c67830fd527956c02f2eb1bc55991cc8be609b3490c0c2a4063f0f2bd2a3203328ea6816579aed76090809e51175f275286f56e77d0455f9ec45c0ed2f0f454374382a3b2d043862d3ee069d5966cbe017927a8a8aaf5873de038d940375b3a2971d453e646dbbb614246325f1f88639c1e868e43b7868f37cd577f8ce35ff05bc0159992c34b933eb9c50bf9d5257d91b644f0b2658c63010afc9fc49f60a50b6f7ae994d4377313b9e78657cccdf4cdfa5d96eb5e935613a27d109b5c20434ca108f05df5f798d8bb421c3e9dc2f546d1b45050a26f889ae0235d2c39b1ea4b2f3b52672727c9e5da6db731c3539c80d10538e69643c79c681014f84fb3a8356dbafbeb6e8e701c445d524b63b1b8fff49c4fbcf672a07977b9661f472efc508d430cefe8e744f324c22846060c637ada1e83a177ad2520b8ac214b844c506493434f8f1666a0bb6a3f57ec6c4efd3f138fb767d7ef6cac7c9d31db5c954b7a7fd2a87308f997eda1d8ae8cc0c7211ec13fc6fda845eadcd25c7f7a9c69cc38d91439fe7ef153835fd972e218594c2a06", + "msg": "abe86098f798946add9b1b078f16358ea0dd0cd1", + "ct": "9d0a4e2fcd6ff30cb3ccaaa29f311392e1b43fe4", + "tag": "f35dac665c8bac31f6ab0587615ec1bc", + "result": "valid" + }, + { + "tcId": 212, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2ca090f0f4ec5afdf4a3cfb253fe2e87771ddd5b0375f567", + "iv": "4c48b15143a3f40305c70cd6", + "aad": "894fb598d67e5d2d434fd216d38e69631e69c23e488ffbde6e4ff84b10f51563da1c8ca05308fda743af0c55c3714479d0b337b6157c065bf74e9527985a76561843f347f15268f2c9b778b273a6496c0b13dd6bedd7876b336abac4e871584c54c8ab1ee731be17ed0044c82fef47341131f3ce09918dc2920a8b6426ef40a3a539230a28e2636d27e42a2636d016bb58ef8987fb52f066e75e3193a8f98f58f6eb6178bf930cca0ffc5728d67a9e02351051b47abccc8e8afaeff2134c79a08d3c4f596de227f87f48f53f60715054bb59e9640b3f224817ff2453cd685740bbd65f7de9d71d041a90a5146122e1c13bbaf364a7bc30e1827cb962aa409fefcc2d512cef53b3f0059550c5464219b636082768f61296cd1eef8cce71c17c84fd4717e231bb5be272839bd7385c8ef8680100212ecab4430a8bb6fa6599c47ace673409901b0f098b61720920419f033c5efc7cf633047021c8329697a3887ba7d0e4ce8e573c9c055daf285782eb0657ebf4666f4fe078f2fb93323b7151d95af1ffb5bddec2fb1e96b4c70a0b8162224905dd2c0acb9b1c1c332bdd356d05b5fab9813c16f893dcce2a95b0b34d4d9a5997037a90ded22de5e4d0e3e410569d3b010d31ba78843c6b6226f364ecc9695623ce1c1c21bf5734e08c3097d0f32a0624d32b9eb49f7ae61b68c50f5920db675a5a8a73cd288364ec9705db799893", + "msg": "00f6840e9b66ef3b6be01f74dfea1ca408038ef5", + "ct": "daf4f2eed72c51941e8038e92c5d9272c2b2d97b", + "tag": "5c3fd7da0dfbf67c11acb866caf92a99", + "result": "valid" + }, + { + "tcId": 213, + "comment": "Flipped bit 0 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b5e44c5b2fe90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 214, + "comment": "Flipped bit 1 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b6e44c5b2fe90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 215, + "comment": "Flipped bit 7 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "34e44c5b2fe90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 216, + "comment": "Flipped bit 8 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e54c5b2fe90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 217, + "comment": "Flipped bit 31 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44cdb2fe90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 218, + "comment": "Flipped bit 32 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2ee90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 219, + "comment": "Flipped bit 33 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2de90e4c78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 220, + "comment": "Flipped bit 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90ecc78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 221, + "comment": "Flipped bit 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c79f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 222, + "comment": "Flipped bit 71 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4cf8f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 223, + "comment": "Flipped bit 77 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78d358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 224, + "comment": "Flipped bit 80 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f359da0d99cb64", + "result": "invalid" + }, + { + "tcId": 225, + "comment": "Flipped bit 96 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0c99cb64", + "result": "invalid" + }, + { + "tcId": 226, + "comment": "Flipped bit 97 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0f99cb64", + "result": "invalid" + }, + { + "tcId": 227, + "comment": "Flipped bit 103 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da8d99cb64", + "result": "invalid" + }, + { + "tcId": 228, + "comment": "Flipped bit 120 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0d99cb65", + "result": "invalid" + }, + { + "tcId": 229, + "comment": "Flipped bit 121 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0d99cb66", + "result": "invalid" + }, + { + "tcId": 230, + "comment": "Flipped bit 126 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0d99cb24", + "result": "invalid" + }, + { + "tcId": 231, + "comment": "Flipped bit 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90e4c78f358da0d99cbe4", + "result": "invalid" + }, + { + "tcId": 232, + "comment": "Flipped bits 0 and 64 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b5e44c5b2fe90e4c79f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 233, + "comment": "Flipped bits 31 and 63 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44cdb2fe90ecc78f358da0d99cb64", + "result": "invalid" + }, + { + "tcId": 234, + "comment": "Flipped bits 63 and 127 in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b4e44c5b2fe90ecc78f358da0d99cbe4", + "result": "invalid" + }, + { + "tcId": 235, + "comment": "all bits of tag flipped", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "4b1bb3a4d016f1b3870ca725f266349b", + "result": "invalid" + }, + { + "tcId": 236, + "comment": "Tag changed to all zero", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 237, + "comment": "tag changed to all 1", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 238, + "comment": "msbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "3464ccdbaf698eccf873d85a8d194be4", + "result": "invalid" + }, + { + "tcId": 239, + "comment": "lsbs changed in tag", + "flags": [ + "ModifiedTag" + ], + "key": "000102030405060708090a0b0c0d0e0f1011121314151617", + "iv": "505152535455565758595a5b", + "aad": "", + "msg": "202122232425262728292a2b2c2d2e2f", + "ct": "458256842dfd297f30bd2f8f15c92db0", + "tag": "b5e54d5a2ee80f4d79f259db0c98ca65", + "result": "invalid" + } + ] + }, + { + "ivSize": 128, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 240, + "comment": "J0:000102030405060708090a0b0c0d0e0f", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "5c2ea9b695fcf6e264b96074d6bfa572", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "28e1c5232f4ee8161dbe4c036309e0b3254e9212bef0a93431ce5e5604c8f6a73c18a3183018b770", + "tag": "d5808a1bd11a01129bf3c6919aff2339", + "result": "valid" + }, + { + "tcId": 241, + "comment": "J0:00000000000000000000000000000000", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "57b3a81f2c36b6b06577ca0fbab8fa8e", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "cceebeb4fe4cd90c514e52d2327a2ecd75393661006cf2476d8620149aef3d1cdce491fff3e7a7a3", + "tag": "8132e865b69d64ef37db261f80cbbe24", + "result": "valid" + }, + { + "tcId": 242, + "comment": "J0:ffffffffffffffffffffffffffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "ce20a7e870696a5e68533c465bad2ba1", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "4f4350565d91d9aa8c5f4048550492ad6d6fdabf66da5d1e2af7bfe1a8aadaa0baa3de38a41d9713", + "tag": "155da6441ec071ef2d8e6cffbacc1c7c", + "result": "valid" + }, + { + "tcId": 243, + "comment": "J0:fffffffffffffffffffffffffffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "918e3c19dbdfee2db18156c5b93f3d75", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "8316a53167b6de1a7575700693ffef274f4350565d91d9aa8c5f4048550492ad6d6fdabf66da5d1e", + "tag": "6c574aa6a2490cc3b2f2f8f0ffbc56c4", + "result": "valid" + }, + { + "tcId": 244, + "comment": "J0:fffffffffffffffffffffffffffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "717d900b270462b9dbf7e9419e890609", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "5175927513e751eb309f45bc2ef225f28316a53167b6de1a7575700693ffef274f4350565d91d9aa", + "tag": "8082a761e1d755344bf29622144e7d39", + "result": "valid" + }, + { + "tcId": 245, + "comment": "J0:000102030405060708090a0bffffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "ecd52120af240e9b4bf3b9d1eeb49434", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "36b3fbecd09178d04527fb37544f5579d20d60a41266f685c48098e1a52804ca387d90709d3268dd", + "tag": "033e0ef2953ebfd8425737c7d393f89a", + "result": "valid" + }, + { + "tcId": 246, + "comment": "J0:000102030405060708090a0bfffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "b37bbad104928ae89221d3520c2682e0", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "16929b773051f12b0adac95f65e21a7f36b3fbecd09178d04527fb37544f5579d20d60a41266f685", + "tag": "ca448bb7e52e897eca234ef343d057d0", + "result": "valid" + }, + { + "tcId": 247, + "comment": "J0:000102030405060708090a0bfffffffd", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "538816c3f849067cf8576cd62b90b99c", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "6d3faefaf691d58163846f8d4b9ffd5916929b773051f12b0adac95f65e21a7f36b3fbecd09178d0", + "tag": "84f49740e6757f63dd0df7cb7656d0ef", + "result": "valid" + }, + { + "tcId": 248, + "comment": "J0:000102030405060708090a0b7fffffff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "d10e631943cd3bdababab2bbd13951c0", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "d60196c2d14fcf30c0991d2721ddc52d385f407a16691dade82c9023c855fd8e2e8fbb562102f018", + "tag": "877e15d9889e69a99fcc6d727465c391", + "result": "valid" + }, + { + "tcId": 249, + "comment": "J0:000102030405060708090a0b7ffffffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "8ea0f8e8e87bbfa96368d83833ab4714", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "948fbceca12a6e4fabb79b6d965e336fd60196c2d14fcf30c0991d2721ddc52d385f407a16691dad", + "tag": "cd5757626945976ba9f0264bd6bee894", + "result": "valid" + }, + { + "tcId": 250, + "comment": "J0:000102030405060708090a0bffff7fff", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "7b2df4fbed1de2727eb24898e5deabb9", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "a1a0120660ff52e6b1700b12c54d2d33b94b00cd7882d8857d84e6e183a1dea6ee85a7da84fbc35d", + "tag": "b015d72da62c81cb4d267253b20db9e5", + "result": "valid" + }, + { + "tcId": 251, + "comment": "J0:000102030405060708090a0bffff7ffe", + "flags": [ + "CounterWrap" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "24836f0a46ab6601a760221b074cbd6d", + "aad": "", + "msg": "00000000000000000000000000000000000000000000000000000000000000000000000000000000", + "ct": "5e3434b45edbf0d1f6e02d1144dbf867a1a0120660ff52e6b1700b12c54d2d33b94b00cd7882d885", + "tag": "ee74ccb30d649ebf6916d05a7dbe5696", + "result": "valid" + }, + { + "tcId": 252, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "00000000000000000000000000000000", + "aad": "", + "msg": "8d74f1c97243d362577ff376c393d2dc", + "ct": "265c42e2b96ea1de9c24f7182e337390", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 253, + "comment": "special case", + "flags": [ + "SpecialCase" + ], + "key": "00112233445566778899aabbccddeeff102132435465768798a9bacbdcedfe0f", + "iv": "ffffffffffffffffffffffffffffffff", + "aad": "", + "msg": "884df0e76f3ce227bf9595d103825a46", + "ct": "988f47668ea650cbaa6714711abe268d", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 254, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b4cd11db0b3e0b9b34eafd9fe027746976379155e76116afde1b96d21298e34f", + "iv": "00c49f4ebb07393f07ebc3825f7b0830", + "aad": "", + "msg": "", + "ct": "", + "tag": "306fe8c9645cc849823e333a685b90b2", + "result": "valid" + }, + { + "tcId": 255, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b7797eb0c1a6089ad5452d81fdb14828c040ddc4589c32b565aad8cb4de3e4a0", + "iv": "0ad570d8863918fe89124e09d125a271", + "aad": "", + "msg": "ed", + "ct": "3f", + "tag": "fd8f593b83314e33c5a72efbeb7095e8", + "result": "valid" + }, + { + "tcId": 256, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4c010d9561c7234c308c01cea3040c925a9f324dc958ff904ae39b37e60e1e03", + "iv": "2a55caa137c5b0b66cf3809eb8f730c4", + "aad": "", + "msg": "2a093c9ed72b8ff4994201e9f9e010", + "ct": "041341078f0439e50b43c991635117", + "tag": "5b8a2f2da20ef657c903da88ef5f57bb", + "result": "valid" + }, + { + "tcId": 257, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e7f7a48df99edd92b81f508618aa96526b279debd9ddb292d385ddbae80b2259", + "iv": "7ee376910f08f497aa6c3aa7113697fd", + "aad": "", + "msg": "5e51dbbb861b5ec60751c0996e00527f", + "ct": "469478d448f7e97d755541aa09ad95b0", + "tag": "254ada5cf662d90c5e11b2bd9c4db4c4", + "result": "valid" + }, + { + "tcId": 258, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4f84782bfbb64a973c3de3dcfa3430367fd68bc0b4c3b31e5d7c8141ba3e6a67", + "iv": "5d1bde6fa0994b33efd8f23f531248a7", + "aad": "", + "msg": "78cb6650a1908a842101ea85804fed00cc56fbdafafba0ef4d1ca607dcae57b6", + "ct": "cb960201fa5ad41d41d1c2c8037c71d52b72e76b16b589d71b976627c9734c9d", + "tag": "8dfce16467c3a6ebb3e7242c9a551962", + "result": "valid" + } + ] + }, + { + "ivSize": 120, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 259, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "34c74e28182948e03af02a01f46eb4f7", + "iv": "b0a73119a97d623806b49d45ddf4c7", + "aad": "", + "msg": "fe82ba66cf2e265741f2c86c", + "ct": "2bc3ef8e7402b4631f48e9be", + "tag": "4b6f6f5be291a90b9e93a8a82ddbc8d8", + "result": "valid" + } + ] + }, + { + "ivSize": 160, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 260, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "55cb7cac77efe18a1ea3b30c65f3f346", + "iv": "e22b6b144ab26b5781316e7a42a76202ac4b2278", + "aad": "", + "msg": "2f3d11ea32bf5bc72cbe2b8d", + "ct": "4fe13ef29f118f85a63188f8", + "tag": "05975b175316df8045889f43e0c857e0", + "result": "valid" + } + ] + }, + { + "ivSize": 120, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 261, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "66f75acbd8d3acf7af47d13e8384c2809d6b91503a7f294b", + "iv": "edf93e16294f15eded83808f09320e", + "aad": "", + "msg": "a900c86b6b7e0e5563f8f826", + "ct": "9af1a022c61c4315aa0e923e", + "tag": "20529bff3c59222ec33353af337b1d40", + "result": "valid" + } + ] + }, + { + "ivSize": 160, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 262, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "ef2e299dd4ecd7e3b9cc62780922cc2c89f78840564d1276", + "iv": "130c14c839e35b7d56b3350b194b0da342e6b65d", + "aad": "", + "msg": "03f59579b14437199583270e", + "ct": "073a5291b11df379f31b4f16", + "tag": "17205999491bd4c1d6c7ec3e56779c32", + "result": "valid" + } + ] + }, + { + "ivSize": 120, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 263, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "e98b0669a645eb14cd06df6968fc5f10edc9f54feed264e3d410cdc61b72ef51", + "iv": "17ca250fb733877556263223eadde1", + "aad": "", + "msg": "f384b3ed7b274641f5db60cf", + "ct": "fc213602aa423b87d7c2a874", + "tag": "36b15bab6923b17218fe1c24048e2391", + "result": "valid" + } + ] + }, + { + "ivSize": 160, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 264, + "comment": "unusual IV size", + "flags": [ + "LongIv" + ], + "key": "849b3e6b8cdd85bdcfb8eb701aa5522ae2340fbe5214e389622cef76979225c4", + "iv": "0f9d6ed7eef362dfa4a7dfa5c0f74c5b27bd4ebf", + "aad": "", + "msg": "8c5564e53051c0de273199b4", + "ct": "c1d76233e8c5042e92bf8d32", + "tag": "7cf036d235d3b2dd349a8c804b65144a", + "result": "valid" + } + ] + }, + { + "ivSize": 256, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 265, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "5927bae748bb69d81b5a724e0a165652", + "iv": "365e0b96932b13306f92e9bb23847165bcbf5d35e45a83d75c86ecca70131f4c", + "aad": "", + "msg": "316bf99bfafc76f1bfc0b03c", + "ct": "5348af57fafe2485b43f2bc4", + "tag": "019a96c5373c031626b6c0300d4cf78b", + "result": "valid" + } + ] + }, + { + "ivSize": 512, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 266, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "dbd3676f293409273f27b375e03793a3", + "iv": "967fa7c990eb2becbd450835e28ea3a9000c7216285cfa7696e8c3dac3ce952a1fe638d7c8c73e1d708dce01b5a20fcc9aa011949d2a835f777423c172fa3aa0", + "aad": "", + "msg": "625efedb8b7f1aa62238a8f2", + "ct": "f559b70fe1149cb34406a2c7", + "tag": "94180ddb7bb1995abe0219eab5ce232f", + "result": "valid" + } + ] + }, + { + "ivSize": 1024, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 267, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "7e5a39dcda7e066988f19adf4de4d501", + "iv": "494356c3459d60e3a83433c9bcf2c0454a763e496e4ec99bfbe4bbb83a4fda76b542213899dcf5521cd9bbbe5d11545bda44a3f4a681ce2843acea730d83d3930ea30991ee1a68ebf6d1a5a40f9b02a1aab091298df8dd689dc7613bcbff94d35f2ca43377d81618562bcf6573411ec9bc97c5a6276b554054c0fa787073d067", + "aad": "", + "msg": "b04729b4adbaac63c2aaf8d8", + "ct": "5291dd4da91ccc2e77306d83", + "tag": "a7f7b21a3b7ece509e922647fd905f06", + "result": "valid" + } + ] + }, + { + "ivSize": 2056, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 268, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "eac3f28cd937ff29eb6158a3721b5145", + "iv": "6fd260bba87339539c37dc68fdc3656f63c83028cb8adcb531085e98bd570c6b735d0cc4b4b924696000a2d893621ae64dcce992b562b89a5285643a08febccbc52243cbfc8d45212e047b00c87c6b6bf175f8bb678ec55c1091315cbecb8b85700f4a4653623fb78e63cfff7d6235e48e9832c9f0716d10992fc5b0ad4e6972bbeeb1ad670cd7ec8fac82e07ea5a64f9761a39714aaa73affd2cb190a7ac2df5e5dcea6812ae2c872c7ac70453c5e7ec4d0b5b18c6ff3bfb9ae15fea44cf392615b80034edae596b8821f97fca58d167fb44a093b0c009a0bd5631355b0cb25d93ba9b79b006301d99db657e801933fc2764a0ce650eaf5a1299efe60cb53b634", + "aad": "", + "msg": "098912a302773377b9c26ac3", + "ct": "e3be947153a26a3a54e3015c", + "tag": "fd042bdde22f67c4fd298d5dc0867606", + "result": "valid" + } + ] + }, + { + "ivSize": 256, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 269, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "8f9ebc67a9a6430c2b0ceeaf983e1356964bb928635b9ca4", + "iv": "36e4b381574d171c7769a788cbc147224fabd8b773f16b8ae84d8f2603aaa440", + "aad": "", + "msg": "a3a96ee94f94caa81ebcd66d", + "ct": "8c2a9823a3b3d413be696387", + "tag": "faaf01ceb40a7e145e8fe65aa9af58c0", + "result": "valid" + } + ] + }, + { + "ivSize": 512, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 270, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "f4bbdfd06f7fb1434880e4166d38d56e02a3f0df0d5301ce", + "iv": "90743bd5d794d52ac848b7e2384545a25846acf143be84c0ead0432fcf3172631cf58d0ca78571c03053c1e1b85ed79cb5303d0e3a98ff4f56c4f0a5eb4f0eac", + "aad": "", + "msg": "39d2abe6697f17ec27f2a39c", + "ct": "a660ea5bf07a78fea0120173", + "tag": "7404fc7b7354694428236f203c130244", + "result": "valid" + } + ] + }, + { + "ivSize": 1024, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 271, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "1761c77798ef9cdfa40553f34614fe7402212087f0509411", + "iv": "fbb3eab379c9b8689dc30b0713690e55d51c956ca36fbcc73eeeee16a46d7c41a7a9626e68e25d685c008c19d3b2b1792bdc99c35441a6fcac35e0d6446dd914f543abd9ecd6b0cb5201c243026c4f13641d67c8d8cd5114b6e11ebbc6b1dee2a18db2150a5a575dcd21648e0337dadbccd3deffd6d979e03e6b9ddfee0abdc2", + "aad": "", + "msg": "35ca4eb463a2000138210b4d", + "ct": "f400132ff38c04ed747dde34", + "tag": "ca1534e7dd0336bbb32a79830c71a447", + "result": "valid" + } + ] + }, + { + "ivSize": 2056, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 272, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "f795ece7de1881fbc6843eb740f812e41e3fc49ff6c7b940", + "iv": "3569fca7c9d06e2a03fed1aac2484fd4416ca07d55ecbb333ec674f0ea5c6e75a10dfb9c738b69dab2eda10ada721a61c7f02b7e7f79e8a9e2dc36b3fdf609e436054c82a774ec617dceec84a577037ff1a3f120d9818d042063acb36c9584e81ec94f11f1ee240f2e45e944694a9c8e535acbb01d93958411cff68e3d32f8931746a4a0cece65e93c51c70b3111034b6867b407e0147f97c576d3ed8cec7e8ec26e95643e46e97ea3595c9c3172b4856f2d2b6dc8564666ddac92c794ffb2d4dc7f461761f0e326650f48d327604e095bd8754072116c96360d09f010ac2f39eb96b227f3d738deb756c8699460d88cf716170ae15267b14f4a89164720f1c602", + "aad": "", + "msg": "22dbd8037aa05b14cf81dd23", + "ct": "13a95a06c1bed4845af9c701", + "tag": "03379836b0c82f64a1bccdcd763acbbc", + "result": "valid" + } + ] + }, + { + "ivSize": 256, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 273, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "ee4171917d2337496812a2784d6a71300e6b8c1ac3b1ef58cee77c229aeaf2c5", + "iv": "e826a79361f9d582b64450e3edc82589487853d5b22feaa0c889875bd0d87cd4", + "aad": "", + "msg": "94d2f8697facaaa191ba617a", + "ct": "a295c2cb27ce23d26874ade1", + "tag": "04650a78bbb61db337c9c32aa3e7b6fa", + "result": "valid" + } + ] + }, + { + "ivSize": 512, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 274, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "132c59b4bcb8afb31637734a81105bb2c9878f320ace9076d5fd7c5d216c8d12", + "iv": "ec51ee18cfb46897d3666c7df35c29ca5d898241c4a34f893eb1db5d5c6b76e24617459d1153868154437a0e95aa3c26e956b494a52dd5ac3b9331116c7c775f", + "aad": "", + "msg": "12c7be00facda49596e19134", + "ct": "9cdcfc3aaa8d466f25588e4b", + "tag": "7e80f51e7180f1cd3ba84349888fcd5c", + "result": "valid" + } + ] + }, + { + "ivSize": 1024, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 275, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "7b0b12491901d62d097fa26dc71e15cfacafa3226719e47126d99c79d98ec222", + "iv": "7d08b226b4a5d03f6f8cb3a3cb8d1ce31b059dc5112385275e38a15c97e0f24022b249a5f7019ea577198cb26ac64e82b2b04681537c4198775a523b0e6494b84febaef3399b35c27b0969fa43572bf5827a763aac1af69526f37e38acb5d354f2b68487f275f4361ed39073f7dd6653ac17c0794118a0cf143293ac0be66229", + "aad": "", + "msg": "c80312590700c3bbfacd1a40", + "ct": "3f3c151e984d059462f9e5a0", + "tag": "e559f5f755aa292171cc35fbf911a64f", + "result": "valid" + } + ] + }, + { + "ivSize": 2056, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 276, + "comment": "long IV size", + "flags": [ + "LongIv" + ], + "key": "3bc3bf39d0d5ffd94cca2b45c678a2d049151ed2babc713be53cb66f54a16337", + "iv": "92c2cee7e9138b186da51f146fb21fd5b491f1a19eef61d4ed14ce6b21b04fdb6ff8ebb60fddc55926e7bda2a8f35c610bb795232412739d6c2d74458ef5a1a1cde9bf17e47e3b00db0b0504d56dc8b8d3de23f7c3a5d52e8d0aab1e64405aaa852ec2dd667ed9c1fd8dc1fdbbc8712c7a38f30faeab594f33897b41b1720f3c2f954ed91ca450d82c3dcd35858c608ad42f36832e56b04821a132f72e0da7b62cbd3925250f64fbb3f5c4783495893097adc09a32d776e04bf72558d37830b372341f6536d8ee9df4a82e4074e7774ab6917a04fa8c499eb4b46a92def365da8b5eb1e0b438779507d1f5272a6e8629a3f9c7bd4862c5691ee8b56bfe292deb4e", + "aad": "", + "msg": "8125ee7637d7d0e03bbacf35", + "ct": "5496ae94c3322ebf959ea9a9", + "tag": "70717cc00fd1ffa59bb04329226a0c0a", + "result": "valid" + } + ] + }, + { + "ivSize": 8, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 277, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "59a284f50aedd8d3e2a91637d3815579", + "iv": "80", + "aad": "", + "msg": "", + "ct": "", + "tag": "af498f701d2470695f6e7c8327a2398b", + "result": "valid" + }, + { + "tcId": 278, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "fec58aa8cf06bfe05de829f27ec77693", + "iv": "9d", + "aad": "", + "msg": "f2d99a9f893378e0757d27c2e3a3101b", + "ct": "0a24612a9d1cbe967dbfe804bf8440e5", + "tag": "96e6fd2cdc707e3ee0a1c90d34c9c36c", + "result": "valid" + } + ] + }, + { + "ivSize": 16, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 279, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "88a972cce9eaf5a7813ce8149d0c1d0e", + "iv": "0f2f", + "aad": "", + "msg": "", + "ct": "", + "tag": "4ccf1efb4da05b4ae4452aea42f5424b", + "result": "valid" + }, + { + "tcId": 280, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "b43967ee933e4632bd6562ba1201bf83", + "iv": "8760", + "aad": "", + "msg": "5a6ad6db70591d1e520b0122f05021a0", + "ct": "ba3e7f8b2999995c7fc4006ca4f475ff", + "tag": "98f47a5279cebbcac214515710f6cd8a", + "result": "valid" + } + ] + }, + { + "ivSize": 32, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 281, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "4e9a97d3ed54c7b54610793ab05052e1", + "iv": "cc851957", + "aad": "", + "msg": "", + "ct": "", + "tag": "e574b355bda2980e047e584feb1676ca", + "result": "valid" + }, + { + "tcId": 282, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "d83c1d7a97c43f182409a4aa5609c1b1", + "iv": "7b5faeb2", + "aad": "", + "msg": "c8f07ba1d65554a9bd40390c30c5529c", + "ct": "1b84baea9df1e65bee7b49e4a8cda1ec", + "tag": "5c0bb79d8240041edce0f94bd4bb384f", + "result": "valid" + } + ] + }, + { + "ivSize": 48, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 283, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "c6a705677affb49e276d9511caa46145", + "iv": "4ad80c2854fb", + "aad": "", + "msg": "", + "ct": "", + "tag": "1e2ed72af590cafb8647d185865f5463", + "result": "valid" + }, + { + "tcId": 284, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "eba7699b56cc0aa2f66a2a5be9944413", + "iv": "d1dafc8de3e3", + "aad": "", + "msg": "d021e53d9098a2df3d6b903cdad0cd9c", + "ct": "18291aa8dc7b07448aa8f71bb8e380bf", + "tag": "9c0e22e5c41b1039ff5661ffaefa8e0f", + "result": "valid" + } + ] + }, + { + "ivSize": 80, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 285, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "1e6c6214a6a5dd5b628c71de07788137", + "iv": "40bcc315dec88bf326cc", + "aad": "", + "msg": "", + "ct": "", + "tag": "6f539a125a2f4fd214597e2f981efe6e", + "result": "valid" + }, + { + "tcId": 286, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "fc93582fa1f8b58cc9e80dd583e9bf8b", + "iv": "5d4bf58798fac351a399", + "aad": "", + "msg": "866d5e1b0aa29004e51ea87de86e3c05", + "ct": "91c20598dcbd90998c9a7d6b1e57321f", + "tag": "b071203f3da17c19ad87a40db08b65f5", + "result": "valid" + } + ] + }, + { + "ivSize": 8, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 287, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "c70ce38e84e5f53ed41c3f0d2ca493412ad32cb04c6e2efa", + "iv": "cb", + "aad": "", + "msg": "", + "ct": "", + "tag": "08d96edb5e22874cd10cb2256ca04bc6", + "result": "valid" + }, + { + "tcId": 288, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "74c816b83dfd287210a3e2c6da8d3053bbfbd9b156d3fdd8", + "iv": "0f", + "aad": "", + "msg": "f2b7b2c9b312cf2af78f003df15c8e19", + "ct": "6c5e796ba9a3ddc64f401e68d135101d", + "tag": "96a132ed43924e98feb888ff682bdaef", + "result": "valid" + } + ] + }, + { + "ivSize": 16, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 289, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "cbf45ba488932aea1a10e5862f92e4a7e277bda9f34af6d0", + "iv": "75e5", + "aad": "", + "msg": "", + "ct": "", + "tag": "1f0d23070fcd748e25bf6454f5c9136e", + "result": "valid" + }, + { + "tcId": 290, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "e1c0446f11ae6aa4fa254f9a846fc6e13e45e537e47f2042", + "iv": "8989", + "aad": "", + "msg": "3a2f5ad0eb216e546e0bcaa377b6cbc7", + "ct": "550b48a43e821fd76f49f0f1a897aead", + "tag": "f6e0a979481f9957ddad0f21a777a73a", + "result": "valid" + } + ] + }, + { + "ivSize": 32, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 291, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "567563bf4cf154902275a53bc57cd6dd7b370d27011bdac8", + "iv": "68d7fc38", + "aad": "", + "msg": "", + "ct": "", + "tag": "1475563e3212f3b5e40062569afd71e3", + "result": "valid" + }, + { + "tcId": 292, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "834d0bb601170865a78139428a1503695a6a291ebd747cd1", + "iv": "bb9d2aa3", + "aad": "", + "msg": "6f79e18b4acd5a03d3a5f7e1a8d0f183", + "ct": "309133e76159fe8a41b20843486511ab", + "tag": "03ab26993b701910a2e8ecccd2ba9e52", + "result": "valid" + } + ] + }, + { + "ivSize": 48, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 293, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "99fb18f5ba430bb9ea942968ecb799b43406e1af4b6425a1", + "iv": "a984bdcdcae2", + "aad": "", + "msg": "", + "ct": "", + "tag": "d7b9a6b58a97982916e83219fbf71b1e", + "result": "valid" + }, + { + "tcId": 294, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "b77b242aa0d51c92fda013e0cb0ef2437399ace5d3f507e4", + "iv": "52aa01e0d0d6", + "aad": "", + "msg": "4ba541a9914729216153801340ab1779", + "ct": "e08261e46eaf90d978ea8f7889bccd4f", + "tag": "c052a55df3926a50990a532efe3d80ec", + "result": "valid" + } + ] + }, + { + "ivSize": 64, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 295, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "d74599b3d2db81653de43b52fc994c50d0be759fab87c33a", + "iv": "d1c61cf8532531b5", + "aad": "", + "msg": "", + "ct": "", + "tag": "f94f2049a6560c470b3a7ca7bbc31a3d", + "result": "valid" + }, + { + "tcId": 296, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "0b177198c8b419bf74acc3bc65b5fb3d09a915ff71add754", + "iv": "8f075cbcda9831c3", + "aad": "", + "msg": "c4b1e05ca3d591f9543e64de3fc682ac", + "ct": "3c6ec0ab1b827bf238a5384fb7e212ce", + "tag": "7db7402224fd583e312bc0e61cf11366", + "result": "valid" + } + ] + }, + { + "ivSize": 80, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 297, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "172f22f2e59364dc418cd751dfa8444ae18644c0f9a2be84", + "iv": "bf9026d3ddaa37e7f180", + "aad": "", + "msg": "", + "ct": "", + "tag": "a8dc52c779611a7028b188615c9a34eb", + "result": "valid" + }, + { + "tcId": 298, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "4c41104d3f40265f9e35c320a01e7876c31400a0bd4d7092", + "iv": "85fdc81afd9f4828177e", + "aad": "", + "msg": "ba7cd07dfd8b5cf6ffd3ddb7635612c6", + "ct": "2d8dc37ece9cda05dd0977112dd864c5", + "tag": "abee97e6f26d5c97e36fcad760b2e6c6", + "result": "valid" + } + ] + }, + { + "ivSize": 8, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 299, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "8f9a38c1014966e4d9ae736139c5e79b99345874f42d4c7d2c81aa6797c417c0", + "iv": "a9", + "aad": "", + "msg": "", + "ct": "", + "tag": "2a268bf3a75fd7b00ba230b904bbb014", + "result": "valid" + }, + { + "tcId": 300, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "144cd8279229e8bb2de99d24e615306663913fe9177fcd270fafec493d43bca1", + "iv": "b3", + "aad": "", + "msg": "976229f5538f9636476d69f0c328e29d", + "ct": "7bea30ecc2f73f8e121263b37966954c", + "tag": "8bbad4adc54b37a2b2f0f6e8617548c9", + "result": "valid" + } + ] + }, + { + "ivSize": 16, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 301, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "7d31861f9d3536e14016a3216b1042e0d2f7d4614314268b6f834ec7f38bbb65", + "iv": "c332", + "aad": "", + "msg": "", + "ct": "", + "tag": "1d978a693120c11f6d51a3ed88cd4ace", + "result": "valid" + }, + { + "tcId": 302, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "22b35fe9623ee11f8b60b6d22db3765b666ed972fa7ccd92b45f22deee02cab1", + "iv": "da6c", + "aad": "", + "msg": "5341c78e4ce5bf8fbc3e077d1990dd5d", + "ct": "9c39f5b110361e9a770cc5e8b0f444bb", + "tag": "b63ff43c12073ec5572b1be70f17e231", + "result": "valid" + } + ] + }, + { + "ivSize": 32, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 303, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "c224e0bba3d7a99165f7996b67a0fce3e12f2c01179b197b69b7e628bca92096", + "iv": "6b30145e", + "aad": "", + "msg": "", + "ct": "", + "tag": "ae6f7c9a29f0d8204ca50b14a1e0dcf2", + "result": "valid" + }, + { + "tcId": 304, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "093eb12343537ee8e91c1f715b862603f8daf9d4e1d7d67212a9d68e5aac9358", + "iv": "5110604c", + "aad": "", + "msg": "33efb58c91e8c70271870ec00fe2e202", + "ct": "f73f72f976a296ba3ca94bc6eb08cd46", + "tag": "b824c33c13f289429659aa017c632f71", + "result": "valid" + } + ] + }, + { + "ivSize": 48, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 305, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "98e6f8ab673e804e865e32403a6551bf807a959343c60d34559360bc295ecb5b", + "iv": "d4d857510888", + "aad": "", + "msg": "", + "ct": "", + "tag": "3db16725fafc828d414ab61c16a6c38f", + "result": "valid" + }, + { + "tcId": 306, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "0bd0e8e7781166e1d876dec8fad34ba95b032a27cac0551595116091005947b7", + "iv": "1bdcd44b663e", + "aad": "", + "msg": "91222263b12cf5616a049cbe29ab9b5b", + "ct": "ed463f4f43336af3f4d7e08770201145", + "tag": "c8fc39906aca0c64e14a43ff750abd8a", + "result": "valid" + } + ] + }, + { + "ivSize": 64, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 307, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "61ba694897925d1b4174d40401469c3ef267cdb9f829edb1a10618c16d666059", + "iv": "0d10c5c84b88d688", + "aad": "", + "msg": "", + "ct": "", + "tag": "1311f9f830d729c189b74ec4f9080fa1", + "result": "valid" + }, + { + "tcId": 308, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "115884f693b155563e9bfb3b07cacb2f7f7caa9bfe51f89e23feb5a9468bfdd0", + "iv": "04102199ef21e1df", + "aad": "", + "msg": "82e3e604d2be8fcab74f638d1e70f24c", + "ct": "7e0dd6c72aec49f89cc6a80060c0b170", + "tag": "af68a37cfefecc4ab99ba50a5353edca", + "result": "valid" + } + ] + }, + { + "ivSize": 80, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 309, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "44ab204d150adb17f83d1e5205b6e1419673fadee610fb9a38185a96741021eb", + "iv": "ff3914982be30b3b2112", + "aad": "", + "msg": "", + "ct": "", + "tag": "f187b281c9fbb24cca241227d0b5d164", + "result": "valid" + }, + { + "tcId": 310, + "comment": "small IV sizes", + "flags": [ + "SmallIv" + ], + "key": "d3b44b8dfc3530404a63b3ca04cc71cfc71a5538448b2625c981856cb7daed0f", + "iv": "7c3c42fa17347e1df797", + "aad": "", + "msg": "1d1775579656f7f6c6891401d733e2ab", + "ct": "684a6f58762e591733e9e7fe7f5722a2", + "tag": "1ce163444dc3754c39d556cc3994b7da", + "result": "valid" + } + ] + }, + { + "ivSize": 0, + "keySize": 128, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 311, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "8f3f52e3c75c58f5cb261f518f4ad30a", + "iv": "", + "aad": "", + "msg": "", + "ct": "", + "tag": "cf71978ffcc778f3c85ac9c31b6fe191", + "result": "invalid" + }, + { + "tcId": 312, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "2a4bf90e56b70fdd8649d775c089de3b", + "iv": "", + "aad": "", + "msg": "324ced6cd15ecc5b3741541e22c18ad9", + "ct": "00a29f0a5e2e7490279d1faf8b881c7b", + "tag": "a2c7e8d7a19b884f742dfec3e76c75ee", + "result": "invalid" + } + ] + }, + { + "ivSize": 0, + "keySize": 192, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 313, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "0b18d21337035c7baa08211b702fa780ac7c09be8f9ed11f", + "iv": "", + "aad": "", + "msg": "", + "ct": "", + "tag": "ca69a2eb3a096ea36b1015d5dffff532", + "result": "invalid" + }, + { + "tcId": 314, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "ba76d594a6df915bb7ab7e6d1a8d024b2796336c1b8328a9", + "iv": "", + "aad": "", + "msg": "d62f302742d61d823ea991b93430d589", + "ct": "509b0658d09f7a5bb9db43b70c8387f7", + "tag": "2c9488d53a0b2b5308c2757dfac7219f", + "result": "invalid" + } + ] + }, + { + "ivSize": 0, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 315, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "3f8ca47b9a940582644e8ecf9c2d44e8138377a8379c5c11aafe7fec19856cf1", + "iv": "", + "aad": "", + "msg": "", + "ct": "", + "tag": "1726aa695fbaa21a1db88455c670a4b0", + "result": "invalid" + }, + { + "tcId": 316, + "comment": "0 size IV is not valid", + "flags": [ + "ZeroLengthIv" + ], + "key": "7660d10966c6503903a552dde2a809ede9da490e5e5cc3e349da999671809883", + "iv": "", + "aad": "", + "msg": "c314235341debfafa1526bb61044a7f1", + "ct": "7772ea358901f571d3d35c19497639d9", + "tag": "8fe0520ad744a11f0ccfd228454363fa", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/chacha20_poly1305_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/chacha20_poly1305_test.json new file mode 100644 index 000000000..1ad9ff254 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/chacha20_poly1305_test.json @@ -0,0 +1,4721 @@ +{ + "algorithm": "CHACHA20-POLY1305", + "schema": "aead_test_schema_v1.json", + "numberOfTests": 325, + "header": [ + "Test vectors of type AeadTest test authenticated encryption with additional data.", + "The test vectors are intended for testing both encryption and decryption.", + "Test vectors with \"result\" : \"valid\" are valid encryptions.", + "Test vectors with \"result\" : \"invalid\" are using invalid parameters", + "or contain an invalid ciphertext or tag." + ], + "notes": { + "EdgeCaseCiphertext": { + "bugType": "EDGE_CASE", + "description": "The test vector contains values where the ciphertext is a special case. The purpose of the test vector is to detect incorrect poly1305 computations." + }, + "EdgeCasePoly1305": { + "bugType": "EDGE_CASE", + "description": "The test vector contains an edge case for the integer arithmetic used to compute Poly1305. I.e., the goal of the test vector is to catch integer overflows." + }, + "EdgeCasePolyKey": { + "bugType": "EDGE_CASE", + "description": "The test vector contains values where the key for Poly1305 has edge case values. E.g. the nonces have been constructed such that the Poly1305 key contains limbs with values such as 0. The goal of the test vector is to detect incorrect integer arithmetic in the Poly1305 computation." + }, + "EdgeCaseTag": { + "bugType": "EDGE_CASE", + "description": "The tag contains an edge case. The goal of the test vector is to check for arithmetic errors in the final modular addition of CHACHA-POLY-1305." + }, + "InvalidNonceSize": { + "bugType": "MODIFIED_PARAMETER", + "description": "RFC 7539 restricts the size of the nonce of CHACHA-POLY1305 to 12 bytes and XCHACHA-POLY1305 to 24 bytes. Other sizes are invalid." + }, + "Ktv": { + "bugType": "BASIC", + "description": "Known test vector.", + "links": [ + "RFC 7539" + ] + }, + "ModifiedTag": { + "bugType": "AUTH_BYPASS", + "description": "The test vector contains a ciphertext where the tag has been modified. The goal of the test vector is to detect implementations with partial or incorrect tag verification." + }, + "Pseudorandom": { + "bugType": "FUNCTIONALITY", + "description": "The test vector contains pseudorandomly generated inputs. The goal of the test vector is to check the implementation for different input sizes." + } + }, + "testGroups": [ + { + "ivSize": 96, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 1, + "comment": "RFC 7539", + "flags": [ + "Ktv" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "070000004041424344454647", + "aad": "50515253c0c1c2c3c4c5c6c7", + "msg": "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e", + "ct": "d31a8d34648e60db7b86afbc53ef7ec2a4aded51296e08fea9e2b5a736ee62d63dbea45e8ca9671282fafb69da92728b1a71de0a9e060b2905d6a5b67ecd3b3692ddbd7f2d778b8c9803aee328091b58fab324e4fad675945585808b4831d7bc3ff4def08e4b7a9de576d26586cec64b6116", + "tag": "1ae10b594f09e26a7e902ecbd0600691", + "result": "valid" + }, + { + "tcId": 2, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "80ba3192c803ce965ea371d5ff073cf0f43b6a2ab576b208426e11409c09b9b0", + "iv": "4da5bf8dfd5852c1ea12379d", + "aad": "", + "msg": "", + "ct": "", + "tag": "76acb342cf3166a5b63c0c0ea1383c8d", + "result": "valid" + }, + { + "tcId": 3, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7a4cd759172e02eb204db2c3f5c746227df584fc1345196391dbb9577a250742", + "iv": "a92ef0ac991dd516a3c6f689", + "aad": "bd506764f2d2c410", + "msg": "", + "ct": "", + "tag": "906fa6284b52f87b7359cbaa7563c709", + "result": "valid" + }, + { + "tcId": 4, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cc56b680552eb75008f5484b4cb803fa5063ebd6eab91f6ab6aef4916a766273", + "iv": "99e23ec48985bccdeeab60f1", + "aad": "", + "msg": "2a", + "ct": "3a", + "tag": "cac27dec0968801e9f6eded69d807522", + "result": "valid" + }, + { + "tcId": 5, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "46f0254965f769d52bdb4a70b443199f8ef207520d1220c55e4b70f0fda620ee", + "iv": "ab0dca716ee051d2782f4403", + "aad": "91ca6c592cbcca53", + "msg": "51", + "ct": "c4", + "tag": "168310ca45b1f7c66cad4e99e43f72b9", + "result": "valid" + }, + { + "tcId": 6, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2f7f7e4f592bb389194989743507bf3ee9cbde1786b6695fe6c025fd9ba4c100", + "iv": "461af122e9f2e0347e03f2db", + "aad": "", + "msg": "5c60", + "ct": "4d13", + "tag": "91e8b61efb39c122195453077b22e5e2", + "result": "valid" + }, + { + "tcId": 7, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c8833dce5ea9f248aa2030eacfe72bffe69a620caf793344e5718fe0d7ab1a58", + "iv": "61546ba5f1720590b6040ac6", + "aad": "88364fc8060518bf", + "msg": "ddf2", + "ct": "b60d", + "tag": "ead0fd4697ec2e5558237719d02437a2", + "result": "valid" + }, + { + "tcId": 8, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bd8ed7fb0d607522f04d0b12d42c92570bccc5ba2486953d70ba2e8193f6225a", + "iv": "d2ab0abb50a8e9fba25429e1", + "aad": "", + "msg": "201221", + "ct": "3cf470", + "tag": "a27a69c9d7ee84586f11388c6884e63a", + "result": "valid" + }, + { + "tcId": 9, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1c8b59b17a5ceced31bde97d4cefd9aaaa63362e096e863ec1c89580bca79b7a", + "iv": "94f32a6dff588f2b5a2ead45", + "aad": "6c8cf2ab3820b695", + "msg": "453f95", + "ct": "610925", + "tag": "a8a7883eb7e40bc40e2e5922ae95ddc3", + "result": "valid" + }, + { + "tcId": 10, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e4912cb75a1174345f1a457366f18885fe8460b06478e04be2f7fb4ec9c113e5", + "iv": "7aa5ad8bf5254762171ec869", + "aad": "", + "msg": "9e4c1d03", + "ct": "fe6849aa", + "tag": "99ad07871b25c27defc31a541bd5c418", + "result": "valid" + }, + { + "tcId": 11, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e05777ef3d989ace7d2abfba452bfded54801dbd5c66e91c0c2ef00479d85572", + "iv": "b7f526e3fd71cf5720961aec", + "aad": "15d93a96d0e6c5a9", + "msg": "17bfda03", + "ct": "f4710e51", + "tag": "b957c6a37b6a4c94996c002186d63b2b", + "result": "valid" + }, + { + "tcId": 12, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1a4c4f39abe890e62345c947bcf7de7c2e33bd5ceeda0a0abf0e7ef935ddf3ee", + "iv": "9447bf85d5b97d8aee0f8e51", + "aad": "", + "msg": "c15a593bd0", + "ct": "f711647ff1", + "tag": "22b12dc38cb79629f84cdbdc2425c09d", + "result": "valid" + }, + { + "tcId": 13, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "800e9a24791700c9609736695ba2a8b99b2d57f1c3bfb61ed49db1c6c5219583", + "iv": "3dbe876bd880ec8ea2017043", + "aad": "96224835610b782b", + "msg": "a7bfd041e3", + "ct": "d171f046ea", + "tag": "d179b1b9c4184378df009019dbb8c249", + "result": "valid" + }, + { + "tcId": 14, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "208c2c376c9430433db20e1a6b7ba817f8ffbfa6827f26759ccede42e591d3ec", + "iv": "27fb58ec6a21e84696cb8830", + "aad": "", + "msg": "af104b5ccd0e", + "ct": "9351b1b1b082", + "tag": "560785509f60f26b681933d9cdbfd29f", + "result": "valid" + }, + { + "tcId": 15, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2eb168e53b07ab04355ea792fe11a6be2ce9c39cfe15a997076b1e38c17ad620", + "iv": "b5965470c383fd29fe7eaee7", + "aad": "6d52feb2509f7fbf", + "msg": "6fdf2927e169", + "ct": "41abff7b71cc", + "tag": "9b5174297c03cf8902d1f706fd008902", + "result": "valid" + }, + { + "tcId": 16, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "55568158d3a6483f1f7021eab69b703f614251cadc1af5d34a374fdbfc5adac7", + "iv": "3c4e654d663fa4596dc55bb7", + "aad": "", + "msg": "ab85e9c1571731", + "ct": "5dfe3440dbb3c3", + "tag": "ed7a434e2602d394281e0afa9fb7aa42", + "result": "valid" + }, + { + "tcId": 17, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e3c09e7fab1aefb516da6a33022a1dd4eb272c80d540c5da52a730f34d840d7f", + "iv": "58389375c69ee398de948396", + "aad": "84e46be8c0919053", + "msg": "4ee5cda20d4290", + "ct": "4bd47212941ce3", + "tag": "185f1408ee7fbf18f5abad6e2253a1ba", + "result": "valid" + }, + { + "tcId": 18, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "51e4bf2bad92b7aff1a4bc05550ba81df4b96fabf41c12c7b00e60e48db7e152", + "iv": "4f07afedfdc3b6c2361823d3", + "aad": "", + "msg": "be3308f72a2c6aed", + "ct": "8e9439a56eeec817", + "tag": "fbe8a6ed8fabb1937539dd6c00e90021", + "result": "valid" + }, + { + "tcId": 19, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1131c1418577a054de7a4ac551950f1a053f9ae46e5b75fe4abd5608d7cddadd", + "iv": "b4ea666ee119563366484a78", + "aad": "66c0ae70076cb14d", + "msg": "a4c9c2801b71f7df", + "ct": "b9b910433af052b0", + "tag": "4530f51aeee024e0a445a6328fa67a18", + "result": "valid" + }, + { + "tcId": 20, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e1094967f86d893cdfe2e2e6d5c7ee4dfef67da3c9c5d64e6ad7c1577dcb38c5", + "iv": "8092fc245b3326cddbd1424c", + "aad": "", + "msg": "c37aa791ddd6accf91", + "ct": "d9d897a9c1c5bb9f01", + "tag": "085a430373058f1a12a0d589fd5be68b", + "result": "valid" + }, + { + "tcId": 21, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "236f9baee4f9da15beeca40ff4af7c760f254a64bc3a3d7f4fad557e61b68586", + "iv": "f1ca81338629587acf9372bf", + "aad": "8c32f47a386152ec", + "msg": "d7f26d5252e1765f5b", + "ct": "8fdb429d47761cbf8e", + "tag": "8ef647ed334fdebbc2bef80be02884e0", + "result": "valid" + }, + { + "tcId": 22, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4de207a3b70c51e5f23048eed5a5da9bb65e917a69aa93e7c8b4a815cd9724de", + "iv": "4c15a71dc6791a8c005ad502", + "aad": "", + "msg": "f2c54b6b5e490da18659", + "ct": "700d35adf5100a22a1de", + "tag": "102d992ffaff599b5bddddeb2dfb399b", + "result": "valid" + }, + { + "tcId": 23, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6d667fd79e5fb725f50343dccc4863227c75ee3f7a578476e3e9f32598d81559", + "iv": "6220527aba88e27f766658b2", + "aad": "e1e27ccddb3cb407", + "msg": "0c8c5a252681f2b5b4c0", + "ct": "04aad66c60e0bf8ebba9", + "tag": "c15f69a4d2aef97d7748756ff49d894b", + "result": "valid" + }, + { + "tcId": 24, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "8f4bd94ef73e75d1e068c30b37ead576c5344e093ece1330e9101c82f793cf05", + "iv": "ec1e2967f0f6979e5f5b07fb", + "aad": "", + "msg": "b89812b34d9bced4a0ba07", + "ct": "1c3d53baaa36eaa1d8ec4d", + "tag": "4d94ebf960f12433bec43aa86d7e6e6d", + "result": "valid" + }, + { + "tcId": 25, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2aa3bc7033351cac51364cdaf6ffac2c20f64046e1550a7b1c65f41800599019", + "iv": "28cce57a5db2cd206321e340", + "aad": "a9bc350eaf2e6e3d", + "msg": "83016823123484b56095b0", + "ct": "1c8578f8e75203d0336a52", + "tag": "5910f7a9d5e4df05d7248bd7a8d65e63", + "result": "valid" + }, + { + "tcId": 26, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "99b62bd5afbe3fb015bde93f0abf483957a1c3eb3ca59cb50b39f7f8a9cc51be", + "iv": "9a59fce26df0005e07538656", + "aad": "", + "msg": "42baae5978feaf5c368d14e0", + "ct": "ff7dc203b26c467a6b50db33", + "tag": "578c0f2758c2e14e36d4fc106dcb29b4", + "result": "valid" + }, + { + "tcId": 27, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "85f35b6282cff440bc1020c8136ff27031110fa63ec16f1e825118b006b91257", + "iv": "58dbd4ad2c4ad35dd906e9ce", + "aad": "a506e1a5c69093f9", + "msg": "fdc85b94a4b2a6b759b1a0da", + "ct": "9f8816de0994e938d9e53f95", + "tag": "d086fc6c9d8fa915fd8423a7cf05072f", + "result": "valid" + }, + { + "tcId": 28, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "faf4bfe8019a891c74901b17f4f48cee5cd065d55fdea60118aaf6c4319a0ea5", + "iv": "b776c3fddba7c81362ce6e1b", + "aad": "", + "msg": "8dadff8d60c8e88f604f274833", + "ct": "e6b33a74a4ac443bd93f9c1b94", + "tag": "0c115172bdb02bbad3130fff22790d60", + "result": "valid" + }, + { + "tcId": 29, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "841020d1606edcfc536abfb1a638a7b958e21efc10c386ac45a18493450afd5f", + "iv": "6d62f159731b140eb18ce074", + "aad": "5a8e1c7aa39810d5", + "msg": "d6af138f701b801e60c85ffd5c", + "ct": "b0a7500aca45bb15f01ece4389", + "tag": "0160e83adbec7f6a2ee2ff0215f9ef00", + "result": "valid" + }, + { + "tcId": 30, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "470f9ce3d2250bd60cbbefdb2e6a1178c012299b5590639c7797b6024fa703d8", + "iv": "a9ea4d619fe405d04cba7d7a", + "aad": "", + "msg": "6ca67dd023fba6507b9f9a1f667e", + "ct": "d3017e0bb1705b380b34cc333450", + "tag": "5708e72ca2bd354f487f82f67fbc3acb", + "result": "valid" + }, + { + "tcId": 31, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e4b97e91e4c8e85eb7ce0a7f30bf8a0abf4468251e4c6386c0e7aacb8e879aa8", + "iv": "0e23c942a0c9fb526586eead", + "aad": "eaaaeab26957f9a1", + "msg": "b84b3f74cd23064bb426fe2ced2b", + "ct": "52e9672b416d84d97033796072d0", + "tag": "e83839dc1fd9b8b9d1444c40e488d493", + "result": "valid" + }, + { + "tcId": 32, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "67119627bd988eda906219e08c0d0d779a07d208ce8a4fe0709af755eeec6dcb", + "iv": "68ab7fdbf61901dad461d23c", + "aad": "", + "msg": "51f8c1f731ea14acdb210a6d973e07", + "ct": "0b29638e1fbdd6df53970be2210042", + "tag": "2a9134087d67a46e79178d0a93f5e1d2", + "result": "valid" + }, + { + "tcId": 33, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e6f1118d41e4b43fb58221b7ed79673834e0d8ac5c4fa60bbc8bc4893a58894d", + "iv": "d95b3243afaef714c5035b6a", + "aad": "6453a53384632212", + "msg": "97469da667d6110f9cbda1d1a20673", + "ct": "32db66c4a3819d81557455e5980fed", + "tag": "feae30dec94e6ad3a9eea06a0d703917", + "result": "valid" + }, + { + "tcId": 34, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "59d4eafb4de0cfc7d3db99a8f54b15d7b39f0acc8da69763b019c1699f87674a", + "iv": "2fcb1b38a99e71b84740ad9b", + "aad": "", + "msg": "549b365af913f3b081131ccb6b825588", + "ct": "e9110e9f56ab3ca483500ceabab67a13", + "tag": "836ccabf15a6a22a51c1071cfa68fa0c", + "result": "valid" + }, + { + "tcId": 35, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b907a45075513fe8a8019edee3f2591487b2a030b03c6e1d771c862571d2ea1e", + "iv": "118a6964c2d3e380071f5266", + "aad": "034585621af8d7ff", + "msg": "55a465644f5b650928cbee7c063214d6", + "ct": "e4b113cb775945f3d3a8ae9ec141c00c", + "tag": "7c43f16ce096d0dc27c95849dc383b7d", + "result": "valid" + }, + { + "tcId": 36, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3b2458d8176e1621c0cc24c0c0e24c1e80d72f7ee9149a4b166176629616d011", + "iv": "45aaa3e5d16d2d42dc03445d", + "aad": "", + "msg": "3ff1514b1c503915918f0c0c31094a6e1f", + "ct": "02cc3acb5ee1fcdd12a03bb857976474d3", + "tag": "d83b7463a2c3800fe958c28eaa290813", + "result": "valid" + }, + { + "tcId": 37, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "f60c6a1b625725f76c7037b48fe3577fa7f7b87b1bd5a982176d182306ffb870", + "iv": "f0384fb876121410633d993d", + "aad": "9aaf299eeea78f79", + "msg": "63858ca3e2ce69887b578a3c167b421c9c", + "ct": "35766488d2bc7c2b8d17cbbb9abfad9e6d", + "tag": "1f391e657b2738dda08448cba2811ceb", + "result": "valid" + }, + { + "tcId": 38, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "37ceb574ccb0b701dd11369388ca27101732339f49d8d908ace4b23af0b7ce89", + "iv": "37270b368f6b1e3e2ca51744", + "aad": "", + "msg": "f26991537257378151f4776aad28ae8bd16b", + "ct": "b621d76a8dacff00b3f840cdf26c894cc5d1", + "tag": "e0a21716ed94c0382fa9b0903d15bb68", + "result": "valid" + }, + { + "tcId": 39, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "68888361919bc10622f45df168e5f6a03bd8e884c0611bea2f34c1882ed9832b", + "iv": "bfd6ff40f2df8ca7845980cc", + "aad": "b8373438ddb2d6c3", + "msg": "ff97f2eefb3401ac31fc8dc1590d1a92cbc1", + "ct": "e0a745186c1a7b147f74faff2a715df5c19d", + "tag": "917baf703e355d4d950e6c05fe8f349f", + "result": "valid" + }, + { + "tcId": 40, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1b35b856b5a86d3403d28fc2103a631d42deca5175cdb0669a5e5d90b2caafc5", + "iv": "2343de88be6c7196d33b8694", + "aad": "", + "msg": "21ef185c3ae9a96fa5eb473878f4d0b242781d", + "ct": "d6e0ed54fccef30bd605d72da3320e249a9cb5", + "tag": "c68bc6724ec803c43984ce42f6bd09ff", + "result": "valid" + }, + { + "tcId": 41, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d6484e3973f6be8c83ed3208d5be5cfa06fda72fbfdc5b19d09be3f4e4eba29d", + "iv": "1af1d90e877e11a496efa3df", + "aad": "cc4efd8364fb114a", + "msg": "7335ab04b03e706109ec3ee835db9a246ea0ad", + "ct": "29e54d608237c3c3609dba16e6edf43842d72f", + "tag": "d3365fdcd506aaaa5368661e80e9d99b", + "result": "valid" + }, + { + "tcId": 42, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "422add37849d6e4c3dfd8020dc6a07e8a249788f3d6a83b9cb4d802362c97542", + "iv": "1e7e67be948de7352ffdb727", + "aad": "", + "msg": "d7f5e611dd3a2750fb843fc1b6b93087310dc87d", + "ct": "7fe606652d858f595ec2e706754fa3d933fcc834", + "tag": "78d59235aa5d03a4c32590e590c04d22", + "result": "valid" + }, + { + "tcId": 43, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cdccfe3f46d782ef47df4e72f0c02d9c7f774def970d23486f11a57f54247f17", + "iv": "376187894605a8d45e30de51", + "aad": "956846a209e087ed", + "msg": "e28e0e9f9d22463ac0e42639b530f42102fded75", + "ct": "14f707c446988a4903775ec7acec6da114d43112", + "tag": "987d4b147c490d43d376a198cab383f0", + "result": "valid" + }, + { + "tcId": 44, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e79dfc6d2fc465b8439e1c5baccb5d8ef2853899fc19753b397e6c25b35e977e", + "iv": "f9d6320d7ce51d8ed0677d3a", + "aad": "", + "msg": "4f543e7938d1b878dacaeec81dce4899974816813b", + "ct": "1003f13ea1329cbb187316f64c3ff3a87cf5b96661", + "tag": "d2323ad625094bec84790d7958d5583f", + "result": "valid" + }, + { + "tcId": 45, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1d7b8f1d96a1424923aef8a984869d4a777a110990ba465627acf80396c7f376", + "iv": "50ba1962cdc32a5a2d36e640", + "aad": "093053e20261daab", + "msg": "5d3efd5767f3c12efd08af9a44e028ae68c9eff843", + "ct": "2d48b0834e9ffe3046103ef7a214f02e8e4d33360e", + "tag": "d533ad089be229ea606ec0f3fa22eb33", + "result": "valid" + }, + { + "tcId": 46, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "dd433e28cfbcb5de4ab36a02bf38686d83208771a0e63dcd08b4df1a07ac47a1", + "iv": "c9cc0a1afc38ec6c30c38c68", + "aad": "", + "msg": "8a3e17aba9606dd49e3b1a4d9e5e42f1742373632489", + "ct": "e9917ff3e64bbe1783579375e75ea823976b35539949", + "tag": "074a890669b25105434c75beed3248db", + "result": "valid" + }, + { + "tcId": 47, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a60924101b42ac24154a88de42142b2334cf599176caf4d1226f712dd9172930", + "iv": "8ba77644b08d65d5e9f31942", + "aad": "b2a4e12a19a61c75", + "msg": "c949957e66439deee4b2ac1d4a6c98a6c527b90f52ab", + "ct": "db4c700513818972b0dc0e531b1c281ca03e40c60dea", + "tag": "63f4478bba2af469a7a4dc3b4f141360", + "result": "valid" + }, + { + "tcId": 48, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1aa42027836965b1e6086fa137f9cf7f1ff48676696829bd281ff81c8ea0a4a9", + "iv": "4b3dca84ecc407f424f281a9", + "aad": "", + "msg": "37252a3eb5c8960f0567e503a9035783b3d0a19a4b9a47", + "ct": "b5f14617491fc923b683e2cc9562d043dd5986b97dbdbd", + "tag": "972ce54713c05c4bb4d088c0a30cacd3", + "result": "valid" + }, + { + "tcId": 49, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5d40db0cc18ef2e42815d3b6245a466a0b30a0f93e318ac10edde3bf8ad98160", + "iv": "acad618039b317470d21621b", + "aad": "413036411af75745", + "msg": "959dde1ef3129b27702c558849e466f2baca1a45bdf4b2", + "ct": "b7ca3879f95140bf6a97b3212218b7bf864a51e5bb0b3e", + "tag": "fe558fb570145470ea693eb76eb73171", + "result": "valid" + }, + { + "tcId": 50, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0212a8de5007ed87b33f1a7090b6114f9e08cefd9607f2c276bdcfdbc5ce9cd7", + "iv": "e6b1adf2fd58a8762c65f31b", + "aad": "", + "msg": "10f1ecf9c60584665d9ae5efe279e7f7377eea6916d2b111", + "ct": "42f26c56cb4be21d9d8d0c80fc99dde00d75f38074bfe764", + "tag": "54aa7e13d48fff7d7557039457040a3a", + "result": "valid" + }, + { + "tcId": 51, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c5bc09565646e7edda954f1f739223dada20b95c44ab033d0fae4b0283d18be3", + "iv": "6b282ebecc541bcd7834ed55", + "aad": "3e8bc5ade182ff08", + "msg": "9222f9018e54fd6de1200806a9ee8e4cc904d29f25cba193", + "ct": "123032437b4bfd6920e8f7e7e0087ae4889ebe7a0ad0e900", + "tag": "3cf68f179550da63d3b96c2d55411865", + "result": "valid" + }, + { + "tcId": 52, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "9460b3c44ed86e70f3bda66385e1ca10b0c1677ef4f1360532830d17535f996f", + "iv": "abfaf42e0dba884efcf07823", + "aad": "", + "msg": "5c5cce881b93fb7a1b7939af1ffc5f84d3280ada778cca0953", + "ct": "1d218c9f1f9f02f248a6f976a7557057f37d9393d9f213c1f3", + "tag": "bc88344c6fdc898feed394fb28511316", + "result": "valid" + }, + { + "tcId": 53, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c111d6d5d78a071b15ab37cc8c3819199387ab7c1933aa97b1489f6584ba8e2a", + "iv": "85f18ad8ff72cafee2452ab8", + "aad": "84cdff939391c022", + "msg": "6989c646a10b7c76f4d9f7d574da40e152013cf0dd78f5aa8a", + "ct": "9715d344e8d3f3a3eaa98a9cea57c0cd717c6ef5076027c9ec", + "tag": "3056ff5ee0aa8636bb639984edb5236b", + "result": "valid" + }, + { + "tcId": 54, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "8a1b1e699a0c4a3e610b10902daedab1bf1ea0d505c47d7842cbcee0d3b1b6e6", + "iv": "a6f9a8d335fa84c3b27dcd2a", + "aad": "", + "msg": "ee6a15fc183108f0877e7f2b8a9615f4b3fc36e1c83440f66aad", + "ct": "9089bbdb8bcfd124e227bf75c4bfe1cba2004a274fc31aa32358", + "tag": "fd2e21c64a019621c68594826cd7b1cd", + "result": "valid" + }, + { + "tcId": 55, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "74b384e6e013ec4172ed7a28a10fb9bb79b4be2a24f6999e3d3caa28e64a8656", + "iv": "ebc19fc9ecb2339908ea3836", + "aad": "85073f2edc13d3a1", + "msg": "3aa9f7372f056e5a0729752d9a37132d6dd07c56792e1c7582a9", + "ct": "796ffb70ab43e7fa79f95583e384524727bb3e47fc45b969f714", + "tag": "c3322b4445de5f3c9f18dcc847cc94c3", + "result": "valid" + }, + { + "tcId": 56, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "77d824795d2029f0eb0e0baab5cfeb32f7e93474913a7f95c737a667a3c33314", + "iv": "f3307430f492d2b8a72d3a81", + "aad": "", + "msg": "0c4179a497d8fdd72796fb725692b805d63b7c718359cf10518aee", + "ct": "49c81d17d67d7ba9954f497d0b0ddc21f3f839c9d2cc198d30bc2c", + "tag": "50009899e5b2a9726c8f3556cadfbe84", + "result": "valid" + }, + { + "tcId": 57, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bec5eac68f893951cbd7d1ecd3ee6611130dd9c3f80cddf95111d07d5edd76d1", + "iv": "342ada4f0c115124b222df80", + "aad": "73365f6d80edb1d8", + "msg": "481433d8b1cd38af4a750e13a64b7a4e8507682b3517595938a20e", + "ct": "4c129fc13cbdd9d3fe81ac755bf4fbea2fdd7e0aca0505a6ee9637", + "tag": "9cede1d30a03db5d55265d3648bc40d4", + "result": "valid" + }, + { + "tcId": 58, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a59c1e13064df8f2b8df77a492b0ca2eae921b52a84b305a3a9a51408a9ecb69", + "iv": "9544d41ece0c92ef01cfac2d", + "aad": "", + "msg": "1c35b898821ba55c2617c25df9e6df2a8002b384902186cd69dfd20e", + "ct": "a6fa8f57ddc81d6099f667dd62402b6a5d5b7d05a329298029113169", + "tag": "bb24e38b31dbbc3e575b9e3ee076af2a", + "result": "valid" + }, + { + "tcId": 59, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "084b5d7365f1a8fec6365939ed741e6ea5893e0318d82ab47500a97d77aaa041", + "iv": "829f005e980f0a6e2f983eaa", + "aad": "770f6e6e89a3fe8e", + "msg": "7510016efadc385a71ed689ceb590c8ea9cc1e81b793338bddf5f10c", + "ct": "fd42cb5cf894f879e3cf751662aaa58a2288cc53548802becaf42359", + "tag": "188329438afe1cd7225d0478aa90c773", + "result": "valid" + }, + { + "tcId": 60, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5a7f850a1d9aafa77d59ae1b731965e8aaec6352280fc76a7b5e23ef3610cfe4", + "iv": "4946a0d6adea93b82d4332e5", + "aad": "", + "msg": "3c161d791f624fb0388e808f0f69ed790dbe4cbd089ebac46627bcf01d", + "ct": "402302b56140c4dcc39774732c55883de124ce4bf0a0261cfa1569e2cf", + "tag": "e830bfe933a96786cff2dd72b82c4bd5", + "result": "valid" + }, + { + "tcId": 61, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e6d5a4246f6f05618b59c8f9ec3ac8068cc0d3f351c571aa52b09cb251f9c2f6", + "iv": "2f90a65e9e48725de6ffc727", + "aad": "f2415377ad283fd8", + "msg": "964fc9e0e8355947aa1c2caadd7b3dbef82a1024e623606fac436ef573", + "ct": "d052932bad6e6c4f835f02019e52d7ff807dc2a5aac2040883c79dd3d5", + "tag": "655f93396b4d755dc4475721665fed91", + "result": "valid" + }, + { + "tcId": 62, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "09e822123adbb1ed89b79a58619c64853992f8371d46338712f6c91ab11a68bb", + "iv": "a797205a6cacdd7e47a4789d", + "aad": "", + "msg": "80b71bbe833629841bd3aeaeb9db6123e51d367b436fe9d2d3454b62cfad", + "ct": "83f5c77396cabd28dfcc002cba0756d4ea5455e0261d847d5708aac21e8d", + "tag": "705a05820a21f381d244d40e58d2f16b", + "result": "valid" + }, + { + "tcId": 63, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "625735fe7f8fc81b0c1edc3d08a78b41268f87a3c68488b674222630c1d587a5", + "iv": "9d8cdf289dddd09afdc1b02f", + "aad": "200a9c95946ff05c", + "msg": "67ae1882d0b1c1b2485bec98115ecf53b9b438deb1d0400531705038873a", + "ct": "209b7539385c8b19ecd0fd8b5011b2996e316f1942064e68edfa363acbcd", + "tag": "fa2f454b9fa2608f780f7c6f9b780fe1", + "result": "valid" + }, + { + "tcId": 64, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2eb51c469aa8eb9e6c54a8349bae50a20f0e382711bba1152c424f03b6671d71", + "iv": "04a9be03508a5f31371a6fd2", + "aad": "", + "msg": "b053999286a2824f42cc8c203ab24e2c97a685adcc2ad32662558e55a5c729", + "ct": "45c7d6b53acad4abb68876a6e96a48fb59524d2c92c9d8a189c9fd2db91746", + "tag": "566d3ca10e311b695f3eae1551652493", + "result": "valid" + }, + { + "tcId": 65, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7f5b74c07ed1b40fd14358fe2ff2a740c116c7706510e6a437f19ea49911cec4", + "iv": "470a339ecb3219b8b81a1f8b", + "aad": "374618a06ea98a48", + "msg": "f45206abc25552b2abc9ab7fa243035fedaaddc3b2293956f1ea6e7156e7eb", + "ct": "46a80c4187024720084627580080dde5a3f4a11093a7076ed6f3d326bc7b70", + "tag": "534d4aa2835a52e72d14df0e4f47f25f", + "result": "valid" + }, + { + "tcId": 66, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "e1731d5854e1b70cb3ffe8b786a2b3ebf0994370954757b9dc8c7bc5354634a3", + "iv": "72cfd90ef3026ca22b7e6e6a", + "aad": "", + "msg": "b9c554cbc36ac18ae897df7beecac1dbeb4eafa156bb60ce2e5d48f05715e678", + "ct": "ea29afa49d36e8760f5fe19723b9811ed5d519934a440f5081ac430b953b0e21", + "tag": "222541af46b86533c6b68d2ff108a7ea", + "result": "valid" + }, + { + "tcId": 67, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "27d860631b0485a410702fea61bc873f3442260caded4abde25b786a2d97f145", + "iv": "262880d475f3dac5340dd1b8", + "aad": "2333e5ce0f93b059", + "msg": "6b2604996cd30c14a13a5257ed6cffd3bc5e29d6b97eb1799eb335e281ea451e", + "ct": "6dad637897544d8bf6be9507ed4d1bb2e954bc427e5de729daf50762846ff2f4", + "tag": "7b997d93c982189d7095dc794c746232", + "result": "valid" + }, + { + "tcId": 68, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5155dee9aade1cc61ee7e3f92660f7590f5e5ba82f1b59b850e3fa453d2fa6b3", + "iv": "c26c4b3bfdb97ee6b0f63ca1", + "aad": "", + "msg": "2734e08eff8f5c4f84fa0c207f49c7fd78af1ad5123ff81f83f500edf4eda09edf", + "ct": "f5982b601c7a18fc72a65b218c44974dc564d8314cbe6f87fcf6c6cfbe618b34b1", + "tag": "c43632f55760b5d1ed37556a94d049b5", + "result": "valid" + }, + { + "tcId": 69, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "573f08ebbe0cce4ac9618e8c3b224bea0a32f055c6996838a32f527ca3c3b695", + "iv": "ad8050dc6d122dce3e5639ed", + "aad": "e99698241c599b5f", + "msg": "668d5e3f95fe030daf432a5fc5837af3a79c81e94b28d8204c5ee262ab3c9908a7", + "ct": "eaf6810e6ec1cb7a2918856257d1aa3d51a827879146c6337ecf535e9c89b149c5", + "tag": "a2950c2f394a3466c345f796323c1aa7", + "result": "valid" + }, + { + "tcId": 70, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cf0d40a4644e5f51815165d5301b22631f4544c49a1878e3a0a5e8e1aae0f264", + "iv": "e74a515e7e2102b90bef55d2", + "aad": "", + "msg": "973d0c753826bae466cf9abb3493152e9de7819e2bd0c71171346b4d2cebf8041aa3cedc0dfd7b467e26228bc86c9a", + "ct": "fba78ae4f9d808a62e3da40be2cb7700c3613d9eb2c529c652e76a432c658d27095f0eb8f940c324981ea935e507f9", + "tag": "8f046956db3a512908bd7afc8f2ab0a9", + "result": "valid" + }, + { + "tcId": 71, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6cbfd71c645d184cf5d23c402bdb0d25ec54898c8a0273d42eb5be109fdcb2ac", + "iv": "d4d807341683825b31cd4d95", + "aad": "b3e4064683b02d84", + "msg": "a98995504df16f748bfb7785ff91eeb3b660ea9ed3450c3d5e7b0e79ef653659a9978d75542ef91c456762215640b9", + "ct": "a1ffed80761829ecce242e0e88b138049016bca018da2b6e19986b3e318cae8d806198fb4c527cc39350ebddeac573", + "tag": "c4cbf0befda0b70242c640d7cd02d7a3", + "result": "valid" + }, + { + "tcId": 72, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5b1d1035c0b17ee0b0444767f80a25b8c1b741f4b50a4d3052226baa1c6fb701", + "iv": "d61040a313ed492823cc065b", + "aad": "", + "msg": "d096803181beef9e008ff85d5ddc38ddacf0f09ee5f7e07f1e4079cb64d0dc8f5e6711cd4921a7887de76e2678fdc67618f1185586bfea9d4c685d50e4bb9a82", + "ct": "9a4ef22b181677b5755c08f747c0f8d8e8d4c18a9cc2405c12bb51bb1872c8e8b877678bec442cfcbb0ff464a64b74332cf072898c7e0eddf6232ea6e27efe50", + "tag": "9ff3427a0f32fa566d9ca0a78aefc013", + "result": "valid" + }, + { + "tcId": 73, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "97d635c4f47574d9998a90875da1d3a284b755b2d39297a5725235190e10a97e", + "iv": "d31c21aba175b70de4ebb19c", + "aad": "7193f623663321a2", + "msg": "94ee166d6d6ecf8832437136b4ae805d428864359586d9193a25016293edba443c58e07e7b7195ec5bd84582a9d56c8d4a108c7d7ce34e6c6f8ea1bec0567317", + "ct": "5fbbdecc34be201614f636031eeb42f1cace3c79a12cffd871ee8e73820c829749f1abb4294367849fb6c2aa56bda8a3078f723d7c1c852024b017b58973fb1e", + "tag": "09263da7b4cb921452f97dca40f580ec", + "result": "valid" + }, + { + "tcId": 74, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "fe6e55bdaed1f7284ca5fc0f8c5f2b8df56dc0f49e8ca66a41995e783351f901", + "iv": "17c86a8abbb7e003acde2799", + "aad": "", + "msg": "b429eb80fb8fe8baeda0c85b9c333458e7c2992e558475069d12d45c22217564121588032297eff56783742a5fc22d7410ffb29d66098661d76f126c3c27689e43b37267cac5a3a6d3ab49e391da29cd3054a5692e2807e4c3ea46c8761d50f592", + "ct": "d0102f6c258bf49742cec34cf2d0fedf23d105fb4c84cf98515e1bc9a64f8ad5be8f0721bde50645d00083c3a263a31053b760245f52ae2866a5ec83b19f61be1d30d5c5d9fecc4cbbe08fd385813a2aa39a00ff9c10f7f23702add1e4b2ffa31c", + "tag": "41865fc71de12b19612127ce49993bb0", + "result": "valid" + }, + { + "tcId": 75, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "aabc063474e65c4c3e9bdc480dea97b45110c8618846ff6b15bdd2a4a5682c4e", + "iv": "46362f45d6379e63e5229460", + "aad": "a11c40b603767330", + "msg": "ceb534ce50dc23ff638ace3ef63ab2cc2973eeada80785fc165d06c2f5100ff5e8ab2882c475afcd05ccd49f2e7d8f55ef3a72e3dc51d6852b8e6b9e7aece57be6556b0b6d9413e33fc5fc24a9a205ad59574bb39d944a92dc47970d84a6ad3176", + "ct": "7545391b51de01d5c53dfaca777909063e58edee4bb1227e7110ac4d2620c2aec2f848f56deeb037a8dced75afa8a6c890e2dee42f950bb33d9e2424d08a505d899563973ed38870f3de6ee2adc7fe072c366c14e2cf7ca62fb3d36bee11685461", + "tag": "b70d44ef8c66c5c7bbf10dcadd7facf6", + "result": "valid" + }, + { + "tcId": 76, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ea1d436f6359caec010789fa94fe08b167c3e497d8917282f47ad2a8f95fd0f1", + "iv": "73fe022202767af834e32126", + "aad": "", + "msg": "adf9b6df5c5cc9473e0bb579f9a6aad396f93d28bf83e98136f978cfb9d501d09ef778c122b43c876c22e40d74a48d908978465a06be9e80891710c8c2690a762bc9eb8bcb2aa2707db149abafb9c17c1f0b68c7adcea98aebf4c6a39e5a8f693133eaaa5bb0b3708720d7b86424101bad56aa190c67d25fe35a4a34e1f4fd", + "ct": "ace9d080f1ae875c559fb3f0830e042a3a21ed7cbe6c5de366a3b0d7511b31425fd43a0af3ba7bb0a299c0f122ac5c677babcd1e1af24f284ead5fbb42aadc3665d2c28c818aac133c851efe01dad7d7321b197390e707df69b2a386de1d4cea60c203324b53102f4a760644cda341fdbdc3b5ca0aae74b7411c63a958e742", + "tag": "aadbe96afff09960024a0be5e94425c6", + "result": "valid" + }, + { + "tcId": 77, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "ce758567bb0bf3a692333e4fa7b6a52e02c6afb4ca04beadb94a4aff207e9bc2", + "iv": "d1cc1ab3d7d31e478cb4a589", + "aad": "884fe40045a1893f", + "msg": "03f9bcc27aef21ad1c9f22ca275f294ab582cf9a4878b2a6abec983723621c8b2d4cc97d91f1e96a946a8d25206a9ff0f4f04c5784dc64af5978b7371f12eac6bb47111eede49be44d23355bf0e477d701f3fefb26b67aa95354230f6cee09699252421ab2c3f2e89ecddecc405acd8c177a2aa5b6b2ff2ebff301ee59b5b5", + "ct": "ebdbb8a9613cd78b62ae915f355fdaf50b6967688d25e0757d8988e6145aa557593f0476e70c0c307f0c3878da9d0454e652771ea89fcfa29ac89737ce53942654488dc9311fd6430da3ae7c390ee4f11db6b7a775e4c3759603de64ebc55c755f46476d2289f3f468e60b12cd615137ebbec389b58db53a20c8b708b445ec", + "tag": "3d49d49da114603a70034b6437aa565b", + "result": "valid" + }, + { + "tcId": 78, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d7addd3889fadf8c893eee14ba2b7ea5bf56b449904869615bd05d5f114cf377", + "iv": "8a3ad26b28cd13ba6504e260", + "aad": "", + "msg": "c877a76bf595560772167c6e3bcc705305db9c6fcbeb90f4fea85116038bc53c3fa5b4b4ea0de5cc534fbe1cf9ae44824c6c2c0a5c885bd8c3cdc906f12675737e434b983e1e231a52a275db5fb1a0cac6a07b3b7dcb19482a5d3b06a9317a54826cea6b36fce452fa9b5475e2aaf25499499d8a8932a19eb987c903bd8502fe", + "ct": "294a764c03353f5f4f6e93cd7e977480d6c343071db0b7c1f0db1e95b85e6053f0423168a9c7533268db9a194e7665359d14489bc47172a9f21370e89b0bd0e5ef9661738de282572bcc3e541247626e57e75dec0f91ac5c530bd1a53271842996dcd04d865321b1ecb6e7630114fe780291b8dc3e5d0abc8e65b1c5493e9af0", + "tag": "f2b974ca0f14fb9f92014bff18573cff", + "result": "valid" + }, + { + "tcId": 79, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "80be86fb6fc49bc73428cab576f6ad72ff6aca04001b8b1c57a7128be73900aa", + "iv": "903188433c1ce8971aa19b9d", + "aad": "0587af8530ad0547", + "msg": "67ce499cd8ed68bd717dfe61c60f27d260b1c163a72e8cc8597253d3d987c2dbe1bff2e44d9bd4765d3e53d9c3f8eb3b90e751f47c7157bdc1142bc33f5833ac1cd1262cbb239066b334a4ed99ae82c74f2b49540f1a614bc239d8fc5add8c178184e41281f6e66c5c3117fd953547f7c829425b5082aa69686847eaf5784692", + "ct": "2b90b4f3de280c44913d1984bdd5dfa0566c6a14a058659a9b623277b0bb6e82101e79395d12e643f62d9a822bae497907493e4f8213fcf99da8a78fdf867af36bc8b0931c1886b4f0ae5729986494dbd59737e956cd8f226c7c522689d082f023894d54acab0c4d609f3746a67369bb8876008f7fd3dc6681c5fb9d728c5911", + "tag": "f005ebe1c1ada75a9cee8d630881d5b8", + "result": "valid" + }, + { + "tcId": 80, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "01e75ae803d3045e6b28b7f67937eee2d8d98f77b4892d48ab1f15f57fa88bbe", + "iv": "6902e8f0ef1e9ec60a3e46f0", + "aad": "", + "msg": "32dde3b9bc671fad1265b26cad3d8dd0f099134f6755f98613024e1bd10da9a62bad01a997f973101e855ee1c7e60e6b6aa1df9d80fa567d0ccca0f956680be76ed37c71fdedef560e2523e8c5fdb9516250017304f8ff416b9b8e5d17c1f062ded4616ea9d462ed6ca0dfddb9f5295b7a127c0825ffab56ea4983c01eec867f93e24a18be48ceb540986c530104fd466318eb812eb42fd04355615f92503e53799742cdc71830eaa44aeec914b6ff1cbb4f6f81ab595078331d645c8d083b469731174a706b1666e5e450cb62671067032a566f597b9866b71514a409e38fcabe844964581b3ab5152696b76e49ace66581d21f512e28e077c44948a65260", + "ct": "6bc2433f8ab0712b59c5fbc6915bc5b971002b1689d36ee49089ff0c54fa359acf9a2a22823b0f9705f702891999f0685cb5f043c5b70d7581c18332144afe7eb3e43a843efdb7ae608f23267088a180d9620aa278129b0dc7af85901815c91b9b26b1007bb394ae1586426c58b5f34f403d311a98aa5a552f7b02491aab1e358e1c06efff292cfd4f28f0ddb25fb13365850992650a8a2f551e7abecd9995bb4219e69ab32ce1b7e73a68a72d66f84f6ba8af34f4673c43e9f8b298016647b878c786ac04145759bc758342c82a71e2590da936d85fa3f0d3ccc3c26265bf5aa1ceb68b572528e3e6d261d537f72345b5ca2b807e5c5d61ca198caeb848a5", + "tag": "6e646aa9606b65092b3c5714b0a06eec", + "result": "valid" + }, + { + "tcId": 81, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "09e85f871440c5e49fb7364fcd0627c0623c4240af18afb446c0051c04948e28", + "iv": "dfff8398e35a2e760dc5884a", + "aad": "f7bd1b5ce93343df", + "msg": "028f4d6686248655364389d9f5ecaebb69fc78dac06d7b7811ca1d0b00e529fa8497f3633cf33c9488d039eed3e58becedd6897f1cd285c0624b822789d8f5a392f21feee6fd8973e217bc3113bc669fd3f99585b9ef82e66ee60ee1ee8af75e2a0149001610a980ec9dfec09249514360f24016ad861e56366a402d68c624f4f56dacfc6a6043abe7c06a00e10d68838f86a2569f652ce5fb1f8345cd81ab73adefe859bbe10226de32f16d6dfaddcf6f3af160e134500d2896e3dd148b9d8c4df663c9f65bd417e0f3cfb979c06d88f749451f4d82c6f7e35b9e0ba382a0551593edccb3b3b4d620cea2705255246184f0ee9236443c8e3b4867604add56", + "ct": "1227bc0e129faf1f3ef849e0a091b53a4f1b94c989a0f6975765a6f98f5738e2e3253aec99ce1e1943d21efd21313db6e61904921a5a981f910171e9faa0e7ee57cb1f63876733a023391f9f70adefb9d61630b7adb1e2a3f57a8cea23975c073e128d8c8fac29d7f1a30082966e03e5e38560dd2527757f3f1d31a722f5840271803e2aab34443e7d793a0743532cb7de6d45664696107ac41da5a860420b0f15754c077f6e6df2f7f1f3854fccd6c701ad0c790499bdbead35f9192ff537ab2180b2beed6578de7f732d5f913ece1eb5a022adb57933606998ff3c00c560e8f89c3d8417b5f85f06cc9eed1a7678510bab47c6f06f9dfa6bccb0e9b605fd", + "tag": "2b63fa33cc020819b33c1ca9108986ec", + "result": "valid" + }, + { + "tcId": 82, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "dc4dbf811f9509e33a45a8a0743e9391de333f69c56ee4f0fe90ce21c238ee59", + "iv": "1859d3ba4710cdd300baa029", + "aad": "", + "msg": "df91c48591f4cae8c4d659d024dfd0a3535981487764bf19b012713e6ac6d578aa0b3a51d7ac97cd503fdc8682cabdb6a5256e9890458356f39b9749f6ab158112fbe4f91acd333477998b9f0d7cc0be2d40acfa5103adc1b0d0a5cc94733d703e0d8c26e09e9d079fa6a65cf35240a16280826ab7c0d8ac5882c89e58444233c2f60aaae0cbd1a7ed850065242a9378c340232fd86f1fd52a92c960a9a86f529f431acf3aa94133785803f4ac1a22378332daa22dea3d34d2fdb7c308fa44ab93b3fb02f428be22fad6c0b10c138af97b92a199296dd947c93fbc40674c34c5623d26d9c90dc6b3357018b9f9250fb4dd5c11518191a236745a2bd42f863766", + "ct": "c155b08f248b9a1ec7cd3b3a7a1fe37964de2effb752342d8c2804558c36be935bcd900dac4a0120f1ca7b8d1d1bc886ad5660e29af36523fb53fd5993f106fccf6b4e8448bf4f3f331133767d6a961e1bf756ab676485755852deec520d97fd4f97c945389768777ea01c4f03cb8d4ad9c3badd09724a5a542b2223b50b1b0f0b311e7321b5e1c4b7e1fc1a8cac613ef91187166147ce84321ce1bb10e82e401e4f5b5009a590937e4e0be98d4d1f3a3c809fe8546255e77c756f809b273ddd18ac2098e315a4ab6e6e8f7749a72b50ae449878153c12f63e62c9e453790c74b7ae09f6c2d9331b532127c29b36a8fd87552f189ef67a66f204d0813e2547ea", + "tag": "a0aafb534e72d5d0291ce28de457714b", + "result": "valid" + }, + { + "tcId": 83, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "851d60f903fee79704ef4a5e64d6ea9bbdbbc2bbce54a08ffd810a7d966dd2d6", + "iv": "aa9434bf91cd9e494314e68e", + "aad": "6fd57103d966e810", + "msg": "d0197218ffe58d1bff3a3e0b4d246495a2198eece00185095f0bff1bb2eb78ee83b86c232444e2bac93c05f5be3ae1913077c24f8a753362729ea8f947a82a0a5c0ab56762cbc78f94992396e3f252a38591fe1de6d0e71b5dc01d3f146d3050de55d15f64e11bc5510df4dca985e4ebdd232b972615e749914cf26ceb4e66802eb8324a5aa54b515b3386e1305f0efbade636f2e0f0a8b365783a1f02a1462002ff444bd8ce05397037bd96a910eba07bd606a8599202cf1ec70bda6b3346ff7060bf2837ba3f000fb63d31451de7fbc4544e920fba343ce7e49b71aab3a3e7bdc23e1ebfeaf00ee980368e0e6c13ca0ba195333d610fe826ab2f15e2a26e82", + "ct": "6fe7d827a25e8028ba3a228894bb4d0c05a3e9d0b18273126669f90f8b46764252e9197d748178d4386472b286262f9d322f327e50e998e3928d3d201600e3c6431c697f848c91fa1cd1f8d282c3778662ee4e4cb2a225a5f1e362703011703ec1ffba91febe291f3d49cfe40a8fe34fba48686974f0957dd1351c7ed05795de157dac2e8be7c15cb33acc322bf8f5d9fbdebb84744e2a69d44ec1efe2a34ce97afc6fc46311885c96c481747ab86fe9c1c60832dc5625dbb9f48e34dc7a6f0fc439ecd76729f6b7b9cbade2703efdf352d3421aa715e3dd954cbf0fbdf74d31f980c4c0a1867b430f20f35127eef3a996ab46667ee3709afcf6490383efb394", + "tag": "02dc33981da69c02be2c7e383a4001c4", + "result": "valid" + }, + { + "tcId": 84, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "317ba331307f3a3d3d82ee1fdab70f62a155af14daf631307a61b187d413e533", + "iv": "a6687cf508356b174625deaa", + "aad": "", + "msg": "32c1d09107c599d3cce4e782179c966c6ef963689d45351dbe0f6f881db273e54db76fc48fdc5d30f089da838301a5f924bba3c044e19b3ed5aa6be87118554004ca30e0324337d987839412bf8f8bbdd537205d4b0e2120e965373235d6cbd2fb3776ba0a384ec1d9b7c631a0379ff997c3f974a6f7bbf4fd23016211f5fc10acadb5e400d2ff0fdfd193f5c6fc6d4f7271dfd1349ed80fbedaebb155b9b02fb3074495d55f9a2455f59bf6f113191a029c6b0ba75d97cdc0c84f131836337f29f9d96ca448eec0cc46d1ca8b3735661979d83302fec08fffcf5e58f12b1e7050657b1b97c64a4e07e317f554f8310b6ccb49f36d48c57816d24952aada711d4f", + "ct": "2152f1edb34c35b43f7176809ecf6db0a0a2afaa18392744f7bb1d4a4c026c374bc28fb560987d0259da7b59a1920528a192211244f8b9446f3e680a54e4c0c66d4c60449ccb2e9244cec83622cdce99f5aafb8cb37d70bc866a045202cff331c783ff953ba053bd2db6086ac351878f0deaf49d92d0dded0a39182da35dac8c47e14cfe258aa4c85903c4ec1739261221a75e918b5ef24ca1ef1beb7a32e1890548d34cab34b4bcefad5d5d110cf6fd4e42ff4e35c24e8b6295130c5dd914e96b1f89838018914adf2e17426ff36965a738892007a74111c977a6d78250b912a539909d6ac350f37a67ec0fb0aafba26f2df1814691987145bcb3d80a815daba2", + "tag": "a17ed683b37ce537184298103ad6a8c3", + "result": "valid" + }, + { + "tcId": 85, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a0e4170759650755c454888ab1e44913ad801fb6c4035c2d6aaf537a4fbb21c5", + "iv": "b10abdcc32cfb8523c6449f0", + "aad": "9d3abb5f1b4791fa", + "msg": "654a874abb7a13ea1d43140ae49f6e4ac8bfb8a8e979ce4b21320e69af4ea44bad0f3166db17017cedaad64719917e58c05bc4646a8c4c34931043cd6136202ec65487a1713ce144248d8ff8199763a3c37943e4c0a9de87d1079ed2a19cdb322cbe8131c1b04f7770ea23f8603076073b4a5bbdba96a3ea09197cfb61f7411a75e1855b076f5f57f6a3611ba821047f8880d82795397aaf900b335a458990622ba91fa5758e996d55209e44879c6d068e7cc0d5abed0d9470d8198ddbae92a28f98c62a158316dea8092ca7ffcf8b81adcb0f918f296e9a655439a186190b41cc9b4580627da94ebfe1d621bcca787de5f970006b7de87a6645827afc4ebf7ffa", + "ct": "91d5e36eade5744e02e1cd1368258eb15dd4b3bbc92aa030a947c274328a26fa326ad8ea814db7beee7e6d991a27bc95045853c6b434fa64810623152a35ca79dca26d1742b2b3cdfbcebdcde47c087bbbc4e9ed4fe2d67e51d5cb16326ebb17e949ba3415f8fbd235276f2f90e3a233271ea7ddf88c3f9105685bcf3295f94505e2bdfa8f6fd18498ea945e7b47fb016feef608327dca93ccf54cccb3825cdb7ee61ed5d47f33b175ec0f6393136b0b17fa640d3d3e6f7f06990b80035e0297caab819dcdbb60b877b5ae2d09b4708d5e27c656c5c28e29ad85b32e84802efe315d90da7eb07575971dc39c2a7f44db5c0fbf47d8700e70103a0669462425453c", + "tag": "737254b4bf0485fccde0392be1a3c858", + "result": "valid" + }, + { + "tcId": 86, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "4f62e56f7b15035f427849714beb97e6acf88371e1f69b388129bb447273d6b8", + "iv": "137d5c98a92f6dcee4f29d7c", + "aad": "", + "msg": "a147b716b86ac8dac7447d5ba60ee8a4191d2c64a3aa04276aee7bf7dc824962c09ace20a7e614cc9e177b5b11819b8f17008a9408e8cd8bb34b401be35368f492c17629b6467299bfd2ec4d9a7f17dea6f9ca084e871fb7fc78c2bf299b810522062726c5cae14b839722ecff499a2b3f082b6d1bfedb752f84a4e77459c9268d63199315363e9aaa39bea7fbbcc60a5eedc8a1a982ad6fa67c295b932eb3999047e0a99b3823032b6b3b7c4c553970afca50cb4e5ce859c25c598eb682005f17aec5526e26493208483679a23ccef6f7403a3f3055affd531a1cb7d183892dd577d526e8da8aa8b8b980a36e176b8d9293e785ac01bdd4dac8cf8dbdd82926f1e31408284fb3aa01f4414ac7aa7832d2ec02dd2db9b6b4b61d8c1cbb31dac7b6afa8d08b6877e439600c4a6fc07511877df2e9ce3a9538a726002a46c083d98124b185730f3b2aea2a01cb626be809f87b2ac100511c5b8fa0e9d40c9c999ea0aa87aad08cfb62c1ba869178be986156f7622d8c48ad80a552e9d08c36671ae232efefc8619c562e715f04ae52db2ad8e4a09e8c671b12289558117f9562d51beb59e29b10dd9eb232e8fcdb1cfdd14899acd693de14a7c076a4656386e23b06415b2c7a93b166cad1048bc605a49a79df3c03a3380de68a4f013e05e5283745d4078ebe308dc8881ced62ed571a93c69e8aae6e51f5e61e4ff75699aa32", + "ct": "8cf1182948f64274bae9a56362643e4c0a0f336ba0e60fb6559c0444fda0d03410f240432048d4dda78736db698970898aee32c5941057c87195bd151807505af56d939f0cf687b64ae21204203c0fe7bbada00d98a7dfef5378bfa01f5500230c7a453823d7eb9d604741182341adf0c90c652f7e3b549d8ac2090d78d8dfb9265ee2c2e92e760f76816f9cab794523b9bd6c4d22b94f8fbc07fa5fb6c55fb56570f5f9f22b7fe355ef36b20d31e17274d63fcac8904e67e3886afec43056d3bcbe683e7947a1fd8bebdfbc95ece9bd0418b74f7dbd745b5e8490b9891c124326753a5eb6f04150ca4c1a105874c21b90a52213ae8a483cfc7189f49491a1b0896a9171db2764d79ec1f98170f9f7a0bebe494246f708ea5bfb1ea4ba16df704d022a0b50d42d7b018995c1da346c1b9f8ff9432b830015d69ab2b4dcb6d24ea6c0b721552fd23171634895c0d1f3827e2954949e52db5fad0179d1b006c6591810526af9b7c3cd3c16d8df46254153b82c1156c360c6207c787d6074cac0ee638250273be768e6ebe14ccb0d7df728d085caefd2d6e24dbdaae063ad00225b1fa5015d620a87563780e0aa4eff4b500c4c1765dda555e224986b02b07f4be7dd955105ff5d1d61d35e66819744ba946f91ce302ee49a9ff4e3288f3d8ec5ff8b1936be6beed5cd8dccf4822802c3bf77a4c050d0893c13343dfbd7be796e", + "tag": "e7ce1fa9c9a48457efb48d09cc5c2c24", + "result": "valid" + }, + { + "tcId": 87, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "c02c2c0f7af8aa219933eeb5cae06b047b231abe1678fa3c1764ba850ecd65d7", + "iv": "52f284156a66918965da70d2", + "aad": "38daa49513175a80", + "msg": "9a2ec2de2ce5df3d0431a40021eec52633a845be351d042acd384fadccb40af3885ce163877bae78c4c8759c39405621070585313868ac7b90a53ed9fe4f8b245e2ba817be9261363ba141b3bebbb18bdb6b32070b50fbd42373c1f9ec32ab85634c0efd845d59fceea4155a6ccd34fed3ce0f68863047b600097a7c604a25f8222509287fe383fee8f41a9d82fe909b9271fcc0f2501094d1bb111a35ae540714db20d73f52fa70d28bc0d5a160a6f7cc1208ad4177d32e1539ff74b67f68dace45a3a4fd8cf5e8af97205a9cdc4c0053f3005e99c79e850e77077f296856773bfca498e8127d7ba1895709ea47deb4d24603b2919adc140c33c249c4b5a60112bbb61e5e8fe4ed06bd31566086c1e7823a907b254a3e40b7d00b8d4c94a7f3d2a2d9a603796a18336da0f56af1d0b9b3fc2af717e0a84478bce8c8451fc1e4fe755f78723bdd82fb705810d43e925b5d69e248315b89b2dded9412e2736db550d8696f64e27ae92ae5e3d26b04c69710489ed17a6764e7ee9d5d947b009af46a0db26a503b11f496d6eb52dd56b98052620e0feec99c211710ca31d2a48231da19d02bb25ded8b862bd8c242e5f602757af181d0b469c0017427c00506ad19882a3c4ee1e2692d9b14046cd08d6e2d43bd20e33e928db64cdec8ada4263afddedd0526777db986b725fb1611e54dc63b9728af4ad950abe2e950d1239a89", + "ct": "83b19ed278195ab46de72ad88cbdebe1a164167217efa1c2f64ae1820ead80fe11ea034447149f83fb97d41f94ec350cc34271d11da22089bba9578901eea60d9c1a710bb55ff5b1c7fdce513e598de145166ad4a8e1ade5f924ade4c657809026f2c2c32aa5415a744920ffb436bf47ca88fe47b6c6673312381fb328447297ab3cd9e6781259b50996a49a1e33d7b0b443f8a278c3eb370fae028746138a51ecff1eddd4a31c4b5a33165a95515b7abc4f61ac5fbcd69681bb9a6e2bd6edd4c6a7a21b25228aae717061620a6a23df738abb6878a923b6a01d43d996ca7e42048799595f43df2799ef4f2b170870daa4861b1ec811d3c5bc886b9c17ef014fe00d0c04fae95bc56184abf3981829febd8091d55c65f02fc31d6e94a77023c669a62cfd0edb165d5cf4375b2cbf48e518989f7b7a1123ce4572b37081ed98125086c2649705a707b3a5162ab91f7ba0fceb2e24395c62f6bc8176961e4bf046cf8a5615810d28c7e6a0a12adcee66fd4ddc4733704d271d3a8ba601f7675c9db88df760fcdf818ff072237270ae5b0cef853fe9ee0317ff62e8631f431e8499a4ca7751c2336b7275f787ba78782992fd6e73a2d2dcc740076847a922880900f9778b2b09bf98575d0e4ac63ab8e88377e1969889cc5a05f32c774a045bb1ab680e3584428f86ccade4107f3ef18abc9af1c24fdd4bce7902fa5e06b4376c", + "tag": "4653b36f7430536fed993668db4fe243", + "result": "valid" + }, + { + "tcId": 88, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6aada828b2273ffb81dc794a8629e305cb646f9d266002bd313427d384838767", + "iv": "00dea4505cd5396f6ba408a5", + "aad": "", + "msg": "1d99ee022f9576ed69af8a7f3945362ab0c4691a4d333a3f5f85cf8d7db7fb8a069b48998cf286ffa4615e87398c3c3c1295d5bee272bdeb5166470a8923f7b79dc92b2a97de34ba87db2907ac84fb23d38f2e1af835f737488fc04fac70432d3a0b02a472f851025803aac692273273e27be1dd9679a4d626997c363ba706a7db1f4cdc07fe3c67fbec0aa8619038e05607d95a5ddc4b403cd6dabc41790adb6cd76eaeac3491c3cd6a8787e0f29c042b4e2afe987674b9495ef55768c696bc6c3df1c1e9a7c0456f478a1a1cc4c3a9b0f2cd3b42db8d0b6aa36dfec3d2c08d1398eeb75db61ae902d2da5a1efac7904b8ae32af1ff942c99769504bb5c56f5819e4f899e8bbacfd4682d82f41e179a9ddf9a0820cc4316f252d1d35597aeda43ab870887e67aabe79f046b03a9a83588994058a07baedbbbf9c01d833732efac89ae8173f902e831d579d31e4a409cef5e494a27bb6367e84fc57642048e44d687ce73dd9e71384182b262d63a715698132f218fc2c3611ed0dbf814799866c8c43b4aa7c13b5a53f9a337627d76bb960f60fa891f0076a538c396500cefd2dd1e4e024f9d83275f9b2c0ce6df41bb6488398fc657dba0efdae0019dd31b03227edc5229aff60cd083c0f0b66675baaf91c3206819a0c985bc3283600e9e6d62c6fab2c6aefd69829c75063c54ad11269ac5ec563ecd870c2af4cde6cec43e", + "ct": "e0ebc9ad51c2421c7e5add66854a184abee5b08da0281dba8ceed731016d93cc28bf8f58c56c0b976053799ef1019b68000b61429f2884fc5c0fc51dbc2832d9f0cf62e84ee2b2e4a71b44f6f29fa53546bac52bfb301b0132107b6e81592a14e59d7bf8d0b1649f72f536877c850d2b0ad6f2818225ad9ee74b3a91e6a53dc86fdb28dfc9edcccaaa4229b5e5af96c5d1b6c852a5a7cc2046deeb228c6cddda6899618203a070dc713f0f533c72f51b6c0ee57f6400a68f0f9a8bac249f6ba851153aaf58d9a311a9c699a53a4828157bf0abe63360696fd00fa42fa90483a04cde63b7eb4b12d988470a58a5a4ae6a507dcd6468c4a56bd84a39bf30a55109aeaaac08c5b3f6c482c8d4f3adf4f41b3cef09ee255d671a8a45c96535d55113414bbc72e07b02d8f548b7ff8511b71b52cf98eb85f951fc029b5a20927b876101f1e7993be9a33069c9c8711f198b8fce00727b8f5503bf27185db2e8fe8a0f79dbfa46a44c5369bd0121ac5dc048c5448efff93d65c05a3880e36de4b1f2fbc3fccefefd0109c2e6f6565a413f4fa616628fc28cd53c4493cd0ae307844e8f780412a5753c2c4c2f5246b1d063684aca3d5a929226cb2ca938d36e156bacf534b4d675be66b79b403c48106d32f0ec30cea379a092a577afede7a0de18e4eee6544ed7a7e14e24b1f1769d1d18f275e8ac7d665d97ead3e2fd78499f5d9c13", + "tag": "d7a76044b3762b0fdaa78c14d56a83be", + "result": "valid" + }, + { + "tcId": 89, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "285215fdae568e13d4501fa7259ee663927ef005f495b1991cc0c4f8b4e521d8", + "iv": "908863b8e51baed66187c998", + "aad": "9b94574d8697d904", + "msg": "91675754494a79adc2727177662f81e915df62ae76984a6532c53beff09de23089642976c2cc244e26191bc97286381983c58e1790ed61c189fa6ad6fe61e0636d353d4ae71b16bd790d83a4e0fd4f8ff2333a9963ce15e083ce5e64bc25cc6b32cb84a2c9bb497aa4f6082abb1f1cf78374682882bf242f06b2849c7a907944f1eb0cb1e1619c93d05419ab77264d1b7336c5f454d52c35a1005bc97a1dac3c46c951983a45fa87f19be57fbcdad58562de4c6981925d5b6118a3e50439926723c1879d710b6c79e880ee5c3facd6fb54ed86e7329f1f9c461791937608339ac13930b1c515b7b2dc98324a4eca7213005d2cf274edb9c318794e608f8323aca43dc6a6063f6ab9ceb0d149601ecaf8134a8b0acfc55bcfff0717047c7259958866a48c3097fbe0d5f17fced6362675fc5a5201c132ff97e0d8e801a59b2562b289d91c587217c71de36c26e1cef3d1245cf86ac2ffd7afcd085915db585cb41ed7f8060dfbea6ad5399c0b2769b0f3672c9d81966ad063ab46da9e0a07c5c9f42b70fa5d60e9374c5849b13f72e99514e8e6460d02ec433924d1c76946b3b7379fe70e4eebe53afc581b8d6fbfc9f48bceb14a571bd3a20bb460fb107f2006af1839f1c2ce07940c8dc64bc02961f50997f3ebdf7472efd7b9cf4ad75ab53fdeee6c634935c62fe062db0e082941eeb2a5568528bf0de46819288d6446ad33", + "ct": "fd395a8a8a4d4f6404587fe9786e324a529a9c824fd6f09d1a489fa060d1a7fde3859ae324b631a3cc4b566e7270d91c09247f536a34bfe412e980da64bd995d87b25f9e4b39e634842d2112eedd5dadaacbccc701caf8e03988f4161700dbd9fc806eb2dabfa6d303dd6528a4ed256758e14d9e10b6d59fe4961c25384f0342b6277d503dd23d61d47ee4e30fbaf4fb2f2549dbb1a519f0da04b05e39b266067c9d27287f1fa91f69a81e63d7c207e6e7783061b02dda0fb3fc60b6aa9dcfa896a72f534a076779364443d9e6991317ff8c8249fa6d65510baab744bd1b697ef07d883f3b91d026ab982bec4101c454fd0dbce62f756414695873a3f5ec0d67821ca778268a968b5e8305fe97003c8c15355bd81505069887bb08f67f6e81d418c5bf85a904ec09cd6c04b3d6a7e088d02161e465d5322d3d7f4ac9bbe6e80fbda1fb9c6d6791a0f14419765789b043f2e231b7d05ffb0be6140a93e6161730f0e08467389487159c5a3fdae47ad2f65be4456e285ca14226bb2acb4f0e612f47bc70e801868e6d744f797b9d2b4933072bdbcbfbfad8a98b1704c963b53169943f1cc15c33631c84451f92b920e0b08883e65b4270b42bf2396fc27488e2a36c93a729995f0c245d2886ca54f70422eebe3510c42734a5500c7b1757df214b4dcec11eb6084e6405c8a0bd4b0b1c3c0a4b2923d197a287c23e5604271b756f", + "tag": "62188f853284fb3f7eacfc876cf906e4", + "result": "valid" + }, + { + "tcId": 90, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "afd579aa1accc682aca54e142aa69df09802f020b24a42c41db58f6997edc678", + "iv": "9f79d1da957491069d774496", + "aad": "", + "msg": "bafc6e865c48bd34b7f9329e35cfb286cd4dc31f8316171218bf0471dffd35a330a181697ca5178688dd87efe527924f90d1c78ba40de70952ff44c26efe2159e59358f3931573df9373a73b91ba9592e12140cc009feedd2595e5b6f066b5ef6de99d4c31552cecb0614f1dce990e46e7694382f3cf3ccfcd1ea62e563e5f0dc36cb5a84e0c0b3f1f8f3fa9100f487195ff2e3169ad08136aa8ad566548c9836aa00dbac74716c26e838c1486a0084d3dfd692585e2e5ae7c75caf0e7af60219f96116ae963b4a5899cb30a120daaca7833776692c25ad7c185e6a2d70ce03ff156cd25d76153539d6855773e21142f9ba0313562875f105a2b770a15b533fbf5110dafb69329982ab44ed1b9f321d7b79ae15a19d9f3bd4c504c24b23b812d514c19ae2a347cc18c12ce915a0bad7cc89a8720d4ba5ee0964fe05e4cc59a13f92c670b8655071e216f19ad05f4bbcca6dc7feeb188d6269c58065c98fcbbac183a9abb3811d80cb476544bd74b26991f3df987f0ed0ea6238659ac09a2250fecc0723ffc51647b74bdf454f26e11112c8bbd797f09a3be8251c6b5b319ed9537278cc1abedb32aa10840984b96e8636b289335846ae4fbd4a00f6600d98ebe25885c68d7043ce0dc5229d7e9bd51bea9b8fe0552f40688429c482629ced623f6074858147e73da3ff4ad2ae45c1a1c8a6c5b3b2c3d568a756608179f63b580fd", + "ct": "112f4ce552e41a1e8c93f6ed3e1273b9dab4c1eeb5c100c2c2732af27f0160764012af269a50f04d10ba24bb43598547b700cfc480ab123f6e5c7488d674a637552ca03eb298af4ca2879830ca25f273713bd5bde16a06b31254b412bf6a8ce22efe73b15380fafe2ade9d5c57e6267d082b5adc06f55e8313b1d0753a46b988e7776b201a9d5896c349e8631f1b381c8f43247d0d9b171701fc94c5265ead84f3d44672bb799d3ddf8d63ae73d79104e48366f05d048df2ee54102d637b9c2d4d03200109be48b6d4c2fb9b0b45f7945c8c5468c97f36c9f4b9789a3a547348739dac3e7b1144884d501b4a073f04081de6287b66af2d0e3728cf2064be88975e578581e1e8d7c7d9c956d558c2fa6816721518f1e1de493e83628a42cce40f85c55d5973b397ea1d58ee473bf5ea59f35510e1903d22673c3d289121f3fed8ee4253e299a52410bbbd39daf1b87e43b5c4be3e4698943e5578f0744c2b0a4d39922d6c4b205e8259166a46230d326442492763dba8a2cd9d62c7e8715e43c891ce2f5333b02ea94ce6fa1c27e86e3488a9b7f26bb814d214b9d29eefa5a4a04040cdcbb1a13ca2f436e302f767da3a7675bcf501cee45f774eb64c0fcb64f1d2e5cd8dd9f9600e0b5197125a35249a0da6f64cadca4a769984bab62438af11c323de33014f627e945cb90f5be88291af1e7e169d7695db6289302ad99fec050c", + "tag": "e2fcadc31ad755139d38ecbfb75d1ddc", + "result": "valid" + }, + { + "tcId": 91, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5f44a54d8959406787895ad07ee415090a45e1171789a2236ef30b1fb8aa6f58", + "iv": "0184e1b899f829c859822f21", + "aad": "88794ff41cdc04a6", + "msg": "0a0e09595a1a5d0784ce1abe4aafea00e66b30fbfa4ec23b22d0701f72b9492ae7d9cca281474fd5b1aad8265486cdb8c74f23bdbc0148affc171829ab113b18df5d873f70b54c340276381689edd981a4ee6a9354a7a0b3055b2c17e8dce3910857d3022ecb6871c7fead7601789fb211d0a4eb345bd16cf2ee447d0cc6267ef2b7b43a89778f6fcb08176be0308df23906567cace11c19e8962047c2a5db9d26c964d67318308bcbae06af8cd95405c5eba980528e4fdb10c24c0be0904199a7222e309495c4117b244c28f835dd68006ad8ca6a0e3bc0621115e3d7aab15d553c54acdb15f3479e4de48ffbf358a5aae9366cfd8f9dcf6a8010a70ec9fdfe889612368356a3c722dc04684ce6acd54fca83b3f097144be4b0af9ec4eac6d6bc443df3e3a679f29ed7afc162f936d7212de96ba50857178efebf83647b09fd751d48fe97ee68dbcf72547835502646ea68e8b17cf88d4ceb0ac5522e19ece5b30a0d5cb382d8c72478a5ebb18b8460df0eec767b232b0ecd7b9d5837367bdc08d7cc15b9e89a611e0e5f6f852f6264f07b4be7eb4482f3253c6b662b2f0b663be4f2e66ed71002f723da349cbbe0e0d1bd1837ff13228baaa0da2a07853164b227313748dba26b629ca6c995367bb977809c2a35661c048589fe1cba874190a80c9a7005df968a9bef0abf2fe4841aeea7cd2ba8c0e897aea78fbc2948ad2f8a", + "ct": "ab64c27d42a6dd6d3a5882ae3a8d351026d48bbec73ddabdab59d0729680ca7edabb8acc71d23023394f21c205f4dcf3191bfeff50bedb42bcd3b20cacfbb0a201cceac62d8ee1cb187bf76abc9f0efc36fcf32e442a4aff52abc43e90e4f40dee972e9c8f78eba8dad3d5c3f065733e1e8d18fda5baa8b4d2cdbb9955d9f9ac5186605f5f7bd12efe38578878530fac56e0187e9d52dc1ec53b0fab591cda716ea608293f2d3c70666cdf966dc0ef4c7dead4b6b85f7585fa22225d792d1988186ce49046eec45d6adec620e8a4a16f5420630f3ac8020763d908d9fab35649e39153d65e06e792be350179b1a5b3ae3131a4c9ba05b6ca9afc8c8d9646aadfa275a65c0eb106f4c93eed0b536973698de3f7659e86e8bdec44c4c1e03b5e967abc89bbc6a831768673575d44b26caecfc82ad3ff5f48a9adc22fcdc000b915a1df8a027ac7d1f8524f3ca156202b2e288bb5d82c0574f8a1e2404bd5df52ac21dfee13ae509fea692ee5e42bae19a82b0249fdd43e725b8820c9a50d256064badb069d7ea142425290cb51ad10af493581a43640e69ebde9ac170f7835976cbff3800ef4fe07b1bbac842170d2ae0ef0c87b1cd8154cee3f46c064b6e68f1bf2aa1950dd658f2764f48885f450b1b2d634860fa233f9d8149e34e03348d4e506a75a0cf2636798826b2d6b7e55837628ab266395306722c924c70ff6081cd27e", + "tag": "c3342ce3b313cc8ce28c166d927a4474", + "result": "valid" + }, + { + "tcId": 92, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7d00b48095adfa3272050607b264185002ba99957c498be022770f2ce2f3143c", + "iv": "87345f1055fd9e2102d50656", + "aad": "02", + "msg": "e5ccaa441bc814688f8f6e8f28b500b2", + "ct": "7e72f5a185af16a611921b438f749f0b", + "tag": "1242c670732334029adfe1c5001651e4", + "result": "valid" + }, + { + "tcId": 93, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "6432717f1db85e41ac7836bce25185a080d5762b9e2b18444b6ec72c3bd8e4dc", + "iv": "87a3163ec0598ad95b3aa713", + "aad": "b648", + "msg": "02cde168fba3f544bbd0332f7adeada8", + "ct": "85f29a719557cdd14d1f8fffab6d9e60", + "tag": "732ca32becd515a1ed353f542e999858", + "result": "valid" + }, + { + "tcId": 94, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7afa0f59dfcb5ad3a76490c5c804327c8d052be737a60fa8bcbf0a2c36630a43", + "iv": "25b7bdf4a6dcbf7c9a3ec2b3", + "aad": "8b71ac", + "msg": "623e6ba6d3166a338bfcc7af90a230c8", + "ct": "d46e8265a8c6a25393dd956bb44397ad", + "tag": "e28f3ad9e3ef4a3d94ee07bf538eaafb", + "result": "valid" + }, + { + "tcId": 95, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "2ec25b0ec7ac244224e9c7fc2fa5d3ef17809e19fd6e954158dd0d72738a4cc8", + "iv": "6fb0d1417cdfff4df37db08c", + "aad": "3a5ddf40", + "msg": "a1c933768a6d573ebf68a99e5e18dae8", + "ct": "2d3cb2d9303491e264f2904f0e0753f4", + "tag": "6c1db959362d217b2322b466536bfea0", + "result": "valid" + }, + { + "tcId": 96, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0a2cf52371cf9d9f95b10108fc82b4fd6110a8ba9a88a26083685ad29826891a", + "iv": "2538fc67afb9eab333f83290", + "aad": "9eec540bb0", + "msg": "0d8c691d044a3978d790432dc71d69f8", + "ct": "a988c03c71b956ff086d0470d706bd34", + "tag": "b35d7cbf2beb894b0c746e0730429e15", + "result": "valid" + }, + { + "tcId": 97, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "307e886b38bb18b445f8a2c6d6f8932492a9cea8d041ba72eb5efdfa70d0b8d2", + "iv": "a071be999151e2a1c41c81e9", + "aad": "56e014d97c74", + "msg": "9aba22b495cb7ec887ddaa62019aa14d", + "ct": "32bf95d4c195dbaf58d9af4001c6e57d", + "tag": "4393808703d67a90870578046cd8b525", + "result": "valid" + }, + { + "tcId": 98, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "dacd51a8a8e4d5905b4cbb947ef4013eb296889353f3c9ee35f5577b26737a51", + "iv": "3fa378a1befdddd61ae68cf4", + "aad": "bb5a3812f0aefd", + "msg": "e148313883a77da121124d06b1c77dca", + "ct": "2a207ca7e9da6b13a229604304d87eb1", + "tag": "8a6b6afec87d93ec6e8dbe13d84c0f8c", + "result": "valid" + }, + { + "tcId": 99, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7b5fbbb202c16108fd13066446853a850d8b34e9da40519580da446a922f9162", + "iv": "aa077a5ce9161bde8d8edc40", + "aad": "f94bb92c1c668a695b", + "msg": "da471cd6935a0ca8307ddedc6b959962", + "ct": "548a5ca0ae49211cdf30bbdcb1352d31", + "tag": "204dacb98f8c8908cc5ea22bb23f901f", + "result": "valid" + }, + { + "tcId": 100, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "1ffd101eb97531f6faa821ec4d5c5702725dd033d3b830bb760c4ef27ba983df", + "iv": "598114e8cf7fbdea8ad29683", + "aad": "2155627ec15a978fbcb2", + "msg": "28668ca8db535c7e8eb27491ad0fb7cb", + "ct": "28cedac24f14caa326c7fe401f68a87c", + "tag": "2bf1b2c43d3039f8f5ce359c1102f879", + "result": "valid" + }, + { + "tcId": 101, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "d2d0a973d5951af352cbee57ac9dab1c284c99af3b992ce015f219506f64888d", + "iv": "9acd213570ce9bb9d886c6ef", + "aad": "37ad668d4d4fe889949763", + "msg": "3f3f0076250352e1b6b5c12cfa12625e", + "ct": "7256e856872ad3a54b34a2a6bdca8838", + "tag": "3b12e4586e45223f78a6eea811efb863", + "result": "valid" + }, + { + "tcId": 102, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "adcc520b381382237d05a6400a7dfbcd0771b6aa9edb7966131ddef6af21f1be", + "iv": "9183cdf3a8ba7397b6b2d5d5", + "aad": "b334375415f6215c0bf89a9a", + "msg": "958295619cf1b36f0b474663c0bc79eb", + "ct": "852c141b4239a31feeda03550d70a2be", + "tag": "5fc59287b92d3fcf7d66f13defb11b0d", + "result": "valid" + }, + { + "tcId": 103, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "bd534f7adeca466844fb3ba34658be807f15c5291ed6026860a24f179b712c89", + "iv": "412c3e13ee1f7864bd15ce39", + "aad": "2866afff0bcc6135dc63af88c8", + "msg": "d92f8ce5d8d0ad2eb5f11af02ef63949", + "ct": "89d6d089c4a255952aca11b24a01ff95", + "tag": "f88fa4531204da315e7317970240ce9e", + "result": "valid" + }, + { + "tcId": 104, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "910ade7d324d2c9688439e1f142e0e5f9d130ff832e507fe1985e5a26452a6d0", + "iv": "9be090dba93deff27adf99ee", + "aad": "ea2575f123268e936c8e4c8c1bb8", + "msg": "6e356094ed9d9a7053c7906c48ba3d9f", + "ct": "01ffb343c757b27843d8a900a36ce39d", + "tag": "a315541b7d6313c6fddf64b303d71d60", + "result": "valid" + }, + { + "tcId": 105, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "8e34cf73d245a1082a920b86364eb896c4946467bcb3d58929fcb36690e6394f", + "iv": "6f573aa86baa492ba46596df", + "aad": "bd4cd02fc7502bbdbdf6c9a3cbe8f0", + "msg": "16ddd23ff53f3d23c06334487040eb47", + "ct": "c1b295936d56fadac03e5f742bff73a1", + "tag": "39c457dbab66382babb3b55800cda5b8", + "result": "valid" + }, + { + "tcId": 106, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "cb5575f5c7c45c91cf320b139fb594237560d0a3e6f865a67d4f633f2c08f016", + "iv": "1a6518f02ede1da6809266d9", + "aad": "89cce9fb47441d07e0245a66fe8b778b", + "msg": "623b7850c321e2cf0c6fbcc8dfd1aff2", + "ct": "c84c9bb7c61c1bcb17772a1c500c5095", + "tag": "dbadf7a5138ca03459a2cd65831e092f", + "result": "valid" + }, + { + "tcId": 107, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "a5569e729a69b24ba6e0ff15c4627897436824c941e9d00b2e93fddc4ba77657", + "iv": "564dee49ab00d240fc1068c3", + "aad": "d19f2d989095f7ab03a5fde84416e00c0e", + "msg": "87b3a4d7b26d8d3203a0de1d64ef82e3", + "ct": "94bc80621ed1e71b1fd2b5c3a15e3568", + "tag": "333511861796978401598b963722f5b3", + "result": "valid" + }, + { + "tcId": 108, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "56207465b4e48e6d04630f4a42f35cfc163ab289c22a2b4784f6f9290330bee0", + "iv": "df8713e87ec3dbcfad14d53e", + "aad": "5e6470facd99c1d81e37cd44015fe19480a2a4d3352a4ff560c0640fdbda", + "msg": "e601b38557797da2f8a4106a089d1da6", + "ct": "299b5d3f3d03c087209a16e285143111", + "tag": "4b454ed198de117e83ec49fa8d8508d6", + "result": "valid" + }, + { + "tcId": 109, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "077433022ab34d380fc192fc24c2edc6301fec6f24442f572a1087ff2e05b39a", + "iv": "28adcbc74364f26dd4b3108b", + "aad": "e0100eb116cdc5e22a3b9f9b4126c149595e75107f6e237c69e82960052270", + "msg": "03c874eeaaa6fa9f0da62c758fb0ad04", + "ct": "1e9687b35fbc8eaa1825ed3847798f76", + "tag": "0788bf70fd04030ecd1c96d0bc1fcd5d", + "result": "valid" + }, + { + "tcId": 110, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "3937986af86dafc1ba0c4672d8abc46c207062682d9c264ab06d6c5807205130", + "iv": "8df4b15a888c33286a7b7651", + "aad": "ba446f6f9a0ced22450feb10737d9007fd69abc19b1d4d9049a5551e86ec2b37", + "msg": "dc9e9eaf11e314182df6a4eba17aec9c", + "ct": "605bbf90aeb974f6602bc778056f0dca", + "tag": "38ea23d99054b46b42ffe004129d2204", + "result": "valid" + }, + { + "tcId": 111, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "36372abcdb78e0279646ac3d176b9674e9154eecf0d5469c651ec7e16b4c1199", + "iv": "be40e5f1a11817a0a8fa8949", + "aad": "d41a828d5e71829247021905402ea257dccbc3b80fcd5675056b68bb59e62e8873", + "msg": "81ce84ede9b35859cc8c49a8f6be7dc6", + "ct": "7b7ce0d824809a70de32562ccf2c2bbd", + "tag": "15d44a00ce0d19b4231f921e22bc0a43", + "result": "valid" + }, + { + "tcId": 112, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "9f1479ed097d7fe529c11f2f5add9aaff4a1ca0b68997a2cb7f79749bd90aaf4", + "iv": "84c87dae4eee27730ec35d12", + "aad": "3f2dd49bbf09d69a78a3d80ea2566614fc379474196c1aae84583da73d7ff85c6f42ca42056a9792cc1b9fb3c7d261", + "msg": "a66747c89e857af3a18e2c79500087ed", + "ct": "ca82bff3e2f310ccc976672c4415e69b", + "tag": "57638c62a5d85ded774f913c813ea032", + "result": "valid" + }, + { + "tcId": 113, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0c1e7bebbd5ff8c00827bc862f12154cd59a4fb013446e5022aede44f7670645", + "iv": "10b7c0942a81d7c644cb35cb", + "aad": "4e3d056e4d11811c2f3c35a34692cbd0658320859e3ca134420b1c3584d793a62a07f7a48a9fbe9d51a0a87de10108075c5eba2c61407d952b53b3f5f7200b5975146df9a2e902f715b04c01ab759062e35c7b72feac1b1a6c8e69002feb49b1ce0b4b1746c6c31c771fd7cdf80d2b076d21d212c3723b939c1c1a72e997bd", + "msg": "bd68e65fec0e13228495e18fce6570b7", + "ct": "c97f89ea1a96aed679b4c836858fba45", + "tag": "16e236688142444cb538f4a45647f5cb", + "result": "valid" + }, + { + "tcId": 114, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "991ef9a9cffc46c3816766326bde6fc2ca046970be6f7f30dceaa725e27ff37c", + "iv": "5ea95baaf3740ace298074e8", + "aad": "151c0676d7d742b21482fd07bc9f7b28d312b321d9ee75f4c2024e0ec39ab26ba867208fbffae06ee730de05087b16da2463eff9ab4b70801e582ad3bf83616bb9a61ed60c3074088c0be67320e26089cfc25bdf8037432a2ba490643767492a83a511bd5718a3c07b35321b42dd4ac5da398ebfef5d65637c6748932ae27fe9", + "msg": "c8144d069a953138f71a5c4550283e71", + "ct": "7013d5dec5bb66d15d2ecc893ab5fba9", + "tag": "9651df2f9cf77b52966a0bae6e19c135", + "result": "valid" + }, + { + "tcId": 115, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "0d73ddcb28a05a3b194327bb70bb98da267d973edbc896e41b9d5051b7a2fdfe", + "iv": "e4f0b1637bcbcb146edc3dba", + "aad": "d7b6aa7b2e605cb175a799da9a7fef90345a0b49dc060fcb1d9a5dbdfb3a47fe7444e288bc213686cd80dea3988dfec658c9e781b6a9d556d7519b38fd214c511af9dae74714741a06a3a0fba77311ccddc9fcac514d69455744ceec9083ed07ad5246cf2a108268061b91bee84a1e83e9256435f75c6baf4dd6c2a35fa7bcc5ed", + "msg": "05374b488f5ab044552262d720199ae8", + "ct": "82feb5e5d88ea755ceb77456803e2bf2", + "tag": "e425b62274edbd7ab711117f0b2e4ece", + "result": "valid" + }, + { + "tcId": 116, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "93af42407d97c760adab2706a37a943f77acbc8146ea5698a311e4a99b2663c5", + "iv": "00705ed71d411e9a43ea1323", + "aad": "543d01c9a4caed305a6a7a76754a9deb1255d76a33f6870cae73ca803400b703aead78575d719c837b64a7c590040cf957f5eee46b74dcfe29002f5bd6127aa57ba44e601ea2cdd16051dbffc33b655afc1887e7c1a5bd99e0a5b018e01e7bc80fa0dd1f82839e62b9ec618e7f085d21d5f26be55633329c1fe73956b5692d18ba380d47e1217342334059c391776445ed34214f6608b787ca280463be33bf7d50a2a018235a9e6b204d037025bd49b80de348d13a5a459e40f3507236e14f6a70b420ed55915fa1f9f32e5a2028f8e2755b690da6927e415a8d7283c084ac410c4db4eb20c7682cb3ac10e698fb04a275463d4c67875691e428343d0025ff", + "msg": "46665b3e125f845a5d72b8bf819b05f1", + "ct": "01733e218929a9e240da2d8f5342bdce", + "tag": "836af3f03a858c22df4a0913c3c3205f", + "result": "valid" + }, + { + "tcId": 117, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "09ccd5f02ac621a91bfe26c45889fb40c034a739651e05f974e3d1b8f5467817", + "iv": "bb720368504f2602d6cccd57", + "aad": "d5c987f2f71e3a9caae4616687ed1ae2f00d5e3e2b4628e56e24e0fcb0d9a5c979bf38e3052a2b107fc64308763f1277af3ff6d80109dae056e1f53b08304ba7a7f555b66b556dc3869fb059ed519805f7daae22743d86f2319b95e9c0628a5c7de93e97971e8cdb0833edd36e4c3c0168b4617786c0bb5d433e11f2d390c52ce1beacb7bb31f2d0fa644bf1c616f3f2b2328fe295398eb908b85bf4cd04d697486f51b0dc0cfc08a37fe3e93e9a35e4f434e13c125fd553d554713fa9d431b3cec9f5c9562289a7e7cb6b54be24c9b4ba339444042efbdb8a0178a354a54946b0f4f3bb5804c49d7e19ce8f63b3f6892a7447d5e1bbfa64c78708693ec5f509", + "msg": "b783d9e8ce0d93a089c329491aef73d7", + "ct": "b755cf3739f9aece41a56a7158a4cd51", + "tag": "a7496a7f239a1b7e327af7ddcd868fcd", + "result": "valid" + }, + { + "tcId": 118, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "5d97d19c96153a7cfef2e5f4e27211d3bcc1826c67a6cc0bb02a46f944a85a5f", + "iv": "669ea62069c7199d9ca2be41", + "aad": "d218d976cedc3dd23ce31944405bcd0e44d5fc776838f5154c786d20fb7a39ea2e2e426fa6ce7a011ca05b5f6615e20373f7c80e98cebf8518339ba65b60532de536d3cfecf2a6b8a88a64149feba8de320a697f6a1339b0739927dd22641b8745cd04fb5fcc136dd2f3c921694005dff53ce44213fbc13f67402f882b13b28198fca970847356e2a82a2e79912ff6a1a9de8f4fed47b45b445dcd6c7400fdbc4a5da53bdfa03bad3d99b2e6038e334529b9c6f23f5135eef61db819b7ab1c7da3d1beceb4c2d212250f15fd301901db51a08d2b496e6e1f3e45af39e9556aed00b90e06535418a650bf9ab9f0e5d753f8a2e5d17c1409aba72b50fc161b2d0557", + "msg": "400037002b7dd892f3e582a3386e9632", + "ct": "817080b5020f10f034e3087d41e0fc40", + "tag": "b113757aebb9b4ef7e5d873dd58b640a", + "result": "valid" + }, + { + "tcId": 119, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "b4d739d35bd8877fd0750c84c3d1aaa81f4aadab959dca5bea0fb77b0c266c05", + "iv": "f34e40fa45b970c4dd5255cb", + "aad": "48c9ac49c659b0ad7f1197dcb86868889e5dcf677ab23cce1f75b4951477ed67f6cd0e5b2673401846a0440511eeceaec2149cf02944d2bf00ae30876ffc61c67e1f9f08581c840e50dbb419abcc7d06997ed2a95d5e9943ef83e341383ae4893944d9668e6b8e04a9a20aefdfa009312fdfc1c0f95c516daf3cb5b80ea4fe485f8dce62cc62bede36118c6d06832494c7633540e901beaffcd8a3570b1567ee018b412b7d74d447a7ca414c27193973051424224c449b3fbed90dd32b50013234fc0173eb1f28cc007b8330b84944ca75e54f32bea7b29cca4df44507c1c63dfbdcac4f6ad01f77541a30119c90f8b8df2d96d8dadd2389c372005f09c169dc9892e61b9c1eab8523d0175e6c36146781a01da5b5812cdf80ef31973d3b8fe1e74e866fb631d80dc25aa929447e63801c80afc78c81a5762192cf8eed57d74f44848ed2bbdd2ab41c8f009f99a207651d25e56576f4c7890286b752c59df4a87945d0efbe578bb900d56e5b406e769498918317c84470a3d27250f1c4fe740c6291d60263ce43c236f3640e3c1a93d113a01daf4aa8030f26e9e22679f066764230ab664cb155c0b08b75b553eddadb3a74e2122c26c035233c9b40f832412bc79a68af3d5d55283df540b334b3aa498f71c8101688fcd9c8b90520fae0194ff6f773effea4eba786cb3d81a451cb9d37003ff3fc7dc7bec3e80e94ea881c", + "msg": "0e45f9d687915b44da56b8bdd4588f04", + "ct": "15cf5c8d9865fe34b2c47b976bfcf60f", + "tag": "8982f56140bc1f11679f1577736b96ef", + "result": "valid" + }, + { + "tcId": 120, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "33518a3fd6694b641188e7d473c9550ac6bb72b4aa4494c4109af816ab4571f3", + "iv": "158f6467508774fce7ccd9b9", + "aad": "886675ae18fc751ec295ed7a2370053b474a1859b6c87e8135fe56517b0770adeabedcc5ea2b759801d6e8b773881ea2b8cc0e82cf04c1f682668ec22761e3dcdc92b28990712e57172e1e8dd95bea6e946b4164fab6db2fc49426a7618e897c63d317a0d56817b60158b0f6c0abfa70adf0dad805ee6610467ee73d42fe4c6af40b468db8726db498fbce46e348859cf50e371f539ae4ce3c1a9f399c8561b017f9d7b2e7a2a9637343916e22605a854c390e1128b899b2cea4894d483e5663d9cd007d626ff6a82338ca00b90cf45e1062ef29112870c508ab9644a20df33ceca7c6a535bf78b2b7bf48e4638b9d227167fa26de3e4f6dafe81f4fa9222a0472fecd42280c438011f436b35cfee8e9a0b6ee97cadb63b15ace995c8e5e240132d5b74ddff4188960fa89351eefdd5daa719387980ac7192764fbf0e90f6bc83900695729b0c09bcded2795d33eeb438f3ac6d849aed9ac3b03979cc86e1bec297030d635fd6440b9c08c0f1dff1d837f437ce13b1f6903fe7b965ae1bb174a5e98e9fd11c2afe68eb87cf17c884542c641c06bb7e0124dc077ba2ff175f278805c4d3ae6278a750ba107f5b140ca374a42fe97447781d64f28b2f537ef59df384e8c8a78e51e5d471b7d37acaffde7323abd3b661cbdc38889db16a9d992084866f27f5ccb3556d41ac2a6a2c1fc4b9c1dcdc5d1025123184d64703a109593", + "msg": "16bb3f376160ed2935ebd144401b6332", + "ct": "8b84a0c2dc5c884fc4e6e562f6407178", + "tag": "413f8ea12d38c5a3e776f931a7e235e7", + "result": "valid" + }, + { + "tcId": 121, + "comment": "", + "flags": [ + "Pseudorandom" + ], + "key": "7e8d8c980ce323ecc0c70865e2ebcdff9846613d73e260825152ebd8fae138a8", + "iv": "7089fdbd6507a0c6cd616812", + "aad": "f8f24096168fbd649822b44c1e426232f936470d18432ba25bc412249b2cb80b4586335bc3794da9111c1b4390c6c1bc5c6c726e7c8276d16a6d4b843181a88713681565cbac82159f4cf3333988835938510ae766223047b5d9f04831cb451c90b1f1ea3f8b6fc0b2536344e5f01fc3169d0adb94081492ac3a7c78c8a443b2b7f88c6e3149ea9f5aa15b194d0f8125dbeb63cf386ce11e5cd8df0cbea51d0da859ca7b1a7b70ca03fad12678833cabe4f50912172340ae63234a6c19e07f94cf6cf0bc0e60468e6eabb5ba0a7881c20ca6a85e10f7d227d5bd255809cb3162edb321596d8f035bd63f5211a9c1d67cbc7fbd5664a642bee4c91f6a15dbaa7e816432cd0dd55d04b6ef52457e024f483d2a8d95ce5c88d9a09ea7c28a6e6b3d35cced43224e84681374c7489688f3fd3385b9af77b760308db3407280f0d8586e2b60c6795ed38ea233070ae639c13118ba39476bc9cf447ae8dbead6dd512de32685aeb88da2b3c5f982fc68e31487ca166e511e0a60a7a7844c90681a32e7a59846c8d8406a28a2b8b0a99bbd1b6ee0130bb72ed0017c5b5aff1348cf8fe5f554b42773478109b3977091d4dd7982e65a1072044c3b54874e8156f6610b4ffa6fe799db173b024150835f130d6fd369488fc19e8cc5fbb50aa8dd8701cba2e5a71ca2b6831bcf8efb36afb50d8768c2984026b83187a5682779f3ac69839729", + "msg": "66628635128705e67c81309e9fdad58b", + "ct": "ccdecc5587d68c9d05af127461339cfb", + "tag": "261a1df437594665341798182d5333f3", + "result": "valid" + }, + { + "tcId": 122, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000000000000000000000000000", + "msg": "65b63bf074b7283992e24b1ac0df0d22b555dbe2254d94a43f1de748d3cc6f0d", + "ct": "0000000000000000000000000000000000000000000000000000000000000000", + "tag": "39f4fce3026d83789ffd1ee6f2cd7c4f", + "result": "valid" + }, + { + "tcId": 123, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000000000000000000000000000", + "msg": "65b63bf074b7283992e24b1ac0df0d22b555dbe2254d94a43f1de748d3cc6f0d20c142fe898fbbe668d4324394434c1b18b58ead710aed9c31db1f2a8a1f1bb2", + "ct": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "tag": "f5eaa804605c3a4785f9d7f13b6f67d6", + "result": "valid" + }, + { + "tcId": 124, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000000000000000000000000000", + "msg": "65b63bf074b7283992e24b1ac0df0d22b555dbe2254d94a43f1de748d3cc6f0d20c142fe898fbbe668d4324394434c1b18b58ead710aed9c31db1f2a8a1f1bb24405c183af94ee1ad630cd931158a6213d48c8fff10d0a1f9ef760188e658802aad55e41a1d99069a18db55c56af7c10a6f21ecc8af9b7ce0a7ea0b67426e925", + "ct": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "tag": "9b5c43a78d954e8a3c659eebc13d5d55", + "result": "valid" + }, + { + "tcId": 125, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffffffffffffffffffffffffffff", + "msg": "9a49c40f8b48d7c66d1db4e53f20f2dd4aaa241ddab26b5bc0e218b72c3390f2", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "37e3399d9ca696799f08f4f72bc0cdd8", + "result": "valid" + }, + { + "tcId": 126, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffffffffffffffffffffffffffff", + "msg": "9a49c40f8b48d7c66d1db4e53f20f2dd4aaa241ddab26b5bc0e218b72c3390f2df3ebd0176704419972bcdbc6bbcb3e4e74a71528ef51263ce24e0d575e0e44d", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "3d52710bec86d4ea9fea2ff269549191", + "result": "valid" + }, + { + "tcId": 127, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffffffffffffffffffffffffffff", + "msg": "9a49c40f8b48d7c66d1db4e53f20f2dd4aaa241ddab26b5bc0e218b72c3390f2df3ebd0176704419972bcdbc6bbcb3e4e74a71528ef51263ce24e0d575e0e44dbbfa3e7c506b11e529cf326ceea759dec2b737000ef2f5e061089fe7719a77fd552aa1be5e266f965e724aa3a95083ef590de13375064831f5815f498bd916da", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "51356329e280b12d55d3d98f0a580cbe", + "result": "valid" + }, + { + "tcId": 128, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000080000000800000008000000080", + "msg": "65b63b7074b728b992e24b9ac0df0da2b555db62254d94243f1de7c8d3cc6f8d", + "ct": "0000008000000080000000800000008000000080000000800000008000000080", + "tag": "c152a4b90c548c71dc479edeaf9211bf", + "result": "valid" + }, + { + "tcId": 129, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000080000000800000008000000080", + "msg": "65b63b7074b728b992e24b9ac0df0da2b555db62254d94243f1de7c8d3cc6f8d20c1427e898fbb6668d432c394434c9b18b58e2d710aed1c31db1faa8a1f1b32", + "ct": "00000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080", + "tag": "40ef6383052d91c2e4b4611b0e32c5ff", + "result": "valid" + }, + { + "tcId": 130, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000080000000800000008000000080", + "msg": "65b63b7074b728b992e24b9ac0df0da2b555db62254d94243f1de7c8d3cc6f8d20c1427e898fbb6668d432c394434c9b18b58e2d710aed1c31db1faa8a1f1b324405c103af94ee9ad630cd131158a6a13d48c87ff10d0a9f9ef760988e658882aad55ec1a1d990e9a18db5dc56af7c90a6f21e4c8af9b74e0a7ea0367426e9a5", + "ct": "0000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080", + "tag": "ae9b542541e84fc74542eed6be638fee", + "result": "valid" + }, + { + "tcId": 131, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "80000000800000008000000080000000", + "msg": "e5b63bf0f4b7283912e24b1a40df0d223555dbe2a54d94a4bf1de74853cc6f0d", + "ct": "8000000080000000800000008000000080000000800000008000000080000000", + "tag": "10fee3ecfba9cdf797bae37a626ec83b", + "result": "valid" + }, + { + "tcId": 132, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "80000000800000008000000080000000", + "msg": "e5b63bf0f4b7283912e24b1a40df0d223555dbe2a54d94a4bf1de74853cc6f0da0c142fe098fbbe6e8d4324314434c1b98b58eadf10aed9cb1db1f2a0a1f1bb2", + "ct": "80000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000", + "tag": "7490795bdbbbf5d0aecb9a4f65aa379f", + "result": "valid" + }, + { + "tcId": 133, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "80000000800000008000000080000000", + "msg": "e5b63bf0f4b7283912e24b1a40df0d223555dbe2a54d94a4bf1de74853cc6f0da0c142fe098fbbe6e8d4324314434c1b98b58eadf10aed9cb1db1f2a0a1f1bb2c405c1832f94ee1a5630cd939158a621bd48c8ff710d0a1f1ef760180e6588022ad55e4121d99069218db55cd6af7c1026f21ecc0af9b7ce8a7ea0b6f426e925", + "ct": "8000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000800000008000000080000000", + "tag": "1d1096a8ca9e2bda2762c41d5b16f62f", + "result": "valid" + }, + { + "tcId": 134, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffff7fffffff7fffffff7fffffff7f", + "msg": "9a49c48f8b48d7466d1db4653f20f25d4aaa249ddab26bdbc0e218372c339072", + "ct": "ffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7f", + "tag": "af8492c792bf8d8062be74ff6efb3869", + "result": "valid" + }, + { + "tcId": 135, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffff7fffffff7fffffff7fffffff7f", + "msg": "9a49c48f8b48d7466d1db4653f20f25d4aaa249ddab26bdbc0e218372c339072df3ebd8176704499972bcd3c6bbcb364e74a71d28ef512e3ce24e05575e0e4cd", + "ct": "ffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7f", + "tag": "f24db68c46b67d6f402fa6c897913368", + "result": "valid" + }, + { + "tcId": 136, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffff7fffffff7fffffff7fffffff7f", + "msg": "9a49c48f8b48d7466d1db4653f20f25d4aaa249ddab26bdbc0e218372c339072df3ebd8176704499972bcd3c6bbcb364e74a71d28ef512e3ce24e05575e0e4cdbbfa3efc506b116529cf32eceea7595ec2b737800ef2f56061089f67719a777d552aa13e5e266f165e724a23a950836f590de1b3750648b1f5815fc98bd9165a", + "ct": "ffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7f", + "tag": "43f651ab2e2eb0f04bf689a40d32da24", + "result": "valid" + }, + { + "tcId": 137, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "7fffffff7fffffff7fffffff7fffffff", + "msg": "1a49c40f0b48d7c6ed1db4e5bf20f2ddcaaa241d5ab26b5b40e218b7ac3390f2", + "ct": "7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff", + "tag": "60d95294a3694cfaa64b2f63bc1f82ec", + "result": "valid" + }, + { + "tcId": 138, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "7fffffff7fffffff7fffffff7fffffff", + "msg": "1a49c40f0b48d7c6ed1db4e5bf20f2ddcaaa241d5ab26b5b40e218b7ac3390f25f3ebd01f6704419172bcdbcebbcb3e4674a71520ef512634e24e0d5f5e0e44d", + "ct": "7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff", + "tag": "beaca0b47027196176186d944019c1c8", + "result": "valid" + }, + { + "tcId": 139, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "7fffffff7fffffff7fffffff7fffffff", + "msg": "1a49c40f0b48d7c6ed1db4e5bf20f2ddcaaa241d5ab26b5b40e218b7ac3390f25f3ebd01f6704419172bcdbcebbcb3e4674a71520ef512634e24e0d5f5e0e44d3bfa3e7cd06b11e5a9cf326c6ea759de42b737008ef2f5e0e1089fe7f19a77fdd52aa1bede266f96de724aa3295083efd90de133f506483175815f490bd916da", + "ct": "7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff7fffffff", + "tag": "d4811028a577d4dd69d6b35d717f73e3", + "result": "valid" + }, + { + "tcId": 140, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000ffffffff00000000ffffffff", + "msg": "65b63bf08b48d7c692e24b1a3f20f2ddb555dbe2dab26b5b3f1de7482c3390f2", + "ct": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff", + "tag": "10fb61272b555bee104f5a71818716d6", + "result": "valid" + }, + { + "tcId": 141, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000ffffffff00000000ffffffff", + "msg": "65b63bf08b48d7c692e24b1a3f20f2ddb555dbe2dab26b5b3f1de7482c3390f220c142fe7670441968d432436bbcb3e418b58ead8ef5126331db1f2a75e0e44d", + "ct": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff", + "tag": "4756764e59583504182877d8c33120f0", + "result": "valid" + }, + { + "tcId": 142, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "00000000ffffffff00000000ffffffff", + "msg": "65b63bf08b48d7c692e24b1a3f20f2ddb555dbe2dab26b5b3f1de7482c3390f220c142fe7670441968d432436bbcb3e418b58ead8ef5126331db1f2a75e0e44d4405c183506b11e5d630cd93eea759de3d48c8ff0ef2f5e09ef76018719a77fdaad55e415e266f96a18db55ca95083efa6f21ecc750648310a7ea0b68bd916da", + "ct": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff", + "tag": "95a2b12a4a280089d4bd4f904253e754", + "result": "valid" + }, + { + "tcId": 143, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffff00000000ffffffff00000000", + "msg": "9a49c40f74b728396d1db4e5c0df0d224aaa241d254d94a4c0e218b7d3cc6f0d", + "ct": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "tag": "60dcd45974bebe032eb7b86c9d063452", + "result": "valid" + }, + { + "tcId": 144, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffff00000000ffffffff00000000", + "msg": "9a49c40f74b728396d1db4e5c0df0d224aaa241d254d94a4c0e218b7d3cc6f0ddf3ebd01898fbbe6972bcdbc94434c1be74a7152710aed9cce24e0d58a1f1bb2", + "ct": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "tag": "f0e6a3c1f28ad92d0dbc900be291d877", + "result": "valid" + }, + { + "tcId": 145, + "comment": "", + "flags": [ + "EdgeCaseCiphertext" + ], + "key": "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "iv": "000102030405060708090a0b", + "aad": "ffffffff00000000ffffffff00000000", + "msg": "9a49c40f74b728396d1db4e5c0df0d224aaa241d254d94a4c0e218b7d3cc6f0ddf3ebd01898fbbe6972bcdbc94434c1be74a7152710aed9cce24e0d58a1f1bb2bbfa3e7caf94ee1a29cf326c1158a621c2b73700f10d0a1f61089fe78e658802552aa1bea1d990695e724aa356af7c10590de1338af9b7cef5815f497426e925", + "ct": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "tag": "57eff4a525eeff2ebd7a28eb894282be", + "result": "valid" + }, + { + "tcId": 146, + "comment": "Flipped bit 0 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f5409bb729039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 147, + "comment": "Flipped bit 1 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f6409bb729039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 148, + "comment": "Flipped bit 7 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "74409bb729039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 149, + "comment": "Flipped bit 8 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4419bb729039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 150, + "comment": "Flipped bit 31 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409b3729039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 151, + "comment": "Flipped bit 32 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb728039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 152, + "comment": "Flipped bit 33 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb72b039d0814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 153, + "comment": "Flipped bit 63 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d8814ac514054323f44", + "result": "invalid" + }, + { + "tcId": 154, + "comment": "Flipped bit 64 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0815ac514054323f44", + "result": "invalid" + }, + { + "tcId": 155, + "comment": "Flipped bit 77 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d08148c514054323f44", + "result": "invalid" + }, + { + "tcId": 156, + "comment": "Flipped bit 80 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac504054323f44", + "result": "invalid" + }, + { + "tcId": 157, + "comment": "Flipped bit 96 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514055323f44", + "result": "invalid" + }, + { + "tcId": 158, + "comment": "Flipped bit 97 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514056323f44", + "result": "invalid" + }, + { + "tcId": 159, + "comment": "Flipped bit 120 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514054323f45", + "result": "invalid" + }, + { + "tcId": 160, + "comment": "Flipped bit 121 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514054323f46", + "result": "invalid" + }, + { + "tcId": 161, + "comment": "Flipped bit 126 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514054323f04", + "result": "invalid" + }, + { + "tcId": 162, + "comment": "Flipped bit 127 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d0814ac514054323fc4", + "result": "invalid" + }, + { + "tcId": 163, + "comment": "Flipped bit 63 and 127 in tag expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "f4409bb729039d8814ac514054323fc4", + "result": "invalid" + }, + { + "tcId": 164, + "comment": "Tag changed to all zero expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 165, + "comment": "tag change to all 1 expected tag:f4409bb729039d0814ac514054323f44", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "", + "ct": "", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 166, + "comment": "Flipped bit 0 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "28914007a6119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 167, + "comment": "Flipped bit 1 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "2b914007a6119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 168, + "comment": "Flipped bit 7 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "a9914007a6119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 169, + "comment": "Flipped bit 8 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29904007a6119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 170, + "comment": "Flipped bit 31 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914087a6119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 171, + "comment": "Flipped bit 32 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a7119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 172, + "comment": "Flipped bit 33 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a4119dd3f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 173, + "comment": "Flipped bit 63 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119d53f109bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 174, + "comment": "Flipped bit 64 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f009bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 175, + "comment": "Flipped bit 77 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f129bba21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 176, + "comment": "Flipped bit 80 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109baa21ce9a7d6", + "result": "invalid" + }, + { + "tcId": 177, + "comment": "Flipped bit 96 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21de9a7d6", + "result": "invalid" + }, + { + "tcId": 178, + "comment": "Flipped bit 97 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21ee9a7d6", + "result": "invalid" + }, + { + "tcId": 179, + "comment": "Flipped bit 120 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21ce9a7d7", + "result": "invalid" + }, + { + "tcId": 180, + "comment": "Flipped bit 121 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21ce9a7d4", + "result": "invalid" + }, + { + "tcId": 181, + "comment": "Flipped bit 126 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21ce9a796", + "result": "invalid" + }, + { + "tcId": 182, + "comment": "Flipped bit 127 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119dd3f109bba21ce9a756", + "result": "invalid" + }, + { + "tcId": 183, + "comment": "Flipped bit 63 and 127 in tag expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "29914007a6119d53f109bba21ce9a756", + "result": "invalid" + }, + { + "tcId": 184, + "comment": "Tag changed to all zero expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 185, + "comment": "tag change to all 1 expected tag:29914007a6119dd3f109bba21ce9a7d6", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995a", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 186, + "comment": "Flipped bit 0 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "67405a16e8b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 187, + "comment": "Flipped bit 1 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "64405a16e8b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 188, + "comment": "Flipped bit 7 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "e6405a16e8b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 189, + "comment": "Flipped bit 8 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66415a16e8b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 190, + "comment": "Flipped bit 31 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a96e8b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 191, + "comment": "Flipped bit 32 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e9b44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 192, + "comment": "Flipped bit 33 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16eab44eba92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 193, + "comment": "Flipped bit 63 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44e3a92aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 194, + "comment": "Flipped bit 64 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba93aa47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 195, + "comment": "Flipped bit 77 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba928a47f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 196, + "comment": "Flipped bit 80 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa46f5cea52b7a", + "result": "invalid" + }, + { + "tcId": 197, + "comment": "Flipped bit 96 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cfa52b7a", + "result": "invalid" + }, + { + "tcId": 198, + "comment": "Flipped bit 97 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cca52b7a", + "result": "invalid" + }, + { + "tcId": 199, + "comment": "Flipped bit 120 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cea52b7b", + "result": "invalid" + }, + { + "tcId": 200, + "comment": "Flipped bit 121 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cea52b78", + "result": "invalid" + }, + { + "tcId": 201, + "comment": "Flipped bit 126 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cea52b3a", + "result": "invalid" + }, + { + "tcId": 202, + "comment": "Flipped bit 127 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44eba92aa47f5cea52bfa", + "result": "invalid" + }, + { + "tcId": 203, + "comment": "Flipped bit 63 and 127 in tag expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "66405a16e8b44e3a92aa47f5cea52bfa", + "result": "invalid" + }, + { + "tcId": 204, + "comment": "Tag changed to all zero expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "00000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 205, + "comment": "tag change to all 1 expected tag:66405a16e8b44eba92aa47f5cea52b7a", + "flags": [ + "ModifiedTag" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b", + "aad": "000102", + "msg": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "ct": "d03bcb3ca52d48d1d203b1e7b1a5995af1a0466a61bb386a2e12d189a2c4ea15e9", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 206, + "comment": "edge case for poly1305 key:ffffffefeb344f6bc37ba77ea2ee06dfe8c7f4ae10810422124fc5e1bd7fe301", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef38c382cf07174142ea564920612997b1c2e38aca2438b588d5459493e97e7fa330ff9bc3b9458297ba0967d86ed090b435103478f2869b93ee29c837e95fb6b9903f3b735b7345428eb93b3db1d9b5187cebb889aa177d83e4f63fc9a5c0596eed939883d06aacdfdea44fdecdf5cb7fc", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "c296436246c3a7c4b3ba09ab2a6a0889", + "result": "valid" + }, + { + "tcId": 207, + "comment": "edge case for poly1305 key:278de313ffffffdfffe9acbf3ea59357c4e16a5bc120d346af4a8cf694a84374", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "0001020304050607051e9373", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "931227274a89d0b3aade7fac62c96262c1e77b8dafd248f10ad37c6ccb69cb7131b041593c8bb8c3db38f39dd8a124c424fce4389dede1d3cb9d46cf95970aea9856b6e313d756197baf4fcb58df275bca8a2188f9e8a1ad04354ede542ddc30e8b735b2f5905f5811799282be94ae842ec126c55d2e667235e9acf1d48798f0", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "99a3b0fff6fdcbcce9dc5820f2a64861", + "result": "valid" + }, + { + "tcId": 208, + "comment": "edge case for poly1305 key:0050799fe9e74fcffcffffcfd21aa8b5cb5aa2c6ab347b6886eedaca4bfff3c0", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "0001020304050607048c3c5f", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "0df91f31230e8941e700a752fef08c897c511ed618fdf8a378a1f439013b40a48d4634c27d9ada7c0bb6f3fa92e341425903d7ecd0c49bee4c77e84b11f1c721922308642885b813fae364da32eaf120d6a43a74fb1632443667bfea6eef1be73eb1c3c0b5a57cee8dc4feed4a1fb9ae02f7b1695588c3c878451cb6ee0cb3dc", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "eaff8f47ef9268fd0d94e8a9c4b78d24", + "result": "valid" + }, + { + "tcId": 209, + "comment": "edge case for poly1305 key:dc46b3c53be153ccd4986678ffffffafe484c316c93f64195da65a2742fd3fec", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715ba428a85431430eada56a2c5dc944b6aa6cef0b056a2eecc51d30838e640615e1458e0943e30f91ba41b4362fa9ed6037b21d14da7b4f76f9f68fa8903138d563ce2590af1201c7cfec2290cfce98a822ebb8d1ed9dc4e20d241755aff91cdfd10fdb69efa0d5c8082692601cbfbb955c7", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "86ed21fda080a7d13981078d86b3e3cd", + "result": "valid" + }, + { + "tcId": 210, + "comment": "edge case for poly1305 key:946aff9f2a13f56f92a5f9cfee3cdb1fef6d98d5a55ab563cb28620cd57f19d2", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "66115e67ecd3d4178c4c60e713ab4e5e66f8d1f971da17437a2b5e04fbca1671e847139a5f4e3f8e92d7a3b71eb4ff0e50354c0c1580af3662d5f8151e3f7e8264a0085c32ddfcbeb01a8be4c34d53319800ac4ef9d4e4014524bc7cd3387242e774f4d1a7a0521e42ec44844d0bd8b9d73fec959212fd7e8eacf4d984996d9b", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "34f9e0faa515eee0e784e6ef2678befa", + "result": "valid" + }, + { + "tcId": 211, + "comment": "edge case for poly1305 key:0000003059ffce96438a246ff9536787d92bc40eafa0241a2972780ef6ca1ef8", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060726c6961b", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "e97244259af5a379238da0cad2a5f493655ec0e5024fd553bbb3deb66a94036d106c3d513407b2dd1cc5936c4c9c1e4f4b37b54dec261c601dc99e90680e23e2dc5c9a8d503d8bea49a8cdca3706bfd2a3daa0afb19a70fd3d355fc37c13f3f9e5c8d0864a5f80a780b36d4698ec2ce9ccc27b97ecbe672e41628ebd773acb81", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "3c94b9fe60bdb35c6b7b73b765083492", + "result": "valid" + }, + { + "tcId": 212, + "comment": "edge case for poly1305 key:3fa0ea9c030000a036217d42e775ad189b96e24ee591952e2922ff151334b9ec", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "0001020304050607013da060", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "9453aa159c3d87f17e21e88adabc37e553b904d00eefc66b8e0905e23576fbdc9c7bea9777f3b8368481932534b3344d309e6307cddfe7b3549300dd9cda7efe9d43c8a115912a392904079ee92bcd33099f7022ea94c1e7353b89bfc54de3ceb56f529a1a608bb5a970e1359609d1f56806b37f8605f4c27451da6066fc557a", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "2b11cf9f8db8490d409fc62afd7379f3", + "result": "valid" + }, + { + "tcId": 213, + "comment": "edge case for poly1305 key:a556cb502baf395b020000f03c5108fb1cf76df1b8a8f724e877bd3c588d3285", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060707db33de", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "2e1836640d810c2709fb83ccf1aef3a971085d1bbfb58a425abf75ccec70b3abde0e80539e83a82546e7372a19481547053308dd7842675e9c4f61302426da0d71c1da3102031030ed928152be009b15b52f71b5911991d39f68a8658d99729df2bbef31c8989f9604558df9f2aba4b3766c58aaef3548de545ec1f080225a88", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "c9c8366920f88381407712cec61e6607", + "result": "valid" + }, + { + "tcId": 214, + "comment": "edge case for poly1305 key:0c327fbcc564555545d4fe75020000d0a65799f363ec51b1c5c427b4a04af190", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060702a11942", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "0ecb4d85c956b5268c9b35a8c63b4e9d3e5cb72b64ef98773841b947bd7d59ef7d0eb0e1c050d49a5424ce7deb527d76087e4746674c958965df32d9e5fb03b46501706128d481217aaeae2f78f9259273358a2954cac0bc2fbfe77447d1d387b9314c6541b69f1270b3438b1042b2b4663e62ba4d49c07ac6f163034afa80af", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "2373cfa2ab24446ad5a236167b8027fe", + "result": "valid" + }, + { + "tcId": 215, + "comment": "edge case for poly1305 key:415f08302f210340240d0e903e2b01205ba43e106aebd7e2481016b31118b1ae", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506073c0df637", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "2e8e45e903bfab32f2f0d49d9a3e449bef6f4093e2722cdab2cf935c1822b830fb5a4056516d560dfc8638c9a57d2927200a56f0b67153271d498e8f08dc888c61ef634f7ae40f4608f96f92fea5a1e5bd45131120098dc5de0378e58f2ddb46fa4aa5adb38fe006bb19b69146382f77a79e06214def547cfb5ce37a7008b9b6", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "5f93946478d8081e7247f414ad39a515", + "result": "valid" + }, + { + "tcId": 216, + "comment": "edge case for poly1305 key:feffff1ff6b87403fd6435b09775bc92491a0ae62c5842a30e3b82710cc2dad1", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130bc672c3", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "3619cb470af86dceceb6940f2d9abb34c9a9131476053387445ffebbe240d4f9818377855652f46a8219c7f71c3554f8acef8258de4b7d17c0f3d353ac981cc6a13287be1e6b41dc6d133df4ababebdf43d665ce7a4a5c982a0b139cb8202eebc74173e3224a440e4c37d2b595f384290e939ba016df0d49b36cdb4bd91c39", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "133fe62391744d11ce44594b96c53baf", + "result": "valid" + }, + { + "tcId": 217, + "comment": "edge case for poly1305 key:bf358f18ffffffbf4b62ed6e1f53790785c4dabdfc72e2a219d377a682c85f38", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "000000001011121303e9b9a4", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "af205bda819f7451be0f28667d4b01b59ff2daa8173cab52046c3c9e0d989889c5e021ef7afd06e9ce6cc30e3a6ebab509134ba10d10e570c55587c13eee53e73be54804c8539ffbf23b35922b1ca37b9e9bc24ee204837ca5a294ce05d12600c7eff6aee32270db2feff47dc5a04176169e15850628e6035f78994f9f5603", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "e3451adb9d23a7710a1aafba26f56387", + "result": "valid" + }, + { + "tcId": 218, + "comment": "edge case for poly1305 key:d0b7b3a352a4010ffeffffbfe8cc66dc6e5e7451dc61762c5753174fed88e746", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130700b982", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "68c67272036fb652a0182eeb4781358e4704a4a702fd731bf3b3ea994717989e7d9104e0ae81732a8c7e9a82b3d31d541761a366b67c3396f1a6c67e293ddb65a59e42541dda144dc6c78388cfca982e23350958ac5b3d54a1722fd64733577862e1879c9e9445ebdec5315d1706db7ebbedd4c779935e72057e5b0ecde081", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "b0bb8a55ff5f52a5043c6e7795847557", + "result": "valid" + }, + { + "tcId": 219, + "comment": "edge case for poly1305 key:7bee33931a4157a8cb701becfeffff4fbe7e69f19cd065313bb49a252628dd3d", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "0000000010111213019836bb", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "c483b7334ebe2e879b0c3f9db4fcd9f5219062360d6ce44cdae0f94e04c8345ea7e3ae33855118741dcafe0de4ae98c4e43af7b12b04ee8ab175625823ac040e5abac4403f1d45238adcb8c0cf44bd56917f9f5d93974c82b56951986a9c0450bd9047b5a616e814526ad0580e3ecd8189c9fef2cdb979a22ad3a01930fbd1", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "f4fc25f4c5543a9afee9819e2904fb68", + "result": "valid" + }, + { + "tcId": 220, + "comment": "edge case for poly1305 key:7cb5fbdffb40ff5f3c7de74f655ffc1fac03013a7fe468440b861ebe0ab1650a", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112131d59f288", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "bc7f4f15fd1e4c1399740836670abe39a05707be19956ce169b32321759e0f213ae19ad34aa612b3a29f02c4bbac9f785a55a3adfe419ab891bbe0acee9921322ea21002c9dd3dcdd13a7f8554dddc10f9b529ce94be7050937dab76557b7eb17c685aad8f0797e39d62553988989aab1d9764fe431cc1d4c595062ce93ce9", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "5e67a7b8733e0e4b01ac2178a205ae7e", + "result": "valid" + }, + { + "tcId": 221, + "comment": "edge case for poly1305 key:00000090e6e328c242cde5c83e3d8262d467f2bcd53d3755c781f3c6a2cb0648", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130552a411", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "eaccaa778935ef249e0900149dd889462d2a061486ba102b8caebe465f3959fb3119ebb5689676ffdd6d851a26739e772b54a2f5f473ea9c7e58ccbc4cfc953e8c420b2175d9dd519265630bb79bd87a601b113231a8b16ce54c331347ec04c2b1c9160f38207aa46e96feb06dee883eb422fa14908df300bb1a1ef758c408", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "177a77fce114a4349c4f8d5ec825d06f", + "result": "valid" + }, + { + "tcId": 222, + "comment": "edge case for poly1305 key:9e98d64e000000505a07183c5c68c63c14c9266dd37ff86aafc22ddbdb355617", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130c807a72", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "a76c330e015060a17e64cb7b6d753f201f75be8759fd7539fb92b22aef54c9d3029dba0c15cbf7c95135888319c6b2e6276da21e0c351fd522b29aabb5883a3291d6f427de773b124390ef6fd96621ffbc42dfbf7a34da272cbc9ccb1a498d078033d1ac3bf7e92715948b06d69d5c5039e9164ba9c3a02219ec5908206b3b", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "623c7d4424f5497aedfd1339cf8cecce", + "result": "valid" + }, + { + "tcId": 223, + "comment": "edge case for poly1305 key:1048a92e65f5e63102000080d9ae08de4319a7c45fdbe707b9ec1b7e0d635161", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130397a143", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "228a7e15bcce13051de9145f77f7f4ff7921828b4f99efc4ff55ee0d9344955b69ec2d4798b0517f0273c4456ae5ffc5929cbe74ddb0da51d4f2b4df7578a31240c88ae922c3c5eca7b97d72d497062050a587447c562b343d5c71921944872f9fd06b8f34b3eb5d4341f5ff8a907dd7c2e1676b81252726ba54814da51eab", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "1c18b69354b189731a1a83fe8f0d57c9", + "result": "valid" + }, + { + "tcId": 224, + "comment": "edge case for poly1305 key:01517a2ceb89bbfb5741f7d9000000401a65b132ad661072a00ffe7defbb18a5", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "000000001011121308cb0f3f", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "c7d843188ab193dfef5c4daf583f952cd4b195f240fa2e704d021723023c123371a41e87dfc6e6c3874a42f331cf035988a38c72ba2da854b1208f98bf8cc29948169481ab3a402d5fcc7ff78f9e31925576dc3938074b8c5b27960e3afc750ad686563688b7441787288d5256c1301d563b7744843bd1ab4eff5be6f1653d", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "2045815b8211b9a2995effe0b8ed9868", + "result": "valid" + }, + { + "tcId": 225, + "comment": "edge case for poly1305 key:bc90156087e0125006d90c30babd0590427bff19de1f2e7d0757a79528731138", + "flags": [ + "EdgeCasePolyKey" + ], + "key": "9de836aa579585081f330a7c4036e20e38ef15eff3945184d231867f505fffdf", + "iv": "00000000101112130d8fcf4e", + "aad": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "msg": "cfc3db8631c81c69023a3c8a9ad66c35053685144c4fa2a9510add72e211dad9ca5b982e4c194591fdb74116280311d1299ad81227258cb52f079bbcb12aff161d278dec33a326d71276b3de01a8327ee7f45f94179dff18a3fe643e56c30cfd03871c8110ab00f6612b9e17a4647360d7847bb63a3122613c2e7cdddd08ae", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "1ae2ed84ea9774d78d782bf8d972a8b8", + "result": "valid" + }, + { + "tcId": 226, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "ffffffffffffffffffffffffffffffff415771fda4fbcc55c377f73203e60226", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "000102030405060708090a0b0c0d0e0f", + "result": "valid" + }, + { + "tcId": 227, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "f1ffffffffffffffffffffffffffffff615af39eddb5fcd2519190d5507d3b06", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 228, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "b5ffffffffffffffffffffffffffffff764e5d82ce7da0d44148484fd96a6107", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 229, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "fdffffffffffffffffffffffffffffff2bdbf16d8ea4d39dab8dcb3d4bc4e104", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "00000080000000800000008000000080", + "result": "valid" + }, + { + "tcId": 230, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "a9ffffffffffffffffffffffffffffffaccd5eb31d8fc909e84b0de7de23bb08", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "ffffff7fffffff7fffffff7fffffff7f", + "result": "valid" + }, + { + "tcId": 231, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "d2ffffffffffffffffffffffffffffffdd4b933e7b1a7ed93cc7c050db71dc03", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "01000000010000000100000001000000", + "result": "valid" + }, + { + "tcId": 232, + "comment": "edge case for tag", + "flags": [ + "EdgeCaseTag" + ], + "key": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f", + "iv": "000102030405060708090a0b", + "aad": "ffffffffffffffffffffffffffffffffa08164425d7642e9e90fc8d5c32d2cf6", + "msg": "e48caf8a76183327c9561a4651c07c822ccd1642c06607d0d4bc0afb4de15915dbfa3b0b422e77e15c64bf6247031f15fdb643117809821870000adf83834da5", + "ct": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "tag": "ffffffff000000000000000000000000", + "result": "valid" + }, + { + "tcId": 233, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x0.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c68ce708bf26aab862d97e1b42f31ef37bb66f8090c149e452ec7f20327eb2ea2e38aca2438b588d5459493e97e7fa330ff9bc23c897df6b00af86931d6c81555103478f2869b93ee29c837e95fb6b9903f3b72debfba2384baa48ceedfedb91", + "ct": "e5ffffffffffffffffffffffffffffff0871bc8f1e4aa235087712d9df183609ffffffffffffffffffffffffffffffffffffffe7a33009ef5fc604ea0f9a75e9ffffffffffffffffffffffffffffffffffffffe7a33009ef5fc604ea0f9a75e9", + "tag": "3572162777262c518eef573b720e8e64", + "result": "valid" + }, + { + "tcId": 234, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x0.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "40115e67ecd3d4178c4c60e713ab4e5e390ef93aeb61aa307f141323c38e0685fa47139a5f4e3f8e92d7a3b71eb4ff0e259445f4ffc31bce540190edd6ad207876a0085c32ddfcbeb01a8be4c34d5331eda1a5b6139750f973f0d4841baa2cb8", + "ct": "d9ffffffffffffffffffffffffffffffa009d73c6544428cfac0b2d8c7bbef0bedffffffffffffffffffffffffffffff8a5ef60715bc4b07c92b9707376da105edffffffffffffffffffffffffffffff8a5ef60715bc4b07c92b9707376da105", + "tag": "19532d9fa0b5fbd582aaeda830602f1d", + "result": "valid" + }, + { + "tcId": 235, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x0.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "19de9b9ec8b247d42bbee2016d6715babc286fd979807951b183a188930ad15edcf0b056a2eecc51d30838e640615e14890e659fd3028c904e65018fdfd6038333d14da7b4f76f9f68fa8903138d563c33b7fb50c3e7ebca970f6f89a88a82d6", + "ct": "f9ffffffffffffffffffffffffffffff015d1565924f6c7418de9babf8be4407edffffffffffffffffffffffffffffff2e110e5e1c0468cbaad99c8abeffff07edffffffffffffffffffffffffffffff2e110e5e1c0468cbaad99c8abeffff07", + "tag": "47e5d4294239db73b836c04070ff5b2d", + "result": "valid" + }, + { + "tcId": 236, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x1.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c78ce708bf26aab862d97e1b42f31ef376209eef141691fba5d10eaf581affe62e38aca2438b588d5459493e97e7fa330e73d2dc3bbd954989cb8433b7d6597b5103478f2869b93ee29c837e95fb6b990279d9d218d1e81ac2ce4a6e474403bf", + "ct": "e4ffffffffffffffffffffffffffffff05e74de09a9d7a2aff4a6356b57c7b05fffffffffffffffffffffffffffffffffe759118501a43cdd6a2064aa520adc7fffffffffffffffffffffffffffffffffe759118501a43cdd6a2064aa520adc7", + "tag": "347216375f5b7b5c4e6bff4912fd9473", + "result": "valid" + }, + { + "tcId": 237, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x1.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "49115e67ecd3d4178c4c60e713ab4e5ee02b87aeae8c3da8895f8cb0f6b9cc80f447139a5f4e3f8e92d7a3b71eb4ff0ecc4b7b803a5f8f4647df169080fe567a78a0085c32ddfcbeb01a8be4c34d5331047e9bc2d60bc471602e52f94df95aba", + "ct": "d0ffffffffffffffffffffffffffffff792ca9a820a9d5140c8b2d4bf28c250ee3ffffffffffffffffffffffffffffff6381c873d020df8fdaf5117a613ed707e3ffffffffffffffffffffffffffffff6381c873d020df8fdaf5117a613ed707", + "tag": "adbd2cafc8c8f0e51250e7b81c9d0a2d", + "result": "valid" + }, + { + "tcId": 238, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x1.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715ba839f811ad0310c77052f45320b0d9560c4f0b056a2eecc51d30838e640615e1470d6b14fd209fedf261fd1d250d3478d2bd14da7b4f76f9f68fa8903138d563cca6f2f80c2ec9985ff75bfd4278fc6d8", + "ct": "ffffffffffffffffffffffffffffffff3eeafba63bfe1952ac727f1160b90039f5ffffffffffffffffffffffffffffffd7c9da8e1d0f1a84c2a34cd731fabb09f5ffffffffffffffffffffffffffffffd7c9da8e1d0f1a84c2a34cd731fabb09", + "tag": "232c882f7a1a2f808ccf26496cff5b3d", + "result": "valid" + }, + { + "tcId": 239, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x5.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "fc8ce708bf26aab862d97e1b42f31ef38b79403dfaabc0d8c18d23a3469c13e62e38aca2438b588d5459493e97e7fa330a4b941e6b66fcc2ed7d8cb3e8cc7ffc5103478f2869b93ee29c837e95fb6b9906419f10480a8191a67842ee185e2538", + "ct": "dffffffffffffffffffffffffffffffff8be933274202b099b164e5aabfa9705fffffffffffffffffffffffffffffffffa4dd7da00c12a46b2140ecafa3a8b40fffffffffffffffffffffffffffffffffa4dd7da00c12a46b2140ecafa3a8b40", + "tag": "30721677ff2eb8894e5a9d8492b7b0af", + "result": "valid" + }, + { + "tcId": 240, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "fa8ce708bf26aab862d97e1b42f31ef39bcbb8da477d580d772de4229bba7de22938aca2438b588d5459493e97e7fa331e9dedf9dd64a0681bac2969549425bc5603478f2869b93ee29c837e95fb6b991297e6f7fe08dd3b50a9e734a4067f78", + "ct": "d9ffffffffffffffffffffffffffffffe80c6bd5c9f6b3dc2db689db76dcf901f8ffffffffffffffffffffffffffffffee9bae3db6c376ec44c5ab104662d100f8ffffffffffffffffffffffffffffffee9bae3db6c376ec44c5ab104662d100", + "tag": "2b7216c7873744c20ec5e2cdb260d3fa", + "result": "valid" + }, + { + "tcId": 241, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "66115e67ecd3d4178c4c60e713ab4e5e891b797521ba925b24090aaf6c4482bae847139a5f4e3f8e92d7a3b71eb4ff0e6d50c32d05a946cb8cea57c9f1442cb164a0085c32ddfcbeb01a8be4c34d5331a565236fe9fd0dfcab1b13a03c432071", + "ct": "ffffffffffffffffffffffffffffffff101c5773af9f7ae7a1ddab5468716b34ffffffffffffffffffffffffffffffffc29a70deefd6160211c050231084adccffffffffffffffffffffffffffffffffc29a70deefd6160211c050231084adcc", + "tag": "e17c273f31758e752322ae4869c1bfbb", + "result": "valid" + }, + { + "tcId": 242, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x13.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "ee8ce708bf26aab862d97e1b42f31ef3b9f55bd56e0fd74b46063a96354cfbee3238aca2438b588d5459493e97e7fa3320c78886a6f6292d6cc5fbddb546a2b04d03478f2869b93ee29c837e95fb6b992ccd8388859a547e27c0358045d4f874", + "ct": "cdffffffffffffffffffffffffffffffca3288dae0843c9a1c9d576fd82a7f0de3ffffffffffffffffffffffffffffffd0c1cb42cd51ffa933ac79a4a7b0560ce3ffffffffffffffffffffffffffffffd0c1cb42cd51ffa933ac79a4a7b0560c", + "tag": "22721657b0130d28cf1ec65153c41182", + "result": "valid" + }, + { + "tcId": 243, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x14.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "ef8ce708bf26aab862d97e1b42f31ef3b46fca24d353ff5e49eac51540e840ea3038aca2438b588d5459493e97e7fa333d311e572202011a75e948586fe268b44f03478f2869b93ee29c837e95fb6b99313b1559016e7c493eec86059f703270", + "ct": "ccffffffffffffffffffffffffffffffc7a8192b5dd8148f1371a8ecad8ec409e1ffffffffffffffffffffffffffffffcd375d9349a5d79e2a80ca217d149c08e1ffffffffffffffffffffffffffffffcd375d9349a5d79e2a80ca217d149c08", + "tag": "2172166798485c338f9a6d60f3b21891", + "result": "valid" + }, + { + "tcId": 244, + "comment": "Intermediate sum of poly1305 after processing64 bytes is 0xffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f59d56151de28bef83505f6d89c0b0f7f75b2fa8e6dce386075db283ec85ee62555baffad423af25f66069bb69fb6f4d", + "ct": "d6ee4ee25d3bdea81e76de8934cc51fb849cfca7685708575dc6df7a01e36a81849cfca7685708575dc6df7a01e36a81", + "tag": "831312cbb0f165dc3e8ff52125f48640", + "result": "valid" + }, + { + "tcId": 245, + "comment": "Intermediate sum of poly1305 after processing64 bytes is 0x100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f717f8d5b28032d5c8e8061cd44d71e4f2d55de772fe7a91ce85e410db3e2d8d50d5ddb5400136323fb83f285e40aca2", + "ct": "d464e022f259679255ce87f8694190e881128ee8fc759140941e89e93658a96e81128ee8fc759140941e89e93658a96e", + "tag": "821312db9826b5e7fe0a9d30c5e28d4f", + "result": "valid" + }, + { + "tcId": 246, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x7ffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f28ce708bf26aab862d97e1b42f31ef3e68a922c9219d30f07554d7d99f2bde92c38aca2438b588d5459493e97e7fa33e24c07dd98f9b253ab0c318d9b14f6b15303478f2869b93ee29c837e95fb6b99ee460cd3bb95cf00e009ffd06b86ac75", + "ct": "d1ffffffffffffffffffffffffffffff954d41231c9238de5dce20847494390afdffffffffffffffffffffffffffffff124a4419f35e64d7f465b3f489e2020dfdffffffffffffffffffffffffffffff124a4419f35e64d7f465b3f489e2020d", + "tag": "c1045769d487d545cef3f0d34b7a8733", + "result": "valid" + }, + { + "tcId": 247, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x7ffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715badf0599194b0ce890cc1d8eb383b57f38dcf0b056a2eecc51d30838e640615e1435df81077d068077ce805ea592f6f88833d14da7b4f76f9f68fa8903138d563c8f661fc86de3e72d17ea30a3e5aa79dd", + "ct": "ffffffffffffffffffffffffffffffff6270e3a5a0c3fdb56540b490e801ea61edffffffffffffffffffffffffffffff92c0eac6b200642c2a3cc3a0f3df040cedffffffffffffffffffffffffffffff92c0eac6b200642c2a3cc3a0f3df040c", + "tag": "6cf2f9230af8679e7ecb19421362fce3", + "result": "valid" + }, + { + "tcId": 248, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xfffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef32e6784d857df07543d0dc72f179935fbede8c8baf01ee2044b162cbb343b355acc29d82327cd93f2bfd918034ed5c42a", + "ct": "ffffffffffffffffffffffffffffffff5da057d7d954ec856796aad6faffb1183c2f9be74c6a4576e0b09a7a5c2330963c2f9be74c6a4576e0b09a7a5c233096", + "tag": "64e7efd24516a83e2c87e06a76e2dea3", + "result": "valid" + }, + { + "tcId": 249, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f78ce708bf26aab862d97e1b42f31ef34c6ead26f84a0225d557745d32fc72e72c38aca2438b588d5459493e97e7fa3364db334b69bee579383e61ae742c71bb5303478f2869b93ee29c837e95fb6b9968d138454ad2982a733baff384be2b7f", + "ct": "d4ffffffffffffffffffffffffffffff3fa97e2976c1e9f48fcc19a4df9af604fdffffffffffffffffffffffffffffff94dd708f021933fd6757e3d766da8507fdffffffffffffffffffffffffffffff94dd708f021933fd6757e3d766da8507", + "tag": "e6cc6729d79ba558cd73b03cba54d660", + "result": "valid" + }, + { + "tcId": 250, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "12de9b9ec8b247d42bbee2016d6715ba327f3a1befb4287c17450391ed0eb854d6f0b056a2eecc51d30838e640615e141460d3545c29ddc790711b8e7533698539d14da7b4f76f9f68fa8903138d563caed94d9b4cccba9d491b7588026fe8d0", + "ct": "f2ffffffffffffffffffffffffffffff8f0a40a7047b3d59be1839b286ba2d0de7ffffffffffffffffffffffffffffffb37fb895932f399c74cd868b141a9501e7ffffffffffffffffffffffffffffffb37fb895932f399c74cd868b141a9501", + "tag": "74dda12e0558877bc0e40c3eace0af29", + "result": "valid" + }, + { + "tcId": 251, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x10000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f08ce708bf26aab862d97e1b42f31ef34fd8c3757c9f2938dc3b07d85898bfe22a38aca2438b588d5459493e97e7fa336155412415cbdd760142b62c2ec83fbf5503478f2869b93ee29c837e95fb6b996d5f4a2a36a7a0254a477871de5a657b", + "ct": "d3ffffffffffffffffffffffffffffff3c1f107af214c2e986a06a21b5fe3b01fbffffffffffffffffffffffffffffff915302e07e6c0bf25e2b34553c3ecb03fbffffffffffffffffffffffffffffff915302e07e6c0bf25e2b34553c3ecb03", + "tag": "e5cc6739bfd0f4638def574b5a43dd6f", + "result": "valid" + }, + { + "tcId": 252, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x10000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1bde9b9ec8b247d42bbee2016d6715ba85b67664ee49fa347fbfd2dd92007c57def0b056a2eecc51d30838e640615e14fb27ee075b3c0f0f682babdde63dad8731d14da7b4f76f9f68fa8903138d563c419e70c84bd96855b141c5db91612cd2", + "ct": "fbffffffffffffffffffffffffffffff38c30cd80586ef11d6e2e8fef9b4e90eefffffffffffffffffffffffffffffff5c3885c6943aeb548c9736d887145103efffffffffffffffffffffffffffffff5c3885c6943aeb548c9736d887145103", + "tag": "502455343d39db87947d7346a8e0af39", + "result": "valid" + }, + { + "tcId": 253, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f28ce708bf26aab862d97e1b42f31ef3df03ca84082f7f70ad8e4004cabd2ce42b38aca2438b588d5459493e97e7fa3328fd413caab1d02bf1c65753aa2ad3b95403478f2869b93ee29c837e95fb6b9924f74a3289ddad78bac3990e5ab8897d", + "ct": "d1ffffffffffffffffffffffffffffffacc4198b86a494a1f7152dfd27dba807faffffffffffffffffffffffffffffffd8fb02f8c11606afaeafd52ab8dc2705faffffffffffffffffffffffffffffffd8fb02f8c11606afaeafd52ab8dc2705", + "tag": "0fca702228817d53ee64d142b192e665", + "result": "valid" + }, + { + "tcId": 254, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff0000000100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f38ce708bf26aab862d97e1b42f31ef31ffc31ae69399394b8c338674c3dfde92938aca2438b588d5459493e97e7fa33477ec8cf3ea3d4d5d76d85ad2b7f0bb85603478f2869b93ee29c837e95fb6b994b74c3c11dcfa9869c684bf0dbed517c", + "ct": "d0ffffffffffffffffffffffffffffff6c3be2a1e7b27845e258559ea15b790af8ffffffffffffffffffffffffffffffb7788b0b55040251880407d43989ff04f8ffffffffffffffffffffffffffffffb7788b0b55040251880407d43989ff04", + "tag": "efc3b035ded6b460bfce6f494955e677", + "result": "valid" + }, + { + "tcId": 255, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff0000000100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "4f115e67ecd3d4178c4c60e713ab4e5e4156269fe3da101eeb0abf8dda20fe8fff47139a5f4e3f8e92d7a3b71eb4ff0e6aece983e64f97e43ff5295bc884fa7773a0085c32ddfcbeb01a8be4c34d5331a2d909c10a1bdcd318046d320583f6b7", + "ct": "d6ffffffffffffffffffffffffffffffd85108996dfff8a26ede1e76de151701e8ffffffffffffffffffffffffffffffc5265a700c30c72da2df2eb129447b0ae8ffffffffffffffffffffffffffffffc5265a700c30c72da2df2eb129447b0a", + "tag": "3ea8f9b2012321e63d5fb5bc2c5d332d", + "result": "valid" + }, + { + "tcId": 256, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff0000000100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715baf999461058f6d7733e5cd0d1639d9025cbf0b056a2eecc51d30838e640615e14520a0da50439db00e289e1791342068e24d14da7b4f76f9f68fa8903138d563ce8b3936a14dcbc5a3be38f7f641e87db", + "ct": "ffffffffffffffffffffffffffffffff44ec3cacb339c2569701eaf20829057cfafffffffffffffffffffffffffffffff5156664cb3f3f5b06357c7c726bfa0afafffffffffffffffffffffffffffffff5156664cb3f3f5b06357c7c726bfa0a", + "tag": "bf7fbd422cbf0e700fd1605be8fd212f", + "result": "valid" + }, + { + "tcId": 257, + "comment": "Intermediate sum of poly1305 after processing64 bytes is 0x3ffffffffffff8000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "2bfd0d56ece98771756d60d9d9106cd0c6fc106936c7ef347c078fd71c54228164fc903b0438a3978d3a54ef992aa3ae", + "ct": "088e15a1ac30d236e84be13d641c8ddcb53bc366b84c04e5269ce22ef132a662b53bc366b84c04e5269ce22ef132a662", + "tag": "345fc9fe573c136c1be83730500ce662", + "result": "valid" + }, + { + "tcId": 258, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xfffffffffffff0000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f68ce708bf26aab862d97e1b42f31ef37cc2255decdf8e0fe1373591da0e28e42838aca2438b588d5459493e97e7fa33e291fb4838019c51dfb7141515bb53b15703478f2869b93ee29c837e95fb6b99ee9bf0461b6de10294b2da48e5290975", + "ct": "d5ffffffffffffffffffffffffffffff0f05f652625465debbac58683768ac07f9ffffffffffffffffffffffffffffff1297b88c53a64ad580de966c074da70df9ffffffffffffffffffffffffffffff1297b88c53a64ad580de966c074da70d", + "tag": "336f97a5faa995a2a03781b591588da8", + "result": "valid" + }, + { + "tcId": 259, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xf06eea00ea77bc00b4f34e80fffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c68ce708bf26aab862d97e1b42f31ef37ab66f8090c149e452ec7f20327eb2ea0438aca2438b588d5459493e97e7fa338d2613ea0ef8b656b247373ecec015bc7b03478f2869b93ee29c837e95fb6b99812c18e42d94cb05f942f9633e524f78", + "ct": "e5ffffffffffffffffffffffffffffff0971bc8f1e4aa235087712d9df183609d5ffffffffffffffffffffffffffffff7d20502e655f60d2ed2eb547dc36e100d5ffffffffffffffffffffffffffffff7d20502e655f60d2ed2eb547dc36e100", + "tag": "9351c680c8a5d34882d42145e89745c4", + "result": "valid" + }, + { + "tcId": 260, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3f0f9115ff158843ff4b0cb17effffffc.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c68ce708bf26aab862d97e1b42f31ef374b66f8090c149e452ec7f20327eb2ea2e38aca2438b588d5459493e97e7fa33acd9ec859e0866620cc24c8a97d5d9f55103478f2869b93ee29c837e95fb6b99a0d3e78bbd641b3147c782d767478331", + "ct": "e5ffffffffffffffffffffffffffffff0771bc8f1e4aa235087712d9df183609ffffffffffffffffffffffffffffffff5cdfaf41f5afb0e653abcef385232d49ffffffffffffffffffffffffffffffff5cdfaf41f5afb0e653abcef385232d49", + "tag": "d79266cd25a784599a0a8e31fc84d604", + "result": "valid" + }, + { + "tcId": 261, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xffffffffffffffff0000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f78ce708bf26aab862d97e1b42f31ef34251cd29b0aaa960557c9ea2828334e4e4e231db0a27fac9ec9e744886eb0133c5232142ddf48b3f185140f0fc05f043", + "ct": "d4ffffffffffffffffffffffffffffff31961e263e2142b10fe7f35b6fe5b00735256286b6535dbb4738c289eef304ff35256286b6535dbb4738c289eef304ff", + "tag": "9d671d407d7660459d5d582d83915efe", + "result": "valid" + }, + { + "tcId": 262, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff00000000ffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "f58ce708bf26aab862d97e1b42f31ef373bd9f01bf3331b12e31dd14cf11feee1d38aca2438b588d5459493e97e7fa33625c6965f61a1c36118c747076d5b7b76203478f2869b93ee29c837e95fb6b996e56626bd57661655a89ba2d8647ed73", + "ct": "d6ffffffffffffffffffffffffffffff007a4c0e31b8da6074aab0ed22777a0dccffffffffffffffffffffffffffffff925a2aa19dbdcab24ee5f6096423430bccffffffffffffffffffffffffffffff925a2aa19dbdcab24ee5f6096423430b", + "tag": "7b207c2c3278c64f0d6b913fe371fe63", + "result": "valid" + }, + { + "tcId": 263, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff00000000ffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715bad64add2aa3c5a30a31d9e65e90f93ad1cbf0b056a2eecc51d30838e640615e14de9aeab86144d5464811b2373ba4cc8324d14da7b4f76f9f68fa8903138d563c6423747771a1b21c917bdc314cf84dd6", + "ct": "ffffffffffffffffffffffffffffffff6b3fa796480ab62f9884dc7dfb4daf88faffffffffffffffffffffffffffffff79858179ae42311dacad2f325a8d3007faffffffffffffffffffffffffffffff79858179ae42311dacad2f325a8d3007", + "tag": "62630c18de8c10876adb9f30f300963f", + "result": "valid" + }, + { + "tcId": 264, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffffffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef3ec0933f0bfb91218cea0d74e061f559e2d38aca2438b588d5459493e97e7fa338d5b67e0acee534ce2d9791487b1ecb25203478f2869b93ee29c837e95fb6b9981516cee8f822e1fa9dcb7497723b676", + "ct": "ffffffffffffffffffffffffffffffff9fcee0ff3132f9c9943bbab7eb79d17dfcffffffffffffffffffffffffffffff7d5d2424c74985c8bdb0fb6d9547180efcffffffffffffffffffffffffffffff7d5d2424c74985c8bdb0fb6d9547180e", + "tag": "3672162bb1f3ff537ece013f1aca4f68", + "result": "valid" + }, + { + "tcId": 265, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffffffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715bacc3492272b8a4b112a4e7d7ccf092692cef0b056a2eecc51d30838e640615e1430ce678e9375b2af0b82c2d2fbd7928c21d14da7b4f76f9f68fa8903138d563c8a77f9418390d5f5d2e8acd48c8b13d9", + "ct": "ffffffffffffffffffffffffffffffff7141e89bc0455e348313475fa4bdb3cbffffffffffffffffffffffffffffffff97d10c4f5c7356f4ef3e5fd79afe6e08ffffffffffffffffffffffffffffffff97d10c4f5c7356f4ef3e5fd79afe6e08", + "tag": "feb6412b9031f076eddcd9426fff5b31", + "result": "valid" + }, + { + "tcId": 266, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x100000000000000000000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef3ee83a14f48db696291080edfcc898b882b38aca2438b588d5459493e97e7fa338ad5f6b0283a8b39ebedce92785da9b65403478f2869b93ee29c837e95fb6b9986dffdbe0b56f66aa0e800cf88cff372", + "ct": "ffffffffffffffffffffffffffffffff9d447240c65082b3cb93632621ef0f6bfaffffffffffffffffffffffffffffff7ad3b574439d5dbdb4844ceb6aab5d0afaffffffffffffffffffffffffffffff7ad3b574439d5dbdb4844ceb6aab5d0a", + "tag": "3572163b99284f5f3e4aa94dbab85677", + "result": "valid" + }, + { + "tcId": 267, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x100000000000000000000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "34de9b9ec8b247d42bbee2016d6715ba722b6549c9df0f4b04b5f7432203fa54cef0b056a2eecc51d30838e640615e1487de186cd28e43544c73de628fd1d60e21d14da7b4f76f9f68fa8903138d563c3d6786a3c26b240e9519b064f88d575b", + "ct": "d4ffffffffffffffffffffffffffffffcf5e1ff522101a6eade8cd6049b76f0dffffffffffffffffffffffffffffffff20c173ad1d88a70fa8cf4367eef82a8affffffffffffffffffffffffffffffff20c173ad1d88a70fa8cf4367eef82a8a", + "tag": "dafdf430c8124483c175404b6bff5b41", + "result": "valid" + }, + { + "tcId": 268, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x100000000000000000000000000000001.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef3e87dd08ed4e4e04c5877616cbb02cabb2938aca2438b588d5459493e97e7fa33874f0401d457e336f4311f1152f957ba5603478f2869b93ee29c837e95fb6b998b450f0ff73b9e65bf34d14ca26b0d7e", + "ct": "ffffffffffffffffffffffffffffffff9bba03815a6f0b9d02ec0c9556644e58f8ffffffffffffffffffffffffffffff774947c5bff035b2ab589d68400fa306f8ffffffffffffffffffffffffffffff774947c5bff035b2ab589d68400fa306", + "tag": "3472164b815d9e6afec5505c5aa75d86", + "result": "valid" + }, + { + "tcId": 269, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x100000000000000000000000000000001.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "4c115e67ecd3d4178c4c60e713ab4e5ebb5357ed314ad740b9910fad6f01d781f047139a5f4e3f8e92d7a3b71eb4ff0ec8042b414fdd1bba3a6c936b7ed678797ca0085c32ddfcbeb01a8be4c34d53310031cb03a389508d1d9dd702b3d174b9", + "ct": "d5ffffffffffffffffffffffffffffff225479ebbf6f3ffc3c45ae566b343e0fe7ffffffffffffffffffffffffffffff67ce98b2a5a24b73a74694819f16f904e7ffffffffffffffffffffffffffffff67ce98b2a5a24b73a74694819f16f904", + "tag": "e6022cc3ba20e3f9065fdfcc43a9dc40", + "result": "valid" + }, + { + "tcId": 270, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3fffffffffffffffffffffffffffffff6.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c88ce708bf26aab862d97e1b42f31ef36be436e346f8f2b32f4cbbaef95150ef0438aca2438b588d5459493e97e7fa332fb76b5132e930f6d0acf70875e977b57b03478f2869b93ee29c837e95fb6b9923bd605f11854da59ba93955857b2d71", + "ct": "ebffffffffffffffffffffffffffffff1823e5ecc873196275d7d6571437d40cd5ffffffffffffffffffffffffffffffdfb12895594ee6728fc57571671f8309d5ffffffffffffffffffffffffffffffdfb12895594ee6728fc57571671f8309", + "tag": "3a7216d7ee1da018ce8412f251656b19", + "result": "valid" + }, + { + "tcId": 271, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3fffffffffffffffffffffffffffffff6.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "66115e67ecd3d4178c4c60e713ab4e5ef64296975af7fced168181f76c6508e1c947139a5f4e3f8e92d7a3b71eb4ff0e4975060f7ddef4a098699333b30fbf7c45a0085c32ddfcbeb01a8be4c34d53318140e64d918abf97bf98d75a7e08b3bc", + "ct": "ffffffffffffffffffffffffffffffff6f45b891d4d214519355200c6850e16fdeffffffffffffffffffffffffffffffe6bfb5fc97a1a469054394d952cf3e01deffffffffffffffffffffffffffffffe6bfb5fc97a1a469054394d952cf3e01", + "tag": "353e304fd8553286b26e0d59942fe7cd", + "result": "valid" + }, + { + "tcId": 272, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3fffffffffffffffffffffffffffffffa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "c58ce708bf26aab862d97e1b42f31ef3783cf9302c7d22914b38aca2e7d374ef1d38aca2438b588d5459493e97e7fa33228f2d23597640d574f8e20c4f6b6bb56203478f2869b93ee29c837e95fb6b992e85262d7a1a3d863ffd2c51bff93171", + "ct": "e6ffffffffffffffffffffffffffffff0bfb2a3fa2f6c94011a3c15b0ab5f00cccffffffffffffffffffffffffffffffd2896ee732d196512b9160755d9d9f09ccffffffffffffffffffffffffffffffd2896ee732d196512b9160755d9d9f09", + "tag": "367216178ff1dc45ce73b02cd21f8755", + "result": "valid" + }, + { + "tcId": 273, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x35e50d79435e50d79435e50d79435e50.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef35db72f89d1402b1a0373ff0a9c5cd44b6d67af40798f5455501792953248ec234ca6bfd9ae5c25a3a4d8a62d48a61d53", + "ct": "ffffffffffffffffffffffffffffffff2e70fc865fcbc0cb59e892f3713a50a8bca0fc1dc5fbf327fbb124545a50e9efbca0fc1dc5fbf327fbb124545a50e9ef", + "tag": "0b4961c9525ea2f2cdad6273e1c7824c", + "result": "valid" + }, + { + "tcId": 274, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x35e50d79435e50d79435e50d79435e51.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef35f215ec87d62a264cadb519b4ac90a7668d1dd03e56eda6399ac7803e7dd22114910cd9a32bdab956d634cbb9d33d361", + "ct": "ffffffffffffffffffffffffffffffff2ce68dc7f3e949b590403c62a7af8e95b9168e5e591a7d11320acec28fc527ddb9168e5e591a7d11320acec28fc527dd", + "tag": "0a4961d93a93f1fd8d290a8281b6895b", + "result": "valid" + }, + { + "tcId": 275, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x2fffffffffffffffffffffffffffffffb.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060710abb165", + "aad": "ffffffff", + "msg": "dc8ce708bf26aab862d97e1b42f31ef3d15ad590dd0f40ba18acd168f6ac777a0f38aca2438b588d5459493e97e7fa33932a097f1d39a04ad30f1b6c650260bf7003478f2869b93ee29c837e95fb6b999f2002713e55dd19980ad53195903a7b", + "ct": "ffffffffffffffffffffffffffffffffa29d069f5384ab6b4237bc911bcaf399deffffffffffffffffffffffffffffff632c4abb769e76ce8c66991577f49403deffffffffffffffffffffffffffffff632c4abb769e76ce8c66991577f49403", + "tag": "3572161355240943de9406292a64c551", + "result": "valid" + }, + { + "tcId": 276, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x2fffffffffffffffffffffffffffffffb.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "4d115e67ecd3d4178c4c60e713ab4e5e6ee628fc4b5830184cd293364a213e84fe47139a5f4e3f8e92d7a3b71eb4ff0e29db953ad5458fea61f013ea1854fe7572a0085c32ddfcbeb01a8be4c34d5331e1ee75783911c4dd46015783d553f2b5", + "ct": "d4fffffffffffffffffffffffffffffff7e106fac57dd8a4c90632cd4e14d70ae9ffffffffffffffffffffffffffffff861126c93f3adf23fcda1400f9947f08e9ffffffffffffffffffffffffffffff861126c93f3adf23fcda1400f9947f08", + "tag": "e00d2e8bae5d09c28e9bf59409545d09", + "result": "valid" + }, + { + "tcId": 277, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x2fffffffffffffffffffffffffffffffb.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "3ede9b9ec8b247d42bbee2016d6715ba8567a7fde812a3aa2f552a33c1718c58e2f0b056a2eecc51d30838e640615e14bb8729fd148f23b2a916b7f40f2f29810dd14da7b4f76f9f68fa8903138d563c013eb732046a44e8707cd9f27873a8d4", + "ct": "deffffffffffffffffffffffffffffff3812dd4103ddb68f86081010aac51901d3ffffffffffffffffffffffffffffff1c98423cdb89c7e94daa2af16e06d505d3ffffffffffffffffffffffffffffff1c98423cdb89c7e94daa2af16e06d505", + "tag": "b4ccb422bc5f7264aff73f3675ff5b19", + "result": "valid" + }, + { + "tcId": 278, + "comment": "Intermediate sum of poly1305 after processing64 bytes is 0x5.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "43eadae036f733ea9b5b7eb22aee395db6f51a4d10bc2460810c229651556acf384ad82e3e280cad69f0df25b42b83b0", + "ct": "da047b7825db1802e8e8e1aac6ba88fc2ff2344b9e99ccdc04d8836d556083412ff2344b9e99ccdc04d8836d55608341", + "tag": "973e270a7afcab75348e14dbe19c5156", + "result": "valid" + }, + { + "tcId": 279, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x13.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "6a115e67ecd3d4178c4c60e713ab4e5e519cccebf72573dbee8c12f74255d18c0add1035861ffc0b7f40079b969f8c63b2af4fa3ccd16cb38f425c3996140def", + "ct": "f3ffffffffffffffffffffffffffffffc89be2ed79009b676b58b30c466038021d65fc5026ae3c7a12685bd377d48c921d65fc5026ae3c7a12685bd377d48c92", + "tag": "a22390224c5db0f01696743d870725c5", + "result": "valid" + }, + { + "tcId": 280, + "comment": "Intermediate sum of poly1305 after processing64 bytes is 0x14.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "e235b8c21384557085c3f2eb2a8fa36058cffd2af743dacf96b4ae4d51b4e488d6703f49d9d7f2027e4853feb4ca0df7", + "ct": "7bdb195a00a87e98f6706df3c6db12c1c1c8d32c7966327313600fb655810d06c1c8d32c7966327313600fb655810d06", + "tag": "437d1efad21b0865a541b5cab62e2a44", + "result": "valid" + }, + { + "tcId": 281, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "66115e67ecd3d4178c4c60e713ab4e5e8fab58574a322bac6f394474e4ce7eaec347139a5f4e3f8e92d7a3b71eb4ff0e71532dfb0e9141b00983394722829e7c4fa0085c32ddfcbeb01a8be4c34d5331b966cdb9e2c50a872e727d2eef8592bc", + "ct": "ffffffffffffffffffffffffffffffff16ac7651c417c310eaede58fe0fb9720d4ffffffffffffffffffffffffffffffde999e08e4ee117994a93eadc3421f01d4ffffffffffffffffffffffffffffffde999e08e4ee117994a93eadc3421f01", + "tag": "acf4ffa20c0d06d61a18e9a8d4c84d1d", + "result": "valid" + }, + { + "tcId": 282, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "61115e67ecd3d4178c4c60e713ab4e5e5efe679ba17384c55eb8cc193666fe8d04608c3503d217aa3f90a9b0e1b3b313bc12d3a3491c8712cf92f212e138329f", + "ct": "f8ffffffffffffffffffffffffffffffc7f9499d2f566c79db6c6de23253170313d86050a363d7db52b8f5f800f8b3e213d86050a363d7db52b8f5f800f8b3e2", + "tag": "cd466d06e75b7fd18d5fe21d9227d9a7", + "result": "valid" + }, + { + "tcId": 283, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x7ffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "9064b88a282052a1ee44df05ad213da679f8d1f971da17437a2b5e04fbca167151b2650ec945fec70588bc65a616a5f24f354c0c1580af3662d5f8151e3f7e82dd557ec8a4d63df7274594367bef09cd", + "ct": "098a19123b0c79499df7401d41758c07e0ffffffffffffffffffffffffffffff460a896b69f43eb668a0e02d475da503e0ffffffffffffffffffffffffffffff460a896b69f43eb668a0e02d475da503", + "tag": "ce8a3d4d887d95613d829b538ed01196", + "result": "valid" + }, + { + "tcId": 284, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xfffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "43115e67ecd3d4178c4c60e713ab4e5eeef67bd4795b74015a3493905d544a86e847139a5f4e3f8e92d7a3b71eb4ff0e3197be28eff843592bd8fc8d578421d664a0085c32ddfcbeb01a8be4c34d5331f9a25e6a03ac086e0c29b8e49a832d16", + "ct": "daffffffffffffffffffffffffffffff77f155d2f77e9cbddfe0326b5961a308ffffffffffffffffffffffffffffffff9e5d0ddb05871390b6f2fb67b644a0abffffffffffffffffffffffffffffffff9e5d0ddb05871390b6f2fb67b644a0ab", + "tag": "08289f5199df476fe90475cb95225566", + "result": "valid" + }, + { + "tcId": 285, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xfffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "39de9b9ec8b247d42bbee2016d6715ba4092e1f9a22c8b18184d805c128ade57c7f0b056a2eecc51d30838e640615e1464fe8b9bdd215a620973affefe93398528d14da7b4f76f9f68fa8903138d563cde471554cdc43d38d019c1f889cfb8d0", + "ct": "d9fffffffffffffffffffffffffffffffde79b4549e39e3db110ba7f793e4b0ef6ffffffffffffffffffffffffffffffc3e1e05a1227be39edcf32fb9fbac501f6ffffffffffffffffffffffffffffffc3e1e05a1227be39edcf32fb9fbac501", + "tag": "6d46d2230a9848d518f9d94bb2c49caa", + "result": "valid" + }, + { + "tcId": 286, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "6b115e67ecd3d4178c4c60e713ab4e5e1e34412ab0a056e809d5d4b92be1128a4b2a651a62aeab26cf437fb195407574f3583a8c28603b9e3f41241395cbf4f8", + "ct": "f2ffffffffffffffffffffffffffffff87336f2c3e85be548c0175422fd4fb045c92897fc21f6b57a26b23f9740b75855c92897fc21f6b57a26b23f9740b7585", + "tag": "06df93f651ea5cc56911f30d3e58f997", + "result": "valid" + }, + { + "tcId": 287, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x10000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "3fe606108f35869df4c7aa0128464a1265f8d1f971da17437a2b5e04fbca1671fdbe843a0ad9be25055992ab6dcbc9f153354c0c1580af3662d5f8151e3f7e8271599ffc674a7d152794baf8b03265ce", + "ct": "a608a7889c19ad7587743519c412fbb3fcffffffffffffffffffffffffffffffea06685faa687e546871cee38c80c900fcffffffffffffffffffffffffffffffea06685faa687e546871cee38c80c900", + "tag": "9264fc0f47febb30661254daf9a06189", + "result": "valid" + }, + { + "tcId": 288, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0xffffffffffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "6e8eb98cf7fffe4cd683568cf892991564f8d1f971da17437a2b5e04fbca1671c70f5d8b30c64bf2e6d1d613f40e0bf052354c0c1580af3662d5f8151e3f7e824be8464d5d5588c2c41cfe4029f7a7cf", + "ct": "f7601814e4d3d5a4a530c99414c628b4fdffffffffffffffffffffffffffffffd0b7b1ee90778b838bf98a5b15450b01fdffffffffffffffffffffffffffffffd0b7b1ee90778b838bf98a5b15450b01", + "tag": "69a124fc7f96e220d1a031ced5527279", + "result": "valid" + }, + { + "tcId": 289, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3ffffffffffff8000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "66115e67ecd3d4178c4c60e713ab4e5e18f125ef374c1454b680e23427e7dc69e447139a5f4e3f8e92d7a3b71eb4ff0e858b08eb1d581570a7cd1e48593b757568a0085c32ddfcbeb01a8be4c34d53314dbee8a9f10c5e47803c5a21943c79b5", + "ct": "ffffffffffffffffffffffffffffffff81f60be9b969fce8335443cf23d235e7f3ffffffffffffffffffffffffffffff2a41bb18f72745b93ae719a2b8fbf408f3ffffffffffffffffffffffffffffff2a41bb18f72745b93ae719a2b8fbf408", + "tag": "dfaf8a3a15d45e7f4c3430048d8589f0", + "result": "valid" + }, + { + "tcId": 290, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3ffffffffffff8000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "15de9b9ec8b247d42bbee2016d6715bacc1629a40cd11eafdf04138b45afe458eff0b056a2eecc51d30838e640615e14340ac9b45a5896a418a8cee8032e078f00d14da7b4f76f9f68fa8903138d563c8eb3577b4abdf1fec1c2a0ee747286da", + "ct": "f5ffffffffffffffffffffffffffffff71635318e71e0b8a765929a82e1b7101deffffffffffffffffffffffffffffff9315a275955e72fffc1453ed6207fb0bdeffffffffffffffffffffffffffffff9315a275955e72fffc1453ed6207fb0b", + "tag": "c6f23204865b0adde0070037d6538dd3", + "result": "valid" + }, + { + "tcId": 291, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0xfffffffffffff0000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "b02ab747a310d6a3bbdb97018a3be8b341f8d1f971da17437a2b5e04fbca1671b7a338bc3423895f0fd96cdb27a787f277354c0c1580af3662d5f8151e3f7e823b44237a59b04a6f2d144488fa5e2bcd", + "ct": "29c416dfb03cfd4bc8680819666f5912d8ffffffffffffffffffffffffffffffa01bd4d99492492e62f13093c6ec8703d8ffffffffffffffffffffffffffffffa01bd4d99492492e62f13093c6ec8703", + "tag": "3408eb2b13a9b76befcedf699422d61f", + "result": "valid" + }, + { + "tcId": 292, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xfdb3cec0ff9a5900ff513280fff6a94.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "40115e67ecd3d4178c4c60e713ab4e5e380ef93aeb61aa307f141323c38e0685f647139a5f4e3f8e92d7a3b71eb4ff0e3f769a30e8951ff2fb365fa780fdde7e7aa0085c32ddfcbeb01a8be4c34d5331f7437a7204c154c5dcc71bce4dfad2be", + "ct": "d9ffffffffffffffffffffffffffffffa109d73c6544428cfac0b2d8c7bbef0be1ffffffffffffffffffffffffffffff90bc29c302ea4f3b661c584d613d5f03e1ffffffffffffffffffffffffffffff90bc29c302ea4f3b661c584d613d5f03", + "tag": "09f4f2a3936d7461a67ce022176bb8dd", + "result": "valid" + }, + { + "tcId": 293, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3f024c313f0065a6ff00aecd7f0009567.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "40115e67ecd3d4178c4c60e713ab4e5e060ef93aeb61aa307f141323c38e0685ee47139a5f4e3f8e92d7a3b71eb4ff0e2bca70bfcdf1171ab611d12bed5d627a62a0085c32ddfcbeb01a8be4c34d5331e3ff90fd21a55c2d91e09542205a6eba", + "ct": "d9ffffffffffffffffffffffffffffff9f09d73c6544428cfac0b2d8c7bbef0bf9ffffffffffffffffffffffffffffff8400c34c278e47d32b3bd6c10c9de307f9ffffffffffffffffffffffffffffff8400c34c278e47d32b3bd6c10c9de307", + "tag": "2eb2679aadfd824a5fd8fa2e4a55a65c", + "result": "valid" + }, + { + "tcId": 294, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffff0000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "56115e67ecd3d4178c4c60e713ab4e5e6c7e1312c6774fae7d1e5d0cc609028ff547139a5f4e3f8e92d7a3b71eb4ff0e81c9e61cbeeed5546b1ce5d8fef21a7a79a0085c32ddfcbeb01a8be4c34d533149fc065e52ba9e634ceda1b133f516ba", + "ct": "cffffffffffffffffffffffffffffffff5793d144852a712f8cafcf7c23ceb01e2ffffffffffffffffffffffffffffff2e0355ef5491859df636e2321f329b07e2ffffffffffffffffffffffffffffff2e0355ef5491859df636e2321f329b07", + "tag": "5e89349f6b011cd6e24ee6ac2f590c21", + "result": "valid" + }, + { + "tcId": 295, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffffffffffff0000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "32de9b9ec8b247d42bbee2016d6715ba258d5d3e441683f546beba2e23755f5ccef0b056a2eecc51d30838e640615e149d13fdf8fa899836fa5c410d4ccd25ea21d14da7b4f76f9f68fa8903138d563c27aa6337ea6cff6c23362f0b3b91a4bf", + "ct": "d2ffffffffffffffffffffffffffffff98f82782afd996d0efe3800d48c1ca05ffffffffffffffffffffffffffffffff3a0c9639358f7c6d1ee0dc082de4d96effffffffffffffffffffffffffffffff3a0c9639358f7c6d1ee0dc082de4d96e", + "tag": "d1be7426cd12446fe52e8d45331e0835", + "result": "valid" + }, + { + "tcId": 296, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0xffffffff00000000ffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "2ea8410b4dca8c9d5369a033d8db61e46cf8d1f971da17437a2b5e04fbca1671f0f58e8bba6cf1a52146273d8fe0c4fc5a354c0c1580af3662d5f8151e3f7e827c12954dd7ff3295038b0f6e521968c3", + "ct": "b746e0935ee6a77520da3f2b348fd045f5ffffffffffffffffffffffffffffffe74d62ee1add31d44c6e7b756eabc40df5ffffffffffffffffffffffffffffffe74d62ee1add31d44c6e7b756eabc40d", + "tag": "b24537fcb0dcb6200b0285cafc9c3a7d", + "result": "valid" + }, + { + "tcId": 297, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0xffffffffffffffffffffffffffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "17059a7c8883a28b90bd94ae44d1543662f8d1f971da17437a2b5e04fbca1671a23018bf8e68e413e99ac2d4ab3f8df154354c0c1580af3662d5f8151e3f7e822ed70379e3fb2723cb57ea8776c621ce", + "ct": "8eeb3be49baf8963e30e0bb6a885e597fbffffffffffffffffffffffffffffffb588f4da2ed9246284b29e9c4a748d00fbffffffffffffffffffffffffffffffb588f4da2ed9246284b29e9c4a748d00", + "tag": "43300400ea36e720361153ce0c5d637d", + "result": "valid" + }, + { + "tcId": 298, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x100000000000000000000000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "aaa1b258fd4b54b497b520806a66d7aa68f8d1f971da17437a2b5e04fbca167199132a234a8c789bf8544547940ec3f35e354c0c1580af3662d5f8151e3f7e8215f431e5271fbbabda996d1449f76fcc", + "ct": "334f13c0ee677f5ce406bf988632660bf1ffffffffffffffffffffffffffffff8eabc646ea3db8ea957c190f7545c302f1ffffffffffffffffffffffffffffff8eabc646ea3db8ea957c190f7545c302", + "tag": "d79a0310124adc30c6b64cdef8993e8d", + "result": "valid" + }, + { + "tcId": 299, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x3fffffffffffffffffffffffffffffffa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "9841cfc927a57dc491ab35427ff935e66ef8d1f971da17437a2b5e04fbca1671a683c8f9f9e6780fda4940ddedd76bf258354c0c1580af3662d5f8151e3f7e822a64d33f9475bb3ff884688e302ec7cd", + "ct": "01af6e513489562ce218aa5a93ad8447f7ffffffffffffffffffffffffffffffb13b249c5957b87eb7611c950c9c6b03f7ffffffffffffffffffffffffffffffb13b249c5957b87eb7611c950c9c6b03", + "tag": "0aeb04ecf7def40c42025bbae5509169", + "result": "valid" + }, + { + "tcId": 300, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x3fffffffffffffffffffffffffffffffa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "f4ebbe3fca96bc4885b35582c43e0eb3588a85431430eada56a2c5dc944b6aa6b4570e8446e886bcbff82a24f49be5ed42e0943e30f91ba41b4362fa9ed6037b5b76f37550f12572040a9bc1a777edc5", + "ct": "14cada5efddb046351f2487c56a6e4f6e5ffffffffffffffffffffffffffffff8558412d1bf9b512930fed3d4b054406e5ffffffffffffffffffffffffffffff8558412d1bf9b512930fed3d4b054406", + "tag": "af7293eb09957d9de7432dd41316f0e4", + "result": "valid" + }, + { + "tcId": 301, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x35e50d79435e50d79435e50d79435e50.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "42115e67ecd3d4178c4c60e713ab4e5e0b61bf9b7caf83cc34da625593514289e847139a5f4e3f8e92d7a3b71eb4ff0e696a5c7fb9da9cd4a39c8591086db42d64a0085c32ddfcbeb01a8be4c34d5331a15fbc3d558ed7e3846dc1f8c56ab8ed", + "ct": "dbffffffffffffffffffffffffffffff9266919df28a6b70b10ec3ae9764ab07ffffffffffffffffffffffffffffffffc6a0ef8c53a5cc1d3eb6827be9ad3550ffffffffffffffffffffffffffffffffc6a0ef8c53a5cc1d3eb6827be9ad3550", + "tag": "8fc4f77a6ee052a4c314780b8df9a2d0", + "result": "valid" + }, + { + "tcId": 302, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x35e50d79435e50d79435e50d79435e50.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1ade9b9ec8b247d42bbee2016d6715ba571a3fca3cda7def4c93d4a382ca3a57eaf0b056a2eecc51d30838e640615e1476cddbee2f185776174f6df3bbe5b38105d14da7b4f76f9f68fa8903138d563ccc7445213ffd302cce2503f5ccb932d4", + "ct": "faffffffffffffffffffffffffffffffea6f4576d71568cae5ceee80e97eaf0edbffffffffffffffffffffffffffffffd1d2b02fe01eb32df3f3f0f6dacc4f05dbffffffffffffffffffffffffffffffd1d2b02fe01eb32df3f3f0f6dacc4f05", + "tag": "e178b0d5eb9bc551fa645c49f9f17667", + "result": "valid" + }, + { + "tcId": 303, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x35e50d79435e50d79435e50d79435e51.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "00010203040506072dd4cd40", + "aad": "ffffffff", + "msg": "4b115e67ecd3d4178c4c60e713ab4e5ef28e4d0f20ca1644470c9cdac6000887ed47139a5f4e3f8e92d7a3b71eb4ff0e1464775bacd5c69fe26e1a74968ea27e61a0085c32ddfcbeb01a8be4c34d5331dc51971940818da8c59f5e1d5b89aebe", + "ct": "d2ffffffffffffffffffffffffffffff6b896309aeeffef8c2d83d21c235e109faffffffffffffffffffffffffffffffbbaec4a846aa96567f441d9e774e2303faffffffffffffffffffffffffffffffbbaec4a846aa96567f441d9e774e2303", + "tag": "232ff78a96f347b453ba711b79367ee0", + "result": "valid" + }, + { + "tcId": 304, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x35e50d79435e50d79435e50d79435e51.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715babe31a501536a7c91e4a102cc27cdfe09d2f0b056a2eecc51d30838e640615e14dd9416a12e2f81bdee023d462feef7833dd14da7b4f76f9f68fa8903138d563c672d886e3ecae6e73768534058b276d6", + "ct": "ffffffffffffffffffffffffffffffff0344dfbdb8a569b44dfc38ef4c796b50e3ffffffffffffffffffffffffffffff7a8b7d60e12965e60abea0434ec70b07e3ffffffffffffffffffffffffffffff7a8b7d60e12965e60abea0434ec70b07", + "tag": "bdbf63db237d195ecefdc251f5f17677", + "result": "valid" + }, + { + "tcId": 305, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x5.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "97311cd6e2d25a7b4eaa16f0a61ca6246b8a85431430eada56a2c5dc944b6aa695136310b6b6b5c17c9f8c02ba7d0aeb71e0943e30f91ba41b4362fa9ed6037b7a329ee1a0af160fc76d3de7e99102c3", + "ct": "771078b7d59fe2509aeb0b0e34844c61d6ffffffffffffffffffffffffffffffa41c2cb9eba7866f50684b1b05e3ab00d6ffffffffffffffffffffffffffffffa41c2cb9eba7866f50684b1b05e3ab00", + "tag": "d71bc70d5adc74e7dfd89406fc15f044", + "result": "valid" + }, + { + "tcId": 306, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xa.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "34de9b9ec8b247d42bbee2016d6715ba74cf7e9d82b7e8ed9ec965f6ea310951dc104940e08a4222556828eba459f65a4a006d28729d95d79d2372f77aeeab35", + "ct": "d4ffffffffffffffffffffffffffffffc9ba04216978fdc837945fd581859c08ed1f06e9bd9b718c799feff21bc757b1ed1f06e9bd9b718c799feff21bc757b1", + "tag": "21e63987d494673f3040ae9de2bc0da0", + "result": "valid" + }, + { + "tcId": 307, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x13.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "e72b83514e5e50509070359c1cac7e1c428a85431430eada56a2c5dc944b6aa6dad35950d8a9b55a472f9bb8860a526358e0943e30f91ba41b4362fa9ed6037b35f2a4a1ceb01694fcdd2a5dd5e65a4b", + "ct": "070ae7307913e87b443128628e349459ffffffffffffffffffffffffffffffffebdc16f985b886f46bd85ca13994f388ffffffffffffffffffffffffffffffffebdc16f985b886f46bd85ca13994f388", + "tag": "e4fb945d6a2d0b947834317cc415f024", + "result": "valid" + }, + { + "tcId": 308, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0x14.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "8c6165f445443588041b6e044fb6baae728a85431430eada56a2c5dc944b6aa6881a54c09516a1f1cae7b9dd71130ee168e0943e30f91ba41b4362fa9ed6037b673ba931830f023f7115083822ff06c9", + "ct": "6c40019572098da3d05a73fadd2e50ebcfffffffffffffffffffffffffffffffb9151b69c807925fe6107ec4ce8daf0acfffffffffffffffffffffffffffffffb9151b69c807925fe6107ec4ce8daf0a", + "tag": "c0424863a20e5fa04ccd9784c015f034", + "result": "valid" + }, + { + "tcId": 309, + "comment": "Intermediate sum of poly1305 after processing96 bytes is 0xffffffff.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "18e36174545fa7ec9ea9f05d7057c5ca638a85431430eada56a2c5dc944b6aa6434e1c5e71005b690ca5cb8d580b89ed79e0943e30f91ba41b4362fa9ed6037bac6fe1af6719f8a7b7577a680be781c5", + "ct": "f8c2051563121fc74ae8eda3e2cf2f8fdeffffffffffffffffffffffffffffff724153f72c1168c720520c94e7952806deffffffffffffffffffffffffffffff724153f72c1168c720520c94e7952806", + "tag": "aa7293ffe5db30a31f2581e0e7ae56ed", + "result": "valid" + }, + { + "tcId": 310, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x100000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "12de9b9ec8b247d42bbee2016d6715ba54305dff6b61c40b775c352d025c1a56d7f0b056a2eecc51d30838e640615e14bce574e9e11afedbdca021e53bb9188338d14da7b4f76f9f68fa8903138d563c065cea26f1ff998105ca4fe34ce599d6", + "ct": "f2ffffffffffffffffffffffffffffffe945274380aed12ede010f0e69e88f0fe6ffffffffffffffffffffffffffffff1bfa1f282e1c1a80381cbce05a90e407e6ffffffffffffffffffffffffffffff1bfa1f282e1c1a80381cbce05a90e407", + "tag": "42e5d43d1e808e79f017144d4498c235", + "result": "valid" + }, + { + "tcId": 311, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xffffffffffffffff00000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "36de9b9ec8b247d42bbee2016d6715ba1132811b2f18321ba99b12432c7f865aa3352cd2d7ac70b4c6f5419767926e20352508ba45bba7410ebe1b8bb925334f", + "ct": "d6ffffffffffffffffffffffffffffffac47fba7c4d7273e00c6286047cb1303923a637b8abd431aea02868ed80ccfcb923a637b8abd431aea02868ed80ccfcb", + "tag": "14fba149d1c0edc8aa665851126b5afd", + "result": "valid" + }, + { + "tcId": 312, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0xfffffffffffff0000000000000.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "31de9b9ec8b247d42bbee2016d6715baff746ef53ec3357cbc3c3ce4ab1d2d51ed9eb456dc9d9b59f656a5d2d974d26a7b8e903e4e8a4cac3e1dffce07c38f05", + "ct": "d1ffffffffffffffffffffffffffffff42011449d50c2059156106c7c0a9b808dc91fbff818ca8f7daa162cb66ea7381dc91fbff818ca8f7daa162cb66ea7381", + "tag": "8cff61b7b3919ed6bde72b36e0d31326", + "result": "valid" + }, + { + "tcId": 313, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0xffffffc086698d40c53e13805b346dc.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "19de9b9ec8b247d42bbee2016d6715babf286fd979807951b183a188930ad15ecef0b056a2eecc51d30838e640615e1464413d71939b9cb0a4d32ef115da9e1021d14da7b4f76f9f68fa8903138d563cdef8a3be837efbea7db940f762861f45", + "ct": "f9ffffffffffffffffffffffffffffff025d1565924f6c7418de9babf8be4407ffffffffffffffffffffffffffffffffc35e56b05c9d78eb406fb3f474f36294ffffffffffffffffffffffffffffffffc35e56b05c9d78eb406fb3f474f36294", + "tag": "369cf17011cae47539e2723f010cf980", + "result": "valid" + }, + { + "tcId": 314, + "comment": "Intermediate sum of poly1305 after processing112 bytes is 0x3f0000003f799672bf3ac1ec7fa4cb91f.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "19de9b9ec8b247d42bbee2016d6715babd286fd979807951b183a188930ad15ee3f0b056a2eecc51d30838e640615e14f25e78fe1b53ae416d1fbc698522618f0cd14da7b4f76f9f68fa8903138d563c48e7e6310bb6c91bb475d26ff27ee0da", + "ct": "f9ffffffffffffffffffffffffffffff005d1565924f6c7418de9babf8be4407d2ffffffffffffffffffffffffffffff5541133fd4554a1a89a3216ce40b9d0bd2ffffffffffffffffffffffffffffff5541133fd4554a1a89a3216ce40b9d0b", + "tag": "532eb8e272a8d171378b0d42dff2bed9", + "result": "valid" + }, + { + "tcId": 315, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x100000000000000000000000000000001.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "3dde9b9ec8b247d42bbee2016d6715bac5629699cfd4d9036cef478ed705be5650f575882c3800f757ea6e0f8c6d47acc6e551e0be2fd7029fa1341352da1ac3", + "ct": "ddffffffffffffffffffffffffffffff7817ec25241bcc26c5b27dadbcb12b0f61fa3a21712933597b1da91633f3e64761fa3a21712933597b1da91633f3e647", + "tag": "f8800c5b6283dddfc41f935c01bd0d24", + "result": "valid" + }, + { + "tcId": 316, + "comment": "Intermediate sum of poly1305 after processing80 bytes is 0x3fffffffffffffffffffffffffffffff6.", + "flags": [ + "EdgeCasePoly1305" + ], + "key": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "iv": "000102030405060703e76f6f", + "aad": "ffffffff", + "msg": "1fde9b9ec8b247d42bbee2016d6715ba66d624f288f52941ca24865ce96f0d9736ff33a27c23f4976fc74f1fcd82f5cca0ef17caee342362a78c15031335a8a3", + "ct": "ffffffffffffffffffffffffffffffffdba35e4e633a3c646379bc7f82db98ce07f07c0b2132c73943308806721c542707f07c0b2132c73943308806721c5427", + "tag": "38bfb8318c627d86c34bab1f1ebd0db0", + "result": "valid" + } + ] + }, + { + "ivSize": 0, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 317, + "comment": "nonce has size 0.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 64, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 318, + "comment": "nonce has size 8.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "0001020304050607", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 88, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 319, + "comment": "nonce has size 11.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 104, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 320, + "comment": "nonce has size 13.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 112, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 321, + "comment": "nonce has size 14.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c0d", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 128, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 322, + "comment": "nonce has size 16.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c0d0e0f", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 192, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 323, + "comment": "nonce has size 24.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c0d0e0f1011121314151617", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 160, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 324, + "comment": "nonce has size 20.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c0d0e0f10111213", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + }, + { + "ivSize": 256, + "keySize": 256, + "tagSize": 128, + "type": "AeadTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "tests": [ + { + "tcId": 325, + "comment": "nonce has size 32.", + "flags": [ + "InvalidNonceSize" + ], + "key": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f", + "iv": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "aad": "", + "msg": "", + "ct": "", + "tag": "", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp256r1_ecpoint_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp256r1_ecpoint_test.json new file mode 100644 index 000000000..e4a2458f3 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp256r1_ecpoint_test.json @@ -0,0 +1,3994 @@ +{ + "algorithm": "ECDH", + "schema": "ecdh_ecpoint_test_schema_v1.json", + "numberOfTests": 355, + "header": [ + "Test vectors of type EcdhWebTest are intended for", + "testing an ECDH implementations where the public key", + "is just an ASN encoded point." + ], + "notes": { + "AdditionChain": { + "bugType": "KNOWN_BUG", + "description": "The private key has an unusual bit pattern, such as high or low Hamming weight. The goal is to test edge cases for addition chain implementations." + }, + "CVE-2017-8932": { + "bugType": "KNOWN_BUG", + "description": "A bug in the standard library ScalarMult implementation of curve P-256 for amd64 architectures in Go before 1.7.6 and 1.8.x before 1.8.2 causes incorrect results to be generated for specific input points.", + "effect": "An adaptive attack can be mounted to progressively extract the scalar input to ScalarMult by submitting crafted points and observing failures to the derive correct output.", + "cves": [ + "CVE-2017-8932" + ] + }, + "CompressedPoint": { + "bugType": "UNKNOWN", + "description": "The point in the public key is compressed. Not every library supports points in compressed format." + }, + "CompressedPublic": { + "bugType": "FUNCTIONALITY", + "description": "The public key in the test vector is compressed. Some implementations do not support compressed points." + }, + "EdgeCaseDoubling": { + "bugType": "EDGE_CASE", + "description": "The test vector contains an EC point that hits an edge case (e.g. a coordinate 0) when doubled. The goal of the test vector is to check for arithmetic errors in these test cases.", + "effect": "The effect of such arithmetic errors is unclear and requires further analysis." + }, + "EdgeCaseEphemeralKey": { + "bugType": "EDGE_CASE", + "description": "The test vector contains an ephemeral public key that is an edge case." + }, + "EdgeCaseSharedSecret": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a public key and private key such that the shared ECDH secret is a special case. The goal of this test vector is to detect arithmetic errors.", + "effect": "The seriousness of an arithmetic error is unclear. It requires further analysis to determine if the bug is exploitable." + }, + "InvalidCompressedPublic": { + "bugType": "MODIFIED_PARAMETER", + "description": "The test vector contains a compressed public key that does not exist. I.e., it contains an x-coordinate that does not correspond to any points on the curve. Such keys should be rejected " + }, + "InvalidCurveAttack": { + "bugType": "CONFIDENTIALITY", + "description": "The point of the public key is not on the curve. ", + "effect": "If an implementation does not check whether a point is on the curve then it is likely that the implementation is susceptible to an invalid curve attack. Many implementations compute the shared ECDH secret over a curve defined by the point on the public key. This curve can be weak and hence leak information about the private key." + }, + "InvalidEncoding": { + "bugType": "MODIFIED_PARAMETER", + "description": "The test vector contains a public key with an invalid encoding." + }, + "Normal": { + "bugType": "BASIC", + "description": "The test vector contains a pseudorandomly generated, valid test case. Implementations are expected to pass this test." + }, + "WrongCurve": { + "bugType": "CONFIDENTIALITY", + "description": "The public key and private key use distinct curves. Implementations are expected to reject such parameters.", + "effect": "Computing an ECDH key exchange with public and private keys can in the worst case lead to an invalid curve attack. Hence, it is important that ECDH implementations check the input parameters. The severity of such bugs is typically smaller if an implementation ensures that the point is on the curve and that the ECDH computation is performed on the curve of the private key. Some of the test vectors with modified public key contain shared ECDH secrets, that were computed over the curve of the private key." + } + }, + "testGroups": [ + { + "type": "EcdhEcpointTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "curve": "secp256r1", + "encoding": "ecpoint", + "tests": [ + { + "tcId": 1, + "comment": "normal case", + "flags": [ + "Normal" + ], + "public": "0462d5bd3372af75fe85a040715d0f502428e07046868b0bfdfa61d731afe44f26ac333a93a9e70a81cd5a95b5bf8d13990eb741c8c38872b4a07d275a014e30cf", + "private": "0612465c89a023ab17855b0a6bcebfd3febb53aef84138647b5352e02c10c346", + "shared": "53020d908b0219328b658b525f26780e3ae12bcd952bb25a93bc0895e1714285", + "result": "valid" + }, + { + "tcId": 2, + "comment": "compressed public key", + "flags": [ + "CompressedPublic", + "CompressedPoint" + ], + "public": "0362d5bd3372af75fe85a040715d0f502428e07046868b0bfdfa61d731afe44f26", + "private": "0612465c89a023ab17855b0a6bcebfd3febb53aef84138647b5352e02c10c346", + "shared": "53020d908b0219328b658b525f26780e3ae12bcd952bb25a93bc0895e1714285", + "result": "acceptable" + }, + { + "tcId": 3, + "comment": "shared secret has x-coordinate that satisfies x**2 = 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0458fd4168a87795603e2b04390285bdca6e57de6027fe211dd9d25e2212d29e62080d36bd224d7405509295eed02a17150e03b314f96da37445b0d1d29377d12c", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 4, + "comment": "shared secret has x-coordinate p-3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04a1ecc24bf0d0053d23f5fd80ddf1735a1925039dc1176c581a7e795163c8b9ba2cb5a4e4d5109f4527575e3137b83d79a9bcb3faeff90d2aca2bed71bb523e7e", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc", + "result": "valid" + }, + { + "tcId": 5, + "comment": "shared secret has x-coordinate 2**16 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "041b0e7437c33d379929430d3ec10df59bed7fe2a1d950c5791e1e9ddeef1f4d70fbdb0e3bbce63a27f27838c685207f2ccaf689d25eb622744db1168ac92619e8", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000000000000000000000000000000000000000010000", + "result": "valid" + }, + { + "tcId": 6, + "comment": "shared secret has x-coordinate 2**32 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0408d6148d0244d243b3d0d1777de6375fa7ebeab477f19915d05994db04df219727737d4f8ce0a7f390becce92b2bcd5c054f18ecb58e5dd59baf88b4ed6abea8", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000000000000000000000000000000000000100000000", + "result": "valid" + }, + { + "tcId": 7, + "comment": "shared secret has x-coordinate 2**64 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "042424f9d7ba0a89ce3c7c1e8f15dfd83004d86680967a82cbf9bb6b11dae5fd72e05c3687187b1cf28438a17a7469fa3b094b7d6f36cccc3492c0b0a61fab2a38", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000000000000000000000000000010000000000000000", + "result": "valid" + }, + { + "tcId": 8, + "comment": "shared secret has x-coordinate 2**96 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "044c9695b7668434fc85769acb10f0edcf87a96b7d5dc347b46bb304b0b1d3267fcf5d993bff2a8c774808231a34f41b33667d8ebeafd00689fa3a9bfa05a40c1c", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000000000000000000001000000000000000000000000", + "result": "valid" + }, + { + "tcId": 9, + "comment": "shared secret has x-coordinate that satisfies x**2 = -3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04a492fe4b4908b6d675d687551f99c617e4e5c97aa266958953129eb381f0153b111b95c94fa1d1ecd1d41d2785c1db5195875ae98051732a59ba7720f9089af6", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "6522aed9ea48f2623b8eeae3e213b99da32e74c9421835804d374ce28fcca662", + "result": "valid" + }, + { + "tcId": 10, + "comment": "shared secret has x-coordinate that satisfies x**2 = 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04d5c96efd1907fd48de2ad715acf82eae5c6690fe3efe16a78d61c68d3bfd10df03eac816b9e7b776192a3f5075887c0e225617505833ca997cda32fd0f673c5e", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "507442007322aa895340cba4abc2d730bfd0b16c2c79a46815f8780d2c55a2dd", + "result": "valid" + }, + { + "tcId": 11, + "comment": "shared secret has x-coordinate that satisfies x**2 = 5", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04c74d546f2fcc6dd392f85e5be167e358de908756b0c0bb01cb69d864ca083e1c93f959eece6e10ee11bd3934207d65ae28af68b092585a1509260eceb39b92ef", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "085ec5a4af40176b63189069aeffcb229c96d3e046e0283ed2f9dac21b15ad3c", + "result": "valid" + }, + { + "tcId": 12, + "comment": "shared secret has x-coordinate that satisfies x**2 = 7", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0434fc9f1e7a094cd29598d1841fa9613dbe82313d633a51d63fb6eff074cc9b9a4ecfd9f258c5c4d4210b49751213a24c596982bd1d54e0445443f21ef15492a5", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "190c25f88ad9ae3a098e6cffe6fd0b1bea42114eb0cedd5868a45c5fe277dff3", + "result": "valid" + }, + { + "tcId": 13, + "comment": "shared secret has x-coordinate that satisfies x**2 = 8", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04f475f503a770df72c45aedfe42c008f59aa57e72b232f26600bdd0353957cb20bdb8f6405b4918050a3549f44c07a8eba820cdce4ece699888c638df66f54f7c", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "5f177bfe19baaaee597e68b6a87a519e805e9d28a70cb72fd40f0fe5a754ba45", + "result": "valid" + }, + { + "tcId": 14, + "comment": "shared secret has x-coordinate that satisfies x**2 = 2**96 + 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04949304889050834006ecf11eba0e73f0dd2a5e77a5ea642a34a3f9989eda2d57384509cd42763c87cf460d1ad75664402986bb8cca0acdfc3685d2c9c7d32933", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "3476a8fa9c7448124aa945a2e1103eb91f95c7b4d91aaa1c35b8965191fc0fe0", + "result": "valid" + }, + { + "tcId": 15, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04e25ead8342888d1fbd2bd211e9db5bc761da9cfa1e805078b53606df9e5444403d3421fa70f940dba104d842034d2efec9332161ccfb654a8e9f2ec42fc1a837", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "5555555555555555555555555555555555555555555555555555555555555554", + "result": "valid" + }, + { + "tcId": 16, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04cb32ab951d7581e7602c89320d91d7043e9dc56a10348d586a08d1870753152bf96bd53e7cfc2434dc61a09f8f4853e4c6dd49e786194ec0a988d0e8d29378b8", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9", + "result": "valid" + }, + { + "tcId": 17, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "040b9d56422ed9c2082dd9d46d231fd0141f92e79f5a12da4c77c488c87363f944e6e3c2ec9779615f242bc30d1c28c1f984b8c252243f5f1eaa3d855e1cc2d8a6", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "3333333333333333333333333333333333333333333333333333333333333333", + "result": "valid" + }, + { + "tcId": 18, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "040507fabb16755f4885ae45b3d497822388f4e6a531de512c200480b4e56b892ab70746c1d8a20637eff17948e557a2b4da2562ba6b62991b426b7b3787a19693", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", + "result": "valid" + }, + { + "tcId": 19, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043b18caef2cd982c3b58f258cb76daa029383f42c8f3f083493f42c915935243a260830b7d25b66378c5d25fb0cf23d32527a2cdb7f7d7e6c89ebea8277738ed8", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f", + "result": "valid" + }, + { + "tcId": 20, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04123b1921231bee315e1ea66cb95318d6392f85695bbec03c334740ce7add768efec9a108770ff0eb448eee9f06367416d74b22a2f38157bb00d8c0be44ebf152", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0", + "result": "valid" + }, + { + "tcId": 21, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04924fb33985c8a687fc04c9dd05e531ca0e0223aa58d58351e922ef482043d30cf504745e769b6dcbefe404da37f717b3109d2af23450fcfe2f075c2dabbe7194", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00f9", + "result": "valid" + }, + { + "tcId": 22, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0422495c6884937a1bc05871e9ee1a2c43f8f14db19ee60bd2d89c4293042f5a9452cea27e6fe574a00e5f15fe11aa54f54ebd8bde3aa41c80bf9d5f7b1dc6efec", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00feff", + "result": "valid" + }, + { + "tcId": 23, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04f3cb6754b7e2a86d064dfb9f903185aaa4c92b481c2c1a1ff276303bbc4183e49c318599b0984c3563df339311fe143a7d921ee75b755a52c6f804f897b809f7", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff", + "result": "valid" + }, + { + "tcId": 24, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04a8d93bebbaf25fa9a1f98c44b54dbf28634a5fd08402dba5d9e4873f8123da1db972d91a0eabadb630b271e6551b757d969301beddd11f82decdfbe4f9657f50", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff7ffe", + "result": "valid" + }, + { + "tcId": 25, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048d0086e678a0fe7b4ad7bd4f94a38267b9f9f1d2b82452db4cfb335595c26c55f78476a00a0153941da0b0b81c834682edc9fcc8bc21a7b5bacb460dbb566c19", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000fffe", + "result": "valid" + }, + { + "tcId": 26, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0402a96834fe3b54d440003521f2355aea48d0bbc576473fecc6975100c589865263255764891ffc108cfe754af52a4362953955ddfadcf752637c11edeaa6a807", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000fffefffd", + "result": "valid" + }, + { + "tcId": 27, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048721294f9eb3ba69a13ae7d933fa51c48393fe1b9b9b17a08cecff2ee6ad434d2c23cd11d26694c472dda8cea4133bbc68e1f234bc7e8bffcea9446091855491", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "8000003ffffff0000007fffffe000000ffffffc000001ffffff8000003fffffc", + "result": "valid" + }, + { + "tcId": 28, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043e99ec3c58ac3898936e4a61182b198823c9992209f67bf5291aa354fceb2f1312952518636add666320c8b7fa631541d0ca50796dbff0c1e72f94718776bd60", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffdfffffe", + "result": "valid" + }, + { + "tcId": 29, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04e9484e58f3331b66ffed6d90cb1c78065fa28cfba5c7dd4352013d3252ee4277bd7503b045a38b4b247b32c59593580f39e6abfa376c3dca20cf7f9cfb659e13", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff", + "result": "valid" + }, + { + "tcId": 30, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04eb6eb532fe4af2a5a275ab4e9f728ae64e9dbc08e9359091d75e5334a6e08db64c146339c05d1d5782ebeeb86d3eb5c63e9f99f17187c039666c5237b736e9cd", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "fffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffbffffff", + "result": "valid" + }, + { + "tcId": 31, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048e7b50f7d8c44d5d3496c43141a502f4a43f153d03ad43eda8e39597f1d477b8647f3da67969b7f989ff4addc393515af40c82085ce1f2ee195412c6f583774f", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff", + "result": "valid" + }, + { + "tcId": 32, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0440d4f4f6d9a41ab6ea90d46610b924ab15ed4f259fd09ddd41a707782fa9e203a5080a7e118a50c4b3d2c43dcbbf35c39e276a0a50b33a9ffbe7c9095055fc25", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000fffffffc0000000fffffffc0000000fffffffc0000000fffffffbfffffff", + "result": "valid" + }, + { + "tcId": 33, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04a386ace573f87558a68ead2a20088e3fe928bdae9e109446f93a078c15741f0421261e6db2bf12106e4c6bf85b9581b4c0302a526222f90abc5a549206b11011", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff", + "result": "valid" + }, + { + "tcId": 34, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04739b5c2189729b577ba1a467a1a0851c556b860f6b2016bcd50beb22ee9c0d7961ea43cf1ea7aad1a2360b0f37a74ca532dc8d1af26cdf89a87d93dcaa0c9564", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "00fffffffe00000003fffffff80000000fffffffe00000003fffffff80000000", + "result": "valid" + }, + { + "tcId": 35, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "046c03f055f710aea89341f0ef7a1c6d5c45a50923ce8adb33c2520f7881547748691f4dafcf6d5df8d9e6afda66ca81718bea8171abc87036a9c370385b60d969", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "00000000ffffffff00000000ffffffff00000000ffffffff00000000fffffffc", + "result": "valid" + }, + { + "tcId": 36, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048a3f60cfec64745bf625696f2fe4b6e4ce8208954f4fc4da21f87f9f7a2c3275b54d90851b39707586dc6cceccc5e50a1e4a955463107d1d87c8252df2110d6d", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "result": "valid" + }, + { + "tcId": 37, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04c827fb930fd51d926086191b502af83abb5f717debc8de29897a3934b2571ca05990c0597b0b7a2e42febd56b13235d1d408d76ed2c93b3facf514d902f6910a", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "ffffffff00000000000000ffffffffffffff00000000000000ffffffffffffff", + "result": "valid" + }, + { + "tcId": 38, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04fc85bfee056478a1717582accd11ed49009891cbda5fe40b9f4c1742e127db2c97033f5f6405acfa57553f1e375a13e8d6e3a1151958c709be508e0bac7804d6", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "00000000ffffffffffffff00000000000000ffffffffffffff00000000000000", + "result": "valid" + }, + { + "tcId": 39, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0438bf171cdbd4e2e7128528db43d80655b789e69e6ba1d36b62e4e59d8ecf4c51bbe3244e4fbf79f24512f30c4a605314749e2f20d858ec961060a2cab467013f", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000ffffffffffffffff0000000000000000fffffffffffffffd", + "result": "valid" + }, + { + "tcId": 40, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04249f4f517d7788d4622d762c4312101fba71fe2657f1f2c33c0613d2e21890b778f32da1b61ed9385cd52f5e7103f77b01b403fb6537a0c0e866195d0a448f34", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffffffffffff0000000000000000ffffffffffffffff0000000000000000", + "result": "valid" + }, + { + "tcId": 41, + "comment": "shared secret has an x-coordinate of approx p//3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04e9c0af0bf6dadd8fbe04c5cf3fce80683a9c267b0dc9850cbc1bcdfeb744c3516efe878223dd9dd924e83e3ab22c9bf304129ab59c1f3d30fb58b8770bf9d9bf", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "5555555500000000555555555555555555555555aaaaaaaaaaaaaaaaaaaaaaab", + "result": "valid" + }, + { + "tcId": 42, + "comment": "shared secret has an x-coordinate of approx p//5", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "042b29f482bc43559f70447584919df1e03706ee63c987b6f7499ae29ab01ca828a4bd05d61f596e01623a8e2076c013889fbb0f9937e475a00ddd75e6a992e776", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "3333333300000000333333333333333333333333666666666666666666666666", + "result": "valid" + }, + { + "tcId": 43, + "comment": "shared secret has an x-coordinate of approx p//7", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "042766dc8e289fd27625d4765eb014aa54a44a7d5724050b9446e363071c260913aff9f1dc5e71b666501b24d70805cb8e1a01ee90ca84cb0c6f7ea453df85f520", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "249249246db6db6ddb6db6db6db6db6db6db6db7000000000000000000000000", + "result": "valid" + }, + { + "tcId": 44, + "comment": "shared secret has an x-coordinate of approx p//9", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04d33314f13a7fe8357bfd7a11799498e55bc782c6f434856d733b668e1d05448348dc5aae3f6431dd20c018f54b1d65fd1864ddfeea04ad7533971237c60ac0c7", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "1c71c71c5555555571c71c71c71c71c71c71c71c8e38e38e38e38e38e38e38e4", + "result": "valid" + }, + { + "tcId": 45, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043cbc1b31b43f17dc200dd70c2944c04c6cb1b082820c234a300b05b7763844c74fde0a4ef93887469793270eb2ff148287da9265b0334f9e2609aac16e8ad503", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffffffffffffffffffffeecf2230ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 46, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "042830d96489ae24b79cad425056e82746f9e3f419ab9aa21ca1fbb11c7325e7d318abe66f575ee8a2f1c4a80e35260ae82ad7d6f661d15f06967930a585097ef7", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000000111124f400000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 47, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04450b6b6e2097178e9d2850109518d28eb3b6ded2922a5452003bc2e4a4ec775c894e90f0df1b0e6cadb03b9de24f6a22d1bd0a4a58cd645c273cae1c619bfd61", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000001ea77d449ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 48, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffffffffffffffffffffeecf2230ffffffffffffffffffffffffffffffff00000001c7c30643abed0af0a49fe352cb483ff9b97dccdf427c658e8793240d", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "6fd26661851a8de3c6d06f834ef3acb8f2a5f9c136a985ffe10d5eeb51edcfa3", + "result": "valid" + }, + { + "tcId": 49, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000111124f4000000000000000000000000000000000000000d12d381b0760b1c50be8acf859385052c7f53cde67ce13759de3123a0", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f1f0e43b374feb7e7f96d4ffe7519fa8bb6c3cfd25f6f87dab2623d2a2d33851", + "result": "valid" + }, + { + "tcId": 50, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000001ea77d449ffffffffffffffffffffffffffffffff000000007afbc0b325e820646dec622fb558a51c342aa257f4b6a8ec5ddf144f", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "1b085213a9c89d353e1111af078c38c502b7b4771efba51f589b5be243417bdc", + "result": "valid" + }, + { + "tcId": 51, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043cbc1b31b43f17dc200dd70c2944c04c6cb1b082820c234a300b05b7763844c7b021f5b006c778ba686cd8f14d00eb7d78256d9b4fccb061d9f6553e91752afc", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffffffffffffffffffffeecf2230ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 52, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "042830d96489ae24b79cad425056e82746f9e3f419ab9aa21ca1fbb11c7325e7d3e754198fa8a1175e0e3b57f1cad9f517d528290a9e2ea0f96986cf5a7af68108", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000000111124f400000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 53, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04450b6b6e2097178e9d2850109518d28eb3b6ded2922a5452003bc2e4a4ec775c76b16f0e20e4f194524fc4621db095dd2e42f5b6a7329ba3d8c351e39e64029e", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000001ea77d449ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 54, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffffffffffffffffffffeecf2230fffffffffffffffffffffffffffffffffffffffd383cf9bd5412f50f5b601cad34b7c00746823320bd839a71786cdbf2", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "6fd26661851a8de3c6d06f834ef3acb8f2a5f9c136a985ffe10d5eeb51edcfa3", + "result": "valid" + }, + { + "tcId": 55, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000111124f400000000000000000000000000000000fffffff1ed2c7e5089f4e3af4175307a6c7afad480ac3219831ec8a621cedc5f", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f1f0e43b374feb7e7f96d4ffe7519fa8bb6c3cfd25f6f87dab2623d2a2d33851", + "result": "valid" + }, + { + "tcId": 56, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000001ea77d449fffffffffffffffffffffffffffffffffffffffe85043f4dda17df9b92139dd04aa75ae4cbd55da80b495713a220ebb0", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "1b085213a9c89d353e1111af078c38c502b7b4771efba51f589b5be243417bdc", + "result": "valid" + }, + { + "tcId": 57, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "049a0f0e3dd31417bbd9e298bc068ab6d5c36733af26ed67676f410c804b8b2ca1b02c82f3a61a376db795626e9400557112273a36cddb08caaa43953965454730", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffffffffffffffffffffca089011ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 58, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048e5d22d5e53ec797c55ecd68a08a7c3361cd99ca7fad1a68ea802a6a4cb58a918ea7a07023ef67677024bd3841e187c64b30a30a3750eb2ee873fbe58fa1357b", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000001f6bd1e500000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 59, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04293aa349b934ab2c839cf54b8a737df2304ef9b20fa494e31ad62b315dd6a53c118182b85ef466eb9a8e87f9661f7d017984c15ea82043f536d1ee6a6d95b509", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000002099f55d5ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 60, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffffffffffffffffffffca089011ffffffffffffffffffffffffffffffff267bfdf8a61148decd80283732dd4c1095e4bb40b9658408208dc1147fffffff", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "44236c8b9505a19d48774a3903c0292759b0f826e6ac092ff898d87e53d353fc", + "result": "valid" + }, + { + "tcId": 61, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000001f6bd1e5000000000000000000000000000000004096edd6871c320cb8a9f4531751105c97b4c257811bbc32963eaf39ffffffff", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "3ebbace1098a81949d5605dd94a7aa88dc396c2c23e01a9c8cca5bb07bfbb6a1", + "result": "valid" + }, + { + "tcId": 62, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000002099f55d5ffffffffffffffffffffffffffffffff152c1a22d823a27855ed03f8e2ab5038bb1df4d87e43865f2daf6948ffffffff", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "67cb63566c7ceb12fdd85ce9d2f77c359242bbaa0ea1bf3cf510a4a26591d1f1", + "result": "valid" + }, + { + "tcId": 63, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "049a0f0e3dd31417bbd9e298bc068ab6d5c36733af26ed67676f410c804b8b2ca14fd37d0b59e5c893486a9d916bffaa8eedd8c5ca3224f73555bc6ac69abab8cf", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "7fffffffffffffffffffffffca089011ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 64, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048e5d22d5e53ec797c55ecd68a08a7c3361cd99ca7fad1a68ea802a6a4cb58a9171585f8edc1098998fdb42c7be1e7839b4cf5cf6c8af14d1178c041a705eca84", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "0000000000000000000000001f6bd1e500000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 65, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04293aa349b934ab2c839cf54b8a737df2304ef9b20fa494e31ad62b315dd6a53cee7e7d46a10b99156571780699e082fe867b3ea257dfbc0ac92e1195926a4af6", + "private": "0a0d622a47e48f6bc1038ace438c6f528aa00ad2bd1da5f13ee46bf5f633d71a", + "shared": "000000000000000000000002099f55d5ffffffffffffffffffffffffffffffff", + "result": "valid" + }, + { + "tcId": 66, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffffffffffffffffffffca089011ffffffffffffffffffffffffffffffffd984020659eeb722327fd7c8cd22b3ef6a1b44c0469a7bf7df723eeb80000000", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "44236c8b9505a19d48774a3903c0292759b0f826e6ac092ff898d87e53d353fc", + "result": "valid" + }, + { + "tcId": 67, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000001f6bd1e500000000000000000000000000000000bf69122878e3cdf447560bace8aeefa3684b3da97ee443cd69c150c600000000", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "3ebbace1098a81949d5605dd94a7aa88dc396c2c23e01a9c8cca5bb07bfbb6a1", + "result": "valid" + }, + { + "tcId": 68, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000002099f55d5ffffffffffffffffffffffffffffffffead3e5dc27dc5d88aa12fc071d54afc744e20b2881bc79a0d25096b700000000", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "67cb63566c7ceb12fdd85ce9d2f77c359242bbaa0ea1bf3cf510a4a26591d1f1", + "result": "valid" + }, + { + "tcId": 69, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000066485c780e2f83d72433bd5d84a06bb6541c2af31dae871728bf856a174f93f4", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "cfe4077c8730b1c9384581d36bff5542bc417c9eff5c2afcb98cc8829b2ce848", + "result": "valid" + }, + { + "tcId": 70, + "comment": "ephemeral key has x-coordinate p-3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffff00000001000000000000000000000000fffffffffffffffffffffffc19719bebf6aea13f25c96dfd7c71f5225d4c8fc09eb5a0ab9f39e9178e55c121", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "4c25702d10cd12ec7e77c4f1979237976d6aa809c645d75a59d399a52377eb7b", + "result": "valid" + }, + { + "tcId": 71, + "comment": "ephemeral key has x-coordinate 2**16 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000000000000000001000073ca30641acabe581170b4d5253f7a342b039a87ab2447badad08ece2cf19f52", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "4cfd639fd80c84b935c33cfaacceeb256b2f7e273c3ae5f0ff92b74957376f22", + "result": "valid" + }, + { + "tcId": 72, + "comment": "ephemeral key has x-coordinate 2**32 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000100000000328bbc85099acc7685cf4bb5e18d72c57271615ccd46377bfacb0e8501aa76fb", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "581bb2ea633af1e59b15c1342d5e14adb58f613a231149f7df7a69c0eca95b2c", + "result": "valid" + }, + { + "tcId": 73, + "comment": "ephemeral key has x-coordinate 2**64 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000001000000000000000010048b687675af9815297d73a7f25b1a3c42d33c64b466991a7573b4954aa0b0", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "9920473de58a319ebd87d57f4f6c09093c5e0072c01bc8df0dc60b8a7a684c6f", + "result": "valid" + }, + { + "tcId": 74, + "comment": "ephemeral key has x-coordinate 2**96 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000000000000000000000000000000000010000000000000000000000007d12de58d54423eb85ae8d157ae416fb004a7eb522ac1b67047ef3cdf9acdc3f", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "d9cd0d10ed4d3dc01f4216d229e21c6a447227a5bc2592c359b2d689a2dee3a8", + "result": "valid" + }, + { + "tcId": 75, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = -3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "046522aed9ea48f2623b8eeae3e213b99da32e74c9421835804d374ce28fcca6622c7fda3c84b704f27ffc0b2ab350d8cbc33a34df0c811155ed4389d2710e3fa9", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "af8bc612853197a6ee8b4af7300c0bc623f0cf4e4b301f47d66c27e8ecce9268", + "result": "valid" + }, + { + "tcId": 76, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04507442007322aa895340cba4abc2d730bfd0b16c2c79a46815f8780d2c55a2dd4619d69f9940f51663aa12381bc7cf678bd1a72a49fbc11b0b69cb22d1af9f2d", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "4e173a80907f361fe5a5d335ba7685d5eba93e9dfc8d8fcdb1dcd2d2bde27507", + "result": "valid" + }, + { + "tcId": 77, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 5", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04085ec5a4af40176b63189069aeffcb229c96d3e046e0283ed2f9dac21b15ad3c7859f97cb6e203f46bf3438f61282325e94e681b60b5669788aeb0655bf19d38", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "d874b55678d0a04d216c31b02f3ad1f30c92caaf168f34e3a743356d9276e993", + "result": "valid" + }, + { + "tcId": 78, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 7", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04190c25f88ad9ae3a098e6cffe6fd0b1bea42114eb0cedd5868a45c5fe277dff321b8342ef077bc6724112403eaee5a15b4c31a71589f02ded09cd99cc5db9c83", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "11a8582057463fc76fda3ab8087eb0a420b0d601bb3134165a369646931e52a6", + "result": "valid" + }, + { + "tcId": 79, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 8", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "045f177bfe19baaaee597e68b6a87a519e805e9d28a70cb72fd40f0fe5a754ba4562ca1103f70a2006cd1f67f5f6a3580b29dc446abc90e0e910c1e05a9aa788cd", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "73220471ec8bad99a297db488a34a259f9bc891ffaf09922e6b5001f5df67018", + "result": "valid" + }, + { + "tcId": 80, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 2**96 + 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "043476a8fa9c7448124aa945a2e1103eb91f95c7b4d91aaa1c35b8965191fc0fe04ddac138688df5123fa5760d670247893f9ad5cad5e88895a0ae7fdf97b8f412", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f4e5f1757c8a03a3aec57b598b66a93bb356a6917e26b60489c0d06236ac6a37", + "result": "valid" + }, + { + "tcId": 81, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0455555555555555555555555555555555555555555555555555555555555555540a46712790e63f981f0103b2a609fa691c5291a17974eb0c3b518faac21535d6", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "be033e3db6216d3b3f9d66c96ca3b24475813ba8eb7820d7d6ff29c72fd39c64", + "result": "valid" + }, + { + "tcId": 82, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa9389142d4676cee2332eb8909fa13f95f20cdb3acc831a231802a4858a973ca63", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "a0da0b184f59ab0fdc0a6b03157c1b75269b284608b74a6e826f77104c42a9bd", + "result": "valid" + }, + { + "tcId": 83, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04333333333333333333333333333333333333333333333333333333333333333311489212aff79cbed5b6440161d57c98a34e6b80ec3854c3b2855af35f0d17e1", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "ac03527f79d801081da4c0adcbba92e983ed46254354fd98e23ab659ee02a6cd", + "result": "valid" + }, + { + "tcId": 84, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc75552486fd8e6bc424492204207fece59d93fb124390497f841d9c808c8cc3ec", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "0d2759dae57c906a8cca8541a56f429a6ffedf028212f7f0ad06b696ee655caf", + "result": "valid" + }, + { + "tcId": 85, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f03425ba0d8a018b42861e816c79a17d3b47df8f5f7107c181168e9edc62cb3cf", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "ff6e930d08290769ef982bc568b0b45f88b7d5219b00667820793b3e824c1615", + "result": "valid" + }, + { + "tcId": 86, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f017b41bf72c9f5ec204dba0deb5dfaa43b793a83b243060d0375b969e0416bd56", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "bd106c43e45272091553f476e015fbb0982764c018d5f0666834ae0dc5dca131", + "result": "valid" + }, + { + "tcId": 87, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00f918461138bca461c00fc474da0e4e35309be520e2e109e17a1cecb892b96598f6", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "b661d2bf35efdd264f32a3bb254cd6443e8115a297aba1d31610495d7c560dd5", + "result": "valid" + }, + { + "tcId": 88, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00feff2d6c62a47883c5899cac06b1367c21948689d522674a60f43f4b808adf618b0b", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "e818ea3c65c24330b7b8894680fe349b17f450e9d878292f1390ead78085ed1f", + "result": "valid" + }, + { + "tcId": 89, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff2e2213caf03033e0fd0f7951154f6e6c3a9244a72faca65e9ce9eeb5c8e1cea9", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "55d0a203e22ffb523c8d2705060cee9d28308b51f184beefc518cff690bad346", + "result": "valid" + }, + { + "tcId": 90, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "048000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff7ffe1d3b684a87958143f250bf5a2f7859fd036620b4dc18dacd1d0c8c42eeb2e54a", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "50af11f10d130df5f9adcdd0103ff3d42808582487330932c2546022bf7c6a18", + "result": "valid" + }, + { + "tcId": 91, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000fffe7ccb5c10c028f331230dd0a005e9faf37864c198c5bf7d91bdd71624520d4b04", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "ec90224ee61b2ed7cb6b9716e248aa099dbf1eae41d1ca477e8e5ba4a512913e", + "result": "valid" + }, + { + "tcId": 92, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000fffefffd620bbe0a621748ea2b0e0dfa463169e7c805412f4374dc9755c4db93989a7529", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "cf1acfa0595265623fbfee5d8498e609b6590760d1b04f31f3470cd1af3ba9dd", + "result": "valid" + }, + { + "tcId": 93, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "048000003ffffff0000007fffffe000000ffffffc000001ffffff8000003fffffc0c3527bd081c1c07b313bc1a0c3f845fb2fe22557699ccc8f1354e61a27b7f88", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "967e55f853dad60f678bd35a46bd3c7dc6cf7d18526ac0890af80ade84461005", + "result": "valid" + }, + { + "tcId": 94, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffdfffffe232aa1c67f77cfb00e73898cf431831073c6b2a4bfa1135881a0595720759ece", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f21a20024d8315ae877f90af5b0c68b6a50214fea797942870c35f4ca127e591", + "result": "valid" + }, + { + "tcId": 95, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff1582fa32e2d4a89dfcfb3d0b149f667dba3329490f4d64ee2ad586c0c9e8c508", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "06fa1059935e47a9fd667e13f469614eb257cc9a7e3fc599bfb92780d59b146d", + "result": "valid" + }, + { + "tcId": 96, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04fffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffbffffff73f471909cfde3db2c13523bcf372877c28d23ed1ff6a3326df6bbc4b756723e", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "2e83d496538e7bd16b530d93b960317394b5f8b9da5128a03d08b3c8fbb46561", + "result": "valid" + }, + { + "tcId": 97, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff2c63650e6a5d332e2987dd09a79008e8faabbd37e49cb016bfb92c8cd0f5da77", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "e3c18e7d7377dc540bc45c08d389bdbe255fa80ca8faf1ef6b94d52049987d21", + "result": "valid" + }, + { + "tcId": 98, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000fffffffc0000000fffffffc0000000fffffffc0000000fffffffbfffffff71664ef90d87525ddf7815e676ae3b96c25ed9e7bdaa05da96227a1fe38c3d11", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "bc0a152832a8972bbeceb522e661e5249cc7455bf93cba324e810ab62a2e58c1", + "result": "valid" + }, + { + "tcId": 99, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff5df80fc6cae26b6c1952fbd00ed174ee1209d069335f5b48588e29e80b9191ad", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f503ac65637e0f17cb4408961cb882c875e4c6ef7a548d2d52d8c2f681838c55", + "result": "valid" + }, + { + "tcId": 100, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400fffffffe00000003fffffff80000000fffffffe00000003fffffff8000000007bc25fb4d2b4cd12a16515725d64cdbd5bc86b7f84ef005c9e51d0700a3a4b8", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "68e8765c71a63f3458e8edb2e52f499a1de13ae1ff1c95f18c4adad9d898667a", + "result": "valid" + }, + { + "tcId": 101, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000ffffffff00000000ffffffff00000000ffffffff00000000fffffffc4de9de6942e770033f5f1defbb36249e6bdf45a33e2ef4ec75a7ad880b5432c8", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "4060db7a9bf8ca17a5ffa614a85f9a25ed6f1854dc0f2396b9e8439ea8807a55", + "result": "valid" + }, + { + "tcId": 102, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000462e0f7377a81a3a47a28e62dd8105687e457496c61fdce49ba1aaeefcf10b44", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "9e6b02ef374c5b7c8d1021d1e0520ef5f6e3cb7e454d6630bd270decc0343f1e", + "result": "valid" + }, + { + "tcId": 103, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffff00000000000000ffffffffffffff00000000000000ffffffffffffff7a116c964a4cd60668bf89cffe157714a3ce21b93b3ca607c8a5b93ac54ffc0a", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "516d6d329b095a7c7e93b4023d4d05020c1445ef1ddcb3347b3a27d7d7f57265", + "result": "valid" + }, + { + "tcId": 104, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000ffffffffffffff00000000000000ffffffffffffff0000000000000012a69aaa5d3ac4cee07592ea0989dd9f426a0e4d16807b6c6d04baa628a659c0", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "e7e84fa13b2c443d0a5c3ea60cf87e772c7faf9f18ef5a0d77113dd6c92c8d17", + "result": "valid" + }, + { + "tcId": 105, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000ffffffffffffffff0000000000000000fffffffffffffffd137bd006820a8be23475ea25d8fa05c8ed47fca1236cd5d1f07667db6fcd2979", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "6c7b3006dccdb0b021f00307200793374419358b1367800ace76d988b10ff699", + "result": "valid" + }, + { + "tcId": 106, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffffffffffff0000000000000000ffffffffffffffff0000000000000000322a5313a994312a3f047d5a9c6cdeda173f1d3b35143b3b1a594f7dbe544d0e", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "b522e81a22720c57040f2e02781728577cb5603ea280be7a1c84750e33d7c963", + "result": "valid" + }, + { + "tcId": 107, + "comment": "ephemeral key has an x-coordinate of approx p//3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "045555555500000000555555555555555555555555aaaaaaaaaaaaaaaaaaaaaaab79dfbfa5e66fbea30e75ecc703e65db43e027416c01f6e20fe129be0e43457d8", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "f9ee8b2b668e2a76ed66dfc57006b6403ef8e388c066a0b0493ee0425f8dbe3e", + "result": "valid" + }, + { + "tcId": 108, + "comment": "ephemeral key has an x-coordinate of approx p//5", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04333333330000000033333333333333333333333366666666666666666666666610a4ea9bc365e1b224b173e9fd688a5234932ec90a5cb9ecc0a22a109927e73b", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "1b78098993807e9df54800e2c0f836ea1c4604f7b3c9401311784f69ac4657bb", + "result": "valid" + }, + { + "tcId": 109, + "comment": "ephemeral key has an x-coordinate of approx p//7", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04249249246db6db6ddb6db6db6db6db6db6db6db70000000000000000000000005ebbe906d14cfa3e7e90d397973f093a6c678a23bcb2896189ffece5a1ca398e", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "7ee2972f263079a49b5bfc664bcf42c2573af3514340e8e726e08881aa2d33b1", + "result": "valid" + }, + { + "tcId": 110, + "comment": "ephemeral key has an x-coordinate of approx p//9", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "041c71c71c5555555571c71c71c71c71c71c71c71c8e38e38e38e38e38e38e38e46ef488581fbbd6b4ef78d03cdd161272243fdcc10979fd8e8fd199b98a63d378", + "private": "55d55f11bb8da1ea318bca7266f0376662441ea87270aa2077f1b770c4854a48", + "shared": "7b5020080ce9bd76083ff132dc28ea996314be1a4ac21f987fbbe859f902fab1", + "result": "valid" + }, + { + "tcId": 111, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04851eb1b8699d1cc01c6b6048139797dab3981c924f9ef81bd1f464c3182c870901285b2ae7cbcabfd5bccb9441eb3376b491595f60a1ec21dbe9f972bc32abbe", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "6d03fef6b354840f4642fba1c8fce9f7d1cda8ae27b6ca01510fb44573fdaffb", + "result": "valid" + }, + { + "tcId": 112, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f576e22747f6c77a8f685a7a7b527363e0fe7d351a9e3f5923fff2bf97e91af41e575d400331cfc9f97180d8a48c418c5a982609fab88937d2590bfdaf37d6a4", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "98009cee0e8ea4fb42dfb70a5ada46ece32e2885a4f9c3a6afba13e82f87e113", + "result": "valid" + }, + { + "tcId": 113, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04310785fa42c37bd200781d70e3859b39b2fa1d286a3b6c4f605a41e045634b81b8d32564a7a232c5d47407a7795c01eda819f23a5a190149eb8c9abf94ed7c49", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "e8f0e427cc30ae50197d2bbf3a451667a470797d5abe55ff1b1d6de88e41372c", + "result": "valid" + }, + { + "tcId": 114, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0481bfb55b010b1bdf08b8d9d8590087aa278e28febff3b05632eeff09011c5579732d0e65267ea28b7af8cfcb148936c2af8664cbb4f04e188148a1457400c2a7", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b485f3364354b738dc5402729b880c90c502d9ab52ccf81e3d21602c7b9bd909", + "result": "valid" + }, + { + "tcId": 115, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0402495ac9f43e45aae30d3366e351cc08828cf3e11cc3b7209fbd1730c4a14f4e4aaa98dbe0d94caa44538fcf7949eb44debb7bcd228a54d9cd9b3c2eddf94611", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e5781ddaf18dcfc33f4879a2660b7a32a599fc32ea5a1beb28a48caa3e6ec7b7", + "result": "valid" + }, + { + "tcId": 116, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04efe7754ed4c0b3c1dd301bc1ed69800aa2ff5d51fb85937715e60d2e7bcada8e4ea7e547a04c3869106b56245c27da9737b9e8160c05fb0d86040276708fb9fb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b5a0ec92aecc3010d27d2263d3da66e3d2f3395d23947024a3f4744454622027", + "result": "valid" + }, + { + "tcId": 117, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0466aeda76d73983caf2de921af389268ceffd278fb9eccf928702b1f4271b43f1d646d6cf8bc11a0ef97cd64c08a11f72f94af4e6b3c9870b8eb3a5b036c04fb8", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "8462e9df7960ece33089e5a98d61da4faaf3660f93d75f7cc5e397b64cd1591d", + "result": "valid" + }, + { + "tcId": 118, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f483602787972cf7b7582d8e2f2c7998e537ca57eba69718b68d96240f035b1b55dcb4f7be7b79c469ba8a0b104900d7053ffcac04f394be925fe0cff2e969c3", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "d44d05d246e61892c1056e28865f60574dbeb6be62680776a537b0b2c3e6b4dc", + "result": "valid" + }, + { + "tcId": 119, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04579be77fa6698c4baf0132d2f7993ed76dfd36d78b584605e1be024595e3ad51c069473e1b25fd94a42b68ccb3004a851593a3af78f922d90920d8a877c365f3", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "0550ab2f9500b8580dad07073506da9b2db71bd974a85f81dfd148e260bc8ec1", + "result": "valid" + }, + { + "tcId": 120, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047f8128d883be31873efedab699206f889b776be270e163df43035409fa5215f1f36c3581f8f8d569a4323f8700ca09792150421521e2ef0a96ae9a4caed0e02c", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "1312f05b3e5cae60f27c9485cfd00584cce3f961fee2fdf103c32a79ba17ffbb", + "result": "valid" + }, + { + "tcId": 121, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ee5d94bfb5db9cfe511a3aa70bafc93db93107383c12f5bebffd90c621a2051db4fce13261d54ab29c3c699b77358edb54c71801f3fe2a0d5cdf2ee3f184b4d6", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "be4792922519717e235366d64709c51b027d440c6fb8c216fbd92498aaf71277", + "result": "valid" + }, + { + "tcId": 122, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040ec4f8845226e864c088505d721a2155190d4caa9a1f5a3f0afdf2ff49cf6d8bad01fd3808aa03442cf5396e10e13efd24cbd5a52862822eb62dfd27b5040600", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "05a2ed58207e0d6a99f37a6da640f8b3b1acaf0c16826bc4fd1eb1e2a6a1534c", + "result": "valid" + }, + { + "tcId": 123, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043107892f3427842c8d6aa60afb1d3b1441e28a67f10e1198a07265125bbda7e2ca9d6df758904f2207cddb862806af0b8cb66ad72b161b4dc959acf614fc2f90", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "def48de01d86d7260e5c2a6439068542437a20b140dcd45623dd1ec0d1394742", + "result": "valid" + }, + { + "tcId": 124, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0409e5c414b7f5073858553b8b8b4295488e3f3ab966581f240a6124251512270f8fc12563fb9bd6f97b445417cfb14cf9944bac1a26c176b532b698ea8c1bed6f", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "c06f7373e67ee8c64dd86127fff8b2d23d284420d30e571a79fbb9b54aa70dfe", + "result": "valid" + }, + { + "tcId": 125, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f93b07969211cafc1a30c5c578c8bf35be63a04daa2ba434da8b5e4b83769ef554b022e4f7f406bc93e71a8719ad0ccc392755ceb274e248829a72540e95f169", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "7a966ea1fd7c32b1fe01eb14b50d835d92c31f0a4204517aea66939e7106cc1c", + "result": "valid" + }, + { + "tcId": 126, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04513609657f902924e921dab1411685316b41d2bfc0be53d1de49db9c1ca78e55141d36501aac4b47dbf24fad43e47bac111596c05f66ef69258ddf0227e8e7ad", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "27347a05a945862499ce29fa7f6e4b2c496b6984b3936db3da2a5b82c4fe6302", + "result": "valid" + }, + { + "tcId": 127, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0493ebaf5ecc0aa486e7e735130611ab5b165fe395a4f1ea8f82097ce422f44202ae855c1eb4c334f53b87e426801a0376837db2c86137522894ef6d9d69520163", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "4f04382598f2288f95fda3657d5e517b5f8885f2257d12b3efabb624ad5d2626", + "result": "valid" + }, + { + "tcId": 128, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0411fd00b18efc4efa07e87878b5df2e7a596f93b950e50e9adda40d4e6ac854c0cc47edcf533fe03a614c03a709c9d0c0cf8dbfd4e2140b5b2df23848b49548c2", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "3b50f822d5c9311735fdb358e8c6fb2e4aa695656d75f84f151cbbdc40f7f259", + "result": "valid" + }, + { + "tcId": 129, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04501a72044f83c517316628b0bc9d89ab82131bc12df36c7a42b952d5bc23c85182ba2906e104dd0a7eed7b0b1772e12b3b3b7f40a2df049174fab09a02a1a5bf", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "ac45cd4afa8a5e4e4a0e3f60e7bfea0b759875781aa7722750022e02b66e1303", + "result": "valid" + }, + { + "tcId": 130, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041f3d7d05b846eab4dac4db695a441f194c226821f5429f66aba4ae0e6ba5b90400334b91fd4073d1b7c354bd62f6bced7cdbbbd7c2d392b03ac1fe52df084069", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "8682d123138dbb4dc40451478b078596e5b19c8b1b5c68c2a8a3b046873bfe6e", + "result": "valid" + }, + { + "tcId": 131, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0411ccde06e8de88d192897fd0f7bb5896553a524df319e4594a55623bc76462e122a170de0b9442314a947fbf5e035880b562ef88e3ac98594f48abc63741337b", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "246a119990f295924b62b290e591f428054c2d34314c54ee50dd3d85ed5516be", + "result": "valid" + }, + { + "tcId": 132, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04594b085272f89fae6813fd3944baddbb9f2b18236273cdabf3e607a73714a252956035b2531b98fdafa63ee7e72752ef03caa9ebbb1697a18e6d31e149485e5d", + "private": "00e461c5b5e63d75b4c8c123bf8b9cd45e712af08f7e2e494a8f255ac9d80e058b", + "shared": "343c4a2c74e9416b07c855c2ec5ab053e11b51c47389d8455d6175e24f513717", + "result": "valid" + }, + { + "tcId": 133, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048238f048c292e08d49bdb5dab1f08da6d39cdbefb1d75e03e76048b903d6baf9c761b25afbf041e0e65eb9e013c336fbfc364134355fd10a86c258de3e19a857", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "81fa8ca50ac155200de410dfdfd8093037674baba7ca102828a5d0026f24f0f5", + "result": "valid" + }, + { + "tcId": 134, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042d08cf1230463b7102e8a54185986a62a3f2520c0c151ace12f5d073a40cbb2fecb8c2ed0a722185e987cf7c32acc42133f6ddb7230ea48dc0f7c6b5a43a4c0f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "151411c3b8e6d25c515186c1d9b9c6e1a05da5a7f09cd4ea8844e0916846ba48", + "result": "valid" + }, + { + "tcId": 135, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bcd1f2a75eee0baf7e0f55bbb1c876966d9d5d21f02a145ac9668491e4ca5e511c5be74b4082596f2c6cdbdb6cc9083895f333cee8075c2650963e7e727906e6", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f72d64d6b5e38ae223c77ad3467818f8b03b9535011400157a5f426c4a512fa1", + "result": "valid" + }, + { + "tcId": 136, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044700bc548e9d6256ece382112b93f8780fd2e427f690c35bf31f682284119c725ea408d7fc6599bd2b0e754f9de166ea47a4e48b14925fa7bb635ef09642af05", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "108a89a0bc8e1b85981fe4853a86a42648ccbe6855dda1079136db8c59fc2065", + "result": "valid" + }, + { + "tcId": 137, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a0b351864a8c47ba445634bc107fed06451f97391c55921db61e74ca527a6a45fab27b1896d52df4611f627414c48ba7a131766002d5523ff883a499769a422b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7d362a6e1f00e525fbf012fcc9da98e09ddc281c143f1e023fac6a6b6303341f", + "result": "valid" + }, + { + "tcId": 138, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041350cac374bb076ee89eb8af43d076afc7312021006431fd909d22df064f6637244f236a65e7c1c778f6cac2d9b4ec3bd999ac185797a227cf00552d6aa5163a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1de1656d961de1f584a2f7179bd3be3b4a282cbd3248f29e74b73a812cad8d90", + "result": "valid" + }, + { + "tcId": 139, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c185508f464f67aacc24fa859e744fe57c3ecef2fa911c16dd2cbd073b308aaa8fef47dcef6b0fba6205f0b7e23d17758f1df5401cd9a39de42b07b92d153625", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "56ae038f61abb293f43328a5e6e40bdf73f9e7d5868e5bf1af3b03fafa559e86", + "result": "valid" + }, + { + "tcId": 140, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dccff194a9d307b5900a13f2d7a192f6e82845af1007c951b5b9720bff98d0a028fb8ba9238ad537e0d7f31444086611430abaea547913a0591dd908ecd864b5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c75eb0a2cd617f0117f1d9adc1056a0252a0cca0b64b373bb30d5231380415ca", + "result": "valid" + }, + { + "tcId": 141, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040cb05cb7a4b01db1382620ca756285e1a7c6846bbb595cbbac9f89e0a62489cca88829c95f6b2e8187d2e1c3a744f41d3ebc98fa01748b1248462b350256a5e8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "010385fdf7f4c6402ae432e4b2f11f2f861c75c4dd27b4f35b7f1efa94bbeecf", + "result": "valid" + }, + { + "tcId": 142, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f95894cfe4f14ccc483adf9cdf106709e3eca5ceb20e7c145d3bf18b6aeaa8039c42c0c8c3db57e0bbb2593ebe088771ebd0e2857fc2a877c3748adacd038542", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "af116b172237915370625d3ca7360a6b6d651c573031ac33c0ce4b72a9427a7c", + "result": "valid" + }, + { + "tcId": 143, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0416a8b93a6b9529b5920566131a792c554ac421af3a4bfc341408d14ddc8971c5f60ea4663449bf3ec747481d730c4d97a1565b5bb207e27e55aec88969f2023e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "10c3a41e0a1d0018444bbc3bcf76b2893f66b69cfb046255c82a17ffa3413246", + "result": "valid" + }, + { + "tcId": 144, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047d9c0f7a011de080da8e6e225f7211e729c29425c9dc9a289d5cf8a0f63589aa129b3bfcb433ff084409e32f73741e592913003367123b3e6ec4b7fc398d1b29", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2695b4e4a5c648ec17905e69286b6d4935a21772f5ded1e55136cf17331de9d5", + "result": "valid" + }, + { + "tcId": 145, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fea54580f4096299c17c281a3fcf6738226b636c85e8efd360a4413848b07881fd47181ae8c3ad8948f65d8c845a863b2f86a6ce8aa37a5e5c20d3e96fc9c884", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a6f648ff3373f9433a21a38829a5667ccc2b1bcd3de13516537d6d9b77c04044", + "result": "valid" + }, + { + "tcId": 146, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0408beacc04ac27e3839ce74d515d238aa98e1aa1b5e580fc5fae0116e520d880cba0585f723c44f243813b07e2d7626605ee5861523d1ac075479da773efe026e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e1db68841b6000deba2e9a666ab2cd227fd9f33f69187b611dafec0d6c9b6e7e", + "result": "valid" + }, + { + "tcId": 147, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048cc2807089ccab7bdfbf1697f153d4eea63f3043ce63135f6b906f8235f76bf99ebdb2c26b09f49b122d1ac73a8ba37ce9c385c0269c4e40ac3a9c20314a4437", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "36648fd5e125abe08ae21199d08eb78eb7e345a1fb3b26e5fd25d3c1e96e3bb5", + "result": "valid" + }, + { + "tcId": 148, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e854fed884e6c76277af9d8dc83df66b81478a8ffff2c313f22abf0f8d4442f50f57244419b2075ce2b282440944213d87c50f58b9e7b71765d45fcad152b333", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "418df7a1a6315f55104b5b9f96da454725f59992c588a531e80a4744b8d7d4b8", + "result": "valid" + }, + { + "tcId": 149, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c1f319279a7bae9f3dc527c42308a7a6255763cccd6f24d266e75f88eb4d022f6b3a3cf14ed3b5e6915ff322b705b175da07223cff4e9ad4520dec7028e1e396", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "32dda9876dcac25c58543304a2cf6c1b31fdabf3c89e43d6eee628a02422b19c", + "result": "valid" + }, + { + "tcId": 150, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044753ee2e3ac201e9a4bf25e31513a45365b5d0526dcb2e0a88736fc8ae2681c1cc49b1e868d4de224593ec7e00e9f2c209f3b935428d3bfa978f74869af889e2", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4c54d63b14b8ff10b653f663f3230c1827d682c833ead1f44ad6ae8e7df35e2d", + "result": "valid" + }, + { + "tcId": 151, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0429c1e774c9d3a8930df8a663fadc8b9a6092d8054ff37adf598edd78d0a3ffc57173a3594be68b7ad191e0ff27d79eb4e7bb22f1090873cf307cd073b27368fc", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4df3a98474884b1c3c78b6c81e4f90d53d8bb4daba4227c411a5747e6aac8cb8", + "result": "valid" + }, + { + "tcId": 152, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04893cb0c308aaa2092d9af93e0f02cd951ec386e866480eece443cc89e672733ff6c6f43caa1e1d168ba3ead9ea041cf4f227d76b90e9e25f497f2ece8935512b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d2aa087051fbdc35051d21ff415f934ab5698629abde5d4b39f2f6a76e3992cf", + "result": "valid" + }, + { + "tcId": 153, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c5a2dc340e0983aad4f895bf54be9d9e176d6ba1ba6c859ca0851889a97b7dc5c90dab79207b861fd996429639cd8f31be0298b63f4934923a483a9e6f7c5ab9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ac7c60651653a4f3d4478ebb9aec4381183ffe1b152b6643c07c47c0b2a489cd", + "result": "valid" + }, + { + "tcId": 154, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e9db2cf8037505fd8a8044f4b3f80f67f9688815c69c788ddb26fcb3c84cb8adf02e121e4020424c6d8f1d269c00f2a7f23a59237fb48a5ba17ee57c1c264282", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "509d06dc43813dba9114c13c337bdc0bccc2c7dfa7a7d8960e5593c52849c855", + "result": "valid" + }, + { + "tcId": 155, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04776aef1acb82b628e132cc29440988f0a15d4cc2b4f328aecb063c9b86e5018e91bb2038fbbb05573b1c943de8bae0853d6a934d4d164429aa145d68e9c2e0cb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "28a88b6b258f233020ba6fa9c00d1d72831f4515b86966a9782f521315e18aa7", + "result": "valid" + }, + { + "tcId": 156, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049ec06b0b08662c0e1dd9111696a63a1601cc83cee20695778adf84d43064fc90ea9ffe0e7b32c3e30e5f7809d9acc49a8da7b77742c2a3d3660f1cee1dd4be19", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c4ff865ff3dc4953ea78d92a02f3345a53bdb6050cfd8f41baa4395ecb6acab8", + "result": "valid" + }, + { + "tcId": 157, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fa51d128adc2000f09ff12c6fd8e25aa08556d708bf6b0ffff9e8eaad4783f0d1dd40ad51ae91e0ab471f2f6067052b1afe96a57cf5e4ddf899a6258f81c332f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "de1069f051637e10166559cef44688afc809341855261215c4f381d9d7da76ca", + "result": "valid" + }, + { + "tcId": 158, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04614dcfbea4789a3f3eb4a8e2f111c887f0248d9316b99d0864c927a045d69417ac5f8c4001f7b6e67faf5b2692f745b86f51e725c1080f15330a631ef6a503ab", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4207bf4159faa0e50ed238b9c0ff46194a539a1ba03a5a4c8d68f369aecd31a5", + "result": "valid" + }, + { + "tcId": 159, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048321763f5533310a4779e83a58ff110480394690f7c2f65fc229c1a58ffbddc86d170141a108fc92f2bb96ddcea0652cb650c5e863af9289d37ae87a29022d9f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7c8e29caa01e9f325e1e70d71a59850749239adf4e1b8fa5d6d0abd70c83afb7", + "result": "valid" + }, + { + "tcId": 160, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04aa42c977da1ed42e52041c0af2c090f244b22ae354cc9b10781e44c89eebe336f7100a0eac8b55513ce57a8d0c195adcf50d1b05fd35b0576cd92805cbab4c1f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "98afbf6e00eb004c79657b40b7105f8526b5205942af2218f453bc26337306be", + "result": "valid" + }, + { + "tcId": 161, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040730d77d9114d5610d49a98dc196ca9e1e8fd2abe007da96b574f736bf1939258c8814055a774f7e79f7b4fb9cfb03d839566afc6059311f3d55d49ca4ddab31", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c537409021ad95646fbccf9232ea47fa764d12db7595f436a65ad5b13cdd19f8", + "result": "valid" + }, + { + "tcId": 162, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0485a82fabb60c7664e2500c59d0f24eac1aab0060c07b49828c55009fd27aa49647b85f72b467bfa2fe1b13258feb121aee75a3155b30e8b4b566b610f13b6dc5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ad60146b1cf2d9661884b9ef867cbb09e42466563936b03174efd8517ca8c6e0", + "result": "valid" + }, + { + "tcId": 163, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04833f2a6e5c76c3ddd13a106cee4aa8b2a9dc32e0bd7bbe2a6322abe0ab4110a2ab93845403808a7cc8e8b65fa42da414327ec3a19d539fc033ba8d8aae7cb23f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f677a03d68570cf6083a1ba415b40b5f7ffdace4eeb804983cbd03b979d939b2", + "result": "valid" + }, + { + "tcId": 164, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cf8116ba0901b0b95308bc686fed90ceba0e5d424c8ec206cab8d7cffe93fba2d5e7a62cdeab84a20fce37b5b0ac168ca2a85a1d18cb04ee48deb250b54691aa", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "30c9fb67a3db93a4b3a54135d265171a14a2a0a79cd715e13515510793d8d081", + "result": "valid" + }, + { + "tcId": 165, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e754cdf8e56944d5bd36d025b1c0f5fb2754a2eee0fb5200bd169cdfc83f07c38f2b7881de647c2c66294e1adf767e515adda742d3a863f0cdd6665b964e60a3", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "8451f3414247058c32b53be128cffd2f2887434ab902b67b05fbbe7aeed8cbd1", + "result": "valid" + }, + { + "tcId": 166, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0474f1feb9a641fd87a49e16fbb1be363297ef971213bc7d36b6abbf29d0e88ac34b6c246b313be6c3c9f33defd4ade947af547168f7c22278df8cb7b06a8018c5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "dd6bf055a9e431479707e64590fc58f97ad3238d063ce8f66d5d37b2e3475638", + "result": "valid" + }, + { + "tcId": 167, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049368066a0748867a7b870244f5c9f82ea8bd51552959dd550bb7394497159a5dbf89b521e51db372c0bcd11fee41682cecf8e702f5956f1274efee4dfcb2f65f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4529f4b631c9984ab216a6801281fc4fd8731a58b65ca8d07bff07811116371f", + "result": "valid" + }, + { + "tcId": 168, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0464e5d7b0f7fcf4c9c16156cb8745c43995f823e7e10954131e61f9fa09059e2c2f7a39dd0dc6e8a9bb7cc79d821e7c749963dd97c7070129db638c0dd1ba053a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "12aeb42630e4885a93cac090c66479d011a1fdfaa46c0db33e0fd51e1e573cd8", + "result": "valid" + }, + { + "tcId": 169, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043da0655a52e3d6857a39faef864cee42f1816bd8d83af8c657990846821f00228f76d10162e295fd7737d0d22fafbab24d5db0ff432b51354030e1fb09273c51", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ad8deae400ae52dfc8d5ecd3518d78c789b3ec88cc1ec7719081a066def26c4e", + "result": "valid" + }, + { + "tcId": 170, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0442e831d5dfd2b9f5387263cd686ee03dfa235cbc07f6f3a87a7e8150556362b32be47f8e3011572855ca487ffb594f7722ef9fc3292902a23146c19bbf6da76a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e6d3991eecb1a4b78aa700ea56934a38785b3662c59766e2ee5b157f77ecbb7c", + "result": "valid" + }, + { + "tcId": 171, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041321838efd80e1dd8e4d0d95d17895c7dc60303a5c234182b592d9d21ef14752a44eaf3394c63708763f3b97b2d2863fd3b77ebda44862c7c23daaa437d5fe59", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "99bfe73eaba2599e79307488047236de003e9fd26f5ff1dbef62b3fec75fd612", + "result": "valid" + }, + { + "tcId": 172, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042407bb2cef161472cc799db14e703183676f312c571e9f3df137f55df9442c4077bf00500aa7bece8c1f762ff08a0ec71bfdadfaf13380704e6202de62c5f22f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "faedeb03f8b5178db58604ab69b10b176e92c5deccf4249a9d60010dcd16a635", + "result": "valid" + }, + { + "tcId": 173, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042477b9ec12029a86f50cd95dda6cead7a34f1c2360f39e3d1159793c8ee663a6bcfed85bd19d4ed3855807267e39156413b41e39a701d8d17a23ac685fe5360c", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "47e5858af99e4e916054897807d685c8cb8b0f1692ba782bec2290a58248c683", + "result": "valid" + }, + { + "tcId": 174, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c829d3a99bb47e4256fcc63210c13282ab59e7aae90877b1797bd699d672a38b8696a03730704204894aa967273c120b57cbb71f9fca62c64f692e7f49598d2b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ade4ff3437df254696fb2b19f5154108d88e775e57d345bbf57a02b2abb3f07a", + "result": "valid" + }, + { + "tcId": 175, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fd61ec5552fbb24b575ebdc9d4a443e156bfc0d13c9dc611149e21d79c48c444b7b73a8dbb83a5e2267a8bcd398b10af0843474c750265e9d48d04ac4ab60405", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "598922a353fe1add65ac8f66fd225e826fa8ce493470322593735fc6627e6f2f", + "result": "valid" + }, + { + "tcId": 176, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049cd9e0f17c11a10f8aaa1f47ea7141f6399f40b079b07b14cd388f3b6b0a47a8efc86998f717a83e53c8e58ad23c71d0ecc8bc841bc16ff232a5e326844cd4c9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "923cca706deb11de7c17f8dc089dadcee15042d5619732d9ea537f7dd993fc31", + "result": "valid" + }, + { + "tcId": 177, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043846b407782243fdf3b04042990b16e2abdb325ba098532879d14e16e914c274de571bc4ce2edd7d2d37df5593959b5c7ab59ac8fe5e06c44bbae6960b6c2510", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "bf6234cf4de2040548dd0ea2a99310389db48fe6c0eb81395ab2d42484f841ae", + "result": "valid" + }, + { + "tcId": 178, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d3a07a4b6f9b660d92b3fe937e2ebf91dda8005a7ffd0292dad91d0592f1a89ed7209513bde00287b8234e280c00b3c59dc5e333c8c56864bb6cfb364e3f2d85", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "da223bd733d403e2f2f9f59ff712230b0ab7feafc87dc7021644569e3d513795", + "result": "valid" + }, + { + "tcId": 179, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042ad9550728f65b142ed676438bafe80e365cff4eb557526560e4adfd696da778f0f01da8e947628346614ed7fefe24901f9eee79de6dc06d85d563722ec77961", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "fb888df1c34b3ff15620b94a20726954eb7989e6f8a266ee4902f45e7e86e21a", + "result": "valid" + }, + { + "tcId": 180, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0419f5f0b4edd6124e340adbcce791b06d14054c7eb1f9914b44245c51d6c1101d82304d117f729ef06d97eb56aeb99a6222dc3de5e30c071956fd73ee8cdbeb81", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c656a27fc48053f9bcfa3a240f904be76954cc8b8cb3f4790613e618c5069ddb", + "result": "valid" + }, + { + "tcId": 181, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044485dc2fbc68079c357a04daa6d5306cc78827b0fa64935747b98123009b26605258c4a5608315007db08c27ba86c8971bddc529d1c14e66478ef7fd92b33ae0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "59e168701d9676742fd203e9ff357dfafbbe51eccb2797f7bb416d4ae21bad99", + "result": "valid" + }, + { + "tcId": 182, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042f98fd0dc4b37807d9b1dd015a08a90dc90c088014d1305e49017b60d5b07e0e1e8ec878731277193c54991353d1a424a1153b87bf2cf25309c74032fdc73f95", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7f19652f3077e73a9677fee21d0cbad29914e3bb0270fe77500c4c0a9da8eeb8", + "result": "valid" + }, + { + "tcId": 183, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04df1a499387ece423215b041d19076b61902d31bec5135910b90d8819df3bd2fe9a9bffe9f1b68acab7f57f9a19ca5820389f1d73533dd73f6532d69652336fb7", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b1c79105ffd4b5f4f92ce3a5f55624fd2aace8eee3b80f5438c8419c55051a7d", + "result": "valid" + }, + { + "tcId": 184, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b8c2c47d8c6dd3bdee17a58081cba359e86ef4e19b368d46ed5e43fbe074b08c9b3031b7756e746099d22c985e9fd6213519186acb537fe4bcdb69f5f3a01968", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e1f33be462ded1d121dd2a15d413fb8b9a105922cb90c550abe7ddf352266c75", + "result": "valid" + }, + { + "tcId": 185, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421a34eeb4e1e2ed7e4546a8144a8d1c83ed64f3318f72f7a2d786316bdb5e97412a8cfaa2fac8629fa7e20d9229f35662f5d05ea8cd38836537d16c1a64605aa", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "04b295929582f1a5273346623d9d07fa43c654e9b1564244ddf82d61793fecb8", + "result": "valid" + }, + { + "tcId": 186, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047e9906202cd1abf7147027c8647b3a5816b363266326804d6d596e875f02e1e686a981ef38871ad59f427815cedc1aead339c90d61da12b0f7275f4084761afb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "bc33390ac64b082bb0f2ec689f239e5931a54483e7acae90442a9401c3645223", + "result": "valid" + }, + { + "tcId": 187, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bc21004d799ecb473253e3ed07b4aff2d3ca90f12943a76e9ebdcd4931c438eaa9b6e2c6834bfbe56f4c4e5e22b125814d83f2973dcd64dc7f51939574002fac", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5a0c1a2a33176dcb56645a3548ff709e31c37067e5ef969d230c1b1927d75d62", + "result": "valid" + }, + { + "tcId": 188, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ca6b6e4eda95cccd6cc8e16c3c6c748e2acbe31b70529bcb69445c1140e63e2583cf3c33723659b2e303051c3c1e9f702f9f27421f6b3457e377356018489b46", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7c6a5a4a5608ae11acda6292f6d3b05b7153877dd6e1ad914ff5e3550f457661", + "result": "valid" + }, + { + "tcId": 189, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04884cf0d17df4ef5e488d725b47d069cd2b99940b05b26efcd55d0e5ecd205b61e3b191a7f9f920cfab05b0f9cddd02fecf857d0e405ca36f0106aa367d492460", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d990ca49c9b414818622b9c69197fccb197c94bd1ce13c24110e94c5c321e2c9", + "result": "valid" + }, + { + "tcId": 190, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b1e5aec6272dbb856417e7ce6102bace3e0dd7c32386511e065c1a32d5688fc5c078aff94b8eac78bdb54b210bc74676d2336ab7bc7236808291540f65c82982", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "973af53e8a92e7469856265229acbbe0adb5574beb32ea6780be385b28ae8b07", + "result": "valid" + }, + { + "tcId": 191, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ff8d38f61f633c5eb570ef877e61b4466b511ecc3dc3de87e6224a8c78c0893d7153d4f87b7f9d0488b6588df56c9934ae75d1486c1ebdb49444bad832d08017", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d9fdde34e48cadf6e63c1de84b22da7180ac644c42c055d28625b2bf11cf4951", + "result": "valid" + }, + { + "tcId": 192, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044c381ef0302e1b428f4887f7b4fde4960245920f40c4005669a091644c27482bef739bc3a3d22c6e707557f2469f504aea9e8a07591776b3324beb5c498e6f55", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9dda17a91ad44d472304c805b350f9ee55de2d94d7327160dbc50e2eaa85e4e8", + "result": "valid" + }, + { + "tcId": 193, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04245a530c56d07978f91177e8d97cb1368546bafefbf8148cef339fe7bb652ba5b27a60edd2f498ca636996a9e5e629d5c9ec203217c1b5402ff99a0d2fa97cad", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7a69b8de61da48f9901ff440192fc90086c3a2bb56bdb224a55b89cb82c72162", + "result": "valid" + }, + { + "tcId": 194, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043cc566a230b3df272a172cd80fb481cfdb8dd1c27a84dbb7a391f11484f14ef99be9d4cfd33748ee157625f809d0fbc1a6f0317d97dbfeda4999742455fdf78e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "76a4006db3de3e098936d004cac1f7af41d515f753b9aa4433eb2466da42acfc", + "result": "valid" + }, + { + "tcId": 195, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04455fc13990663bf24cf5908c59e4c3a084fc39ee1a7b14d812c227a8dabd6f94685d00ad604b206d59b2f4d9a75442083b85a316dab78574a3bbaa6259e89a3e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "3be92a857ffb42c5d5c128925b89aec34cfe649920dfd647f0a03f421fb20f09", + "result": "valid" + }, + { + "tcId": 196, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f933578fd1938e44b271ae431ffd0df5548496945d91cb8d311ebec9dd50d036f3d88fa2aae4236cb08858158d725e1213fdb982503bc910a5b58366cd85ee0e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "19e0d41257ccbee1c453f834fa5f349cd9bbb98a92e848354a7579dfd2c78e30", + "result": "valid" + }, + { + "tcId": 197, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045606cbf0c5b52f0f464137d0133559fea50af271a9826ff6125746636d981850d7b10dab8e64b2f8df6fafb8d5943e7b37c6500fa95bfd6680d8f2ff74c4407a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "3a7a54996053b41361b605e73852a5a0b17d85b42b3c4a6f119c6c87ebeb9f03", + "result": "valid" + }, + { + "tcId": 198, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bf236450ef33bceffbb90e0b86f8e99deaa1337c89826363b3cb4e0a66d541030676703afc892b8059c92e24f653b9cb2a11a5f520c848303c17c2c48600c84c", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "72f042a5b276a980d50a0583483eeda72de8ac796b1d50a843b4552a151e199d", + "result": "valid" + }, + { + "tcId": 199, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000066485c780e2f83d72433bd5d84a06bb6541c2af31dae871728bf856a174f93f4", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "40eafb850ca7e08f19ee6447f196aeabf292e27397856e106e60a6c8b48cdb27", + "result": "valid" + }, + { + "tcId": 200, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0481bfb55b010b1bdf08b8d9d8590087aa278e28febff3b05632eeff09011c55798cd2f199d9815d7585073034eb76c93d50799b354b0fb1e77eb75eba8bff3d58", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b485f3364354b738dc5402729b880c90c502d9ab52ccf81e3d21602c7b9bd909", + "result": "valid" + }, + { + "tcId": 201, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04614dcfbea4789a3f3eb4a8e2f111c887f0248d9316b99d0864c927a045d6941753a073befe08491a8050a4d96d08ba4790ae18db3ef7f0eaccf59ce1095afc54", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4207bf4159faa0e50ed238b9c0ff46194a539a1ba03a5a4c8d68f369aecd31a5", + "result": "valid" + }, + { + "tcId": 202, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dbfa466f12013255f9d57a6496c158ee7dd202a1ce4a5a53005b3564d509a0bbf2578007e857bdd082751ef2f3b4b9c38a0b87bab413d55ccb26a574f2b4be9d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e2d57eeec983756c9124f885a4d118ed5b8de7d2895fd91264cf291496949a12", + "result": "valid" + }, + { + "tcId": 203, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048238f048c292e08d49bdb5dab1f08da6d39cdbefb1d75e03e76048b903d6baf9389e4da4040fbe2019a1461fec3cc90403c9becccaa02ef5793da721c1e657a8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "81fa8ca50ac155200de410dfdfd8093037674baba7ca102828a5d0026f24f0f5", + "result": "valid" + }, + { + "tcId": 204, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042d08cf1230463b7102e8a54185986a62a3f2520c0c151ace12f5d073a40cbb2f13473d11f58dde7b16783083cd533bdecc092249dcf15b723f08394a5bc5b3f0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "151411c3b8e6d25c515186c1d9b9c6e1a05da5a7f09cd4ea8844e0916846ba48", + "result": "valid" + }, + { + "tcId": 205, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e8966a6013dde2bb3b2a28c6eb013c481ddb7249ef19d73b92da35cad1d6f14604bf43d798ae27621df2eddc8f5d90ee0289c54bbac82b3c5264c478761d153", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5460bbc867f4f61b79ed491e41779e2ac8dea27ec1320b558f3cff5b6a94c224", + "result": "valid" + }, + { + "tcId": 206, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044f612e0252b8d484bd2657a9ca1bba22afe978466aae6f12bf1d9171e01683ca48f4f3c986bf941b523889a7583fae695d3d4ea4adfb57d0c82370fd82364c1e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a78ac266fc5a85102db78180bd9ae4b77039ec97391a211403322e4d56b59049", + "result": "valid" + }, + { + "tcId": 207, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e8b782dab2dba4db066670ae656c7eca4abc7b1a24c7976de2ce02f25b668413bda2f9991ad7aaf44437bfdd3d91c8f94178cde0f8af9833544ccc9e2d606b8e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f481ae23b9192191e8e1c47203f6a807e54e1ff471e6642716f07895b32f4451", + "result": "valid" + }, + { + "tcId": 208, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041350cac374bb076ee89eb8af43d076afc7312021006431fd909d22df064f6637dbb0dc949a183e398709353d264b13c4266653e8a8685dd830ffaad2955ae9c5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1de1656d961de1f584a2f7179bd3be3b4a282cbd3248f29e74b73a812cad8d90", + "result": "valid" + }, + { + "tcId": 209, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ec624cda95af6633088f9809e441104322ff529e0952aad4efe3286203e0c700396b89e7168b1da4dab123aa6eb7ed60069d07b241d6fff4ba04647e4fccf1a9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "50b13920c2368b9a2e8c80a02a6f4e4a2f84af33532eaf5728da161e620a312a", + "result": "valid" + }, + { + "tcId": 210, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d80a508b155f0c733936d523201bde339794417858cd4a34b685635138ddcf67b4af7eb47f6a8491c9147b49babcdd6538e0a126547493cdcb7e8c900d48337f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e597c39fd42649418bb49eca83589645df32ff1b3f3417087ccb3ee5bf38fbf5", + "result": "valid" + }, + { + "tcId": 211, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040cb05cb7a4b01db1382620ca756285e1a7c6846bbb595cbbac9f89e0a62489cc5777d635a094d17f782d1e3c58bb0be2c1436706fe8b74edb7b9d4cafda95a17", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "010385fdf7f4c6402ae432e4b2f11f2f861c75c4dd27b4f35b7f1efa94bbeecf", + "result": "valid" + }, + { + "tcId": 212, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0472aba18bcccea84909fa724888c2d1d007b11c97e02f61e44b125b402a11041a3ca1faea5f02dd5f1327d5028de70e78c81b05338a2b2e3da509f08e2bd9ea3f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5696fa199ef1088f88c8979db25721d0a707eb7a51bfd97a1278bcfd43b38304", + "result": "valid" + }, + { + "tcId": 213, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04276e45461a0e00704bee883b3e61016eec41678d8176d37eba25557a740284e05ab0fd1bf9fdac37fa83f83f5156648bb036d6ce46ff1f6ad4c72bc953214f0f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "eab63813807eec138a696be8b9e0023dd3c6cee35b7378174aac70838866c216", + "result": "valid" + }, + { + "tcId": 214, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ec90e45db57bc01f74d7d01e8783937723f8e27ba99541698e01c57cd2a39da0933bfd2d11d31af9cba4c53aeabe6a3635a0643c114afa109ada02004286aea1", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c982c6d73a9307038bbed250369aca65a7e392bf15f440227eb9fea43cc4756e", + "result": "valid" + }, + { + "tcId": 215, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0428993d7c18770eec4418c16d595987c196412f7b273da44136b19d4b516a2ac7b9ba3574a31169d3f2f7a62758d9d27a2a4fea904b24d42312a9ebfb49ae355a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5581a9f0971c60709ebaf53b1febd6e0d174664b82a36692656953507c0f6dc9", + "result": "valid" + }, + { + "tcId": 216, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043e4851b2b0d1463b9c90772e10fe8cf29b181463de28e9cf81b4c9604931a4dabde252d07c1061e60f4f8cbae5c2a290c034438a06a8bac67b1ece8ed551a234", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c7df69b1bc484804a3683449c3a228ff787387d56672588140c980b1fd4765e2", + "result": "valid" + }, + { + "tcId": 217, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043cedff3609bd11397ed3aca84a0a7bffd009d48beab100719c7607ed28e56124a15f6af627e03f57a98012fba18321b1dff6c24f51d7b6415d102608b772a44e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "973c078916ecc4c660aa00dd4ec1e1df8793cb7f8670766a5156f8344088002f", + "result": "valid" + }, + { + "tcId": 218, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441e9d4cfa8efe80b895a8cbcce2568e251db7ecdfd20a7ad710d4a4bf2addc6b5ec36a8339168a03f15b8c80f2a2a828f151d38791584853ba2ff44a2a0460a1", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b48e119d29eef7dbb76b64218e728ddbf6ec600505ec7ced6ab6fb8763308da5", + "result": "valid" + }, + { + "tcId": 219, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04776aef1acb82b628e132cc29440988f0a15d4cc2b4f328aecb063c9b86e5018e6e44dfc60444faa9c4e36bc217451f7ac2956cb3b2e9bbd655eba297163d1f34", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "28a88b6b258f233020ba6fa9c00d1d72831f4515b86966a9782f521315e18aa7", + "result": "valid" + }, + { + "tcId": 220, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049ec06b0b08662c0e1dd9111696a63a1601cc83cee20695778adf84d43064fc90156001f084cd3c1df1a087f626533b6572584889bd3d5c2c99f0e311e22b41e6", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c4ff865ff3dc4953ea78d92a02f3345a53bdb6050cfd8f41baa4395ecb6acab8", + "result": "valid" + }, + { + "tcId": 221, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fa51d128adc2000f09ff12c6fd8e25aa08556d708bf6b0ffff9e8eaad4783f0de22bf529e516e1f64b8e0d09f98fad4e501695a930a1b22076659da707e3ccd0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "de1069f051637e10166559cef44688afc809341855261215c4f381d9d7da76ca", + "result": "valid" + }, + { + "tcId": 222, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04efe7754ed4c0b3c1dd301bc1ed69800aa2ff5d51fb85937715e60d2e7bcada8eb1581ab75fb3c797ef94a9dba3d82568c84617eaf3fa04f279fbfd898f704604", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "b5a0ec92aecc3010d27d2263d3da66e3d2f3395d23947024a3f4744454622027", + "result": "valid" + }, + { + "tcId": 223, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d8e13fbd017f1f9a26be35c611d7b2299f5d10de3c8a26362273fffb85238f3ed1426b748c1f87e3afa2c1e7a0224310c980655e07399590d1494d6d6bea0396", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d2a5bc66498c6036aecdfaad041cef732a893de190a0a5b42ff71e13f09280e7", + "result": "valid" + }, + { + "tcId": 224, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045a1027666a0e372481fec0b3901e058d60107c07b1115550ceb05789b55a6d35063d4c8ee66ed45ff3e1dfdcfd73ed96a9e83193884adbcaa574b2dd118a692b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1f812313ddcf36bc38071d0e51a74100d630c8e20cc414326eefa42ecb1b5f8e", + "result": "valid" + }, + { + "tcId": 225, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047937b9c40986dd755a0656203089782583da7d8113a44190762ab474a20bcf60efcbc1525aed5b4ad8e687cb02c2ef8887095cadca56c765b41b4a9544ff2fe8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f284089bddd5e2e1be3f82640efa0658468fa1f10b281963a3ca190c3982fda6", + "result": "valid" + }, + { + "tcId": 226, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049368066a0748867a7b870244f5c9f82ea8bd51552959dd550bb7394497159a5d40764add1ae24c8e3f432ee011be97d3130718fe0a6a90ed8b1011b2034d09a0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4529f4b631c9984ab216a6801281fc4fd8731a58b65ca8d07bff07811116371f", + "result": "valid" + }, + { + "tcId": 227, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04981d7449bdf0013f5eeddbb7e42c442f7ccdd9427bd26d7b388755aa5e26f46a1292b88fa6bf5dffca054dd42ed3594277b593dcc402d80340fb7816e4dcab37", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "64bbc9fdd73643eb2954f4ab640381b938c5e601846a0c6b6954966e0dc73e6f", + "result": "valid" + }, + { + "tcId": 228, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0409e78d4ef60d05f750f6636209092bc43cbdd6b47e11a9de20a9feb2a50bb96c0000000000000000000000000000000000000000000000000000000000000001", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "28f67757acc28b1684ba76ffd534aed42d45b8b3f10b82a5699416eff7199a74", + "result": "valid" + }, + { + "tcId": 229, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045384d6c0def78960db967b8096d35477c5a5ce30ef0c6d8879a5568ca87e979401ee56c4581722610b43f3cbfcf3862c082a6e36baa36fd6f78403c0e399faa5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9ee653cda46db67612760ce35bac8450bbf48dbf74451ed93abb6db408a9fe10", + "result": "valid" + }, + { + "tcId": 230, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044eca7641a4afd5eab0b214657ff3bdcbfc66f1551a53bb59493bc38ed78ff39614a0cadff14c14736edbdcdab510cba07a8924ffd0490ee514aedfaadb648b01", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9736ad6b2a2ef17ec3f8c8dc2e35715fb1c06f28d82e4e26876f0214588165f1", + "result": "valid" + }, + { + "tcId": 231, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048d0177ebab9c6e9e10db6dd095dbac0d6375e8a97b70f611875d877f0069d2c70000000000000000000000000000000000000000000000000000000000000001", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "748fa4f5a399320382dc920026938694c41a26fe2aaa318c5e710198dd71c793", + "result": "valid" + }, + { + "tcId": 232, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045fdb7f0cffb8b5b1142d24698a4bda76bf9827d63b1a6bd85a4e2f9b59c510cfbcb35ba9c987108b6d4337ad5393f9f910ec92410c230869d66528ed88c1b98a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7f97db83b4d86f04fe286041ee21e80ec3d59f3ce82cdeeaf362016fc87a3e02", + "result": "valid" + }, + { + "tcId": 233, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04530b2293e60c6b6f14c75c90b1ef8b9f9fa6b2151b8d9855792eb2b3dc69f07a0db42440e73fd7d6df04aed5022fbe21ceaec33c5fbade1bd6ad321ef2e10d0b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "21794cf24f56273fa4463cc7ae4232fa34dbe0f18b73613b8ae9cbfb9c36abf0", + "result": "valid" + }, + { + "tcId": 234, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046916fac45e568b6b9e2e2ecd611b282e5fcc40a3067d601057f879ce5a8a73cc0000000000000000000000000000000000000000000000000000000000000001", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "915106d07816e879e7643f00abf6d79fb8f1cb78bf64a6a3827f91a7b0ef0f41", + "result": "valid" + }, + { + "tcId": 235, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ed9568c85bc52a6b45733618c3602107c1fdacf23b1a38e486af95978a214e2efa0d71d5e737891c4276e247581ee6139011ca1460db9b1e20b364d9275683e2", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2fcce552310819dd775ab7ba9ff0f96a1fcadd25a0c709703cef04bb6e1a7bd7", + "result": "valid" + }, + { + "tcId": 236, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049ff7731c00f2aa88b3fc174aba907ad17595e602e768a5f1e9462a6d4b89b2d23f178a70b9bb3edce289118338a33df30c432c347f12a3de0a2b03b353878d96", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "757d926a2693bc8a3d2d8c0554a13579ef9e559186578911f37edc88b2f5e61a", + "result": "valid" + }, + { + "tcId": 237, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048270f8179d57436b34dfc0bdf7d417a5c895116b90cb51aec718614f864a635d174804e0c0e06e3d68d3149e0b956621c6aa2bde83f4d17d03d28ef8aa389fff", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "3db29ec6f978d2269e92e9c7eb5c8b5a8e56c2228a4fb9e483feca50aa3e451f", + "result": "valid" + }, + { + "tcId": 238, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c61750e98abaf20225a881dbfd3510532cfc3df971bbbca4a2bd52f91acc9c59d0fe79342097f88ae78fc79a8032245fdd2c30cc64aceaaa9fd57b0825692531", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "72c57c2e10d77318b3a796097bbf768c6366142d80f98c90a93780a841075f32", + "result": "valid" + }, + { + "tcId": 239, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049c5d3bb54650d9550e1ee2efa3ea43c14ab99d18bb049f37b42a6dac48232f0bd3a2760d83d33afe4ce6f1d1245489c509bd26b0251f308f8c996e80f7a3f8eb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a96b07944e9eb2b22a9a36575eff1f4f6363b4aa3a53b100b8518a67ba5405dd", + "result": "valid" + }, + { + "tcId": 240, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f1724efd481ad45a55795f06126b1f5ed28e7d9bb4fee910af2ad8c1373b18ff77edbc34da6c787ec73430347f4da86810032d88f7475f6c42f15914079d179e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "855883316b6d097ae5eab6c67e8411a1397349a09b9d7d8f096b2ba1bd03ea31", + "result": "valid" + }, + { + "tcId": 241, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fc3680af52fa89ffcd193ecc0b0714466fe5db277ee5872846c520bf4e3721d927260a0e225a3d377e6723ecb6bef8d4493c2da78a22a307fcca8f88f4527208", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5a75bb7a0c96b8340d0842bcccf11974e1a5a2c8f4bc22b333433cce646b6a8a", + "result": "valid" + }, + { + "tcId": 242, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04106b6f81e3482db18d74029291821ae448c38844ef783bf1d6999a404401f63f6a5753f0edc68a62cfd6a0b181bb2599e1f3bac5fa8824af160de79ed867c350", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d96412e31cf4d26195920cac952fb79ea25f6c50abc79b5ed0ef8026a6e83319", + "result": "valid" + }, + { + "tcId": 243, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04093cb5193a4f94cd18edaa20a973b87ff79b0c03684c79487ecfee347e5354eb04fcb5752539170777932be15cd84c97f03815ffee8b60b647c178eebb8e14d4", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2b0eed9badc92a1068196dfec124fe8f9d3f451e294d322eb881cce02f286026", + "result": "valid" + }, + { + "tcId": 244, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d6c38f448b964e27b5b450cc38d3cf41ef9df83d8a959771eb9c21855cb36445df638aef46a2aeb13199281e1a26d12fe61b029ec7f68b90faa89f88c7a95942", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ed0b1d8dfd27a61fce91dc6405bfc53b6d48a8c13ba541c96ef3dcf31d7cdb88", + "result": "valid" + }, + { + "tcId": 245, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048a748d61f59c3b6a29b733b0d554b2492e7f76fad7cae1c17f2ac3de9e4a65d2eedbe6c26b6fd22bfc03c1687555d2f0a38e02adee5570686171abfec6681917", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a796dd144f21ba3318f9e10828ecefc9c0f6ef2c427ae31351c16c2fbfa3cfa6", + "result": "valid" + }, + { + "tcId": 246, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f1052699d87e5677c75e26b2abe719310648d820a96e5b381fff58b392401581b1bb16ae8b68cbb76a3256870bad1ee5a30ff9fd662fd4f8d1fe5b5f1f98ff46", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1f3a9615b0745046a972bad5d59794a0b60b032b4ac94fe85f77dfb380d1f32b", + "result": "valid" + }, + { + "tcId": 247, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041219af5230064ee9778667225f0e009cdb961330e386edb34e4fa9fddd0e5be7e2a12554227f613aaaa78938ddbbc99b923f9d181b8192dc4b816577e8f3b7e9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "caf9141d1fca4d0f10683b5e86d2b41af5602f017991fe7348d44e8d7014115c", + "result": "valid" + }, + { + "tcId": 248, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0460def130f190e6dc44f5eb8a59e12e7efb27db968c7fa6cc6d31785f066b41b1f1bb556ac4cd77033e7aa6c5ba16f47ebafb14975a7fd72dd9b7fe23116bca55", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "6539ec1c98fa75197ba07c678b26300b3da1fe407dd4c68b89457ed669082e06", + "result": "valid" + }, + { + "tcId": 249, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f23f09bdb7d17289eb005975a757a39325b4df9b29e55ba2ca679b5ec0973ae918c881f3c7b6c12bed1ec54b837d08c5908e89bdcedd84b9177720378f789600", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "0b6619827cfa948d63f021e9eddb92f884fb5ce8a404bfe059e993fc23447a69", + "result": "valid" + }, + { + "tcId": 250, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045dbec098c1b7de3e3e2e73d0b62cd49c877e1a0130a1b39eb2fd4dbd4426aa4ccbeee217591a8d76cc8deaf14dde52e3f401e53b30cbb9c1807910d827d0041d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2a53a561acf5caec6eb0d8aa40727942881a75d136899dfbff91528236926c39", + "result": "valid" + }, + { + "tcId": 251, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041e70730dc4f39c8970182e1a29cc836b9e9d6cbd6fcaa8c0dc1062fed9a849693e7b9151f9c8a3345366f8221c8fb700e8c3a9aa7f0cc46a48864e1605592094", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9b377716ff1d056dac8e392249eaec740d2f5aa62303f4baf6bb1b03b2a276c5", + "result": "valid" + }, + { + "tcId": 252, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f428c9ae3e23eaf9c2a5b9a7e41efd1cffbf35f881bfc35694d9c05d1e312b10ef6da9023cfd2dd0cb7b9e2a77d644affe62a63fb0f29d45291c6861aa063c5c", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "0c0c6867669743082547aa94451feb362fa29fbaf228dfb3eaf375f1a5ec2fb3", + "result": "valid" + }, + { + "tcId": 253, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b9a16d9a5b85a714e2bb2aa22b086a17404c7a3ff62452732347419c99e90bdad578b462f523994304b6afcf6944a9cc5d0ad1afad956475c8f2953c06b06b97", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d11f9e32587fd3b6f4a2354812618b4b3b4a7539b8a223b388bb7437f8d138a5", + "result": "valid" + }, + { + "tcId": 254, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048f659a163a58e9f900c1e9b34fb1cd61ffc9890267be3417c8afe79d57214da05cd5cb68a2b93da0dbe56c1cfc0dce8b6c3260e0c48379c6d2091f16b39221c0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4babf6368e0359b78614060241ece46facca3f52f5bbc47ac0b46a075b5dd3a0", + "result": "valid" + }, + { + "tcId": 255, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d257f133f00a079f4e6778ea4a9bf42b9f231290431b5b93d7e8b0e35b48010650d6c6b46574d1efce03510b8db4a0981ce138c5bd8fe0e54c988c40c5fc9200", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9627cc5c8d8b72278be89c32b52210173e6f4b8e2f48e460c6429f46f9f469ae", + "result": "valid" + }, + { + "tcId": 256, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045ef2ac57c4e93cf78d8f86c35d413b98dc1902dd245affde5c16034afc7ea45547b3e9f77fbc5075bad03c418094f1aec1d03edeafa167fa6af83526552f7034", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "d2b178bc9bb16b5a91a100bb72e15a9639e050c034346061413ec20c4fcc9bbc", + "result": "valid" + }, + { + "tcId": 257, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a7b513f96266414fa6ff439a35d8f09ab615db0bb6a3b1a120c217683f724b2342007a2c9feabcd6249a0d17acecd995e2a217fb5f07bec96938016e297efa52", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "6cdca0a731aff1ccfb1904a769cef79eba965fbab1cc64d2049d0df45dccd276", + "result": "valid" + }, + { + "tcId": 258, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047743ab7248dae5f1a59ac6b0a136e9f1e51aff8bd45795ace5f8187a13edf9adbd9642078378bab5c6d484f9e1ce39675b72170bf39abc9be7942fc01fc435d7", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "bd15e97a7f49aa33e57b54140a75fffce71b788ce0faa334cf8b45623dcc818a", + "result": "valid" + }, + { + "tcId": 259, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040e3aa971bacdace350dc0957fa5bde0946324eb139939d7fc1997c701effd04a4e6c3625d9564168d3a752961221a1de8cf5f3d603752a8c2e6277ac3a918c25", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "c8b5e8e7488857a2dde62c5fc21e4525ebaba0e06b5be83ec6e7dd771e15a01a", + "result": "valid" + }, + { + "tcId": 260, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040f563e21bf9b24015a7cdbb6f000a692784ac2e4bc2715c76f684264a899c8240cab0d76e6b01cabe4f327429d11be115ed6dc0ca74f02c1b987a082f5af43a8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1c63a457509b148272687e6e442bde51982d41b0080d8c0c5eb714257af971e7", + "result": "valid" + }, + { + "tcId": 261, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045da49f10249e4df3dbb4e31ece0b0ee9aa073f2588195aaae63e74f6567a774810b5dd61b6bf219e9eab30ef09c13fc184b3d09ff7a4e192bca8f5111c4163c7", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "73a1ac9ece354a930dfd9c77577b4f50acc0a78964ea0d7775631d64c709c4a2", + "result": "valid" + }, + { + "tcId": 262, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046f72e6e5c6300679d3f14f0f6e590665643576ae8bbcb7c05b2f4a83e75e6ac3e712cb056ff034da340543c5da6997e65a3ab4cd39e997892bb92ee2c22b8167", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "fcaa406329bb74f995862cea7cecc7425c6bd4148ef1a9f46b5d42da5994556a", + "result": "valid" + }, + { + "tcId": 263, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046b544df9168e7787db282e2ae01dd72306d9c9bc80f5ab38ce594766c3d929e967493ff601ca60862b47d3a0785c917e44584044e36023a54424015e58be5040", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e49ff11d46b6c4b5dde528b04132d15c040e79f9b7151fbc650030988028cb87", + "result": "valid" + }, + { + "tcId": 264, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041c31385b9db9b374e92499939ab0fd7e7eda464561eba89fcd7b4769814a8638a4764cf8ce97b5d143bb8eeb9e1b27287f2b73942ecdbc6359aafb1ee7a152c2", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "fc8f64eac1c7e688c52c467185de21914e8b253056d9e4be010ed0128f92a889", + "result": "valid" + }, + { + "tcId": 265, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04aabcf8b1443d6cbb1de129a0ffe09f60b23fd9d0a44b6bdf25bed7373fdbfd1db716bde7fe9f2f46de0b688e3025e029cff15244429ad4f83484f5dea4af8583", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "6b56d8a01a884319ab5fb9d890cacfc7aabd81ad938cb5eaae207c8c1aa06efb", + "result": "valid" + }, + { + "tcId": 266, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e7cd580bd957915d527056832e37793ab3b082ddfad9372412e1908e5c16bbb6208601a970d5844b780d9246e9583eb35918c42ed695c07d52244037f0e31db5", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2f64b5c8046d41a4e1d631ff23846bff956a4925a47f8534490a20b4b1918b9c", + "result": "valid" + }, + { + "tcId": 267, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042a52db1fe246b71c79c0d0ac49a7d38de67b202995efbbd2a9cc525f6f36010368f494be27e0593e2d612f1fa10a9211437e6aa16e65d97735014072f0dcec94", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "63ac31e718b9a780a85f0670e1d3685bbe306e5f06fee282a8784700b503c124", + "result": "valid" + }, + { + "tcId": 268, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041c50dc49fef708c4cdd62e766f9b60f784d51afee17a8fe9f3701b2fae55b7a5d10f0d9639d83dce8f26a869705a6d6d38e6d328f5685581142aec0dcd1f90e7", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "555c1917b770cebe6a98337a008ae3d8d04f571565327c93debf61ef90ddddd8", + "result": "valid" + }, + { + "tcId": 269, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046d0aa1bc1cee6d07d045002c13290d0ca25ca3c8783343a525fac70472b92c62d6fba71174448b472cf172b0ca9e377f1a2603ba7ae1276d153b20c63e7d24bf", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "3a65a9200f8f96635912faa5e7859fa303a76a1c2a41ea97ef61aa39287700a9", + "result": "valid" + }, + { + "tcId": 270, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f07e3d8be2ba54c6084141e1fd2b29cfd00d4e6dd6ffb115ed839b10bd8a422f42992cb9a5243897d55408e9bb556043318d87349af35dcc0975ed805c8fa2c9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "bb7bb52da570ba58e05fd322f82d556c2d65b365db30815879f67f233b089b51", + "result": "valid" + }, + { + "tcId": 271, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0443a9b90274dbd5f36dd29046fc8390008dde74513ce4c3e8892b236efff80c9dc71547152a5897dbe16957bd15d1a87d770496f814fe2921c8f33df04393c7f8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e8cae9944233b867eedf5902fc49ecd07e4c81c46279531e89520b74ba5370b5", + "result": "valid" + }, + { + "tcId": 272, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e9af8e8c19da9d5c2f3b3c03b8e927c3cbe2d717f98f500972e56d82eb07c2b14e83fcaacadc26f8bb5e7b94741fe54f31275ebd6e1c969d7ec2fecead8a0dae", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e72ad0cdb25f4307d1d834a5f792e9af64fd1b69a47041ec8fa46d526f419e4d", + "result": "valid" + }, + { + "tcId": 273, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0433d9582b567aadbe59606fa6ffc11848e4947b5179597317776317b2b4ff65d0b4d8568dc843319cc04f4bf110496dee7c9229fc68cb0958f3cbd37ecca6990f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "000197fbc260a84dbcbf88136aeaa79b03bb8949aefd2416bef63929ef789bf3", + "result": "valid" + }, + { + "tcId": 274, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e21c0282adb1b2055fda744644c68612cfb0c68a70b9812d007f21a78f1adc4849f3e7644bc6633e2773a2f3cc5214fa7208e30afb3de992f077ee321569dc48", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "cdb18bf62670a853488ca510d8f55bab2918991424925bd9b74a821d2c6e7e3c", + "result": "valid" + }, + { + "tcId": 275, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04af27de0da6556e4e64588c9694afee9a84e1cbd0c388972df3a997f760bbcd903c5a02e161551f333d770559ab1af49bf8b68274896590939ce956d9913b676f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "167303505d22cf9ef78c5b9687a5418fa9fb284f2b0ff68316288ecd7f2e2e09", + "result": "valid" + }, + { + "tcId": 276, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040da41b82550b358ff474915d83104d41a83a12ef70589b9d392f0f30dc32429edc76163c8fe07a3f709cbd92da0bbfc5045f3db82aa5344cf1fd5b27fcd2f7a6", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "85600ff23c3cde26009fea9b6539664bf045056883728ab0d4498ea0a8f4a453", + "result": "valid" + }, + { + "tcId": 277, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0419c844b8c7209026a0996a782983e1bd0f0de9255b86739be9bef08ea5475cc669a779ddf57747cf7d9a22f00ed8efc6e818af5827b750d665fee6d6d58a22e8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a3250a2bfb145ce86e706ac3ab2bf503a66486ac0b2f7522601c124b0e0f9c5b", + "result": "valid" + }, + { + "tcId": 278, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bd07bd4326cdcabf42905efa4559a30e68cb215d40c9afb60ce02d4fda617579b927b5cba02d24fb9aafe1d429351e48bae9dd92d7bc7be15e5b8a30a86be13d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2d70cc8c8af01366051cc8359c2fc8f258757e2601fd8f3e08422a7b23bfeff5", + "result": "valid" + }, + { + "tcId": 279, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040089dee27a60d071dabbaf58f3e56614dad3b7f9a8030769fd0463b3e6e0f03a147b4d6e7e7fd939b9b54dab458fd556ad8fdaf4da6c3909588c4e050ca74a67", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "cbe0c571d1080ea34ee20ad1bfd21ea5ecc442ead733fb4eee3c0d7b0cce9935", + "result": "valid" + }, + { + "tcId": 280, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0442ede106cf85aef46df7e5dba8a8b00459317d9e766a7b77c299aa0e17dea142b6e9a86f4fc3e945d4323ba8e459f6b7b14c563a698c757a2d5f7b0bc301ede2", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "33320fc7917fe4e19280bfbfe16f223c037f7c2dc30c0fda98310740f57fe289", + "result": "valid" + }, + { + "tcId": 281, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04974b4316c5e7d1348b28dbc4fd61d8d3470de744c30f5be237f85f29969dea77b5f00b58b83cfc7bc51655465b4a28abe1ed3dbec20c6b4643aec85b95a5bec6", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "35c726ead66c39414fe0c24604df7838e5725d2fc1bd0853261e1de3338ecb4f", + "result": "valid" + }, + { + "tcId": 282, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0459873d7523936a121b629e9870f930419f253a5767b9d0dc49716f2c50e17bd0163b71f2bf4318fbde1ceaa585450080eec28474cd18bf7c21d2d1bfde4ff677", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "66ea42fe6fd8741b37599bbdada3ec0e6b08c0b52ea67c29a33172f72742583c", + "result": "valid" + }, + { + "tcId": 283, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bd85a79f81c4f9613e64fa347886437856c7358d1b69cf1e923d7742d82f9b6767d26918eaa8acb113a1daadaedc709742457303ebc23cdda5572613dc827703", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2f8a502e4f440133e84fb625292cbeabe2cb79da73987c76d4fed864d1b1b762", + "result": "valid" + }, + { + "tcId": 284, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043e6a4effc47c2f5926bb6b4acf2eac48b9524c47d511f816976796778600d6c5bfce593242a5985a977590f8d7485df3f953352957f3c17c13e94583d9c0e7b9", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "06436817d8928b77b73d16c5c3b35e243ad3ef2ab59ad047142c67a6d0923c84", + "result": "valid" + }, + { + "tcId": 285, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049a4487fcfce8396688e7449e095fe803caa253d4bd7c66dbc6261cc9d9f883a50e5251bae29c5a5cdfa31bc61105671a88a018467398158d35b88829237c0bff", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7e83fd2c3d713bc85d6d85d9078b3a0842824d410e8abde04da0fd71c7d94705", + "result": "valid" + }, + { + "tcId": 286, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fed6ce127290c1291ca5ce64acb4e0f2f8905654d1d25ba57c1f74ab52f21f42963d31671c06b802169929525c4a1fdeff5b1eafab919dc2df6c52be84dfaef3", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "0e3dfdab606ebdc6428282acd443f189c99b3b483aa101fd8d6bed38aec59e02", + "result": "valid" + }, + { + "tcId": 287, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f7cee5b55f1869f137dd707c8f8fb8965a2be5840c3149fb759695a4661b9c0d23c78c4e9647b0d6cb2f2602be73ff25cf3d09c96d892b5745fe5eca814aec91", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f489f2bd93f76b8e41fc6b9f211bc599d49db1f17a38e95bab1d31b2a2b55829", + "result": "valid" + }, + { + "tcId": 288, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042baaaec3b3e8d54a4e18f0960b947da2535e3cfcca2cfa8b7113aad8e3b6626f72f71e7c9e96042c1d39cc8f1139d5147c6f4fe62e23cf6df364b5f4d899f842", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "cc5738b49d30d5d02cf7e0c54a3de09b5b6f3c4dea91dd0679072a3562444c37", + "result": "valid" + }, + { + "tcId": 289, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a51ab1238bc1bed25247e7d179c83a61ae2d4a9fe2288c363ae0eb7a77de432a3c6d35d82ba8017e6ca9041cc785a30703f7bc4427506e624ac5979d715421dd", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "89a11177d6907a81d47467093bf6a3cc8ba55dee05239b160a31a3000f5d807b", + "result": "valid" + }, + { + "tcId": 290, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048b5ae8a0e55f30f509061315abae79ac480f88b44655f7269a385c81526884be262974a31a0e2322126c2d77b26b108abd81f8b952c458ccc95d46fb4924c7c0", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "2cb03c30b20037a5cf4d5b33574f3abac895bfab37867eb2ebed260e0929058d", + "result": "valid" + }, + { + "tcId": 291, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045f60c77e474dd66c8135ee3dafc75ba644649824c72737542091ad469adbb685312c09c69b629d0436bf3bd6c6083ff2a87be484a73ef3a5d2c3e06b5d9b21b3", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e54d487d0c4b12fe522af3e663ce316e632ba9d63a1f02a36fc5a82bf82731a4", + "result": "valid" + }, + { + "tcId": 292, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e06eaa73f6feae45417d859bbad4bc404b2885bcd213ebace594e16f4970e0c411ed3323a3d7afc7076239884307f91849ed5f5e36b6171d309c81344c53e06d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ccea969d40fa42933f4fbdc4cabe2185f8a452996254c1f4e0dde5e14feeea8d", + "result": "valid" + }, + { + "tcId": 293, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040f1c1b89e9fc6fc0faefc9109fc4a1247d9f54c7497b6cc975e6a5455bef410836cb3818548ac9b41e2b8336c3eb8d97075ae47e1827fa1ff93d4341d43c0c1d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "eaae0e188c9427bf3c8b3ded772122204c328d5941e389d808e2724638f9aff8", + "result": "valid" + }, + { + "tcId": 294, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04577069e8284a95f51dcab919b0536657058971dab76217f8d3ae722a64092e26e51f68a722cc0397f4801401771e9a3d1988d4af76f14f9e2f9c36e0773e29c2", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "fea0cce1358f1ff40ffeaaffbf91b2e8d426d4e31e9627731ace3a122eab6b0d", + "result": "valid" + }, + { + "tcId": 295, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042406a2759050b925dd4f814c5033e355548f42bbf1afb791c110f0031f29f68099d5f4b005de3927f165abeff196a28c7217fab1be2b5209c324e7d62d2dd687", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "837621ea4827bba0376aaa8aa66cfe144a2ff1e359dc619a06441d3e055f9771", + "result": "valid" + }, + { + "tcId": 296, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ccaac61f35a27861183621642bc573af913356fb47cf582f0b5299099d6f6c6991f7272b83b738a7a5d30447c87f126a7d98ec72fa2609d0939d18db7ea7eb3a", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "63974ce6153762e5b364523cead93e8ce8bcc77dda56365d676136169fc4e39b", + "result": "valid" + }, + { + "tcId": 297, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0401415917272f1984e7217a36fb311fd2904d41a6b13973f92aae3b90e85e4d56d97c822eb7b21a84d0d1be4867404a80c34867f43139dadcc3619e10b222562b", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "0a0488144bc36d690b62148ac3076047d46d48f7adbb0f34fee9a636295fe737", + "result": "valid" + }, + { + "tcId": 298, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b2575d100c6fa056bcd137ab111b5315a8908c29243b84f3dc996d0e45764b9166cabeb41885588ec08b47257df58bd58f7dcd9e012e2669fa2f52e25767fc4c", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1232165538a44268aa7c199c54d6d207c4ef3f5aa790c10c926a20752ca645ce", + "result": "valid" + }, + { + "tcId": 299, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c17355ed30ccd6427f9685709021b25c11ed176e9610c479bcc4cc7552a738e61f75114761dba0ec60cd264bbab763c5d5abcc75cd8fb5651d0645179988cc6d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "dcab5e874e4fb76bc4312528e9d76dfae56145922533089734110bf5653f4d77", + "result": "valid" + }, + { + "tcId": 300, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04341592390ccce485de8880f3d727f664c381914a1becec383b35586751fc81c2add71852b87016e1019cae7a9080e75ce0b0b8aac175d692d5e7b4dad088f5cc", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "4ce2701b2be63a0083a4c53f7a0bf04cf871654f5edb6f625e3ea5e7d0bdcc90", + "result": "valid" + }, + { + "tcId": 301, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fa764b6b76a86c3b762120825d353a24766208c1f5cc0fe3fe7998026a2ec5c43bb2f948fd94cdaa5869b1e0e73a4d97035cc49357fb7b74d7ed0a2c5b8d54eb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "7abef9765cca721320fbf8edcbef6d2ba25d17b70ffa1776029bc38fe677a12c", + "result": "valid" + }, + { + "tcId": 302, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a71fbb617199bd585b4b66212ca33ca9e09370e6bf15c8ea0acefd9c8e945d06840f058863078e743e220ff99f23bbc1daa36835d4b1269f0a7536e63f06d853", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "5f61404dbbbc2867dff95c1f37ed44f4cb8fabcd223b03739d888308d13bc412", + "result": "valid" + }, + { + "tcId": 303, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0413c8292d854d39451c0c63a802b8c03e4fcb875ef01239896295ba1c0f386975f82df197086fd86032cb36b69a27876dd75a8e9679f36ffc2210edb128d4be13", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "8d673a577e35bf9d5d00676c08b2c739617c46a052188403aa06dc714af6acc1", + "result": "valid" + }, + { + "tcId": 304, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040cd9df415acc0c32fd4e3d6924ce53075b0452bf919a2ab2ebe26597570f1ecd5985d8d2c5df78fc100f87efb6dfa9543757bdffecf083dfcd1ecb38de6c23f8", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "a7835ffee0f2a69dfcf70d4e798dbe3ed32ba03cfddae5ddd11d8c0ac3d74f9b", + "result": "valid" + }, + { + "tcId": 305, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d2dbea4046b23fd2b233d1ce31dceddb89b25f26c0627a9d2db3c5605c9cc99535bdc8de7451c1e27e97aa91402cce3882c71269d9cbdcb5d7ac0ceb911b9b6d", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "e98ea22209cd397edb6c319648c1eb24bc4d39598ab11995571926684ce2ceca", + "result": "valid" + }, + { + "tcId": 306, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04888fb044fb2b6caa60366bfa662adba479b8365a6555a29887d580f587086ba8482f4ec24082a48d6402afa1622143f26e61d91b7e30d6a4b223630ee10f70fb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "91b65733860b1bdb9541d9f55895a3dbb3f13c199251d33006b6dcf90ac349ed", + "result": "valid" + }, + { + "tcId": 307, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042e2bec134249379d57700301f3a58e4b395a4d28370d2a06e65e7ac89ed76ac697dc960bd795cdf4fbcfdd75149057b8e022331c7b5461f383ac589d764df333", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "1fdf7c5c48047a113e5e5d1b7ed593337e769231cca5c7110160e0c1b97f4256", + "result": "valid" + }, + { + "tcId": 308, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c78cda7e3b9e1772ebed30b2b51dcf155a69a0fc504557836e25147cfb8127d2f8289cf38b033d3763c8f9f6c091787a3142fb83dff5719590282c6f852e0105", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "ba0abc3e71726cb51330489176357b81b8074d7690e4e82e9a3c00151e1fa318", + "result": "valid" + }, + { + "tcId": 309, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041e3df4dd7fb7718cb0aa0dd72f8a25c83c4e804e7cbd48c5e965651f9e23bf4ef0ff40dd9796e4a9a5eddd2c4ca4ebd10990d8fb8918d12d53c76001afa9de7f", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "16e632f9752d36602c95ec274b32ad594f39f6ac3bd4b0b20f8637392142cef4", + "result": "valid" + }, + { + "tcId": 310, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e5c5dc3fd88d85668b3b709fd6b4232f1f80949cbccb5588363e6c217a2b3ed88dbd0d6e3cc97f3081d16602aa3d1b655ee0791c87fcb5abe6217d8c8513807e", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9eed4b96569f604a4d3f5af97499807111fc9888c458ece2e3000e245c2c02b0", + "result": "valid" + }, + { + "tcId": 311, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04021c41eceec24e0fba894ad7415a9598cbcd14fa6ca46e25575268a1d8e5bbc63f846c6a185fa3f23bb92c14e7e2cba8c74047c09af766f55ef0c907c80d9451", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "21ac32013838812621dbb584965bded6fc851d3a029810679bc57b2381bb7a7d", + "result": "valid" + }, + { + "tcId": 312, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048e24192cd33335a114f5070266c014cb0d8c704d16d6042e89c17597bcd4e77ebdb4c5171704c2c09275c22a310e0c4fe092e4084856da99b94abbfa9f469f48", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "fc5978da01ca83e127dddf989a0358871b3c4ce0755bfb020633db467e21a53c", + "result": "valid" + }, + { + "tcId": 313, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0431c90ae47a93d09a2352b6f3677e7975ea62aadedb56c118eb8b9f771e2dd9f5f2601fb9cca2304e594423cf48064dbed17ae40452f18be6ae018321911e8cb3", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "9f417341261aa45d396b0ccf2a3dee7a466ca47e3ce86ecd2071d9c4db08820e", + "result": "valid" + }, + { + "tcId": 314, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d2f211cfab84e01c8e5544036234debe35ae103bb878d7abcea6825f753e03a385f7f1870e64f1262af67a25ef9880419f45608e7f9da6dee83f5f46ceb53dcb", + "private": "00809c461d8b39163537ff8f5ef5b977e4cdb980e70e38a7ee0b37cc876729e9ff", + "shared": "f419febb32c254611adf569c2d583b17542b1538caa0001967f0a4bc34b8b789", + "result": "valid" + }, + { + "tcId": 315, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "03", + "shared": "85a0b58519b28e70a694ec5198f72c4bfdabaa30a70f7143b5b1cd7536f716ca", + "result": "valid" + }, + { + "tcId": 316, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "shared": "a329a7d80424ea2d6c904393808e510dfbb28155092f1bac284dceda1f13afe5", + "result": "valid" + }, + { + "tcId": 317, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "0100000000000000000000000000000000000000000000000000000000000000", + "shared": "bd26d0293e8851c51ebe0d426345683ae94026aca545282a4759faa85fde6687", + "result": "valid" + }, + { + "tcId": 318, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "shared": "ea9350b2490a2010c7abf43fb1a38be729a2de375ea7a6ac34ff58cc87e51b6c", + "result": "valid" + }, + { + "tcId": 319, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "008000000000000000000000000000000000000000000000000000000000000000", + "shared": "34eed3f6673d340b6f716913f6dfa36b5ac85fa667791e2d6a217b0c0b7ba807", + "result": "valid" + }, + { + "tcId": 320, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e83f3b9cac2fc632551", + "shared": "1354ce6692c9df7b6fc3119d47c56338afbedccb62faa546c0fe6ed4959e41c3", + "result": "valid" + }, + { + "tcId": 321, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3a9cac2fc632551", + "shared": "fe7496c30d534995f0bf428b5471c21585aaafc81733916f0165597a55d12cb4", + "result": "valid" + }, + { + "tcId": 322, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b1cac2fc632551", + "shared": "348bf8042e4edf1d03c8b36ab815156e77c201b764ed4562cfe2ee90638ffef5", + "result": "valid" + }, + { + "tcId": 323, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac1fc632551", + "shared": "6e4ec5479a7c20a537501700484f6f433a8a8fe53c288f7a25c8e8c92d39e8dc", + "result": "valid" + }, + { + "tcId": 324, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324f3", + "shared": "f7407d61fdf581be4f564621d590ca9b7ba37f31396150f9922f1501da8c83ef", + "result": "valid" + }, + { + "tcId": 325, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632533", + "shared": "82236fd272208693e0574555ca465c6cc512163486084fa57f5e1bd2e2ccc0b3", + "result": "valid" + }, + { + "tcId": 326, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632543", + "shared": "06537149664dba1a9924654cb7f787ed224851b0df25ef53fcf54f8f26cd5f3f", + "result": "valid" + }, + { + "tcId": 327, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254b", + "shared": "f2b38539bce995d443c7bfeeefadc9e42cc2c89c60bf4e86eac95d51987bd112", + "result": "valid" + }, + { + "tcId": 328, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "shared": "85a0b58519b28e70a694ec5198f72c4bfdabaa30a70f7143b5b1cd7536f716ca", + "result": "valid" + }, + { + "tcId": 329, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "0431028f3377fc8f2b1967edaab90213acad0da9f50897f08f57537f78f116744743a1930189363bbde2ac4cbd1649cdc6f451add71dd2f16a8a867f2b17caa16b", + "private": "00ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f", + "shared": "027b013a6f166db655d69d643c127ef8ace175311e667dff2520f5b5c75b7659", + "result": "valid" + }, + { + "tcId": 330, + "comment": "CVE-2017-8932", + "flags": [ + "CVE-2017-8932" + ], + "public": "04023819813ac969847059028ea88a1f30dfbcde03fc791d3a252c6b41211882eaf93e4ae433cc12cf2a43fc0ef26400c0e125508224cdb649380f25479148a4ad", + "private": "2a265f8bcbdcaf94d58519141e578124cb40d64a501fba9c11847b28965bc737", + "shared": "4d4de80f1534850d261075997e3049321a0864082d24a917863366c0724f5ae3", + "result": "valid" + }, + { + "tcId": 331, + "comment": "CVE-2017-8932", + "flags": [ + "CVE-2017-8932" + ], + "public": "04cc11887b2d66cbae8f4d306627192522932146b42f01d3c6f92bd5c8ba739b06a2f08a029cd06b46183085bae9248b0ed15b70280c7ef13a457f5af382426031", + "private": "313f72ff9fe811bf573176231b286a3bdb6f1b14e05c40146590727a71c3bccd", + "shared": "831c3f6b5f762d2f461901577af41354ac5f228c2591f84f8a6e51e2e3f17991", + "result": "valid" + }, + { + "tcId": 332, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 333, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 334, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000ffffffff00000001000000000000000000000000fffffffffffffffffffffffe", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 335, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 336, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 337, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 338, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000001ffffffff00000001000000000000000000000000fffffffffffffffffffffffe", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 339, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000001ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 340, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000fffffffffffffffffffffffe0000000000000000000000000000000000000000000000000000000000000000", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 341, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000fffffffffffffffffffffffe0000000000000000000000000000000000000000000000000000000000000001", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 342, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000fffffffffffffffffffffffeffffffff00000001000000000000000000000000fffffffffffffffffffffffe", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 343, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000fffffffffffffffffffffffeffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 344, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 345, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000001", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 346, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000ffffffffffffffffffffffffffffffff00000001000000000000000000000000fffffffffffffffffffffffe", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 347, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04ffffffff00000001000000000000000000000000ffffffffffffffffffffffffffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 348, + "comment": "", + "flags": [ + "InvalidEncoding" + ], + "public": "", + "private": "7e4aa54f714bf01df85c50269bea3a86721f84afe74f7b41ea58abcf3474e88d", + "shared": "", + "result": "invalid" + }, + { + "tcId": 349, + "comment": "invalid public key", + "flags": [ + "InvalidCompressedPublic", + "CompressedPoint" + ], + "public": "02fd4bf61763b46581fd9174d623516cf3c81edd40e29ffa2777fb6cb0ae3ce535", + "private": "6f953faff3599e6c762d7f4cabfeed092de2add1df1bc5748c6cbb725cf35458", + "shared": "", + "result": "invalid" + }, + { + "tcId": 350, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "03efdde3b32872a9effcf3b94cbf73aa7b39f9683ece9121b9852167f4e3da609b", + "private": "00d27edf0ff5b6b6b465753e7158370332c153b468a1be087ad0f490bdb99e5f02", + "shared": "", + "result": "invalid" + }, + { + "tcId": 351, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "02efdde3b32872a9effcf3b94cbf73aa7b39f9683ece9121b9852167f4e3da609b", + "private": "00d27edf0ff5b6b6b465753e7158370332c153b468a1be087ad0f490bdb99e5f03", + "shared": "", + "result": "invalid" + }, + { + "tcId": 352, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "02c49524b2adfd8f5f972ef554652836e2efb2d306c6d3b0689234cec93ae73db5", + "private": "0095ead84540c2d027aa3130ff1b47888cc1ed67e8dda46156e71ce0991791e835", + "shared": "", + "result": "invalid" + }, + { + "tcId": 353, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "0318f9bae7747cd844e98525b7ccd0daf6e1d20a818b2175a9a91e4eae5343bc98", + "private": "00a8681ef67fb1f189647d95e8db00c52ceef6d41a85ba0a5bd74c44e8e62c8aa4", + "shared": "", + "result": "invalid" + }, + { + "tcId": 354, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "0218f9bae7747cd844e98525b7ccd0daf6e1d20a818b2175a9a91e4eae5343bc98", + "private": "00a8681ef67fb1f189647d95e8db00c52ceef6d41a85ba0a5bd74c44e8e62c8aa5", + "shared": "", + "result": "invalid" + }, + { + "tcId": 355, + "comment": "public key is a low order point on twist", + "flags": [ + "WrongCurve", + "CompressedPoint" + ], + "public": "03c49524b2adfd8f5f972ef554652836e2efb2d306c6d3b0689234cec93ae73db5", + "private": "0095ead84540c2d027aa3130ff1b47888cc1ed67e8dda46156e71ce0991791e834", + "shared": "", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp384r1_ecpoint_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp384r1_ecpoint_test.json new file mode 100644 index 000000000..737e3b4f7 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdh_secp384r1_ecpoint_test.json @@ -0,0 +1,8760 @@ +{ + "algorithm": "ECDH", + "schema": "ecdh_ecpoint_test_schema_v1.json", + "numberOfTests": 790, + "header": [ + "Test vectors of type EcdhWebTest are intended for", + "testing an ECDH implementations where the public key", + "is just an ASN encoded point." + ], + "notes": { + "AdditionChain": { + "bugType": "KNOWN_BUG", + "description": "The private key has an unusual bit pattern, such as high or low Hamming weight. The goal is to test edge cases for addition chain implementations." + }, + "CompressedPoint": { + "bugType": "UNKNOWN", + "description": "The point in the public key is compressed. Not every library supports points in compressed format." + }, + "CompressedPublic": { + "bugType": "FUNCTIONALITY", + "description": "The public key in the test vector is compressed. Some implementations do not support compressed points." + }, + "EdgeCaseDoubling": { + "bugType": "EDGE_CASE", + "description": "The test vector contains an EC point that hits an edge case (e.g. a coordinate 0) when doubled. The goal of the test vector is to check for arithmetic errors in these test cases.", + "effect": "The effect of such arithmetic errors is unclear and requires further analysis." + }, + "EdgeCaseEphemeralKey": { + "bugType": "EDGE_CASE", + "description": "The test vector contains an ephemeral public key that is an edge case." + }, + "EdgeCaseSharedSecret": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a public key and private key such that the shared ECDH secret is a special case. The goal of this test vector is to detect arithmetic errors.", + "effect": "The seriousness of an arithmetic error is unclear. It requires further analysis to determine if the bug is exploitable." + }, + "InvalidCompressedPublic": { + "bugType": "MODIFIED_PARAMETER", + "description": "The test vector contains a compressed public key that does not exist. I.e., it contains an x-coordinate that does not correspond to any points on the curve. Such keys should be rejected " + }, + "InvalidCurveAttack": { + "bugType": "CONFIDENTIALITY", + "description": "The point of the public key is not on the curve. ", + "effect": "If an implementation does not check whether a point is on the curve then it is likely that the implementation is susceptible to an invalid curve attack. Many implementations compute the shared ECDH secret over a curve defined by the point on the public key. This curve can be weak and hence leak information about the private key." + }, + "InvalidEncoding": { + "bugType": "MODIFIED_PARAMETER", + "description": "The test vector contains a public key with an invalid encoding." + }, + "Normal": { + "bugType": "BASIC", + "description": "The test vector contains a pseudorandomly generated, valid test case. Implementations are expected to pass this test." + } + }, + "testGroups": [ + { + "type": "EcdhEcpointTest", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "curve": "secp384r1", + "encoding": "ecpoint", + "tests": [ + { + "tcId": 1, + "comment": "normal case", + "flags": [ + "Normal" + ], + "public": "04790a6e059ef9a5940163183d4a7809135d29791643fc43a2f17ee8bf677ab84f791b64a6be15969ffa012dd9185d8796d9b954baa8a75e82df711b3b56eadff6b0f668c3b26b4b1aeb308a1fcc1c680d329a6705025f1c98a0b5e5bfcb163caa", + "private": "766e61425b2da9f846c09fc3564b93a6f8603b7392c785165bf20da948c49fd1fb1dee4edd64356b9f21c588b75dfd81", + "shared": "6461defb95d996b24296f5a1832b34db05ed031114fbe7d98d098f93859866e4de1e229da71fef0c77fe49b249190135", + "result": "valid" + }, + { + "tcId": 2, + "comment": "compressed public key", + "flags": [ + "CompressedPublic", + "CompressedPoint" + ], + "public": "02790a6e059ef9a5940163183d4a7809135d29791643fc43a2f17ee8bf677ab84f791b64a6be15969ffa012dd9185d8796", + "private": "766e61425b2da9f846c09fc3564b93a6f8603b7392c785165bf20da948c49fd1fb1dee4edd64356b9f21c588b75dfd81", + "shared": "6461defb95d996b24296f5a1832b34db05ed031114fbe7d98d098f93859866e4de1e229da71fef0c77fe49b249190135", + "result": "acceptable" + }, + { + "tcId": 3, + "comment": "shared secret has x-coordinate that satisfies x**2 = 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04490e96d17f4c6ceccd45def408cea33e9704a5f1b01a3de2eaaa3409fd160d78d395d6b3b003d71fd1f590fad95bf1c9d8665efc2070d059aa847125c2f707435955535c7c5df6d6c079ec806dce6b6849d337140db7ca50616f9456de1323c4", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 4, + "comment": "shared secret has x-coordinate that satisfies x**2 = 4", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "040161328909675213e32098d35a6b8308a8d500cca39dcee5e804e73bdb8deaf06fe417291fd9793b231ef5fe86945444a97a01f3ae3a8310c4af49b592cb291ef70ee5bc7f5534d3c23dc9eefde2304842c7737ae937ccf9bd215c28103e9fe2", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002", + "result": "valid" + }, + { + "tcId": 5, + "comment": "shared secret has x-coordinate that satisfies x**2 = 9", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04af4ae964e3bcbd923accda5da3175d411fd62d17dd3c3a1c410bef1730985a6265d90e950ac0fc50743b1ed771906ff33b68cf4d3d83a885a87097fdd329ce83b189f98cec5be44c31d1a3a2bba10f471963232b8ba7610fa8c72179050eb86d", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", + "result": "valid" + }, + { + "tcId": 6, + "comment": "shared secret has x-coordinate p-1", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04d69850ccbacc4736ea200ff2f8488f26247945a2ab48dd3708f494b293d8cba83417f48974881c7fb03854089bbf66cc1c773ec03cb8cd5f007ec3b03bdd05a409b352103f0decf25b41673ab8ca3d04334babee01219f15701f2bca22d40b37", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe", + "result": "valid" + }, + { + "tcId": 7, + "comment": "shared secret has x-coordinate p-3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0455c8e69b6415a85d7355973d5151de82232e4e7cb4f7fcbe519df43e279448d3e6662a94655a826d27645bb4400d3b0c9e841c419500f15232e31ee2883031af0d2a233188f82d2581a01417c74f5ca67bc09a1252c231743b559ed20ad9739d", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc", + "result": "valid" + }, + { + "tcId": 8, + "comment": "shared secret has x-coordinate 2**16 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "046039917aef03e2cc8ee437362882fff8fc4e1bd26a976950b8f49ee805ead13064346e3dedae226f878638010765b8f3024cece86e410dcede120def625150d2942bca8991d1d1db946ef1def4092dfa6f68a880da0e05148bc95fd1cb24f90b", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000", + "result": "valid" + }, + { + "tcId": 9, + "comment": "shared secret has x-coordinate 2**32 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "047fc9bdac2a6f32ad687bb68c23cce13338b95b94dd8146748d064a989cd4aa4b8b0507a42b7e7b0b63fcdc39612b680782a0b74052fc521a11de6828717bd0a889f49e7f0393863bae6eac2979b5affa9fcc823039f6b31ed9e8271d8ecda7ef", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000", + "result": "valid" + }, + { + "tcId": 10, + "comment": "shared secret has x-coordinate 2**64 + 1", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04eb14b4ded19bdf91fde4ea5e8c8629e9e57d95adffa9b113d7eab5629c1a92e853a618a6fddf93b453e3594d881cd9751317512fe3f0c1c3d8447ec84ddf234819f9c5c2f8f43dd45b6cfc67b214fbc98d1312afd4fcb714eaf775e2fce6259d", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000001", + "result": "valid" + }, + { + "tcId": 11, + "comment": "shared secret has x-coordinate 2**96 + 0", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0446725a9c9e077eb00cd324e9d8a861aec0405f000847e618e6fb459ffb9d1e3804d2eaab56c8a9c6b8be562371e70b4ae56312ea42dc8993bda30df56a8b353e45778ed681a61ba9e7528d5022ef4840ed7b210f537c5d284d9e13111f00af42", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000", + "result": "valid" + }, + { + "tcId": 12, + "comment": "shared secret has x-coordinate that satisfies x**2 = 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04ccb13d427b3c4bb33dd4f20cddabc68600eaf97eeb2c81e8c218ae90743e74ff38ca56f0c0224379db464dcf4a40f04350cd7a659b2c4851a5dcf8c990fc920c07d4d5aa50a2185750e6b84c42e83cff635050482decb4780f812e4c49fc7404", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "7c25a4f57f76ab13b25cab3c265db9d9bd925fecbf7bf93bef1308778646628decab067ed988a9755cd88e88de367104", + "result": "valid" + }, + { + "tcId": 13, + "comment": "shared secret has x-coordinate that satisfies x**2 = 3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "049655d8e5622718b317cfbc09894357f75a6b13fa516bcd6630721b869a620196cf0c3dec8860b32d27ed9bac2cf263af17321698116d7d811ae8da9b9cbbf9382c1e36e2b67d6c6af9bcea7d9de00ca72b398606c098a0a0f0c4b8941943ed65", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "6a99a5acd4a7edb1c707d7f8be12e81140338e3e14ba563c703c681a319a3f9ce1f90f032bf840f3758e89cb852ceca6", + "result": "valid" + }, + { + "tcId": 14, + "comment": "shared secret has x-coordinate that satisfies x**2 = 7", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0437f9004983156bbd9c47891e75237bb13016bd7fe6f4e0f71cef0e63f16a672f0d3b0e20165c33407e146b6a4ae6962dd3b57ccb99e7aaf1303240516d0ebe08e585513e3695d42c467dcab5340ef761990cadc8d8840aacc944481415c07feb", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "3b5eed80727bcbc5113b8a9e4db1c81b1dddc2d99ff56d9c3c1054348913bde296311c4bd2fa899b4d0e66aaa1b6a0dd", + "result": "valid" + }, + { + "tcId": 15, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "040503006fa79bf989f03331537a55abf9c3e35051e3025dd0fc1f860f7cc2e70c6efc64d00e8c085b757cb371c7b6e408430456a166627c6d35f49a65343c1dd9b20723b37012789a40fbedf305765d575518e849ee03b9cc98b399ab59963d56", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555552", + "result": "valid" + }, + { + "tcId": 16, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04b95795660f7cf603288e25724768e40a4486f9be541cf48dbaa7b2272f2abe01741134b2d3113688f195bb9531b75d544f0be6b0671f39a2676b09222ae95c2fbc5d26878772547145ee4b1e5d80dd6d6de6a2143187b11b5c8072f19f999cd1", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "result": "valid" + }, + { + "tcId": 17, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04bf196c18e185ca31f67a5ed2901b08e7862d17b4a03c2fb01f08be8e0bf513f633c245266dc8bb55ba8435c283656a69f09d5800522cf61992a8ef850514c2491463001edc076009c3dc19b2cca7782a57243f1dfd8347cd5a8ecd48d6484cbe", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333332", + "result": "valid" + }, + { + "tcId": 18, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04105d970726f59b5f6f413a1aec6f18ea4fd384145582d1dae3202341ae3e3b3a20561400d9eb85e1b8a4d07d7cb4aa9f23e4e9555913e4492cf7c579796969de4e099742e4b5e355ef86e4945cdfc6aa8de8a757f4aaca681a2b07a591e3f0a8", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc9", + "result": "valid" + }, + { + "tcId": 19, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "041ffbeab83d67c6f34b82596d5f62ea05e1b7a648794e96ced40cf31ed6357ebd30935d4fa1127354ee81f975a5e3887d6fc34a2c5f2e9fe2d1e36d46885292fa8078df7305bf1a36e21a828989f5c79a53f86e799c834659dde13a9318bd3206", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f", + "result": "valid" + }, + { + "tcId": 20, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "044c1a6b87dc201bd655a8c8a538a9e7dfebc9c811ec7322450c0088569d356439e83301426bb3f4ee9aa8fbdf8819235da1977aa933cb47cf916d6ac31dbb035a5a9dcfd67d3d2ed191ffeee0ac071fb6518e7e1bc8657bba2a3b0cd6bd46336d", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0", + "result": "valid" + }, + { + "tcId": 21, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0416e0a0530e0b0c733e40fe2ff853578e33bd5c3e7eb84a7338595cdc0f30dcd4f230d1c5d4121dc1f18f11004fc374029c12cdf5b0d18b6d5c38d82da004afede6f767201f9ceae7ba7e95a2cf49af18538264b1483724a894e992012c4ae0f6", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fd", + "result": "valid" + }, + { + "tcId": 22, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0407c56c9e1fbde30378f0183d4f870baf1f0d9201fce216816a0cb5a0941cdbab68792544225976e5cf72f4b831a18f5f7b794ad09877523781bee83a73bbdc880f1efe633e61a4f6deb8a00a101425d4e9c97acdfdd2020922003774c3c54dce", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fefe", + "result": "valid" + }, + { + "tcId": 23, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0486333d305893f06764582f53ca483737a9509b4e421f61641e7ba0471c4466bb9aa0b82b3057a6ff8f4f8e0e41de5a530b3e75aa9366c1cdb962e0a53ffcdc409f821fe4cb34ca460e8d3badb8cd4bffebf0a32821014668521698521055bdba", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007ffd", + "result": "valid" + }, + { + "tcId": 24, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04b6c82814711834315f7415b98a179c7d7d2d8fb0f1a20bb9d5b8e69bcbb1120b76ce8758b622b0d1493312463da3734d7652df938ae7a9975085e463176c0934c01f95d9e493062892c691420c587f68c5468269c2563d61203ec55adccb5fb2", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000", + "result": "valid" + }, + { + "tcId": 25, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04033271ef42d92ad47b273b09ea2f45401161baa52696590d0e175ff2d1c0dfa3fea40e4266d446546c05e480d57fabec7889f16a8bcc176602f6d46561614a2f4284abe697b7cb9ce79f7e2e71b155cb1f155ce925d16391a680eda23152e6e1", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff", + "result": "valid" + }, + { + "tcId": 26, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04c4341928e10696d3cafbfb7569e821b495ed832f61e574bd446505724ef0f3735bd981afb544023c0569b26d631e93b01dcbaa58c46ad2b5da0b695decb73094af8bb47693eb7b726999d27543e04b62fb03401090bce593d136cfcdac88aa6c", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000", + "result": "valid" + }, + { + "tcId": 27, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "041705ea1cc5045c7c8f2bba2c5d989ce09eeef677b6c010ad049661cb6ad7cfb27b58ae3a5e2200e1018160ba59a2aab5132e2b8c5e5788bd04fb9ef7f7e62df4358864ae75063ab266481f8b3e48ef974d04ed05e09ff31d534815c4b282fa62", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "7fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffe000000ffffffc000001ffffff8000003fffffb", + "result": "valid" + }, + { + "tcId": 28, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04d8ed4d180d5d339bcd629532f2e4e555edc2361b76bf362d99666949da9561f29c5d46fd9e5464391f9775b96f7de8c9b6f68c4f0a65978e7ce8d1b9394f3b7b7248ed9f6ef60d57aaeebf90d1803e9a8c60ea4ce3cfa4b6b5141be0f597ea4f", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "c000001ffffff8000003ffffff0000007fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffe000000", + "result": "valid" + }, + { + "tcId": 29, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04b0341a9f0cf82b1b203e8f0117ce69091270bbcb4e3080baa914386ff0602c3aea6dfca2b48588fb2689c63973c30c4cef3e70b592f5080c819aa9649612c0c2f891e3950f0a5ddb100ae64f9c7150922c93e9666a43e63d16c6bd1acf9015e4", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "fffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003fffffe", + "result": "valid" + }, + { + "tcId": 30, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04e58bc72505de4d2ecebddb1d395830e728d8c707362ce16ae69a73c1e8fa1693a1dd594118cac99905165f92480595307eef882bff3dd623566fd3ea3edcb357230c2c84e779a785188c374c09bd7d24cf2d0910a480a5c4d31cdb3ad7a499a9", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "00000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffbffffff", + "result": "valid" + }, + { + "tcId": 31, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0467547cda7fbe8f16be5a4477cbb02979f1af72fc0f39302773552fbcf4667a8e23abc0e12856ee6234deeca5f22ae0503a4df7c068e7432417260cb9fe0d68b9c7fcf7e16a2ada05687d8f8900b84723103edbff0a42b27517da2760b7d38843", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff", + "result": "valid" + }, + { + "tcId": 32, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "048baf422cc761c0f2ba1bcf75d3e90b8d208534dab219f486efacb8e395961064b78bab2db7fa0d99859263c6fa8460c639869346aaa7bb65aed42b5e66fe5876385faf5fa0509c92e90baa8ad1725655d4d9bf0ce77dbb0589262ed12896436f", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc0000000", + "result": "valid" + }, + { + "tcId": 33, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "0491357ca87dbb08e85d7b1acecfd1e086078a82d19f81474da389364a39fe2543eb934b440173c38e61a1d9407855b5d89ef0d9e920764b6d7765b084cf9541dacc43d1dabaa390b0fb856097b0c00a8556f4e3848568ab4ae790c3d346ca01b6", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "fff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff", + "result": "valid" + }, + { + "tcId": 34, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "049b52ab1a05119d66afdfc3cb8e461c4708770568b44004ff18854bd4319419b3d7f01f07c3f1c3c7e9622fa461788eac863a21957f50bcf172c38446122c16a7455080a0cb56e46cccd48f78192fc3fea72e5d016a9e85d1aa778ed7316df317", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000fffffffe00000003fffffff80000000fffffffe00000003fffffff80000000fffffffe00000003fffffff80000000", + "result": "valid" + }, + { + "tcId": 35, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04f63208e34e7e90bb5fb036432467a89981444010663b8533b47bfa94bd2bc16f38aa516b930a4726e3876d3091bfb72ec783ed4da0cac06320817dc8bc64f59ccf06f48abc4386a150913fa95743a7b4601190e1c6ee8f8bf6354b254ecace45", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff", + "result": "valid" + }, + { + "tcId": 36, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043c261ffbf6f7377b194f7e3a0c3b0986d4d7d9ffd437909a9ae72ffa419029800c3812b1f1e63255692f38caf7317d5b56c42d0bedf4e4e46912a950c24a6f8b0f409374a6e434c59e80b81e351b8beb265606b7cf6beaafaf840c7bc275913f", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "result": "valid" + }, + { + "tcId": 37, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04b9a1e0f43b7acd179f2b50792c5fe9b1766aede6ddcb4fac33637e368aaac91f6def88279f4ccf2b49b91faeb38af681e43bbf1dbd8853732aec7416065946f8c58ce75ee8cb81af10823d4c76d9dfe0a79abf8dd4ef50554a84eb2b23814a68", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ffffffffffff00000000000000ffffffffffffff00000000000000ffffffffffffff00000000000000fffffffffffffe", + "result": "valid" + }, + { + "tcId": 38, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04522b841f9ab98282c12a75625b88cc085d3cc619bd874b0830d0f927fe64b1520284f1717ce6c23e204d2ce90a96c48fd082d92be80c623a1565c71f29e7e2663371897f437dc058c74a0b0bfbfc5be4c180473e7ba5989d2d237fa1d3602b19", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000ffffffffffffff00000000000000ffffffffffffff00000000000000fffffffffffffefffffffffffffc", + "result": "valid" + }, + { + "tcId": 39, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04db5910284217954f5fab571c2f36632bce6e34e3e494a8d879318410d0259c64f24ff817de22a8ebeb5aa01e535b76b3098ec4ce98c70d182fa0f9a9a1cbbae9b5806dfd9e5487c1cd8f8d75c2da66da281075d0b115b0064449fd17b8b0b7a7", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000fffffffffffffffc", + "result": "valid" + }, + { + "tcId": 40, + "comment": "shared secret has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04f6be4e1d465ded9f9d8ff22a2ddeb66e0939c2e0040f32db882bfc7cd90a8ff726fdc9f9f1f87f7d7abd273ea9934e142f48505daee822b53bc0068ec694f9c8718a1724fa7c4e47345df36b5015cf57c8985c62e0e857a93f6817c980f29acf", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000", + "result": "valid" + }, + { + "tcId": 41, + "comment": "shared secret has an x-coordinate of approx p//3", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "045c6ec664e5212f0ba35465347105e658641260354ca8fcd77479464c3bbf2a6eb22104712b30e3879857b21a4c66ad396fbff4263e4e59a3a294c59d80e6f18103d0f8a08f78e10f3996b2e4dff07b3301e2d42384fab1ce304fc2038228ee74", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "5555555555555555555555555555555555555555555555555555555555555554ffffffffaaaaaaaaaaaaaaaaffffffff", + "result": "valid" + }, + { + "tcId": 42, + "comment": "shared secret has an x-coordinate of approx p//5", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "040daae48d4d4f37cb65d829f03df3032d65623242f8e025dd8ad64c3eef5af4c3362784574eb899849f247e47e43d2f294074cc86c4f0fbea55b10b13270f30d771cd01e4cec2c6c543aa48169d1becf8673b2af644b3a6f5222d357b90d5e4bf", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "3333333333333333333333333333333333333333333333333333333333333332ffffffffcccccccccccccccd00000000", + "result": "valid" + }, + { + "tcId": 43, + "comment": "shared secret has an x-coordinate of approx p//7", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "043bb65a75bfb67660a30a41fd2596599b925bff83e76c1f15cef02dfb0d6562f2bd0ee504bf8c8d098d051745ea6130f045fcbcba02f22d839305c7d15cd78fd668d8ae5be12eb573f015e473e25e1e3bccc58068443741453d14acb98525d315", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "2492492492492492492492492492492492492492492492492492492492492492249249246db6db6db6db6db700000000", + "result": "valid" + }, + { + "tcId": 44, + "comment": "shared secret has an x-coordinate of approx p//9", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04ed730b037853e88f5d6f87630ecd4bd90bb410b8de550909bdaadaff6971534db172d1815c2150c6ba01a5267c9a7f48490b873cdb59b8fe0d173f8041b782066d28726adedeaf3d2033286e453c36c55cd326778c5c7a9b8d5d849099ef7a64", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "1c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71aaaaaaaa8e38e38e38e38e38ffffffff", + "result": "valid" + }, + { + "tcId": 45, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "046fcaf82d982d222d6096ba83e55b1c7dcb71a41e88f323333f44284d95c4bd3616da7a1bef928f31c26f885ba7adb487826fde2ed9f5649c11cf8465f8bf8ad50f68914936fc39666f68219d066506bea4001fdc816c9a90e7e2afb19bea085f", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000001f03123b00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 46, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000000000000001f03123b0000000000000000000000000000000071bd1e700c34075c3cade8ce29d33724af68a7672b265a4e157055360440ab7c461b8e9ac8024e63a8b9c17c00000000", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "ea817dff44f1944a38444498f1b6c1a70a8b913aa326bc2acc5068805d8ddd7a5e41b8ee5b8371a1cf3f7a094258e3a6", + "result": "valid" + }, + { + "tcId": 47, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "046fcaf82d982d222d6096ba83e55b1c7dcb71a41e88f323333f44284d95c4bd3616da7a1bef928f31c26f885ba7adb4877d9021d1260a9b63ee307b9a0740752af0976eb6c903c6999097de62f99af9405bffe0227e93656f181d504f6415f7a0", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "000000000000000000000000000000000000000000000000000000001f03123b00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 48, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000000000000001f03123b000000000000000000000000000000008e42e18ff3cbf8a3c3521731d62cc8db50975898d4d9a5b1ea8faac9fbbf5482b9e4716437fdb19c57463e84ffffffff", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "ea817dff44f1944a38444498f1b6c1a70a8b913aa326bc2acc5068805d8ddd7a5e41b8ee5b8371a1cf3f7a094258e3a6", + "result": "valid" + }, + { + "tcId": 49, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04bfeb47fb40a65878e6b642f40b8e15022ade9ecfa8cb618043063494e2bc5d2df10d36f37869b58ef12dcc35e3982835fd2e55ec41fdfe8cabbbb7bcd8163645a19e9dac59630f3fe93b208094ff87cd461b53cef53482e70e2e8ea87200cc3f", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "0000000000000000000000000000000000000000000000000000000036a2907c00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 50, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000036a2907c00000000000000000000000000000000000000007f57b69a014783dbfa4967b2f9cfa678a6f0b6e9cfd41648cec5b3c498e72152da3f82d3da2e8e9f8ef37b11", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "bfa93e184f76279fd707d53ddcb3628855cfafb111bcbd0b4df6ef77aee624924d681626a153fa4e59c923b71fc090b3", + "result": "valid" + }, + { + "tcId": 51, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseSharedSecret" + ], + "public": "04bfeb47fb40a65878e6b642f40b8e15022ade9ecfa8cb618043063494e2bc5d2df10d36f37869b58ef12dcc35e398283502d1aa13be0201735444484327e9c9ba5e616253a69cf0c016c4df7f6b007831b9e4ac300acb7d18f1d171588dff33c0", + "private": "00a2b6442a37f8a3759d2cb91df5eca75b14f5a6766da8035cc1943b15a8e4ebb6025f373be334080f22ab821a3535a6a7", + "shared": "0000000000000000000000000000000000000000000000000000000036a2907c00000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 52, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000036a2907c00000000000000000000000000000000ffffffff80a84965feb87c2405b6984d06305987590f4916302be9b7313a4c3a6718deac25c07d2c25d17161710c84ee", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "bfa93e184f76279fd707d53ddcb3628855cfafb111bcbd0b4df6ef77aee624924d681626a153fa4e59c923b71fc090b3", + "result": "valid" + }, + { + "tcId": 53, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003cf99ef04f51a5ea630ba3f9f960dd593a14c9be39fd2bd215d3b4b08aaaf86bbf927f2c46e52ab06fb742b8850e521e", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "6092a1757ddd43a04e185ff9472a0d18c7f7a7dc802f7e059e0c69ae16c802651719406e04de27652ff83da4a780ef2f", + "result": "valid" + }, + { + "tcId": 54, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 4", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002732152442fb6ee5c3e6ce1d920c059bc623563814d79042b903ce60f1d4487fccd450a86da03f3e6ed525d02017bfdb3", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "89c804cb81443386b185bcd9e2e6c35ee6177c3b90298985c4e81a89d520cceb17d729540e56ecc343c26bf314f2d052", + "result": "valid" + }, + { + "tcId": 55, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 9", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036660041b1c7984620e8d7fd7ccdb50cc3ba816da14d41a4d8affaba8488867f0ca5a24f8d42dd7e44b530a27dc5b58da", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "35513157e804bd918d04de202778b81a6fc7ad8aa541ee94116a0f18466725d75e71c6942bf044b1b0ecba19db33e0de", + "result": "valid" + }, + { + "tcId": 56, + "comment": "ephemeral key has x-coordinate p-1", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe732152442fb6ee5c3e6ce1d920c059bc623563814d79042b903ce60f1d4487fccd450a86da03f3e6ed525d02017bfdb3", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "edf040bace18d90bf9ce720df2a3b31d76d95b7ed9530a159ac0b24e82a871033eada40552f9e606f7115e6a78927511", + "result": "valid" + }, + { + "tcId": 57, + "comment": "ephemeral key has x-coordinate p-3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc2de9de09a95b74e6b2c430363e1afb8dff7164987a8cfe0a0d5139250ac02f797f81092a9bdc0e09b574a8f43bf80c17", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "200aef7a451b8c63ba70c04c6bca08e638d8e790f0f1856f9f627c2ce5000c7ac55e798a8980a59ae08a6ec9035095b8", + "result": "valid" + }, + { + "tcId": 58, + "comment": "ephemeral key has x-coordinate 2**16 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000a238f1af3bdb9ff563b0d0bdfd18323518b74192cd7a25f4b5839b8b078f3414eb8cea4949382d67987f4ea2d29cfa7", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "731372d49ea01646c43820996816228f9d297684f8081dabd7d50635cfb99a6e51ab216fc427d494e9f439a4e161c167", + "result": "valid" + }, + { + "tcId": 59, + "comment": "ephemeral key has x-coordinate 2**32 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000009b94cd34fbe39a4e2282eafcf499c06fad8f04745a76623ecb773f161b80bc486ef085d3f20d1ae393e7f375f5a2214", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "abf21358c97653afaab81620987662bf548e491a75f80de45a80e91d7dc1c58d6b88a4669f7fa5ac7212de1b124b9d6b", + "result": "valid" + }, + { + "tcId": 60, + "comment": "ephemeral key has x-coordinate 2**64 + 1", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000101d05931f25cd9e445e940792f03213600dda63bb6f37f64ef3af9fa53b1285ba3545bd82e5ad81fc570a2886cd8c422", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "b6467d72cf5ff03d53b9c1ff581149e9205ddf54ee328f352403e29f85b1619665a22134cfaf0bb0f67bba9f9ebad423", + "result": "valid" + }, + { + "tcId": 61, + "comment": "ephemeral key has x-coordinate 2**96 + 0", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000041365ad130e3031c68d24014d7cac477b91328d4aa01e0791294cf80ad508a85e9989022d46d67feee998de6010597b5", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "3d849b8489a5a61e31ead6cbefcef509ca8cc1ac16ba75a395170f93c7c2e4f5c5a027a8c6141a3fa03e4a400543a284", + "result": "valid" + }, + { + "tcId": 62, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047c25a4f57f76ab13b25cab3c265db9d9bd925fecbf7bf93bef1308778646628decab067ed988a9755cd88e88de367104562ee0c57e71d96cefe31b4c4045bd4086a38e8ab9adf2d5567be318051d70f3aa68b753f271ab032b6abcce919e2962", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "56299684ec5ceb09ba4d94d1231005a826c9c08a5219c757e0136cbe8b6430badd4925172f2939891da7c7893850512f", + "result": "valid" + }, + { + "tcId": 63, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "046a99a5acd4a7edb1c707d7f8be12e81140338e3e14ba563c703c681a319a3f9ce1f90f032bf840f3758e89cb852ceca63cf99ef04f51a5ea630ba3f9f960dd593a14c9be39fd2bd215d3b4b08aaaf86bbf927f2c46e52ab06fb742b8850e521e", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "f58adc13ff997d38383910db7befb17670393a33d95b049c2aa19d760c8e728ecedd32168476b90b26a3742dcc121b07", + "result": "valid" + }, + { + "tcId": 64, + "comment": "ephemeral key has x-coordinate that satisfies x**2 = 7", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "043b5eed80727bcbc5113b8a9e4db1c81b1dddc2d99ff56d9c3c1054348913bde296311c4bd2fa899b4d0e66aaa1b6a0dd7b7f0f28d55e2f3a50f1f1bef3976834a05b43418e979303bc0363ed16d2d0b4011cc37b3c06ad73154faeab7915cd87", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "1fe6fea5f00d3005abaae2267ff18e430915838d87909ab503885edf38be7618ecb321f0a4df71b0913fbf12c76fc1f0", + "result": "valid" + }, + { + "tcId": 65, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "045555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555520e2e16767adcc10e411b7de3123c804391e6534a58e63ee92d5148cc39836179d6e26f80813d1e98e37d2a969aec1be3", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "59dd421ec1f56010516604d9f5b94db3c33c5c26f1bc903b89251ef972eb74544d571bdd3c4fcfc0bb2ae0810c8dc6e1", + "result": "valid" + }, + { + "tcId": 66, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 2", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6690397bd6b2df628ee0507b6ac6961a1e77a2a5f48b9bcd595bfb610fa05a53cccfd8fa0f691545cfb8a1b6c067f64d", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "4e045911b81f5576e1537bf902f0db6f4f258e3929fffb8af70c321b01c24672aaa54f5c7fbf91b83f16dc671969e51e", + "result": "valid" + }, + { + "tcId": 67, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0433333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333251b707c19c0c57e6ad6fabf90f9c11d4b802affc35b461a5c383c285355a04d833c75eeef18e9e890e778707ea93b1d3", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "5e68b8421a259bad77c2c124ddc6ca913a6d1fdc2159180713a733b8651a487eb5ec06011cf3841b85d94b29b31af32b", + "result": "valid" + }, + { + "tcId": 68, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 4", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc950c56942f0cf776bda4a5773d769f7adb7a817575751bd293cde05b7d074cc341dee22c0863b7f7b98d4bca9536f06df", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "df3eaf286fc8f8deed2cc489216062c66ebf658accae64b8a9c41fc48ba68a1a7c9d7b3931840333fd8dfeaed444547a", + "result": "valid" + }, + { + "tcId": 69, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f1a994e9946bd1a9202ee61d41f736d55adbc49ca78b9af61ff6242959bf6dc69bf5ce32d34141082db4040d701b185af", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "ec48e5552f5d908c1239a9918efe4128336215c39cd01bccefa560492e4dc119b4f0c9ee92c322691cab61dcdc0ed0ad", + "result": "valid" + }, + { + "tcId": 70, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 8", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f06a6ecc3ca0806d93ec019a5e3af17d1b1be0e10909a121c66b714e7f580275399b0ab1ea46203b55d112715df55b782b", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "db2f3bd6d69069a606db9742e64b359b7239f92a9095740cdb717097f21aebe37a08723328440ce68899f52f76ad9ddd", + "result": "valid" + }, + { + "tcId": 71, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fd095e76c09278559895613c30488f922ae16eb89ef5b6caeaf3a7af9b3448cfbbad1e16413bce3f5403b573a660a6355b", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "38cc57d3fd3d222e3e5f1fd297c41d34676b375adc4fc30291199e9ff8925a4e30cdfebce55f2c3707d124655b290ff1", + "result": "valid" + }, + { + "tcId": 72, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 16", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00fefe70cb2fb7d6c8fcc4dd85e2723255ff75ad35aa26efb31f40b12e8bbea8d58df10993da601954f06e0d6f1992db276f84", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "f5fd3077a22b2b652ba986dc4829f94802b48114e432442bad687ff6cff65f907ed62dce11bf760f002e239f67daebee", + "result": "valid" + }, + { + "tcId": 73, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007fff0001fffc0007ffd29b05400a10f4a6216845904392afa143bc8735d26517626e5301f95ed461ad51873e181e24977fa8e31d1c16c4881fd", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "3087bf378e4cedbd7572d799b831b55820d8b0864906d7d63b911c9d9c9668dc2320a9f6ff772b292910fdb26f82148c", + "result": "valid" + }, + { + "tcId": 74, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 30", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff8000fffe0003fff800065759829754b32cc1bee15ef0783ee44a19e17eea145e1b0abb9f311f008bc22da8a10019dfea504b80e19c83f2b1b97", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "99b40a3447a0aa7d764664af7ce683befd4b14a70397145d8a7884f95617df082a840097cb0d839bd98b9a3a376c6a3f", + "result": "valid" + }, + { + "tcId": 75, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff112e191f1f78bbc54b6cc4f0b1e59ae8c6ff1a07f5128e41dfa2828e1b6538d4fa2ca2394c6aab3449dcb3fc4eb44c09", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "f3486244119b3632fd55be9e6951eb5d9c8c62f6a27042f94b924155ecfd4ff8744ba3d25bcf85a7b925bd28a12b897f", + "result": "valid" + }, + { + "tcId": 76, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 32", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff0000ffff00003e134991776e17d2396b4d8d9e5c87aefd747bb0640100e2bef90433a34a022fc32b4c7dbede181a7ff0eb77acce3596", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "06d422aa4fe7e2152581501624059d91280c1d9d7cfee8434aba55144adf71b9a569db0d458b9dec552b9622a69b9fdd", + "result": "valid" + }, + { + "tcId": 77, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "047fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffe000000ffffffc000001ffffff8000003fffffb5cee8e414776206cf8074d1317d7a4332712330a970cc66bc83897e22dc98a7e93ea12407a8b602f6f9f7ce639897250", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "310f69a8ab8b6d3ea442e3ceaf744e14941268cc2f25278a7334ad45e92127fdfe5e1a7d0e1b2264331c478544df080f", + "result": "valid" + }, + { + "tcId": 78, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 51", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04c000001ffffff8000003ffffff0000007fffffe000000ffffffc000001ffffff8000003ffffff0000007fffffe00000070a8fe45518a73ad01473c37060b8d712a8b6694efd15208c9a36cbeb77c56b8eb4fa9c330b54ad9e60b1acfce63b47d", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "c38e3a60b02e5aec2a6bf49748fbc977d5e2693c11b8f0fd6355dceb7862277899772912e65b56b41ccdb699bd2fe964", + "result": "valid" + }, + { + "tcId": 79, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04fffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003ffffff0000003fffffe7df648426027f58513c469149746289b27c7913906a8e57efed48e9b7be4e1648559571bd37075eb88b4d6ed23a5b014", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "1406890875bef685c15de45156eea1660f3e0d58f3a76a2311e23101bd4bad44e3a2cb3feb40968cd411b9bad6ed708f", + "result": "valid" + }, + { + "tcId": 80, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 52", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffc000000ffffffbffffff0bf95a0f45a6ef3eed1cbcc73f8ab000cf9487f4e7d2f77f986dc0edcea3b31ae4b6a7dcfc1ad6f6173d102c4a5c5e3e", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "d62ace7e4421d7d526e84c151078d9308b8b5c6e4202c57e36a7cbd25fe490e55153b0d868744be27ee1d80285347905", + "result": "valid" + }, + { + "tcId": 81, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff00000003fffffff4987abae412809c2fa48fd23b1bdf9e622f5a606c44117215ffa61b18ef46e54a7fbbf11f9a6ba59c991b4ae501fedce", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "b1e8aab1aa633d98dc6b768594e1e3edb801a9ef483f287c83e19744d2ad343ad3debdc4dc178213ad6876b52284f552", + "result": "valid" + }, + { + "tcId": 82, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 60", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc0000000fffffffc00000005c7cd6f0ca8516cefb1385f45e50af7c07ee80eb98531dafe45a36f6e3a7e58d076ab884c6077e6945216adc2bd1b184", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "d9923ceb118824b3f4ead329b7dd10506ac07fa3d660bd9aaf14fa38f4a026606f389eae04a1b29d4ea9f5a9c139a00f", + "result": "valid" + }, + { + "tcId": 83, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04fff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff00000001fffffffc00000007fffffff6c70898ae6fb31fa2f086562af2d10486ba4c6fd5e41dfe4aa61598b4707a3bc276a62feb1b98557e3b17c025f7adf4e", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "88a544a769d5c34a051416bd509dfac911863f604c83ea844bf0e4c5c272dec86d057a88b152a9274701938c705900c3", + "result": "valid" + }, + { + "tcId": 84, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 62", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000fffffffe00000003fffffff80000000fffffffe00000003fffffff80000000fffffffe00000003fffffff800000004ca402a62175da91d77e7df7af95ab0a2fd4ca4ea5a27502984536ce57dc364f8ffb8704467d70e11c1bcc7b6abf2888", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "6dade083a56c79629bf41f6901cfc7df30a1d42b6d01b0e7d87240d27015ea3f07ed7b96266d09123ae770fa88396685", + "result": "valid" + }, + { + "tcId": 85, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "0400000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff70370385413d3eff6fa3407ba24f682c2b01b51445dbdf5ef7b0dd0979f17e713e09081571f1e94dfb66bf282002f39f", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "f689f6e475b4e15162521acab4637a3cdb9cb42aa92f9114b0ee300ddae89d5eafff3463a1f5004a2a1bd4aeffa47b78", + "result": "valid" + }, + { + "tcId": 86, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 64", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff0000000003ff5df59802c4afcb370d0485f1517f1ad29481b93e94f345ba795cac07651a41a0604edbceab6452d10f3cc82867e5", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "e9ef08f3a1b8cb6cbbc084c374e5066a09f965c09984c3027490c2df46f3ac5b29f10ae573daaab40ad8a5fc6df6d8a5", + "result": "valid" + }, + { + "tcId": 87, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffffffff00000000000000ffffffffffffff00000000000000ffffffffffffff00000000000000fffffffffffffe40a280179c95dbc81e6c2a5af8fd73bc3288c62bbbf3a6c2126856d0e6bcba33c69c465e39cdcd2d9f6794ac982b1d03", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "7e9c2b64e84baa58bba4ec97a2fdec4e61c888280ee4cbfa4b565500a385b89c79b0b9885fede22d0dd18c2273c33412", + "result": "valid" + }, + { + "tcId": 88, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 112", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04000000000000ffffffffffffff00000000000000ffffffffffffff00000000000000fffffffffffffefffffffffffffc6fa48a8fbf908debe148bf6f37b0ec14b3737d31c06703ba50dbaa1f366764ac751916feba7b00caaec8e24780cd203e", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "5cbadb416abdcd6f61ea44612d6269a54e3ab673dff497a5fda32b7e7c36a7571468728001eba0b5b8b4c03cd7f80c29", + "result": "valid" + }, + { + "tcId": 89, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "040000000000000000ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000fffffffffffffffc05e5bed58bbda2f39160fa02f4efda1787a2f9b6e47e04d1aa84b00b213f81fb4ef3e06851ba091631ab6c76b7e638e0", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "d47b1e00af6f32301aa70a6ba660930c3585b4a5e142f8cb28d8ed0a5ed3288dbecec574713ef8f3c9dce281939612e3", + "result": "valid" + }, + { + "tcId": 90, + "comment": "ephemeral key has x-coordinate with repeating bit-pattern of size 128", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "04ffffffffffffffff0000000000000000ffffffffffffffff0000000000000000ffffffffffffffff00000000000000004546f6d2a8e3b1bac174a6b82a69c5ad0b2e82fc9f717cbe2ca3f706aed54ae7f8b00d8accb23d8bf885e7294cbd5100", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "8f4d736808a00e7506f0d0e96529470a70ad58046d59fbe9ab619646347a64d78cd4a071d9567195b1eee051b3fcb782", + "result": "valid" + }, + { + "tcId": 91, + "comment": "ephemeral key has an x-coordinate of approx p//3", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "045555555555555555555555555555555555555555555555555555555555555554ffffffffaaaaaaaaaaaaaaaaffffffff6b43c195e844c8644ab19430687ef70072e8415ac723e06be802364b62e2f8ef74b3395806db736dc5ad68bb9e47bd8f", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "1783c15fa810c276bfbade2d24ff690f6d22331b4e9ec13948db959c2807f9a3564a074bb7cccf14584a63a10a0bf038", + "result": "valid" + }, + { + "tcId": 92, + "comment": "ephemeral key has an x-coordinate of approx p//5", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "043333333333333333333333333333333333333333333333333333333333333332ffffffffcccccccccccccccd000000001e5995597d039093724349708a5685ecfdcc4647b043a1a7721ce407199b2e931945c4df7096734354b152d50c996dc8", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "070e68f86a8f929ce50d2ae73c39ccdc1bde4b8a68373486040f2f529838bcf25a66c08b64ff56bcea25e20c3ca23772", + "result": "valid" + }, + { + "tcId": 93, + "comment": "ephemeral key has an x-coordinate of approx p//7", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "042492492492492492492492492492492492492492492492492492492492492492249249246db6db6db6db6db7000000007616bae12614bb7bfec096de83fe5231a63a767da5f9bbf081a3a6d60d463fa94262b8f4dc79732f3724969c1d5c58ad", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "693e4be98b55ef432b2cc8c7d7293f04df7d0b9d1184ae678ede285ae891b37ce779c995979a893079e0b20459333795", + "result": "valid" + }, + { + "tcId": 94, + "comment": "ephemeral key has an x-coordinate of approx p//9", + "flags": [ + "EdgeCaseEphemeralKey" + ], + "public": "041c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71c71aaaaaaaa8e38e38e38e38e38ffffffff482ea753587638bf473bc1e54ed23c35979b0e2ddd3eb158cc1095a88221c41af9cbd74445c0b3b1f1e3f1c662173f35", + "private": "2bc15cf3981eab6102c39f9a925aa1309db59c2c02a54411928d73c3945d157848dc36959efef7495c8528ea284c1c97", + "shared": "3c30605f3926ab2db7ad239f4f706c66cc0ec6ec6cf528aa5b7a5199c7815790778f63a92105b69f09e38aa8a5e8a453", + "result": "valid" + }, + { + "tcId": 95, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0487221e1bb91d5b6f6852b8026b4f07fa3feed095f9173896854132a1ef7740205f57a5a8f157ea59837b27677e465bc86385be41e0220ccb27e61d1539ac35c0230c1a7085fa1b35a4fccbee2f31c91ec56ad0e20d718c66e2329e09f96f2ceb", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "f722b9e9bc9ae1658fe88be2b585cc97ca6e3ceb0be0b7cf6a948726686d9182045fa7291cb185164f8e777649242dc4", + "result": "valid" + }, + { + "tcId": 96, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046b138927e4ad26337dfdd9ad78cd761f88e5211bc15c7220b14bbc105c2b613653ea97aa9fcda2602e544d8c82415369e13e740a10c623c2cd81ece5f02118e2a0ef79d90289ad5dc7d6a732e5280329bf5d28c36b3e984d5f2f4d10ef29be46", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "cb118903f92df6c826b3e51052d0f8245f591273adf80bd1725d203a5ca66c61993c4480cc2d06cc9e162d16d418cd45", + "result": "valid" + }, + { + "tcId": 97, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045dafcc0482851a528203698f08b4f6f1af85fd0cb5ee9f77f0f349e300d6c131dfb9d8be4dce6368d22731d5cd6a8a1e0cebaf350f3446e037eb2bacd51399e866378e9ecbfcdfce0c881292ea96d8376c8545553b5873390d30b80249208adf", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "fc0bc4d7bc4b36fb3f71bc23063826ca004fdbe2d9216d6c7a625ae1ae8bb0d91bdf4101906bd16bd3b4fc2ec600e3cc", + "result": "valid" + }, + { + "tcId": 98, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0478dde1e446e2a49097ad47fd94b0f805c0112f6a06e8c7697abecd5e1088bfdea0a85a560ea815a67c84d89981b9a4372a3bf4402ac924c1a326287a75641fd41ef0a7e1206d6f5e2e907716a93a130aa84479583f62aaa70db93340cb6205b8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "386d769a37ae44cbe84c5fa1dc27a1c013816c1a4072bbd11e785ac2b62d1389dbd07c134b4d896fa34ef055afeca542", + "result": "valid" + }, + { + "tcId": 99, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e625b5d3cd8f95129ef9aa55c0eabc0a1f83dfa0f8ff0b8ca94391a89f541d1f8d7914b32fa2269410814917d09a187e9414330a1ee587807048a4f21e484ad50cd795cb9987f2563553086597c60b5982757fcb8a131e5da8b70d02eb90ea80", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "192f3ea1ff90261c37a3a93421a49e8ebcaf95719605f3d0e6469e7de010735f337b638bb43baae40e202f3cb882ea00", + "result": "valid" + }, + { + "tcId": 100, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441f5e0f1d139389ba5e46b0ea7cb41fe39b4a0352985321224aeca649ebaaac395b1e13208292070b58fa95cfe04f5567a281496f3771f5c3132a4dd095c523efde5dcb2399117c377c5497b5d41cdd18db845d7468356344f5885286166dae0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7bfe6c646da528c5bd9fdf63b63fb9439bc2da2f413d18e86cf7b39f325866abc95dfd9590e7220a33b44b8b162185e0", + "result": "valid" + }, + { + "tcId": 101, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0437bd3a7dc8e717acf9a35e499dfc9259fb553444e81ad59a94e41cd7f004d1466e43b47ed8a1f696bfebc416928df0037e7be76689e90387a3d0135ff1ea68a6679a78772ad5664cd5369e037bd658be62b57f43d4a7fcb9a82236e72dcd879a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a323b179e30e83ba66a18e788446344370895c326bd5a7d9794f313ae8326624e807fdcb95e36fc0d252de62d0da84ff", + "result": "valid" + }, + { + "tcId": 102, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b01158db048835c199e92a9edbd5591ed25823bf3ed8553dd24fdf154adcbbfd6a7dddcdec348b5f782c7e84626292e30d4ef3c9ffd37c2484466e13318dab8b9b65252cdefe7d591e85c2dad5ab15fd8e0f5fa7aeb711e119471481410c9d9b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f7070194693c8f583e91a03e1e9339e63ac20ace30b07d36462a5a5f0d0455045d1e5f970dc719dc36e5a4c97ba0efb5", + "result": "valid" + }, + { + "tcId": 103, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04586ada79feb758e88a3138a3ecd471bc6e1f6e327e91150f7ef1d4487f9475815a7c331c38a718c0bd2ff8bf982e563e2d63e9d2ce15e3b2e328183378e202e27b5801354b18431f3eab70b0789235bf2b938269fb903c67f100070aaa48c3f1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2f291ed628b139d70d57d3c9167fe8de85c60a5aae550ebf682a72cc268b73970e7d6e87220a53623b93e554d298589c", + "result": "valid" + }, + { + "tcId": 104, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe732152442fb6ee5c3e6ce1d920c059bc623563814d79042b903ce60f1d4487fccd450a86da03f3e6ed525d02017bfdb3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cd2be8f803e732de163d2b502ba69efb397093a5bd6972358e0a3aa0f29be841742f1a6a73912655959bf29a43e97ea3", + "result": "valid" + }, + { + "tcId": 105, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04389fe3ac7ebdada1174735f0793760e3379279388f3393f4453d49de3dfe4f809fba58a07bd43a0805be005d42954afe6d12f5f29c00ff118437217d40ec4567f72ab41d17d0a106c659b8294f50807d3b790e6b34e2e75ee64ffe6bc4039975", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2151a9452b258a4bca9671db89d01fc44c08361fb3f8004e89367b8516d2de4959255ca29ccdd047808b55bb58088c1c", + "result": "valid" + }, + { + "tcId": 106, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b398054568d731b86488a85fa0a50b85b6093cdaa45ce5c1a40b1829068bf65881fc2702850a6b430842cfc271f144087cd478dd3938ad40cf4fa0720b684b90d555cc288b26c282a314fe4fa3a6cebb321f1dbe4c0c7673ba6e5854586df91d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e4c54f79e24ae82aee5e9d20c38d97e4fa48b81693e9f369165d1d22f61a937b272ceaca07c27ef0b9659ac06f82c74a", + "result": "valid" + }, + { + "tcId": 107, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b0e3119df5540f598a3723cac0b3bfb4de95dbf3c50dae8d647c65e81d6adadb304a33062d112ad272dbfe5c0b340642558719927de258d1373162579622c5bfb79aef25d3a267303e2ff836470332229d61629bfe15e4ef6c4ef9b907922eb5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "38e1631534ad6e480baa612849014e87a1bc369166320b4a53f0cfb969173bfa1964a1058c710681dfe1f71058172bde", + "result": "valid" + }, + { + "tcId": 108, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f03121cc6a4feb23bce7c64d425b61efd0b61f8e388c77458338487ae0b1dc0d56ef551801a19128a827f19ce342756cecc4c6010ab5dffb18ca8baa312d3c47d68f3d6f710f6f52a7ba245b0a8ae8e092d5ca51714d739ee0b0883dbc8356e3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "820a0d971030eea67532b3e481f9828c024e4dc5bd9966ea1d5d326dc080453a45a3282fb84cb44327ff68a9f39330cc", + "result": "valid" + }, + { + "tcId": 109, + "comment": "edge case for Jacobian and projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0489a36d2c5d83db0cf8bd2b2137e65a7197fa3c15f223c74abb41e5708174aa4bca4e89bfd361a314dc28137f4c1cd513a0127bd025f0131bc1a8d826542616034ca61fe5e9e48148c6d8e46dac3a6239fb79daf38cf0b4e61f59a405bd860c35", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9df1d7ad61d52b058b73a830e05fbb11dae39ea6911e340f1230acc71d9efcdb70397c8dfcb993975a11b99964c815cd", + "result": "valid" + }, + { + "tcId": 110, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046b63ac9cd1f26e4f6430a9319a2f7f8fef88e271c2b0cd438faee421ac78d5d2800c33132a77f0a04743f7f79a0000a742e37739629349f0c5f166455c96ce7ba17eb2386307b3170702f085a741f7c1e5894107e408bd891fe57df45c670fa0", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "f8778032bb70e0e148a705b60e8eb238de1664460a91b5a1e44cbc6c4057b6413f337f12ced156dc90c1cedc6e9e4452", + "result": "valid" + }, + { + "tcId": 111, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044b734df08b7a73feae1c0d4210d2db1164bfa5a87d7e57efcb25904abd5faf055d9e5b7d05ac901b2e68449e1f5b3c5f818d5ced7a1aed47fdd1b0bd242bd9d843515712c972dc795d8bfaa52660e63afe3f754639a59d8c7fb17dc4806bd055", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "2908d5113dba728fb2cd79455c9d2498f1c6f455e4b950189c43dd0603c45b5b25140b758f9e1979710908e04c31cb12", + "result": "valid" + }, + { + "tcId": 112, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0414f7f439b391976b31d3a358e2b4956c763facb250ca9fe59471574e0cb10806f26466961cba7b39e574e2322f670f952d7f6ccb3b0da93663c3ec332af683910feaa5504ec7ccc5080580bd0b4447564a8296c42b3badcededbb5f19ca5a104", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "cd70af650c9fcbc6db5f7ce510c097cffce372313e4a2701e9b0f38775fa02a1d9fc30e8aace6cb29724f6a667e81e0e", + "result": "valid" + }, + { + "tcId": 113, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dab466fa8ee97b0c380e7b16adc3f4bec159c909b0a8abffa87c020361236ea60864a5cc674d9f6ee422557928b9766f42610f90e2a0b1279a8205332570a966b3a35accaf376d129d932ae5b2372c173db08750922b2c6d0dfa34b644161f09", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "90cb1e88d13aca7b15cf94830aedb9d25ef7e6a3461a99b78f973758f4632bb5d78f5c716338e8cf59b6ba643e8c65f3", + "result": "valid" + }, + { + "tcId": 114, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041017f0a379643a5be054d2ca30e6f933217b048dce29ee7ee77072f1bc0298e6833eb4e555de1a6edbe457e1aeecf7ce57f9b4e4c992286d33b82b43216674ea0a240229a5ac04b665ebaa677a2bf1bb8bd865296acbf6f6d662a92371e8d14c", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "53120b266cae9d4734a454a4757862befc4ebc4cad121a577f005cab1e768d553c82a5188e0e57ec34578da862bce42c", + "result": "valid" + }, + { + "tcId": 115, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04115cc3c80f33f04511095c48a79c82ec5243f432c515415e3f475ddb314c5526b4fb4aa061f560e20f6762a000d0c50e62c081f0ac84ca33c41ce2ccead8ce3f1f1ecaf9bbbd40acfd36fa7d90803772300f251aae247fc559f5f1f12110b1df", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "888dca4ded43881c1c5435fd6a40a7d9b02235f61b15db54ff9a412ccc589135904ae56e71a5ede64e8602405f60602b", + "result": "valid" + }, + { + "tcId": 116, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d431118a38b84ca232fea3e74f8978c7016254c4582c6db34b35d7acb01ec82c325f0e540cc94ce8742f31ef5d4eed35d845ac5e0790e2ddea014884145060fdc5454403583604a177ffc77c0c2a23f5a4883349248edaf1f269f4aa10425826", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "79e49dc63dd372e7efe4a28db8f3cabee96e927becac48aa6582c48f297950a9eca3f464ce38b34c2ac39bb6489a6a12", + "result": "valid" + }, + { + "tcId": 117, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041c2be494c6a8a164b02b4ee59bf25545a5f0ff4bd83536927cccd64d9f3141c090ffe58d5a47b5abd7b692d4cb7d764b872f612106856a9af9fd462793566fbf64a99c730fca95fa3d46d7616219aa7f830c56e328c31133b8eb2641627f27a7", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "b78d0e17ed3293973232081947176d781e9db59b4cade6010267a6b2db4d42f512cea2c94b4b534e079ac589adb0ab5a", + "result": "valid" + }, + { + "tcId": 118, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042719d27446b6a2cd25c71d34338ede392d48d91786dc3c04886bc6f374f0ca706ad6040be518d2bed65961b4b4098ed896fb601397f985df78ac5581c58e683d9656a5e7ef5bf32674fa182717d6b3e2323a1ce034588d75727bc6ca2dc8108e", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "04dd18543f1a4b2df2208230e371efb2f76e2cf5012fb7dff409400ba48f6da1d8d4dfeda6b17616a34c7899b9b0faab", + "result": "valid" + }, + { + "tcId": 119, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0432c318c33a6b72ce213ff38d05850b0bbfb94ba298b1821ed9510e1fff09f9fa60e719c99607bfc19b4bf77cb0e6e7f555c8d3414f3e21617592d93598408fb36909d2ac461c6b3376e93d8d2663c5c5673586850758a75f60a784efb0e9d017", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "488b395a0b1eee80b38b3a7aac1e2ea8f024aaecb1dab7e262213eef2d9ab40a1d521c395edeaa5931bc6f31daf1fdc6", + "result": "valid" + }, + { + "tcId": 120, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0489b6d669785d93ee6d93428ccd322c40e9791dec6714b7c2f8f5bf73634db744e4ca003477acfa3c5fde349bf12c8c8f94d7ff8a3839caed6ec55d006a854648721c745f84d1c64ab0f89bd1189f471820cc1d2e39bfbc8b70608117d5512b1a", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "b3aab59b2f61fcc1d844eb2d0f1018198f92238b92dfbab0e26529774754005771b5393f3b2a4afb028bc0b901e65c8e", + "result": "valid" + }, + { + "tcId": 121, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e06ba08ebef07f5df80a7da608be7dd06ecc73854704312e1025d8f5f02e25b2cbe048c248a71189373f945050deb9d4752607dc0d40a5d623478fe9180a42f610864ceb15c1fd170cdd603b78e7e6451f6b75e67684ac1a0551fddaef250130", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "2a6862b3856d60c6fa3e11def1cf4ab5856b4e9d9e40ad9a330c3f9a693f803921bbf8c5033074e5830e3e41d4c9fdb6", + "result": "valid" + }, + { + "tcId": 122, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04778f62133bcc7abf57ac1c7b5dc7ec5e0468c958f7197ba6043bb2e36e9963dca11c13e8185417d52dfb63fe7c9ad9eeeb424883ad7a9cdbe00bc03aa75bebddae91692abb20fe13279e1dcb7c71497bb9a65771eb29e8e4232e72236e672841", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "165f0abcfd387a6d6e10e83b345a86cbe76a18c168088830111fac42b44c1516cb8f9ec1590b0ba6e2234624c51927ff", + "result": "valid" + }, + { + "tcId": 123, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b71d7b36b3a5b9600084cc28b1812bfbc3ccabd34e9b88e9a5f17e507ad097fa2513fa4d1ae045186672b595a81d73d98efabe1283eb9729cc06d7df948f87a6e01c69d9fd5fd5e06b24e4aeb8774a366ebd9b84fdd46a40d37be02d2ee50ecb", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "94bf9a5d92dc2a4eb55d7e6b513301971748405523e4b56f89e6cccf45186daa5a39feead77bf2200335f70b98bfe1a8", + "result": "valid" + }, + { + "tcId": 124, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046575bcffedf4e2948126d7696da9177e2c797983c312e642b616b40450c31a838053eb79755ab138f736e6f912afeb2ba2aea6b46ed127050027930edd00b687a4e043c73db530a20f7bd7a5d35b663cde284cd87cb71974e4afd30b702b406d", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "4f90165e6f282d5476c00134e593ba1343f4345758b29b792edee15e7cb9f936fac694ddb8b74e8c1d81616066fdc866", + "result": "valid" + }, + { + "tcId": 125, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ba68641aa366b709b05e5ebf0568878f9d990e270c9c1ff4251b9bee6c920b8bafd0ffdac8cec633d810739fad2c979e856a85ed78b01c564b2287ecea8b3cb6a3ac415153962efae46cfd62e3d8bb99287bd4e9d8a2f957c4023cc86efe9df8", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "69c5a6479036b148821d2e07dbbabc207655eb985f94aef64726ce6ebbd2f4ed3b3294f19315a87a74139761d6ba1d76", + "result": "valid" + }, + { + "tcId": 126, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f5b4e40ca42043de6baa6f22f9016b298d0a4fc4499d70f59feb25076c6196371cf7e6d45fbc13440f9c364e812cee9c40c6a72baf208576373e121de14425191458cf79b12796ee0ed0988f66230227a929e6a33d4b118ad1bb0b693f399ff5", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "3a78cd6a0b43addb79b82fb8b34cb3597d926ec640bd22c2de87189d207d0aa9948ec3d68088ea9d74c1e6e15ae14366", + "result": "valid" + }, + { + "tcId": 127, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04682cd662974df838700b06edba491b6436bedd2377d999c7f1dd582f123a986b6ff16e42a7df441ec9b943ba316e0097135e61c3465feaa0dfc232e6b3379e4ddff12f7df0ad3cc18521d62ddcd9dbf669bfb378bbe3abd8c6acb5294ef4a49d", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "39199003d632db4bb4eb3ae5f830a4fc31bb67339463648304a615e0afd7696d6bac3417be8591704d08a891d5da54f7", + "result": "valid" + }, + { + "tcId": 128, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046c34c583f5b81d0d135b4f09c1fa7b0e28ef35aa43cfd858605230d9b07440b68ff9a6439d8e15f65ed115713ecb1bd6ae2c1512e6fcd3e997c1d3294b9facf2126149bb627c4c281ce49dc4a7e0e2f6ed9587220c5d43b970f0688a64f430fb", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "2dbc872af3efcf7ccf8c909f5cbdcdb96ef42f010b1210d9f3c14e80286b7a50bdb9725ddc158b492f36c5b6365502ff", + "result": "valid" + }, + { + "tcId": 129, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04716421425bb6a58a86d4c24f5a65c45bc721930a56da80d457bb79637dc7ec3e820ce40c23ae78b18ebee3ac9ce8a3ecddb63fa98d64b73cc8ce9241f373ae8f38336136522b4b7785c6e0199d2192a8c694691a043656dc728a4b8b60f9cf99", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "3e68fc4fd2abd0bda88a76b11b45ba4cbd6aad6c5a4bdc585400a3dd1be1e49f94a24be14faf471d93abbbc6f11514fe", + "result": "valid" + }, + { + "tcId": 130, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043bd5526cb34e0789d6b9f71e0ed641eb0090aa0e9fa5fa16167cb027ed7289e748ae1fbf855b9f5331a563843a40be3e2fb768b26b56e21666b88b588bfe0dce4d6ae70b05bb61b2f0f8ba2403512f54657cea023fe93b1bfd236b14d1cb11be", + "private": "00938f3dbe37135cd8c8c04182952f6e6f9bfe7a4cff4eacf90612a48865dc43e9b5d230f761d1fc4dfb69be20e84ccc8f", + "shared": "3f5f8d97bfbd8102d499f7ceb7a07fd6a31f38ef394ba5212c33480d6ddb05652b33f9c4ec904ef0a1fe56fbfab7794f", + "result": "valid" + }, + { + "tcId": 131, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ba6741c1e9f33c600d2b375f18249e9a970d16666fcf858f0476c8d8bb38d8c4a692c9ea42714fb6fbc9ca483afaa18aaf1dc2298fdde0c4c07fa1c3978e3f792c6df315620093bcbd3be6822c464125bc7e7201685d28543ac51e677da2f839", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9ea8aa8bb1d2b334b93a666de4521c2d68d24b056674577f6242299cf9ec959eb331c244937abe39ab6af4dba9bddf56", + "result": "valid" + }, + { + "tcId": 132, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048d6a4af6d90ab4f6295e2d29dd71a3d92c1df969184108d84148ba4b0b693d97c2ca83d2336952d2d3ad92e92ef9c810b149aa9870c4c1a506bdd30e2729c49d667efd9d0d57c050d54bf6a7233e66e2753ae8ef53a929020550a69c343f9104", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "703d5a0c091a11e6b0db28b016ea4ec2c2a6dfab3447e999e76428032f8d30a06ac34ff92da59ce8de866d92a8c701ad", + "result": "valid" + }, + { + "tcId": 133, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441971e03f6b6cae440e06883a3ddc99dfbe1dbefc0d1dfefb97041ceb9c1baa13967633c1381761f75ca82114a0d74b572febd9a760b68f5bd98cb2075c34f1f7b595c67fd4559ac84b9ee98c2e57e7fe4c5563938375e1123288f26d56d95db", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "663173d0b57d1c875284443bba1a007726a58d53ea25a9e72d28c70bc4b12daabaf59d3713c1285f3fbb4131f70e4318", + "result": "valid" + }, + { + "tcId": 134, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048484a62a40b582fdff1b7d5bce7aaf5d5c0c008c5ee9e4f7bed33f7eeab0b8d8d5f9d1904f57f1e25effe94c2a46f113fe9acce730fb5b884ff9e89d8736f72d107719320c50c0ff92dd645d14a9f1baf15625daea5529899789801dad802da8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4f481bb1e39ad450a2e3073a893575a7ba83abcaeb2bacc1e585d4f4171c7930dfb779385bf13c3aec745c1922d1ce81", + "result": "valid" + }, + { + "tcId": 135, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046eb6d288f4b3458eaad93eebeeda704dc296282cf1c29eb7d01181968d1c5f617cfa18346056d9bd93cf46809fbf72efdd3ea5ef38d1772bcc8c5ac1ee117d666fb04ff7d32169ace203dd08d996d718bd0832371fe227e6a337bac9e13f4eac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9ea6ecb38edf617f9c8a286ee3cf5968b1d1d770a7595bfde436bbc4138b649392a4089fde43a2e3b64a65cd2a242cdf", + "result": "valid" + }, + { + "tcId": 136, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ec90cdbedf2026c855402e01e89968487b73f49808ac8f411cadceae717244c96055d90115f82e1716469917aa38e15f4967ea76a28f79e7cbe4a9c8f5ba74d25fba28fb5f4ebafbcbd366b282822951a9a3b3fd8c21c1cca2bb9b75929f819a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9676745d338d90dcab57e1fdeb267a17c821556b685e91b4b93bb0af46ff33472b4ff53d57a06edd44e1feb29e886668", + "result": "valid" + }, + { + "tcId": 137, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0407b906e4fe107c9cde9a33963d85b47ea58dd42df9a3e62892ad129676838a92520c4abab2c0b32307765d6e2213969733deb62ecb5155fc8c7ec46d190a98cb2343199cc54a095c9d61be26ce5212d4c5f4b4b227b833b8d29defd015f5af54", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cc755785f3b5413e0e7c125ed6239d1ff62768d53ab6a547c1d98d78ed4e7b62f0ca533c78374c13e6ee59a9dccecbde", + "result": "valid" + }, + { + "tcId": 138, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e37bd6597c304c042a2cbecb332dfd2c1114b541016266201c7637772b456ed448203f0abc537f9bf8514e5987abe7edc5ea23fef05cef91186bf8d2cfc0bf48bf3176817d5204ca77fe00d5164c392a8defe36299f268b91f4a6ba9c16ad42b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "71f0cf1ddfbcec4fe06dc26c327054a0a89cf0b52b24a9e25814bb503e98e686c76ff2b43412146a29814d96dbd6398e", + "result": "valid" + }, + { + "tcId": 139, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049d58e93ff6f0700707f7dbe2675620e78dcf24b539c8f4d4c64abc861504051c805b8b46f79eb5c892701ec494280b94eb6d579732cc61359f83dde1fe58d1b1065d4a40433e427b7c54d50779f758699eab4005232a766b7d401fa320678d48", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "952343ff7cdfe53938327c08b3603362f180a99ac11fb13d95b7f1a32c241b0341ce213b77053e6f3729b90836f226ac", + "result": "valid" + }, + { + "tcId": 140, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049693407c35a2689c729ff8a437f8f3528040febe8d6caca5cb16d392e70a47540812fa0dcb9b6726a76e9bff79e6bfc9e67871a7180292332ef76aa420eb44f230a1512c68726487848b027c086b5b991075e24e9593298db6a46fd491cbeb4f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3c27f016253416bf9b283ca63ab616ff648660b5cac20a9b08a3d42cbb049b36b5af80ceb13756edf9ee010a70c4f685", + "result": "valid" + }, + { + "tcId": 141, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fddfe784f89f82ff9886011d013f0304ca38b67ad1e56ccdd82d1b4db6b0841041eec2a12db985e302c5fdc181309fc92cab5bae83c9f581e503aa2d6adffc9b3f3ab52c7991aca5920182af9b8de8f6d61c1a6d67d2657dbb7b7ab00ad7c012", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f7cd0abdc59f5482ec96335396d81fa3288dbefd7fe694aeeb3037836c20878e41f1e7b23a473d5e38010ec596b8f7eb", + "result": "valid" + }, + { + "tcId": 142, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0416443b97b303887d47e2cd09813f902de048f412b1a605cff711d1278300f7db92f2989ea2b10fd5fae9de8aa2bac95dda81b01d1e5cae29d1739f9d2968707bb9f6c204eda1b7d1d0584f1a9050647f8cbbca17ed1db20156b524b2e2a7b290", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49bd7460d26d4d64a1f577a149a1776df320faaaae506f4f8bd2e9f981b622f48c1f00be59d17d7f19d298b1dc673edd", + "result": "valid" + }, + { + "tcId": 143, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0459bce2c60254c46f8d05d7bfa6a2a6ff3b1fe6bf55eff6b727851e4cf4673511da808041e6e490eb76501f3f4b20f56cad86b230662f6ac5f23ce87a320e9ff0fa5b664dbd7a8e8d08de60111c525d22ba5c6d4c9d06bff1240a9b9020a77089", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "803c001dba18eaf5142dc9ab5cf814aade3ae7bbe2a3988b0d9367679c5428ddcf7487649f1bbbb3d49435910dc29e14", + "result": "valid" + }, + { + "tcId": 144, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0494c2b8fe7ca9308a3fbc0c3be193e5e270375290447745cfd0cee69e3d4f4ec1c3aff580a64b30c6315e33c68728aa00fe7ba71a53fc5eb49d95c2cf923a876aa4b84461a630fa194a9930100a9694fd1197b30dd726a35dfa28dbe8f75ccce5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "08b74d1521190891b64491106e2ae7e0ad350fc7517f8afe1ccbc7b475629240beac0fe79d3fcc7f95de4ec0b0732d52", + "result": "valid" + }, + { + "tcId": 145, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b3394b17e602162bf2298dedec44e7497e150013a57752224a97fcc256bcbd7acd841a451e9658faaa52c492558846ab35e8e2f3c0bbc3e40a91d262a4086c31e5ab29d8af8cfc798619599404a27483e55471f8756154b6dac60e3767ba9535", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c38f2b8505f707d0d5c447dc6dca9110dfd067a881c6257ae3c1eac8a214a6c282f0555b926759d066b1e63c13fb4b61", + "result": "valid" + }, + { + "tcId": 146, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0427bc36bd173bf705ddd94445b617ba0a009a43880e8d13952c1984a10cb11bc946be0b2db782a85ac82919961dc7236d9db5a5a98d36e7dd96a1e304dd9a074f2017840e04cfdeae964cd3d8168a3ee1bb7a6896cd4d85d666fbb597697cdff9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "14bcd797d73e8cbf5c82883143705dc05ab2e9efa3b1a58d6fc1d71b8113cdf89adaaf93916d538e9d16bcf4964d5ce1", + "result": "valid" + }, + { + "tcId": 147, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047de61155a03279eee88cc3a88f0b12b9fb9eb95222163e23ecf50073a6b02001c8447895329c57afb67119d88bfbe7ec702ef5bd94c56f9640ed130b84ace9ba9c1763ab018424f74627a021f34f5852c202eb376949533b16264d85fcc0d157", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7e5464251c48902e7e892ccb2c7a23c636f160a4d747cd8e97d425326b2873b6e23cadec5bd89c3f2337e117e3d01db9", + "result": "valid" + }, + { + "tcId": 148, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049853c177966cf8f185d9beeda4c3ffc900cf41ebffab544c964a47c6bb3661da74efb0a137cadac4874fcdcd204328ae71c7d3674e181b358f2a612145c820d0adac31cf13c8b673f0ff29333da520e932dee32619dbe783f5dd565c56b56ed4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f40a123f91729dab41dd21fe32d482319505d5e763f14ad985e9f291fc6d4a7391a9cdf00d692c07f4a208a9a6a90b4d", + "result": "valid" + }, + { + "tcId": 149, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048c8030fb7dbed6b55a82e401706b0b5a2e095fdab0e2a8cbcb74dbfa18172eac712deb1aa515fe29085b281b82e7e60cfd78106abb50d260e56a419364b8d34e878320b4594b96b184f13725678e9b34cccea5e4036d398c34d8ec0d6f77d5df", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d97e81932dd74e9517c547c7c0de232d5664663147120665432770ead09ac4587591e0edde89d523cde3288b8acac63f", + "result": "valid" + }, + { + "tcId": 150, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0416a7a1189b1536a120f66fd07e94fbd1db17e2d9e5ab172c8b783139360135a6296e7bf458ca23189450919dbbda37965a6f1eb31553158f58162210244acb37bedd25e45947d0a13cec32411aa9591f45583fd6066d144213f96c46984dab19", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "302c923791c09bcea5848552922992f572b016e6f9bc280608d7731e85c92c546b9fa929fc13cf3f37885da55e78763c", + "result": "valid" + }, + { + "tcId": 151, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047b91b1432b367a5fa452dbb72640f4f4deb4bcde680244849c8cfb8b4aa9b71c7b72e7a5ecbdad0c09489c71c82326089714c649280829a56238a794c73d93f0301282cd6e89018fc3c02ba366e84dae20323664ffdc8fd2d5f6f2d5e652e6a6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fca1d9cea89398073b03241ce43e5517e7070747e3ca14abd20f19592dfe9a0cdea04d6c4ea3ce445308a53282437a63", + "result": "valid" + }, + { + "tcId": 152, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045096a085a2288aea422669457a11661fef0a1af93a867114c5686f5dfc19ca008520a08ce7fa07c50fc14f4b2962f2b3a6fe40878e51dd663b5de471dcb38f1224156a5d115a1a654cce30c939822ce64e93664f182553e991854f44c8f51a9b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3f01c8662cabf7b6247b383c39e2600f27ab7dc3e847c9a100664d30ef31d19b2ab6c05f5e12811a282b52020b144215", + "result": "valid" + }, + { + "tcId": 153, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0447d94ae8b4bea9424e0070fc08757cbfd0819c353af787ea9846401d5fb9426a2898e79e129aab97fd7cdad830ea85c37085cc430893c546cd6d45dfd9f60315fa7fb88ac79dd85f4c5e8df9856640e8ff6a984abe4f2946e5f1ee9a05cafd51", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c1327d415a50334a1f640115808b1214125c47f54c504e895836cb2e3629184fa6606a75f5f74d239df267070db779e9", + "result": "valid" + }, + { + "tcId": 154, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0499f5a0ae876de00064ea8439e826d7b90e91ed0f3e6f220e6b476cfbbf373d22f9b2cfbb85e49fc5e3100a60de0abf36ecacfd6777ca68bddd30b3014f6b5309e80c0488a3d51a65a8d2ded91d457394c7a36aac2a6effb0ef2e3a6e7f11dc4d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0ed5fe52d3ae81c7482fad6b104568c6a5567cdb64261c688c2a1a8f616b5f4e4cfa3046fac2d042afc5b772f9194ad2", + "result": "valid" + }, + { + "tcId": 155, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e802c2bb1674541543d792d800c2bc80293e7fed8881b2f86769715b371426141054e2bfa9d0b5d55d387a6249a6c9153cd5a30a5c174d28056492d5251115de492b84aa65125116ce97311e1366548e6f7a6c84b03aca285afaab31a1620816", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8db019cac6b9ef73ca998f447f297f8faccc5ec5a30a1b003dc59dabe27a4fe6a13f96ca834c3f0eda3e4e341bb67787", + "result": "valid" + }, + { + "tcId": 156, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040d972c4ed75c4974f95ef93aef996418d28816cc5627acf9dc27aa4404cc3b2df1cb44d4594607ef8425e520d77a25e82a6b074122b04ec5783c6c1194d2b2c9c59f00b30c9e7e8957cc06b0cb12f7621d0f034d253be66325d0e05fc306acac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ae88686c5aabe1d9d2a3a0d36e53fa97321a1ccfac2e7ffa256af879c58adc3311e91cdd03152d4342e573387bf4d2f3", + "result": "valid" + }, + { + "tcId": 157, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040e6e0f21954e0e7483697d9940a6bf97cd0a918781bbbacd9a6fc8ea1a51ec77353ce854f585155a10abc00edcffdae4b2733e4b387d05798c414d62c85932a1ebd2d3d92ff15760f736b974a8419e37619cf56ec75359e4d637d1aee2c6322d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "77d6f09e341430db983348224207b297551f249a00df2ed8efe789d9ba916211d46fe4774e596ecccc0d9f5e14d5331d", + "result": "valid" + }, + { + "tcId": 158, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040eb47b9dd9d25640e4b39cfcfd26ce2f35e3b3ebb264c84b50cfa8c08aebe196b5415e729992c8cb919013e8e7a06a47660e98b4bd07259d9763efea897708ce3b3562741ea14b266cbe37712e96dca4bc3e671e7ced66e6ea5b1a0e31fe7de3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "308a28ec3710b4c9326a572c0532311916a5917536df0e486d8931116426bcb4f8214855f12b852814d3599e6b6e74d9", + "result": "valid" + }, + { + "tcId": 159, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d3dc43da21896d3929879efcec4398f5bff3cf8d1369bc16dd3889e27bb7eee91fb9d6a5a10053c09dd330c15fbccb30746e1062bbe5a1d0b73dff625c3621adad4b4b922b9362fe97c84a07d2df45e75666279b9bf36d74285714fe6f1624e1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e85463b5675345e671b527fc84551c708f1da3324d471b309d170cbf19afcbf46418ffc9d746516000f53a202e8a7d5f", + "result": "valid" + }, + { + "tcId": 160, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dd98049cfb2f804742f284692a43fade96d84fe7b424a223488b8ce940bc3abb7994c9f1d7f2150179644a2f9ededec8e0eb15b319a46c7076def7484ca4a1d14ab03eb38302814962699076082cf7bc09f3b7c8df989c6687f72c178b3cbd21", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6649f55e21c1dbf6801a2d536f9cf56a7d9e2213209ca08fa06278ac5bf3f28812ea120081c65d5cb1fc6206050543e7", + "result": "valid" + }, + { + "tcId": 161, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04be6604816accd31069c263ee1dab6e7ab7233c1842970d93a298ddd1835102d7050aa415ba64d203e75eb20668c31e633468684b965243a830a9bfaa7fa9ea2b4ffdbc3ea728f04db4d7c714c726f3b49c6cd7faf54e04de6787ea700cd2d579", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f98ac89bdb095bd3709640c3e80eed4a12d4c4f322d5b3a177f911aaa49d2133b5774d6dbe9ba08380485fd7b0e4da03", + "result": "valid" + }, + { + "tcId": 162, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f7699e1624cddd192552bb4f00d1aa833a6b9fabfdcc9022ae315f3007cdcba406295adbcfc17616aadd85f8bdc1760428eddd910fd7b8d9495e12ee53a3064616325445c513d670777267844ca5f082071ab6a9ff14a51785fa9b28df0abe15", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ce569bbcf622602edffd3225ad29f5c8765233a9190776f8170b4a213d45a6cbd0e417e557c565f13f907a4e0f085348", + "result": "valid" + }, + { + "tcId": 163, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a0a15de8f94650bde02cd353ef219fa7993b3b9c1676a5277d7dd79c71620a0b7376be65cc4a56d5dc2f30539826c4659da75224d203653bf63bb092048dc673a4aad9c089c6fba5c0df13a410c7166a16a13e2006f4e366eb5205b7b86d4fc4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d91b4a64a48d3d5b7156e49c475c85c6f4a20fd59713077e2187254e92850ed22f9a380db9c6cce9db55dc5a69268052", + "result": "valid" + }, + { + "tcId": 164, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046d5f8ca99997c2f5e39ea33a852db49aef76a738d4d5afa118f8559b267ea8325f888771c0a685b26c891e7b6b9a699d26704913442a25c5466ea9e299b14b14ad1315675e0bc60240dcac17d93787260c0597fcf0753f8f2a764f0d79d35e89", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9e48afb7b4ba2d3c1ceeb058e5def6f0cb08c548931fc5c159576866f1ddced401ffe7ad2045c199f9936be9fae48e4f", + "result": "valid" + }, + { + "tcId": 165, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a4eb25a58155a43b09dc77232f13ea877aa22392533aaa8d766edd803dcc816b781dedd75f491eab043448e7df6c0a1c0d1620bdc576a31e3895813953aa5bbd5abd33c7646ee3e55007a6df0a4912dd788972140f46e08a64b16fc87593bca4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6cc249ef7f46f52af5c9e974a2de9aaa9ed7a3e907561e8956fbb0c7773e754c5f46c05e2c1fddbe9bb27225b0b983c8", + "result": "valid" + }, + { + "tcId": 166, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0447810ff99322041c127917ea053a0419105abefe191f873785f979328f61497c5a53202c091efbee4926832b94a13be8275ea0458c68f2a8cf3199a74819a17ecfdee49786772cecfec48131685bc3088438e23c4ff86469255ab4b9de13fa39", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c859ece7583e8f8ff987069a1e80c5f511c2b16d166a5530ec099db7d194769188c5f7cc36c26fec49cb69b390f226e5", + "result": "valid" + }, + { + "tcId": 167, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045af594693eceb6f540e7dabf4e424931fc9abca42c934b5a9128fd49a862319ceaaec24687f135ba0200fd5ad6b221f85745561164051190c0c1d4324604494f2e15f3f29038b1087114e462315cae2005a24ef36f84cb3643eaff81c53add43", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "de4ce4aba3c5c9adf61c60ff06fd5486eef4e64fc0d8f8edf3b2698e6ed84bdbde121de3b62fdcb9e414bcdaa2b1f677", + "result": "valid" + }, + { + "tcId": 168, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c2628ac27e43c13ad90664a1fa644532593bbb00c5e05b53d02f23ff1958de0900bc55a9ec1bf76ec9cc810165ffb971dee3b12c243d53e5abdb19e7060d204c867d70671b0edfa6bfacea6a9486644ad0dcae47eaba39a41bdc054b3b4cb998", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b338461ee7a73c4c05277dd3901b28cd0256d6fd1a3570950047439670cebc678da051ece147d0992a4df1714f79c2a0", + "result": "valid" + }, + { + "tcId": 169, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043b6d2246a76fa02a3612322849302351c7529632e90067b2b648299eff2a743967ae451ccceeecdd512300c8a233dafc269a9c50eebe683d93b3a3f2989e5db9a8c14c80eaf79ee5cbb10fed33f1706415292823570f3b912585091bb40f809b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7bff8bdf645d412218474927b33836a7156316febd2410c1a53d28eb7268ec85cf2238e8b8464db97e966009b7d48fff", + "result": "valid" + }, + { + "tcId": 170, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f10530e75e6d40e233412f56a02362cd707b054eee5b6b27888671d19a5dea106088a485f4a152d0a28e66ab1eaef5f6c74c053900cd9b6c983d068ba18341b81781de9a6919d962b36b186998f396c0c3701fd0c8f84eadc989095de1645000", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4d6d44e7eeab8fce98ed549d05d5056d2465d857224d8eb74ca0a78878841fe74a454430a8eb940f1d164b8920a723d9", + "result": "valid" + }, + { + "tcId": 171, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0455355568e075b595b0186c43aa4ae7d8e069b4db90018d0d35b6ae64b4b6a9825d8eef7970665f394da643665f7f3fdb65d3c433b2d2af08eb2de45a93194fb4fffcdd15242af00be0dadde1a6db76acd19c807c078e8dedc8bb703cccd8af8b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fe0d089d3c60658c8949021f61848cc00f4edd2c02febbcdbf01a20957ba775e6a4ea76f6b71e765b3e0d70202e20acc", + "result": "valid" + }, + { + "tcId": 172, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f2186fa03880384d484844ad7bd56ee2525b28974a086d1821392a5b0e4d17b24601062545844ab6432f2401322b31dc064dc887834fe44ba027164c55000f9095f128779d1113cd7e05f4a7f72c888573a403db9b6a96173cabbcd680d0a2dc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f21b3d9d8855bafe0185fff62af1894a0c9467fea1d56e06a3c76794e2b0d071f236796dd91df3bd788942e4913dc0a8", + "result": "valid" + }, + { + "tcId": 173, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f67f37c1e676f28abfea8025efeccd47bbb25146e550178c930013bd5f197fdc2d2fb18d0ac41af68852f594ccf8b6c7f050906d390ba2b34219cb0634d02abcc9b3e440d2b4204e70d787953adc534c54ae91bf220d9b2822c2e14502d44601", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f792a0015a08ce7d67156f58fc36d6945f7d0d90edee2156ecca35dc287c406eba45629bd4d1b0c3561da18ac742b581", + "result": "valid" + }, + { + "tcId": 174, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dd03e948c61c4f64b4eb281b67d357ef1979f5a98743cf0986018703191b3e671e72fe9b926c9ffb80fc84abd7a01360892cb6803be97ab91c0ffccb3bea9c43ed2fb9212d40c6a03dcff5cb35ef88b0288166645fdc8a1a0bb41a4f4c9e82d2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9592f8c7057d3b71f9e327795714f040aa9442a6c7d9b04b82ce7819562bd8f70b0d30b2f6849ebb80a05f3847059683", + "result": "valid" + }, + { + "tcId": 175, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e032c6b0ab4202987cf03b5a45483733fa8bdcaa53fed1908d65bf2e0f526ca5c1a78f1b82ed7c5024a800b46a5bf40d3426521d4b3a492d0c638f98efd647c1597eff7b22540c9059be01a70adb34f648956f587319296c721eeb149c57d03", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a2e1b658a2e662352d5603747493e380a9350b1996822e8bbe5ca03046139f3ff712636267ac7c823440e9b5cb9e6956", + "result": "valid" + }, + { + "tcId": 176, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e3fc9790ed5252d40fb65a28506adfe5571a517f33c96997d00f047aa897659c9314577dadb952f936f11e7d078f60699e61173676d89f52e2eb887c7ba16905a3cba39d557b4a6782b1ac2319a33b190342293d7a80184d776283e41570f11f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b783af4f6e339b71eedd46ea7ad5f856f5c8aee7f2ffbb772e3dc8dfd8ae4a01bf9e5116ffa513557700924cdb4f0179", + "result": "valid" + }, + { + "tcId": 177, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041b76e3511b81b92d91f02780dcb76c906f167a5e470bbdad7a28cf56b28decc65a67afc8f0b21f9febe1b326e36fa797eb5b9abb558bf2883ec6ab68a497c54322cc5ea7038187237e5efe5cedbb88dbbaddc8e3a98f7247e952e75d583d87c3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "afdcf498b6b1d40fbe1384a106a37813eadf7926f98c394b9c60e1e742d06d913335c64ac44d618e9e84fe737352fc16", + "result": "valid" + }, + { + "tcId": 178, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048cf3a702443f0dcc2e23e59eb5bb60d60918770bef5a66ded1f3adfe2d911f2d045967827dbcf72a70ea54eefa4c3c12a0c9d488c724c4ba60a2f4cbe3b09e0fc3eb4475f0cae1063104626717c51082675fc1bdca01348f91edba8955cfc13e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "02befd4968dad3d04a3d16f67c148173c2ac00aa441114d908f4cb7ddfe167a3e35583729083db20d5508e2e5c0bac3a", + "result": "valid" + }, + { + "tcId": 179, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0498d02bde0f6ad04d6e72a403994cf5713de9106db35fae0b1b75d51f7931a7ce3570d1cf8307b63236ad14040f928b6b0775f8d38726359a30892c45ab744eb9c182fc289d0cef56db8531cbfd23ef0759c2ddcfd09fa8349a94ad287106b352", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0ba8381c8122c9f58e8c0de91cd671647d6427cd868acc12315e5ecfc9e0139600f5c81a5e3012b74949c0483fc42a53", + "result": "valid" + }, + { + "tcId": 180, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04de490d60010eb5fc9b18b83a3131d7ac063b507ae8f3944cd7d1146b861f48724566ae82dbe7099b052230d27023a15b6be13fa9e2ac571355c15454825c421dfefddc5feb086262745aaeef656b67d02fc2a576f834c3e79a280848f8975d9c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49a1430cc29fafb9beba8820b85b8b2469f2b04b82604f2c584c04681f0501c7610e1e6ebdb0a2ff87c0a5c7d82456f0", + "result": "valid" + }, + { + "tcId": 181, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ca13b23ec1cf4957c7b97f79431e13bf423955d4112a8affc3e694455dced6fb39cab4e59d19430bb89f099c1457a75ad2e4d27b771568bcc96c89ee00a7e848753cde65caa17cfe54925a1299ad8a2c8bded2791482abf899cec674077c511d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5c01139c8682a034ef8508332c4396b37fc786151f7291518840d11bca1553452a34c67833a375bf113d9e9189b75f98", + "result": "valid" + }, + { + "tcId": 182, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04634ce6a687d65f0496a46fd75c72f00fbc064bca470054928f24c0bd0c1c27a967cc3e6ed71a31be9e6fe03a2d9902b19dd2c4b69f1a392501462a8f527e58dd58553cff6d7f39bd4d1540b6b897c364616f689acfbf07de48e4ed50c5f28a2e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ea49209d272d2498eeb15375be399e6247b884b597ad9300c19164d68d12bef9a8a37c615f1ac414449af42c6267359c", + "result": "valid" + }, + { + "tcId": 183, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e5dfc4e90ff3dd8ba11ddf30c722162f43567d9145c4f4f2241d827697b460b270008066fc43c8c55b9b3ade51b4382f5cfefe604731cfad93ba80ebb8076f6e8726656679990ddeab7e90b858b76fe53931603607a0a0adf64337e90383dac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0430e0a48bd1f85ac66722e4350128508f19ea23be0bd6249d179599bc95fadbf2e55b727c0aae963fe6d6e63cbb5926", + "result": "valid" + }, + { + "tcId": 184, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dbb7eb68ec208ddd3fbb3ff9ac9026bb4354381a26a160e9d4fe4f5a4878ea993e6eb91eba404b495386b0e516a36c0ea8c34965ca9ab64e36a685f8fd82137737d9a5af8b32444d9a8c6aa2fce65b800bd39ef93a1e3765db9a6531ffb2e326", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "91c30f8d4b9f58ddadb3b6fa42091a2fbab4d18054c0243e1d5076321156544b43a1b41776bc093dedc9cb86ffe349c3", + "result": "valid" + }, + { + "tcId": 185, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0420d0fdafd528b5d08a2e88e4f905cc04f082e635785fbfc5d32ff289773bbce923ee4f862b6e78654fab9c7c8268d64a893bba6a7ddf5676a1677166f2cb40e1d69db38325d28390bd2e4a307d0436b70651bb91dd3b839fa91249833eedf98d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ad6b29fec443de58bd964644fcf66c514e34a644dd44f2b2b3501085897b145b82abcd992e841cab6a2e115f468f3e81", + "result": "valid" + }, + { + "tcId": 186, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0457fc0bc2e1c90cdfef6dd02d9c7c4088f5a14aa514d133fd5448241967a06a477d07ac2beb7ffd0477bdaba23176e93fcc6348cdcac256553b54029822ef2c954e09c3e82b04c6b2fce0f136302622769638a5ca21f7fbff0fb35657d8bea4f7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c6be267cd4477bfdb72fa444b8cf7ffd3828f4a48ed91739c4a7e64660db007e940fc6dd792e73aec7e9db6b3366aaa6", + "result": "valid" + }, + { + "tcId": 187, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040986ca44fd7a55ca4ed3a988ad1a018e9cdcebd043a392388c932f21bbd41cb6cb65235686c47b5ec49a48df92c8c95c8936a4e0795cf75f508c6a84a2fc196dbc89a883cb395aaabfb2636a7a226ca69be99772d7bf38135b8de8451fc49be7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7a178c2789a1935b63ef1b47e8d39e9296597fd862fbc397bf8a095f36421f367c8840e3649842b37792849a1e25ff10", + "result": "valid" + }, + { + "tcId": 188, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048a4e0b0d274ff274c53cf2611f5f045b512ab90d03d1168fcd83a5fd0b627fba12548e684fdda9a58cc06ef1ac8df354b7752694feccdd8bbaa61089db47dd8abd14cf6dcc73018b6cd87d58d35968da55fe59df78a0561b1bd18d99be996d3a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e9566dc0498d0ca3e5c48bfebe10d57a47e576fb83a2fbef48890a653db83224b7696130bf51d2f50dd20442388eef00", + "result": "valid" + }, + { + "tcId": 189, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0404f4eeea8ab3f524e5d14dcc5bc18937b76ef8a038ad589a2ae3a343ba491f86fc73569ed9ab5db9dd122a6acae3b892a363cf6d3443619eacf5d8c64922203e0d6d6fec89003c3764a079fdb1dc1959d3ecafde91d688ef344854884a0cd3c2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "aa52e99db0983028c06428c94e5a72a4deeb5476db610e7c2725da1402bd7f3237427886b484f28ea217f2f448b1f09a", + "result": "valid" + }, + { + "tcId": 190, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421025351cdd8a029f085b27ea7eeec7a8c71b3bb343f0f6c54d06a48593df1d81b6550a52669b026b7ffbc2ff1e8f3d697c46cc4c616454387d2bbc7e2abf5f2e879b51ce8c7487eb011e996f10d9f6c1f3e89f5d4b9a4627cb2edd2898e459f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d69260c0b0848806de6d9fe74bb381ae829ee4b00d0a26096fa4f9ec38e552831228c45b822f76d2c6f6780362e75ef9", + "result": "valid" + }, + { + "tcId": 191, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b9d3c1b8dfdab46a64b311a5d5b7fd1c587e9ef11975229bd96148d033d0994079d2a684b823d76aa2e23e26c5b13ad8338d0891129d9bd6b2ec4505ffca1a92685c99401255557e362ad5d5a318fc61b2454ff094dee0925d854938402e304d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f2c3ed860582d469a1d19f828de2828675566d8575bfdc5cadbae4631cb81d6cde65a8827b7564dff8d9b88523ce3aa9", + "result": "valid" + }, + { + "tcId": 192, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0411ab8ce8723b26b77b742ae61ea1cfd0f7338945efd1d5ed9a6e29f5468ba60c4fd99fcc20e21a00d2b278aed50dc09c6326f0bd51fd985d4e61d829e1ca601c07855f375329c609260baa38a244cb8dc1015f9ba9a599396f26cd83c1d40892", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "36847e18af6ff85ce717171e185b2485f540ad75c73f1471c3e25aca74ac1ab926b9ab60df62c7d012c3ef07e288831d", + "result": "valid" + }, + { + "tcId": 193, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04898bbda1da65973983f5e1505ef072183e3fd3f865daa9734b43af66f54f334f7711c32a0976ae2aa4d4d313138adf3edd0a5ffe0e6f09e743b38a2566293d1f6543b565b69d726b51efa15f93e67dd43145baa477d36590407753722e54c435", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bfc55c148ad4e928018700849e763af31b76c29bb54159de906373c0f7365ab9cb9582b051eb4041aef1c71e1dec2abf", + "result": "valid" + }, + { + "tcId": 194, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04eb89196ab436262eceb45191833236f0783244d9900d2c86333087749a1109c6c9e11c6ea07f5f156b8931d24b22e6441f20a8b71e48571195785142753e8d4201cb01da7a5d78365d2421ecd9b7635bdd3af1a8934069788c82e2bbd8b58320", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bf629d6cc07affab6db89268b643a4643ada5d8b03523e1c734638f95814e049b74a32f58dc1f2d591331c2cd29f97b6", + "result": "valid" + }, + { + "tcId": 195, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04366533a19572bb73574731c95044a7d9e4b3d220a4f9e25c8eeea514ba576a0288e6eac0aa680217e57183ea5ee6b97a38d1278c45cdc8103df0fd8fc2d2a46052658d0d90436e123bdcd64da1d8bb69439b9565bf42e4c151cc5961610d2217", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0804d3e956466024d9f560005f75739c8fa653a45ee290f1be94da7996dc7f0a41f54f1cf1bb48999661eebdeb2d2216", + "result": "valid" + }, + { + "tcId": 196, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0400e21277d753821efa5d4efce7a021cc48eae0c334ef2f9c5f86304970351815fa2178e6a8cf4a723078e99a67dcd7d131495d2d50f36f460e02a1ca47ed0cff02b2d6b106de48616b0b88bdd60188740c4174f9fd1de433ab792940c41d74c4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "928b93a756f16cbe317755ff0bd139e4f35a2758eb51dbd82f0a31bfb2c013d13a22d20cb29d9b524a0decb0324127fe", + "result": "valid" + }, + { + "tcId": 197, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a7ed0d20e001bb9f735a78a4c18b813460930eb6982de11088014728d6b13fb5dff0c300ed92b751357fd4454516a3768b4c3099a0857f7ef07f9b2ed77cae158652cc0e1b80787d05bcbe3cd4716c4d1435d1f34fc4e7e916f72d9f95998c14", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cf2bb3468f4c7b0a2737eda590f4bbc16a3b11f4c1c5ee1684f2ec2d00c085df896d3106c62525614e5faf081f664ded", + "result": "valid" + }, + { + "tcId": 198, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042475b6e68cf6ed0927ca769f922969fb0ceaa1d4e58bf951bf9a6f8ac2bf00c784c49c91e0b0e283e386a666e59534c6d73741d5bcf282def7edd5982b7b8684f0f5ccd13afdebefaed3bccca70192670eb37e47b2fde18f2c9a0527e5cecfc2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "806645fba46ddd16ff8916d2593c7bc393a0c86f9623ea2cce478e5c414eac379ebf1ede4e1b092e411a00ac367a8db9", + "result": "valid" + }, + { + "tcId": 199, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04eb6aec8588c9f4b8c1ae0dc55d4953f43c75af6b228aefdebbe2ac048934b300e42f7fa54d40a09c54b8292d87a982abf2ce47598994b114521c57fe319f685c37c077c5bc9a883d99bd5a155294a2d79b71ac6ca3353b86e18f7a98df1a7361", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "75fb3dae4572f2ed6a1641ea683a807943bf978563a4d2a02da083617302ad7ced798e3b20f328f94167fd5b8009864d", + "result": "valid" + }, + { + "tcId": 200, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04690491b22b15072e0b59004dafa89b908ba81a747301e893e7a79f4c6d1c177694dbd295d39ffa45164b72c8a6d4f2029f0a5ceefa1a95fd8555bdc7457379f063b7c6967e45b6c5e430b2e305e93e2be515bd28ae9c98f9b7ca9d242e6a543b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bf1221157dcd46a9ebafbd1d15883077f119d9d353b20ba396e177295e4a613f2e492c501bc866a17322e85bea2d4043", + "result": "valid" + }, + { + "tcId": 201, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dee42eb7001239cd9adba47c3e987677005c5d48316c75c8643f25a4fe1375c2308e5c102599ab70074b2efbffe6ff6759dbab2b28c184a20734f18d44738cf1e888ff12b54f780ec574db0db25f05686b72fbbe834d66eacd32fbbeec6164e2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8d0feefa19637c25b2e8748ed23dd8cb2f594ffcf4f182966d7dda8f41b8500d7536336349661120c734fb1d500b30b4", + "result": "valid" + }, + { + "tcId": 202, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046b801e832bd50151df24fce55919d4831bb4eab16371b575da7d96a4439435a53da6f3accde92cd0565703fc79ebdf8f9cff0686bd9bcc5fd097980257e49794e9dbf62653f055b7bd7851adb8020b9b90b57e33aa65a3cc753b79cccc248187", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "88d93ddc04d04349f63c6ee55ba0e9cf784e29cf3eedc4c95dc3ac7a279119df34bd182ae517f7b2b77e60b31506b885", + "result": "valid" + }, + { + "tcId": 203, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0459bfec413dc65c255823215f5c8e175296e22d0b071333c6026ed6e24ee1e31be54fe6c4a63c05870fca95c008096b6c0522cfb2fe9c80886bb7601c7f918ebdaec542c3593d242e73197f1b80e8442bd4b0777dd6d4a2cb52a754ad0080f8cb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "63783ce0594b80cc8f4fcc0b48783e574c62dff06175f00847b026f34c38b87ed480b3275506e4e06a617ef7dcd6e061", + "result": "valid" + }, + { + "tcId": 204, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ece5308b44d5953ecf3d95fdb45e62ebf93c76aef18165814ca305742680170a03633ca81fb360a1f7a571f652aab90b458b04c627f1a9f84b7ef6a86c8a56a3df705b0c0f03b95ec679af1ba3648c6265bbca97f246891708adf3134486727b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d37d085dfd9374de14ef057ce75edff903b1b4a3dbc55b6adde4ff45ee6b62e3251cccab4ebe8c172df35677f65ee30b", + "result": "valid" + }, + { + "tcId": 205, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a81fbcd379c94bfc0b53fa898c08a391655b6f3a85e75115e3ce495d97c9f849052d20ce2a13e5214cb7da39da9f526050f7f36b082df85b253ce01747ffde1040056c64fd947c97416d61e5f9db6cb10204f66ec85b85a06c61fe07951343ee", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6c9308dc35b35a49e2464f822a35fda6ac53bd466064fe6e51494f9a756fae7433191dbfff860c7fa07ea4c8f229c6f5", + "result": "valid" + }, + { + "tcId": 206, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049b4877797bbaa387cc21d40247c7f799fce81c5e81c8f615d7d79c473afade9e3b238008985b5716b395ef05324987cdd65828ba22691587743b98ee1f3d22f5bf1c0fcfd9c4f10cf6ca5959597fa201194fcce07ba88e67d2e1406a79dfc6cc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "16570df749de5c6853d3002e65d624af05fa5ae55f23382545081a2d0d1dbfe9ffd0ca4951cae9b6bb78893a0f9a224e", + "result": "valid" + }, + { + "tcId": 207, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e55b7a39a8255c47ba7f89b44ce2c97c290ded16fc5c8ea76e0d3c22986dd6cfa4b607a609404411f40d6a41c3d9de9984d51ba99b4a9330fdbe09d58a44e6b7acac139236a58b12707af3e12a39adab88c8a250ca7754727f3e214d44b7185c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ab2ad747b87fb97d4b5532054b2b6844bedaaed5abea7cb8c756e82f19fc7ac21e6633dc72e15e57ecfc9c11480f0e2a", + "result": "valid" + }, + { + "tcId": 208, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0485dbca4cd8c4a84d7a6dec4e58a94c65c6e211fdc28340794b1fb32c1b4174fb9475d2bafd6f68c21125404ba79f3c699cff4346c28fef7d5de1d29fb44f2b6739ba3a07226e7870b85b6cd3e9315492a26bd6dfd4ee5376b0a24cb7a6cb6af0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d6e21163f99ef2b47defba93c78c36b46b174d9dc1ef94c304843200000f1443303b477cf176a6aff9a53f1ac071da30", + "result": "valid" + }, + { + "tcId": 209, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042581cf46f515ced039b1633264518f9afea16302ff0360382489ae3379ff1e3574bc83300696a246894c110e10c1cc185cb2b52e6cdce51d0d0693ea8870660d6aae80f536af44a7c78cdd1787f33c570e803a8c38e8184e315d2bbd986b4f1c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6e5fb386014dd2903fda1156672a7a2354cebcab65ba20ee04c80aaedda2808728da06a461c868e99785ca42975b2eaa", + "result": "valid" + }, + { + "tcId": 210, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04792931fa98379d2ad26335beacbe8744960d7ae02a98d023bfacf747806ea49d92844c2fa84f62891ed6512d0ed42481ef41ea557af8a8675a92535d027c79ad80d82a4b3223d3ee4b529bd9b556a4458e540f7e737982c1a696059a6e52b594", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f37e5e09e9df78a5b954cbf1b5a256a79c6fce8310f91494a3b711c1721f033dd4332d145b67a31c21645c12b52b61f7", + "result": "valid" + }, + { + "tcId": 211, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04190cc5669ed80db91417b6c369d6a970f1a5f578870d1fa2925b2db5394ddd3fd02139b0146839c28471f57ddf9b9496bcafd89f3476b207b34a07df1924a149d92a437afc001cf682a0f1b3cb1c0b8e8035edb45d296e7082b3ea8156da9d0e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "131fff5137af54a0a55329d895273ddd6608ac94e18abcf5e03d25278405d64c821fb7fc6180bee439c0ee2cd2970e4f", + "result": "valid" + }, + { + "tcId": 212, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0468b0615803e21e134c667f72ad9f2b11114008352720752c5765219353709ac62c6839413bbb366b2e4806e78f96499383aefed37a99aa9a51249538e2239653c2e4e2360b6c2928c6fce750b7dbe79792784903d6179f34c2d5f49c1fb7bb7c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "894d02fa07176efba33176709c4be3f7fba9c4d4b9beccbec54302bab4702ff3f768d5c566ca7251cb5bd5aee9849c65", + "result": "valid" + }, + { + "tcId": 213, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044bc9c3648a6cc11f7ed2f650107614b9f16370499e2057fd1c6fbdb52a26e4e5372ba0005b80d2f05abf83c2052f54ca3f893daee684009dcbf6f4130e2cf71b5b77b05a9534f44b7d4b98c76a43c5cccb36632bbcb5491f7dfd00d5ed6d38e8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "11d878322eb9a074dcfea054057a23a1a9b5251ecdb2399c5ecf13c546b3e9738b5a19f290cefe41397ad9d720f8eb43", + "result": "valid" + }, + { + "tcId": 214, + "comment": "edge case for Jacobian and projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049e508b7f4c199765c9e1952c5021dae9357650c3b454cc00b11d2c58df6db6fc4508399be0e79f38be6004eef5b85a533a6ea752b8db5fcdf198b895597149ed4e307939d4727cbadad77b9692c8e4633160b87350d9fe41139181c642026ef9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f0fd7d9b7c37e0e95e26dd78f6e064e82515ea83e1a2d922394e5982066e8d3b213d04f36958a2d0fc805d966917cef9", + "result": "valid" + }, + { + "tcId": 215, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048cb8bfcbb7347455fa1a97543ad8dc7703a05f8425c998e80e8a1ff330aa32b3d6a1bea9d794a5ff68bea698fe4c3805f85537edabbdfc11856cf9673f4df853094ad1e0d6f9b286e820a2932ec20c5c6e56466fab96b3eae535b191912485ab", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c71268faa88e00c11a2224743d302204c0f40a9aa851fd09f3e08ad900267a90724bf8a1f7785a731753fe1a146818eb", + "result": "valid" + }, + { + "tcId": 216, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c9fc94bfb299408b8efd2634a4c7e34ca961fbc9452bbdcf9a13adb0848db42f2c090ad6047ddc044887e66438e5ca901911df6fc39cb1f4a4756c9c951b1134aa1a81607476c8a7057b80675791140e6d699d77db9327a56bdf39135d291f43", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e889e3bf04301911b8b497e9da4d1cb6d430c8e8388066995525f58a5799bd6fba3fe92651f1839deebc4b78bf12c6c2", + "result": "valid" + }, + { + "tcId": 217, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041dc30eba5a876cc959143119691c30a2fb004c01b2104e623ac3d01a8aa0a1c3f17cf6be86d8c5c333b23d41f5c24f11ee76d2c316c43245e6c699eeac1d7b3716037366e02cc34357cad509f81c3371e67370fe7429c63397ae48861328b791", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "41580a59de6be7b0314764846c85b970f096d2eec60a7dc9094d9a7143728dd1447d2fbe6a4f826be057361a6bc10ca9", + "result": "valid" + }, + { + "tcId": 218, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043e6891da5413900a248df4b60c9d77ca21dc21dfed9c2c1b05131ab7ca61562b6b091d07d888657492a65dfd66b213091557c48f11364e52608c2b8299151bcb8fae05d30a0149f2971ac9c818a789e1303e506b4f585a2170c74820c44164ec", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6e6d95b0a5553e4fdf08d38d16eafefba7e807a996b0a4ff3f97813632815f1030a94ed27fdc643535479354eba1a7be", + "result": "valid" + }, + { + "tcId": 219, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041b0e3ef428aac6a6fd549f11c41425821c9c4a79e1aa12e7abeca9fce5f5a0b8db47140f8bcadd317053c7f5a7131291eeea8ec48ea098be89430811871680270c4a8f723030445f8dd3d1a6b6423c10a117d8c11233b23899904ed0eead7e32", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1ea198d9ac2253076f88c038ee7c8542740b48cfef7806ce135451857089babbdafd16ec0ac7a2c3a4be20a9b8c51fb9", + "result": "valid" + }, + { + "tcId": 220, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c2f3ec0825b86947c35207131055e73216583d5b891703d167595969a509d1b4b79b25f20baa814176e6a4eac0e0030e12c614b0f081942a2ebd0c9555dbae3af004fd935ceed01fae6f507323694f32fc135196a4b8c54c3c62435c649b0004", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9896b3a23927530c680d908ed2f31bd7550542db91c125540e42b6abed5944bef27fbdfc8c15c3440b20c2c04c250504", + "result": "valid" + }, + { + "tcId": 221, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dbd9eef0d16a4e506fc8c7277ab3385e38f01b851b2f3a984a25341a01a7a06f2d7c16322d869f5feceed9640b59bab22613f2f1df7181bbcb1a5922e72898598c2402ee584b79b6419ba82d0e2b144a2bf7aa9fc581c4bb2b35759bdc0a578d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "001a881fdf3893d103b51e1ad7022689290c1946fc28e7f098c46de9e6924d195404d187d1485a9a086f55d2b89fbef3", + "result": "valid" + }, + { + "tcId": 222, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421eeedfa7b729562415b75c002c0cbf9bb49819887494c39cf2b12bd2a3b10850534ee6be4794316e514141ad533d9c194cfb5500e2d11741691344a9cda4a61adae51e30bff51c1b4b9371c184c6b0c6944029c477872f4872744fe79547685", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "add6fc8962a120008cdc25735a4f8b97fbd4e9064ab18e530989121a011457b3eeb9080dbb6952a7434d8a7b2252575b", + "result": "valid" + }, + { + "tcId": 223, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0423aefc23b42fa5605e2b0bbfd09500568496d8518d3a8dee3232c050b6f3e661af2b4ec7b0d9dd887315681be35f383179ee7621793c725ced704e73a32bbb5724917131ba970e06085c7fd85f3fd6259616a2f8c4099e787f84c1796768db1d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f515ca2335edb53031e74f35390a0e4420408f5c9fbe214c3e10572941e20612d33f0319d4bebdb8b7a2d3e0a7080c46", + "result": "valid" + }, + { + "tcId": 224, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ea707a980acb4b870030be00c51b9e71fbda0a99384174467d438b9291ffc6c4860e75f651f95a144764f54c6e86a98e671affbcce409431dff095e306d96203472e285fe162e03c27f1714aca01b07d7d3a654bfa706bd4280c50ebcd0b1ea6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49fe2d47bf847f419143e37b673740bf2a87f97f16beef777469aeb8a072c8f05498b1933f6164f6cbf11d9856693118", + "result": "valid" + }, + { + "tcId": 225, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d8ff9e972a298b674b1f0cd0f4e00025a1afccffd10aaef27c53ef83f01e9a72cb8cfc8ca3f4ad30babbc26ece9e029727f2adbf670b043c0c3d3272b79df04791ac6bc7296fda0ad08c33d7a72228665d19ad5b309818de43eac7562b13a4a7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ebfcb028e36a65ab3192b4e18c7b0821912e03e4395a6f614195d50d7ba2553b140b61e0035a7a6eacacd017323883c5", + "result": "valid" + }, + { + "tcId": 226, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f5efa4d4068806b0fd64406c8029a6f20a3f7971f0dcda46bc38109a3bf0a162e8e0c6b66ebd7b4602f93259904e42217eb08fe5fd31a6ea9ae90a63a14c87db8dc01c084dc117949761c3185486bceffa319f0bb2bdce60b0575596ef6c269f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5355026a2c19af1278c85a4041620022f7f42ecbb492877f7528b64fff01d6d48c2b0f500fd20d1519961c4b853837ff", + "result": "valid" + }, + { + "tcId": 227, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0422707cf01d882be133fb162f752cd2478a2571bc62f3723d56a1b0abeba57349ae6599325d4fd150871ae9c35f6458757e2eabad1410a28bd86893bad815ed7b7dd993c54082cfc1b15acc96965f80fb9f1943fd5e73e4e153c5a051006e5529", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c193cb4d85259ca7a0a97af6076a42d81c74f930501bf7a2124cead12f9c02fef9e0bc7416a5d432d1a37ea25ff6ac17", + "result": "valid" + }, + { + "tcId": 228, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0433286c463ebc110f0b190aee589b342543e1af8d702d877c80f9a3d69b17a80536f4b7d3506dbd888b59d8659d89c5f0c5cabacb6e3f51c3c1e0f28ffa2eadae713e3590dd35b96f7d016127b81e3c04ed7e3008552c6d267efd2086d4a3954a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f2efd83318914eb88011e68b50a76c4a66d60ecef49f3a3bb020f86f8f44c0b5ff90c832030ce6cfb6dc55caf004ee51", + "result": "valid" + }, + { + "tcId": 229, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f2439b46dedb76c0553201c860c46fa02a2d233a6130e4b9cbbcd4227bf4fa16dbb7b079bce8b5cbfaa563034bfd6cb53bf43e21b3a1627cd5d3c64a73ab3d1363ce724c81007aa37c16f9e9bc880a6557644f5dbaccb8d915d269ab78b818ca", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "01f4bf15b3d2db530ebdf4b47013b8fb8351d8d320ef95a6143626192bedcffd41d01650344a67f2b44db9404a9b5ec3", + "result": "valid" + }, + { + "tcId": 230, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041997402d588e30b876451a0feb55c2c753b2e1eaf4f235574d015160a0898557735760b7c1b958cb9c54a98724ac0e04088d526ada3ac5848296ea36529f28c2ff77012c36ebfc3977aea2b38657e50e246135f63f176c82194288a5add7be3c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a7143c0362411711eb4b1584dcec013c34e07b3bf3ae3a9dcd7121a116738d0574d8a879cfa39cc7bab45ffd44aa18ef", + "result": "valid" + }, + { + "tcId": 231, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040004d333abdd1778ed6367bea67b5c09d6b11939b0644fb093b1366859dd945b5f96d84e209e602d08b6ef1cbd8e611acac5cba5979363f4b38c87a8d3ac3cafff58a82433a7f6f58f225c615c554229d00f7ec20c355c996f1e5567131b2835", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d65de841ccb7cbe704eddb812ee524969c92479d1f8ddcdfcf8523c32710720b1d64e224f51d4a0076457d8d3c6b005f", + "result": "valid" + }, + { + "tcId": 232, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04db07c040908c180e27c2c97e68c0b27f24a7052f8f11fabf00987c7604d245a834c4aeeaf664cb3cb78e60efca621f73e31c527677b2369029d3567974eba36a0b5ab77534d4cc23d44d8b2e721a5bc97ce7a4a46471a9ed8e9e6a2951d9b5fd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "20597b665a286ecd1a86554fc740b435101c72bc86db21bbf6fe66e69d2f09b45b84b9261e6ac5111dbf5ea3b2f3c62e", + "result": "valid" + }, + { + "tcId": 233, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042c4069bc8078236eb23a8c4d575bde9b537b13b79989688c40d89d898a8c29bd7ac61745797b7ee55aca60ea7d6c2a8430fcfbed18a2504661e0253c43e47be01940e81fcb2d65a5e501111978059949c5d25b0b60de7821476b88a8342a0bdf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6ce9bffb8901baa801d1b19e92b5e5f47f5bee10c15fe44b8209977572cc8bd7902ccfc0d7ae98f6b58bb87f316a5792", + "result": "valid" + }, + { + "tcId": 234, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444bc1cb2d42ff974e72bc883dff784e86978501f918eef4d96d6e5242da6f5651a29cf5205c3dc3be33332fa2defc34788f88f549ed78732063020dd3fcb872515b25e088700e3eacb925de767e9edf6e89f089c4f9e0f4d8846980393667f6d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c6dd2d372d5a5173ac63f6d5ab5dec972e8ae44d566c7f826beb7f2693e200c470ddedb1c9929c11ed86d135f44c979f", + "result": "valid" + }, + { + "tcId": 235, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b824eb72c43edb5b3ce9af94ebbd33b446b4a7233b89affe1cfa3beb53cd199fb119a356772bfec178c03b077df12f53f99851fbeb9971ffcf29ad61ba484bd0580036dcaa59f407bc88a471cd862b80a163c91a6f64602b6f713959b2f6c2fd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0299b7fc3e5506926fea66d20f65b9791fb6c88c7179f7d4701d68c13427ab56ac0f9e1da96c1d5f3d1a65ff3122c153", + "result": "valid" + }, + { + "tcId": 236, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049270b8cefb61a5d52fbb5e6b3b62361f3afa5d1a6b01419db9266e2dbabab36aea5b1961318eaf8f0bd7cca75ff2df5b7e538c63012a73f777b25e1737d44fdbc299a76288d7bcb57c8484c71c9bb6453245f239b6c6df32898424383b4c0309", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "13d78b7a4daf8ddd62e347ba235c36486fb2eb4a75a3e17a137ec6c2de37abaf45da92d1cf1b2966ded8d5381fd2319f", + "result": "valid" + }, + { + "tcId": 237, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0419e5c28657479eb41d3718f63e0678be0daa58502a5406d65913567df7b86ab25e905ec846789530d81d8d1fc2a8cade4aaf131a0ccfc79a24bc889c953249ee85b49e2a1bfa52167fe20de296e6497ef9014c2cd0a02afbad1f9d00ac3d924d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7b0863fc6d72c4bd058576cff7a4aedf86482d3d9bc9c5fc55bd8fac84107dd0bf9f27d7e8d624edb0aa6ef1b9cc2246", + "result": "valid" + }, + { + "tcId": 238, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0459666df447dabc386d8dddae93543dc76151f7c1c04858660d9ca8e0655b51a72feffb7085bacbde153fea75b5716ab5c3c7811d0c7435be9e36db00cd29c6ca879ef991adb157a6b4bf56e3de5cb34598b79a684cc3d4e23f22d10063e8d19c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fba2bdfb54e468a4ff5afbaa54c7037400d76414c98eafaa419adab0df50c9692aac67d44a9efbd00d4f9cfc206d537b", + "result": "valid" + }, + { + "tcId": 239, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f718100194fd1683be64de244e820ce43bddd6a70b90f932abfd06a02a87dc5ac453272a8dbd3fe553b1c643d40e3c16bbf0a00716a0852a2a794f8c6f930f50c4489477a582470d0ed01cb8b0fd29a0a7503b9e0473e422b8b9ebe41d79e359", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e06698f21e93090a627323a3c4390ad429a376f8130c66bafbeb228fe2433b57140a70fc7c1d856840cff4e3c24c8ea1", + "result": "valid" + }, + { + "tcId": 240, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b7a12441b2e3f949ab5cf87e5146f2ef6ab8b358d863d0a6b22274d6d6e7c6af1eeb753c165cee1121ca5fd6dbdeffc32d5b0e1ac10eafb9912b1718beaf9b7eb3c376c74d2fb2fec73420dfc7290e8090b1413e799c629786b7bc71548f681c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7ab53f7ac3b96badaf19656cb3d173358181d2174d7145526cefb2ba4cf17d9493ed42b1d3916ff24b5f609252d77b26", + "result": "valid" + }, + { + "tcId": 241, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dccd35c0576159e09b22e2e0a1a0ce8c9db8f38277972a6077d654e5bc8248d0620f8952bfe36148c021e85695207ce5e13cacc5164b94690dcceb9c4ebf34dc2a5cae537c68c978956bba1b3ab915e48611a70474470349851d0a9227c4bb20", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a1e913ab423c4efd1f7907d269ca71ab1071687e490430865bf007dc133457f7f2788764dc5b6249d71d364ef2d573db", + "result": "valid" + }, + { + "tcId": 242, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04200ba02a55370ed2d0a93d34de4ce959167e9e1c4493bc3b6b216e7b441d84285832dbb178d1adb1c04866ca7ce639a9504c120852b1586f6d2025dfe859a5a4507a509118b4278ab8279e688fc2e95330cd46485eda1ed8f194c2a9395baa0d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ddee440b4dffcb28ce1927c7a9661fec789191ef86c96c865e2b6768952934440bd75c246d8f521d01a407f46d0c5890", + "result": "valid" + }, + { + "tcId": 243, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0452c01da038de5b1a63657e3efffd2a5473164231b85a73483fc639b4e65f422b374c6fd763d5560bc6a37bfcb7f456c17f3817e6611097f536f3fbc3f7aedde8a2b7cb8d8e82b13f29168c1c81329a649155a5b11b7e2130d63d1f96b08901b5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "51a623199f1976b598d83a13fdf100a815ecd98e69b270b67d90690a51e8a06dd382aaf21e9e1119860447ed2b7abfe6", + "result": "valid" + }, + { + "tcId": 244, + "comment": "edge case for Jacobian and projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0470f58bcf61ca53f20dfbba8a30e435b3bb41d91f94fc66753bbd5f2ab11fe4496e601d78c2f8bb7e52ec476107ec175dcf3e03d51c739afb7d66bdacc5092d210643ef6866bb634e400033460533d890bc0ceaab561dcd7c300b894508c466b3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5086aa4001f288e762695d85562cffba9fdfa953714c72ad1a964b3a4616b090956f711ee2171fe9cf31d6a0959b54c6", + "result": "valid" + }, + { + "tcId": 245, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0426356632d55706afbb9ac925b388027c70883092b1f5d024bec9c3b9de572fb1dc548c03e1f4195a80339fe53878954eee305f779736113a999bf50617f35d2114b5a192ef3bc22d22cee21b45f3c38cbba3a5071c0b3bf41780c132c35006e9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d411678545fc5e1dbd92ad9143a2113ee6f882d81218c2909b87197452ba3fb669802f5b9949901dee92097b058c9d08", + "result": "valid" + }, + { + "tcId": 246, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f3396d6f7d9afbc12c972df7fe51790e6527bf34058d28e30f49d7c288e43b06cc7c4180b281d638eb39a62a1282794ceae892f12a8fca5cf6bd921f6dcd042d375b2bd2dd6a938f0dbb5aa47db0d308c9e10fea92b69fe2dc2f68974a08bf01", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af337b63fd660ad68f6c3a13e99a0b8688b9f2f29441812db471a35658279ca8dc523121bc8714bb9c9c60b86f5bf27d", + "result": "valid" + }, + { + "tcId": 247, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049e30ffa4fc785a55b63e1e04a731f33771676ea0ea7199e05b80a4e6c9dedef681972fb2e9d3e23f840c986fbb83bfe8ef84e59a50c6645ea3e1b7f03a1b08d94d12f216c1bb45c4479d572357cdb3f703202bde9c4217a3e5d77225dfe658e1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e129ec1c999383133f81484c5c64ce4a110fa0a2f645b5b9aacdd448a73a52ceb099f18086e7289fc236b8fab84dde53", + "result": "valid" + }, + { + "tcId": 248, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04361fc902306132c4f74698efbbaf22c96cac09ede54e8330de2c5c53f11d6e7343cc00cc0211cd118c8f76f20fb89615f6999e47f1aba76656bab120d2ae064c556de95a107f63554b60621c1b5a84d6c1563d52142b7e37ad4743f495b3e6dc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3e14ca08546b2a0d4e682fdaa90cbca3c0d8940372c21987ae0158b19a5069878b57ac95c60cfe1055230a349f0b9da7", + "result": "valid" + }, + { + "tcId": 249, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d1fa4e49a9486c96af811b868dcea873e1bba3b0fc3746bcb32c643a7ce8548518e5262af3636be356b7ca6039253668ffff40f55d32073a951b25e2b5530a91f5b20ea54152ceee8f18710d6b5c8633fa4f61d9a35b5cfa300d8aba9fade236", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fb0c92659abaf0ba2e161436aa331b252f264d4e09bf86a825f0682573e33c9ca93fb1646eada5f1f3f1865736f7a420", + "result": "valid" + }, + { + "tcId": 250, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04433120eb0ec94ed8e7c7398c7eaebbb39da57909c3acaf1096a9e22468eb2667d8ae8a609ee64cc7cf07b98ab69f27ef4f69f7bf9e4d18451cb6488cd922051273d87af65ef645e9b4190e625a2c268dccade931a6899e03f8b5c8f25f0e6b3e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d8742a72fbc89704f82053c2db273c0d5b413260c6f7fcf1b9d9dafdc592b3dca1ffffb1b7d8ccce44fec3cf9f7ffcbf", + "result": "valid" + }, + { + "tcId": 251, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e5fd264a423918d50d45cff9dffacc277361c148e917e4af2b49ee732d49dbbdc1ccfca6431a959ff055d8fbcc1b9c76412b1e59be5ccf5cb2ceaddd699d260d68b0bf387b4bf62167620541813d92daf77d0dc7d82eb3378de9a8ac016b83e4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cf6f62e229e17b604b00d2b517423839318a975f4e06045def60bd42c6c1937a86767f76adffd3e09545e6429c117176", + "result": "valid" + }, + { + "tcId": 252, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04254110dff3a29805b0cfd20f1131856932e1a7a50a368c0d0927f2b9045a8aa05f10bdde1c7cd380ccb56a7c949256b7daa146d443d0eba2989c41057faa8754b98fa41b61e5360cdcece49f5c4d9055de70ca723add52c7c0427a78e5666f18", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e912df3cb68c52464c134d4840dc8a07e33f5cd94254587e662f47bd7434b48b747bc40ddd0014a8b8856defbbd337e8", + "result": "valid" + }, + { + "tcId": 253, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a7f02c6cda8167d16ed6f9d10650872e9185c92991d9ffcf5b4f7adda3cf434bff0d17e6f838f2c1c40fc051ede874b2df5e91f1511b639a43859a1ce952e2ae97d4e7c806a2160a10a9264b2a7e7fda1fd1229bc2697fa4a0c9eaf89c973003", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2a0df86d40ee34f5f6a6694a4c97e8c229b926c140b5d776f14111d672d29564ea1d9f4e4629376677213dc45a465ab7", + "result": "valid" + }, + { + "tcId": 254, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0469aed09c61a7d28a73a6cbe7f2872763657c184a5856d581678f51aa6e79f6712704d38730eef978b08450e185991f0d4fdd6d8671db6bd0c70447e9e5aa1d9036d925edee37f0e32e751bf8d686cb2d3623026cdc131339be8629a41eaaf197", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0b557c61d3574bfc8fc4fb9bde7810319f9ede560f7d479f50bcba6b429b4b0ec1a58abbf9c40a6112dd49a188b48031", + "result": "valid" + }, + { + "tcId": 255, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0463d61859ef7ea3a76a2f6798c03395348c4b97f6442ec3763417ae3c3377395e53720c8e6beb45a5dfd879d4019ac6ef252feb86ab42305b57bcd7cc79745024694060d5b31dfed9a222027f9ae84d0d0b55f196ba9af7ed6db44fcb48a7d58d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c5c4ec0b9109ded3a5663be4d627df888560d9cb00c5320b1e66e1e2cddf0da92c28ce625380ed549dff004d4b69a82d", + "result": "valid" + }, + { + "tcId": 256, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0471cd14bb61280a9ece2fddcf3dc0cf664c7e625e263f39302512e84ed720b9a60e7fdf4f8cfb26b2d8233103ca34b7bf9c7153bb0bec0c188a79a155748427099b2d849b8f4cd2c0bc239722d15a587650a126db2e5ba9b4dbb864b9fa36fed9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "eca8397479082446c3c430d3aed06b1a369a9d34e46d3185eb01145580a085286e72c6cec1f32b8fc497041206e83e31", + "result": "valid" + }, + { + "tcId": 257, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047107affc4b6ad1f30f876b33dbc1b7a90a5ec0679f601f387d68a2fc292465b94dc416a2df5b047bf1f3173644019d6f0c8d7e7232d3bb51e57498240d8ca0a9ab6b4f27a980cbb3ccc78397e3ec099039807d49852f0a5666090beca06ba9ff", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "467de0858a4ad378cb32f63a774eb423a535fa474909285933d9f9cfe5011e065bc6e90c8e43b9b58084dacd264a7309", + "result": "valid" + }, + { + "tcId": 258, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b3170c0b38a653806848be25f01173b358b72c623b645edf0707377a6a931b81f6be51d2de8abefc226bba0e2d6fc26f44bdf0d8c3ad120409541f412993f1f79fa18ddb8310f264487103703c3f3b9d2edf18f0c804bb0f72e67ceaaf4da93b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "11a26df74032c17f2a0709ac163b65b685607c3f55fb548ff8bfebd09b2d1c9da856079123e6dfe3ea7648395d05b4ca", + "result": "valid" + }, + { + "tcId": 259, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fca0fc38bd8ff8c90f0b901329da61841f3bc6b61287d16f452af3dc83b9dbf6ef022cc157203fa4d6239dae9d9b3ec5370ef38ee38a3112a5a23293b5fc336d729b915fc13a0d9369b131ddbd15acf2b7e09d34e72f59d7e9ff518cc44719b9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8b49b2d53ee28bf7b24fc2d7b73ef8bd474530bd9880a597b33c349880493c3af809674cd7966bba5477f6d8e4a12d3c", + "result": "valid" + }, + { + "tcId": 260, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043bafce9b32616f3bde17fc989f1e556f92faf5c30e2cddebc2aba44edf36ae3957c9c610a34521e6ac454652aa597811827b4ff45f991f9405f2d8cf45d5d0876a260ef0deb6e86090c5b45f5b7b1786105324f40a0d2b43ded57868b38b43ef", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ba9b68d1c00aa1246edafb70db6ddaed8570c465d9a5836d4156a1ac7fda2a209c25471a0df6d7de93f980c89c841620", + "result": "valid" + }, + { + "tcId": 261, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0453385b9303d2c5d1ea83e7700b3e811a7c905d1775c379a44e9e5c96821559700b492ee2868c5a01950aa4e2b05932ee8fa1bd83035aabbabc2be7b61f388f78b8046d36bee99b5489bafb3a86dede29c14d5373ed9bac72a92ab8e7c31fb86a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "33c6c7e2c805889caae5679aa024dd79f54456f798eff0a0ddcc1b28d8ad302d2f67092275ff55f8f4d99357ac86ce58", + "result": "valid" + }, + { + "tcId": 262, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049ebf8d313da3e5ba237ee33e6dd5be770390f837c9528fbdd440a9eb2ba1cffb27837d865cbe1b32ff9c7995d5dd511caa4125ec258d182ee7f7173ca1d17139ae13e6072acd970ba56f6d5034e9f45da36b2ec774349be2168f32bbf04f9a31", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0deeb01decaae0eee55e2c29501cdd9cf7d4db2f1679fb72efcaa5db6e05cc4a658480245c59fec9984c613501411b0a", + "result": "valid" + }, + { + "tcId": 263, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d4cd22e8dfa620ca7d68e290451b09285298a1db5a7ca00ea830d6e9ec9cc4d03f5cd43fb2a9aaaa142fe4c6e2269cdc747e0ca07e38f4c5b412e52cb7930c381100d2aafe54b619ebf72e81a46e1149635d25a37fa66e2d1bc9ac25fc1a83f3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d360753c568698d7f7b261dd2f5064ffc8aa9f03343a2291b967632646d51570562f1ae87775648e74f9f30e966e7380", + "result": "valid" + }, + { + "tcId": 264, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421b91b9c374ecf5cedc6d73422c6539b22ae5db61bfdb06b9c89e68112f6433e9d49715f474534fb9cd6c2cbfcdef94fb5d4fe306d59025af4e88f8cb3ddc3d64f707e6820b41cdfc055cd6762da23de01c1b311f1a5bf7010c4ff4ed0a7e84c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "596af71209cdd23c386bb861edbd171ea9bc6a858993110c9333a956b3a03fc0f55393ca46bb15bcf9f12b496459c4e6", + "result": "valid" + }, + { + "tcId": 265, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045193491bad9583e9d7d099a1b8fd792d1cd56ace6448a36aba5d023efc37cfb6f93c15313ff868e4a0fad9b0b02feed9a3d9e7b1b5cebbda846b8917fa34b4642e47abf1ab3d2628bdccfbd1c76da5b385475f4a243184247b06f75ab2973df8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6f18fc58c50d8902de4e81a5a30f293f1c6a9818c9826897504c6bcccd860c41bf6e26f44a1345d9c9e3ea55b03c39a6", + "result": "valid" + }, + { + "tcId": 266, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ad93dc8d629536d9b58caab86bfe70d6b433a757e8c488e399ca1f3d71b02446c547b361332f1d9d5c9c8aa2ba1145782a6f58df4ac8a16cbcf29ef2972427f5956875830837e5c4844024aa1c5d703e1f58887a733169993f70f137965689b8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cfc7bd2973810d5869aa2ef37a41a96a9c361ceadcd087cc95a2574abd06c3ac05d0bfe1f54dc66d0cad2052348c5c4d", + "result": "valid" + }, + { + "tcId": 267, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04943936e0503823cdf65b91529e07462560578e4e791f022bfcadc8c81f845da2c98ae4331c51ad17c26444dab5fe5c522725b4a686e8703b1097b36c3349a9785d4684ca36de82e08250a6c1c13c87d4bd6e6026da44e2aa0ca215a505ec469d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b22456220fb3a175a7dd60950a7dabf61706e6e964b47d38d0ef6a61a04f0d05e9c476f14c383802a00b4e9e640fb6b5", + "result": "valid" + }, + { + "tcId": 268, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0435c2043a99db59ab1313aa191a736231586c898d8e1543e1fe0caff1689a7f3541e4474fa91bc251dbfab19267fbab96539341d1993c64f243ba37a2b62b091f0b3607f5654d2a8c52a347e43def73d3fa54ad79d45dcd46861a5efcf187991b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "933dbc18a92e9b5d033096c8ba3698e1ceb35dcf7c44aa4b9b9f4e99003c1a9512760d2e369f05eb767d17b6ee8ef12f", + "result": "valid" + }, + { + "tcId": 269, + "comment": "edge case for Jacobian and projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0482c355abc42eb1f9c868a7e1da4eda1f45e43ebf58d25788aacd4bb9534f5ca5b49e7e00a868b0d48a51d48ba3e8f46b9be94ce63d472de99a3c6429e9cd5f71e6a21c9c0f9415e028fdcc0b21be8c9b74243ade63c22daa12e73d5e95b86a6e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f1e30f69ee4b07c9beb002d28331cb1b170d00fd00fc6885d1ebe3e59b89230110ce9c2560c0edfcca8da1e3be04252c", + "result": "valid" + }, + { + "tcId": 270, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a7c28ff446c58080c6c77d19d559f1394b791ced8694c94d58c3f7196903b0807fa9a5a8e6032ed5af0f7d7512093cc41d7c7165d57c6d8e12ff9e7f3ed75a608e6a2d81043df37edd98056beefa007c9c4e399b69e9a9cdcdeb02ad8521dd8a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2d821d63ea67645578c105f76df7abf24a0fdc2d44c1b9f69e77876b45bbdc781d822d92d6fd5a8677c5484282fb3eba", + "result": "valid" + }, + { + "tcId": 271, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cc08a94cd0624768529241e722f3599964466c9982d9ac9f010e40321334f2adb10c7c76a427de42b7ad2c11c7dcbee13067b9cd53b526274c944eb02c29231648ce13253535f1486e6feb6191c92765b3e8e49d5016756c6a91b9b59ec451b3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e6fed8a7a165867f09dd0c94a8cb674f4cec2f2dc3776b18f5bb7e5273c9870d20f62362aa98155e592f804b936854ad", + "result": "valid" + }, + { + "tcId": 272, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047a03f569fb03ddb12ee3192d122da9497ca595156d6d18bda3807904f071d3e02440e0eb53aed8c679d3c867b817bcf49de027725884ef6a1b95bbd23ff92f6ed77e4750edd29567738c6eb294dee2ba1acf70e4c61b02cabb6c4e941fa80089", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d260fbbd5cc66104c57146a0ed30e01935d952fb09af7b1b074329da13bb4557877da6d0b7585b3cbb4700fd1441c5a0", + "result": "valid" + }, + { + "tcId": 273, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047a6fadfee03eb09554f2a04fe08300aca88bb3a46e8f6347bace672cfe4276988541cef8dc10536a84580215f5f90a3b6d243d5d9de1cdddd04cbeabdc7a0f6c244391f7cb2d5738fe13c334add4b4585fef61ffd446db33b39402278713ae78", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "15dbb285c23731b1b097856bc8444c3f23874ec977b419d85eb62278a73c277b484150b61298e2b64cf677a003dc980f", + "result": "valid" + }, + { + "tcId": 274, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d0e20a46b36a39f05731087963dea0eaf839b9816f5d7192565614bcb3230312f853595e2639cf274544098a243cda5cd1d0698cdf4868175ebac978e0d91c8e826cabf0b801bef1b2604396f4c6c6e84d36527b3491c90190096f8e37ae8b74", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "08746ec407e71e9697d183324493d997e829f953c36e75d8356b10b5673f0d2dbe6a13a8f19e3af759072f25e98ce92a", + "result": "valid" + }, + { + "tcId": 275, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040c1a9db28bb968fe86f4c40cc82a2e1bb4ac1de7e0944077978155976f0ec6e06fc9f0c9f1eb260239bcdec918a80d48947bb19283bd1375a6925b73a6593ba5f2540002d669fda7ab065711495bb2839789de0c5cf91c1af94ce8d56d2bfe3d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cf3d24d04e4e853b69d5fb37674b75ac2d031fadd9db3811b32ff078e36dc35e98c9e662b675b37275e1f8fb25bdfaf7", + "result": "valid" + }, + { + "tcId": 276, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040cb8ec29dfb552312f10d59e6794cdef40bc498039cf89d9b7271ec6406c5ca0fd396e436ab422c2f34eadc065d33c756f13655776c9d0e18e8e3d95509d2e234b4be188d02c1fd2c47acddcec83bf0b84bef416b186faaf3fa2dbcda31fa59f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2d6e26d45cb42d42159a089c740b1700cca8d5c6d2189a46e419ab8e00dfea41878dd96e5b20ffa1abe1ab408c7a91db", + "result": "valid" + }, + { + "tcId": 277, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e3690e89062b36ac177066f4969d0949164942e3d3c96f7758452ca66f9e113b245625456b7102bd94ec041d9163dc67bee62f5f627a59189c8f1dbaf8c38696cb88ec8d00454f6bef40d49b00605b3bc4eef17787b382035eecdad50737c329", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f94b8683b2922c02de0076e4eae195978b2ec4c01cfd20d26d84c822ecc24a7ce7326dc39903f279800341ff7c1c99fe", + "result": "valid" + }, + { + "tcId": 278, + "comment": "edge case for computation of x with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e51d14f867d85ec55f66e11f43243d50f8dea6ac21ec43b21e60b5cf7e55552c646c5b5a5353a84967c953515ce8306074ec9c08a36bf8d2bdaabe7fd3722cedd10fc21d872046159484651da02a30471ce513c0bce1bf72001f4b31c8340924", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ac573c3117008cb93edfd1e8ab797f4c16f6285a88b45fb8d62ee996c53ae63a3f4cbbd75034764ba46ed22a55e51ec4", + "result": "valid" + }, + { + "tcId": 279, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0435803c8f35bc0ae1e521a4dadc5cf262ccf12837fa5ffbbf970f9c82c68e2b153df24a3350a79e5c500d741bb48194341c5b54e95c6b2cb5c24b72444f17f7752986d1a209425eae6b6203baff529ca5cac532c7a9f0e8eadc5620d093a53a37", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ce49a94810055c7395f47a92709db0cf0f661bbae6b51d8518dd5675ede9748b15e63e0f69cbd9af5c943e031155420e", + "result": "valid" + }, + { + "tcId": 280, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04270996a1f3e5c4583ac5fc5e77f08920373619fdee713da290f88b8993fa6b5547ae60ef7c0760feac69c5ff9c3da2a711ca4a40a9fea4021177ad3895c60a5fc6efc260efe3b41f67d23134faae5e3af4489b1bef9322bd95588aa05e9219de", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c4259e28befe24e56c2d9b1ac3e62631deb9d62cde9914406b8099457dfb04c07b7d1e7c6812bccbde1000aab14312bc", + "result": "valid" + }, + { + "tcId": 281, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041e448577e7f4535c9276c1ec3a9fdfcdec3497153b31a02e29c3ce573005db244d51614f1289d69f7888a01b619d73e3796c1c2e6740264e445c132dfa3dd1cda4b552a2c621ee07927a63e934546fcd479f299abe0246d28e97eb777cb74904", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d4722e6aaf45911919f6d31c5ea03bbcd2d640052e2151cc20064d6240eeee86d92f8bb560c0c9a1ac59bcd432af1742", + "result": "valid" + }, + { + "tcId": 282, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040a4e94f851019609601cbe31f1d9aa5d783a58782d2e23a71c51967cdfbda5dd1588011786059943beec01f45e80c813544419d136537ae8c61ce5dfe043b534cb157a7c55335228b828e9b3cee29d28dfe2203cae668861deea419b0c6d11d8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c22ef24a2512d7a924e2c0a00c311551a1f67cf5912cdad36651aa871300d46fd58d7d9cd54ab40014c69ad8db9c7292", + "result": "valid" + }, + { + "tcId": 283, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04276be110b0d264310201ff9fc755cb5d03f4455fa6cfce12da61a5bcd2c80013605314e1c14a55cf8f62b346d1f45a62b41f3a38c8e192072cca1cd9de749067ddb9bb244d335f0850185a7fc5371b07af648b40c6d398e7017f0dc2d2edc4c1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "67f0e79f7ac8ce850e02812ecc376c7068bd47d3ed1fc1ad7f352a57bc9a1b72848327c0b4fddbac86941c2b68f513ca", + "result": "valid" + }, + { + "tcId": 284, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e8271c38eb6b098239109e4d9b8df287f8446252985df03a109866564dfa7bd7295a7df8ee36536c46ac8950e77bdb45889e5846b735dba89fb666fd922ffb2877599e60fe30b0cb9da4d3ae1612ebcdd34e10570887303ffbc5c2900f4ee742", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8ef6da65ffeb11952f641042481803d5d3218ff39b3112368be9ee3e3785a848934c6c3e9fe10c132c858d1dbdb3f27a", + "result": "valid" + }, + { + "tcId": 285, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04743a59f15cb681157a7803b0ef1059d8bd660f0c731cb7198346adf1011553c4248d7a0e30d95dcd89bd0a2306686883b74699c752c732a109babcf40d78c57ad6e31b53be529e485f99912c2e79045a67452d1af6f5483577582ec328a49cbf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "50666cb11b592876203dca98b76b7311c741a3ac9a9c6f2318f4dc7a0971e0141ad6b18b54e96fba9c29b75b5f29d6ae", + "result": "valid" + }, + { + "tcId": 286, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bc8ad0aa14a667e6f2d6ee72e417f1616c05942c5fe30fe44a888e12202bb31c55449300b2ee4be2512a73cb2f2fe6659f4e0e758ba08a80f5f65f605d30021e3a1f6a825718edaf0f2a365e83f015a773a0de3536a32aabc70047116f2d794f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f4144ac00d840487f83bb21a8a274765e731e2b07b4ee69d5411d5ed6291dc720ac1172b62d4242883b543da39e5d536", + "result": "valid" + }, + { + "tcId": 287, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04df429ad87ed7a1142523878358148a63b7f86ff5257b283161ddde62033ee2ab934957d716ab0f5b58f5e89ee28ea689496f864677e46a13f6687e501efbea709110eda3e0cc4d053979340a3ac31737a5eac3b9347c6ad4ddd3f983902ba3f5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "78d8e2089b8fdef2a890d6b003c2add6c18380dabc9848a57acdbdf931c4807eb758f631937f64be044bd05b0f0d67bc", + "result": "valid" + }, + { + "tcId": 288, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0482131031254eb9d1f99b0bfb926ba54f3c1c51afc766b81245dd3e615af09ba92db9d9f47aae47bdf8e7baac42ded0363e04065434f8ab1506384b0d8d235e76120f18fb8efb7451e52241c38906e5fd565cbc01dfd2d404f62eb8a8267acb31", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "85d4155f1fe751af0f898aa881ded3ed936b2db4b3c65aa16cd8e871d6107ff4f86c96d8b9d25a67e7ab5814cfb9771b", + "result": "valid" + }, + { + "tcId": 289, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ee7fede2b3eb449b091c35fabe021c58840dd398b50b54fba0ba5ccf8f4c36510e47961fdb161dcb7f4bc256d31f5a3c697a4d185888c5a3133b373b48ca0358311ec452c0aef7df8a59be8b97d11475938009481449d9ce562fe3677fbb4738", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "031a3914de858b212decf31f0da98d90d67a11390ff24b4995dfd4f659d1b55898e7d250488f06bfc58ff9bad5a36ee5", + "result": "valid" + }, + { + "tcId": 290, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d3334868c69f629a7d0cfd9192bb8148e59fddb7969f534a4729868d7218c621c1273f229ecd6a08e7f1b0585261e0cc4e6f4de09b0a4f62f6b7927a8d092ba69e7d3fd097475c7ad2aa3a907aeb871090a4516556c26c5c1c6350e502263f34", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "563cdcba49648a744eacebffe833b3b09e328bb2fdf104fdf20a095ab03876ece1f80a15de044be4e063f4f154d72f5d", + "result": "valid" + }, + { + "tcId": 291, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049a43c2297cde2c37a6c333a0cf89a03c53a2326e57a6ad084be7b6e29a7c3963e299925b7b181c956ceed80a46a151d5d4b233b755a8e436c99fbd5f78b2dd42f42674792bd3ddfeb86a1b40f7ae36d291bf39ecb5208acf8adbe96a4fb46b6d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6d2a8ef0eb33a75c4b2e2bb724f144b8c5029a45ab5b7dd77ff7123cb97b13452cb792466e9e3fd7693014564cd1522e", + "result": "valid" + }, + { + "tcId": 292, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a08a947e7cf11871aba2064f5b13b3851c22c4f5cb45581b544a48388bd37c00555e0b57ede104adf425d06c2182a53c531a90f9d1a3cc36d7b3e7e6c16b9e4f0b7b6d540ae2f0e8bbd21248679f91d04608ce9d8769ef41f381901683a40d44", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e0b6ab7325e861183764ca5f93b9e203f052bc51db035cad5e81a2d41ca7d54e2a66d2a9aff8930719924f08db01f235", + "result": "valid" + }, + { + "tcId": 293, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a901902a59977bae69b5f7f478213d8e33ac6eefee917da7f3235bd196acbd72584998ab7d9e063bbcb6e4803e6503d68e6cc0b1d9b8f945afb393dee25e540a1f5397424bf64530f9744d690163eb9fd8d05b6ce2cce3892616c5ffb8e774f8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7c092c9d7bdf2f63a79235d75a9bd19f3a2816f9235d1430935ccda9e193e2ace6bafdee2d3e5b76f6382aed112e849a", + "result": "valid" + }, + { + "tcId": 294, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041112a906bf8f0cb77de5351d268d37411e1c71375047814fbd9864782b255e1fc5dc949781185722595d814edbef8d9213636d2a8c80b97a1f93010e3fe6692f7c1f256e19012dc136e2af33dbb2dbdd5b5f02740adffe4803ee09fd340a6c38", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ced8e7e5520d0c4e87fba7dff937489b73839e603d3f3f7c847941f96bc12dd3271c07ab48d07971d44d7bc76636fa3e", + "result": "valid" + }, + { + "tcId": 295, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b37ddb86f99df526cc6c8ff679c1bfe1c651a9d53578a495de46c2a74b2939595d7294bc31a84e6cb6cbf92addc5d4e49eeaa9a5a16e98f3112b27bac07d7e6172461d96573ccc7c2a1883492bcff9dca1e8992c78704a4fde7d0c42ce0fcc37", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "42b8aa687fda1f65dd3f31b2d5396b99e7cc2bf4c7a4c7d6cc637cac7d4e30d5a1b072723afa177176ff338a74e80e67", + "result": "valid" + }, + { + "tcId": 296, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f2bc7161ea86114402f91b5e0933666f397f6e0872c3dcc5f9e2de0353aa89e3ffd835fa33f8cec388d5ff1079602fbed13a5acb58d3209c6528c08d5169a51472aa562ce80404cb170726607dbf9d9e89ee80ca05853e287429dfd2fb6930b7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "48b9d9ce41a296ddf180b378acac63652de82359b66bf2ccdcc4587d9907f4280982e1ea32efcfad1622ee24c2a70c17", + "result": "valid" + }, + { + "tcId": 297, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fd6eab435df1333d52cfe68659994ab1161abe0846d6fdd2584dba8f38e373c1b7889428200b830f4834bb7b1b2dbfc8a732f239162515c891d176cb048a552ed14c05aacdd2cacfd163ede48556a38a58852e59c8186b6e1b3c8897a7ad651a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6b260913b76facc39a12550d9cc7d831190efa47818111186cc47bf9d23260305de813bcf4e1c55aa2ee17c0d25e6fb6", + "result": "valid" + }, + { + "tcId": 298, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040fb586f4334df39e5d39446c7cc459962b00d088d6d4639f35bc3b3dc46d842c8568705d45a46ca6c0f42a8f9b5768f0783d1dd460cce901af562f659f1e742c1812c60014c38c7ab36204c12ade1f4d32ad0ead801503e04c792b6c557b1344", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6681de2a568ea24efad5a3e8742e97b08be8801912fe8597995c882d7271faf22d572f39506792907be7a7d821357e72", + "result": "valid" + }, + { + "tcId": 299, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04224be7ca6fb841a5a7f0e15c98a3614d1b2568971c0fc0cab5fad62207b5d32f574c8730a739b5a536b9148a720f7c695e561899cda2d13f3260e256e81d227b7aeacb7740c8cc53a9406ad4e8e99ee400e50ec8c2de948dd622b695151e32cd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8ce9abf456d852480d7e0cc321cd3c6715fec2f5e84e1e1cf555de0d3937dc106538046ef0f26822adac05f383edd240", + "result": "valid" + }, + { + "tcId": 300, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0473c31564182f68ea047a3811697971276cb8156dd804fe5fef4a18a3eaa23d2df69986a2aaa34c37c56a25db6dab98114d0e438a975aa58c76052d05b9fc9de20d33458eaa16f332d4ce9ad0ce5e94aad3a5afce477dca2a4199932e5adbff36", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "361b4aba162da8dbf140fbfd0439b3893621b383cbf448aa8bebe5d5312407448f6e4859fbac9fc63d424e3f39ce092d", + "result": "valid" + }, + { + "tcId": 301, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c43eb5618b8dbf6765ed0702881e054517f2ca6705d50888f9e87f9408f6151574b6ac74f8f65ff09a02099987996a41f6b995aa037164fdffb26d767a2afd356733942eb09a9ffe1beb6b8a03e3e00c245f8e4a779c394e172e97ba5200176d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "99c7bfd9a3a430158bf409029757f6856e25712bf72e6548d6c126d56cbae42d5b85687a4ffe4505a83c7a84880ae602", + "result": "valid" + }, + { + "tcId": 302, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048952fed5e005c3406152a00669a345707f90fe517913c829a64eff27c3e0df22475025d6fe0c82ae00f43648b4d8715c5176857fe20d5a71fe733ecf407c6a795ca3a1b7599adaa252f71f44eb198131b3fd66b26f8adacc009da858766d291e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2097091e163f6bbab4ec11cd95bf3f7a7fe5a98816eaabc218dd61ebd8b22327646158c16d76e5310954eeacdef0da99", + "result": "valid" + }, + { + "tcId": 303, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042988addf62149e6ac08219d2f036d3f5720aa862905cf3fe7bdf136dc08b845e8a61be43db86d71a26dc17bf55374a9dac53663a2f821ef318b12c4e3bec97914458ff0b6d9f4f7ca806a250a4ce5aa9cba3f89e860da2796f03e53ef38ead72", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a8d424068fb7846b0d43a5cc13029d054b11c97e508ee0f92e73d35ac8351a462eedfc9da9dd1279f12812ba46c06053", + "result": "valid" + }, + { + "tcId": 304, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ea59bcd98bcb82c149695a7079e32d24bc44ef8cea299519e1e6e7c4cb8127e2d2ec26e74108c7ad41407f6b412a22bbea2f219be006b1e464403e6bfe8ca14a1bef028ea2dafa048b3ef09e2e914323b8ec8e53a7eeefc29f1127de9ded7377", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "25d60bd16a3d73934a6968cebec28acc760ecf166e52d7728d85be5e6a816d10aeac9cc815f9f94c5d57e5a185d50673", + "result": "valid" + }, + { + "tcId": 305, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b64c49ddf18bce79cff3b8cb7b0e58d48421eb6739f59d271fc4f54dd2fcb1cf56dd3b3c69173a5eab50ab1a2e0616d0a26d479b34361b5c08a9af100c61f15340783b3feff770ccc77bd32687cd8daf8644ea66942c057adaa7e9cbfb8c442c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "db1edbbb1f3ac6df9f46128812bce7818b5d745c75322a9abe89983be868aa1aac555f4d60ec272730bb4ad949a53d38", + "result": "valid" + }, + { + "tcId": 306, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a40b1ca1a51a8ee6bef5b58aaabcffe2e15f74a3087edb2620885d7d933e4f50d625eaad93b87b8dff58f0565792b17454768e80017832d60040c32826c74ee8c8b8403fcee4878dc97b28365e3d41c3a68406db9112f6ffd7125dec93b8819a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1f84c641ade162a274ab2efc7cf6582f5a5d91ce7993af6956d55eea0e1b7fbf040da9750486b0fbb2bd70d9ccabb785", + "result": "valid" + }, + { + "tcId": 307, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044e7a82ad74a1b7851995f6e1a18141bb4584ac22e839d4d916018b150fed9cd0cce427bd446798522744d395e90ee4b6cbba3e595b32b983df324d677ab0e1d8f50415fac4887b6894afb2f1ecc63a369ff8313b9c7c66a75e05ae17b7c21a9e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "54efb9bb7269d86b06282b1d7dc28a940cd7789ca4e104c4bb7c5e5736676c3e5370cfd97849e1200a031b668388d8d0", + "result": "valid" + }, + { + "tcId": 308, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040137b07f07d42f23bfc0243e641733600df3971b25070193bd2367a7a37a595c3ef9c160cf461bba642df20a2a3eb84357baef3159bd7dc0c009f99614e80350aae9c34ebe8db22f3007378926aff92ace6401288fa3762b6de56a7397f52154", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1d73b8baa8e91f6f0e1cd8088a46c0925bbafe7cb2130e670ef0cb2f713eaccdf0e35f2e74aa5e6740c98b4da595ad8c", + "result": "valid" + }, + { + "tcId": 309, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0493fe6131c6b3051af98a2e11a6ebecde1f4b622196889bee7ffac53899f92c78038b81492321f29ae74d58628c2cc6a3e75adab1b12c5070988287367f38cdeb5e3499a9a31a88566dc4d984a02bd005b7b4dc7da76715227d4b4d4b0503a1a8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "40e6d1dbfd6560b5f0ef4d1c5cc918faa0d63a56d5f4fa40ad2015e9c7b6540b5480bd1dd9b4822ac10f6eece9e3d2d2", + "result": "valid" + }, + { + "tcId": 310, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ccf5a5b80deba6318b85f57a0d563e95765c7fe30df5ac88837f35329dd51070e29896f4d96ef40bcccf36244df83561b1787a07f9a07e3a16d8f02aa6495c7f4b7c78b2d672f2c7d111e12495a6263d9cd695475f97e794f2dc0cc9c822f112", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "82864ef4d5fd25204ae1591c619f3ed813c762baa009ba3b49ac38c57b2f46652f719adceabfbcaf985b29958d1f420c", + "result": "valid" + }, + { + "tcId": 311, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c7f77ad286c68b88ffa64fefe4aaab3dee1f9bae37b7d069bb92bea82089e831a70dd9ed007ba6dce14f9c6d5e744ecc4ce652913ecbc8934fa65e37967b15742eab27d912c2451727271f955f341fec82203cd8de443e08ce0626f29785830a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1d0d3ed8c1e0d28f5e3766f193da7bdca1cc08376293f9bbde7bde0e9b1ebcf4cfa3c683dc63bcb42b2d9ede54242bc2", + "result": "valid" + }, + { + "tcId": 312, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0434bcf82c3d7c61f54d5421b0af95590ca1f09f98f6b4c270c56023016be0401e56048fb68ba7c688b0364e22b9efb77f2cd527a932f08b532b63dd058a32b57fdd73f7a80f9250a0bfe73954144495d81bb5077386a7785cab559ffad41d4dfc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f488bd6e7cadfbfeab78eec8631272903635d33079ed9f5184356d2eeedcc0da8584d356dcf2bee55d618a1b9e7c34b9", + "result": "valid" + }, + { + "tcId": 313, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0470099781328800375c190ea039c1809bcc5e17790c83de916a80733323aed89bffe128f1dddbef2eb9b49ec763db406abcf20b04e942841e9ed521dc84d105da61a49566e5c2e383b80dd5a8dcebd9f817610e916be97f4021821304d5a219ab", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d32328735a64d34be726100086bb94ff518c72fd571f2174273f8045caca7ba1fe3b28ecaf3b2b707b4be4c356b8bfd7", + "result": "valid" + }, + { + "tcId": 314, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e8ecdf51503bd79a1722b1eafb3d3993e2a3065957a972f99055b790df788010529ae4ef46d52d4a9d2b9f07673428b9525eb69755a42b088d53a0052b4df97acff241edac7f93e924a432023383eb3bf865e1863b9555db49d118ed20b22166", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "47b3fd85517c19b4237a60c9ba5c037e255220a8cd8ec57c790f54a5a0179918bde9742388d7d925d5b7c5440b4ac7c2", + "result": "valid" + }, + { + "tcId": 315, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048159ec6c7cb53ef662253d47436d6c16fb99d89dd54351a51f3d8aed46288794f77d689773152566c7358f65af3c610273110d1cffb2301a468d3b7d23810daa0e5875968921aafe5a8af44a2b389f2aaff174adb5eee4f8c2e2f3256bd64856", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8408e93688ba137f00e5a58404f4b0a8b722498210394a297711383fcaea41dc1675762204b8ec5e6bfb810254a2ae06", + "result": "valid" + }, + { + "tcId": 316, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041364703aeb52b20e7e083e3a0b692703f6da2d9f1c09efd57b34ad115339e39b327a48214ed805353ea37c356d94585f21b0d9a3cfe239dc4af51562f3a9e3e99443bd001bd10704ae2636a6f0baab64df051109d0972e0d08c99cfceb51cb7a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4a39deaf69c2d6a405bbe714f51830dd4cddd92ac6515ba671571894b698115dd7e9a9909941a0476f1e8987f5e11f39", + "result": "valid" + }, + { + "tcId": 317, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048527a4c038d96492f63906a6b690881cd6a2a522c4727efef8cdec9e4c70415add2c474e8f86f9f8e461484cd358da0be45ff665aca1e8e06b2579004ccfb5428640fc6c36d396887c26212899d906f31393f477a399d7a8a42d020d33ac3f90", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fa2429aebb3439d6f95014b1bcca8b955eba5eeac7e1724dab1e22430b4d0f32d4811931b6c3670cd6a3a40b8b059725", + "result": "valid" + }, + { + "tcId": 318, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047ffc8c997ca87675e56f8c3fb88218df6e13a733e9d567e0e5be2766c6f86bd2bfac0bfa664fed97144c1c8c36865fc98f3fac382ca179e547a9667998731ea9233cd9d07506fd35cfc8c44ccc5fa57cdc8077176a72646629e0422cca56d753", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bccc7570bb7e1c7ca951feef506c99d50e9dcfcbe35e451b309ea04bf05d51f41bce2d5679adb10c9432cbc53292eff2", + "result": "valid" + }, + { + "tcId": 319, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0416f4efeba054dc5a550fdae474366b26383c7850135fc23add9cf9bfd39c6aeb61f33bca9bf0562063ca2e4a2eebe5248cc550d7b0fd9e5972f24b846c2b19b7c9acbdb970e7116f11eaa8b8187f003f1541dd4955c6744c007177c15b49dfe3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1bbdd26efc5572928caf9e15247f7944aa03361f2c0c35776823cbc44b5c89b7a3e5fe5a7532a0b7f20caf92dd1e666c", + "result": "valid" + }, + { + "tcId": 320, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04254f33a74e55c029048cc2a77a0a2a0a1b24016e3ecab54c4af3e799a913634278ff780955f58159d8604a859ef168ec29225bc9ea23cee1abd3af2b64d6c679c663e246b08451d9cf4cd5459b3380b17e1fed99d81f9d4a1ec4a59b44fb9cf0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6c2186035548b11da789218dbb34274a77376ed38f34c69c60c9dc3a743a101a0df2047ad67027a1515dc2216c491d71", + "result": "valid" + }, + { + "tcId": 321, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04087195818a43000cd115e53319f38f2b8b69f3b7cdb52eb88a4bc684dca0e8312632854088289aaf8388df6f1497c9cedc1669a0098c0a3462b4f56cf20c035fddef3973a07fa4eb8509e009b735bf93457b8a909ada3163082c0a093b6ebbc0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "802562a7cc0f04c5cd4c8ab77213257eabaf2779e84777aa831c0da6c5d8eff39ad7f1d90cfac78f4eaa8c7e6bf82a6d", + "result": "valid" + }, + { + "tcId": 322, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d001cae6b99b083d0fea895316364045082d1f548fff1fcc6b05c353c8099c013e69d9c3f854f8d0d5fe39cec9879dff6e09e17b3676ae5c179b7665cb2bf55add0a724e2a66aef5b7df415e35990077a0408877ae5ccc3e0a2a08bd71c4a8bf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c7f9f9c4c507884e4b67267ab19fcb8ed69fda597ef1673fe455e95dc966e26665b61270e382d1f18c02bef81de3f017", + "result": "valid" + }, + { + "tcId": 323, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0423fabaf68aa29145518d7ff6d7a84505146da83d89d61d150d4cece8b8b536c88731f1a1ced54cd8566f9ae9be143f6ca3159c990d5ab20465a6b359c2028e5b6dada415bd8bc75cf315eea448bfee5ebd0c8212ff4e5c489644e29c5c107810", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5476330f20a02fec1f7b4eec8f028aa291dece92ab4cffbc8db037adcd9bb95f64d86b41f60e8185ad544999c825a49a", + "result": "valid" + }, + { + "tcId": 324, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0477bb18468e0690dee92fb067ca32084802f4fe3deb52133870c55938e7bc95ed1dabaa11edc26d0c0601bc081b6988de6aeeae1a6275a5c8aacb002cac20a29aebc30c277bdc95d212585b3e3fd3a6908a6fbbe8702654a133deb57024c69566", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8e9109c2db88b35355350208e0d019a4c1675caf813ac25259d733774f5206dbf8967f398dc8fc06adfea6b1f79d1b21", + "result": "valid" + }, + { + "tcId": 325, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040d15cfa47c7377049c22e4456b2ee8b7b1c7a03621819dd624d39a3630f5a6fdb5f843a66f73ccbaf75df38e3b75266417b3977cee2e592c88bddef473c9e7c03b508ef865856e200d716301c702f9fc5fa9c803c0ebb5b3cdb23d769e798b26", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b4c7fd249ac11b24b66d1572da2dc0183e57c921ad8b21531e86a6b0d04a0ce849a41545e9dd3b26bdf0669d93d0bda9", + "result": "valid" + }, + { + "tcId": 326, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ab3eb281ae1167e0004a0f9b29b083df0a22cfcae7b7468782a03c8be78f1e48632268bd12844a95faa4e21a880f7ca740924efbb9b4c1c8a9e36ae57a4a36ce0829ecd006aedd0eae019e7a9ed6a2b1fba851422875d5e65a6a68fe8dc60d3f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e0b0e7b391683833a9d8cae23a36e180b31db462576bca4251fe16c0b3904d6032cfe3f45cebca6bb9f8141c98f41367", + "result": "valid" + }, + { + "tcId": 327, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0495dfd124c9920a639b40657b4b4f7105ad95a0613aadf7e873c30d73b60ef44f9845ea993b8c9185affa32bb12032b6dcc617674f4cda3bfbda9b69768213bbf493569c4ad5d53bf4badb49805869a40bbf4f5267761d7c2f2657a46962e2557", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3bee4eea0bbd753646f27ba89a887f6118ffbd71e0d832af6b1d6db02437b1daeb3cb07421ce6b2bec4f6795356c98e1", + "result": "valid" + }, + { + "tcId": 328, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041c2690960a28ed49e7ad2f8758ea4fbca2da72ecac49e9e7ddad8ab0134d5648077c89cd23fde2f8a84db408e8ae49ca880a64985d535d741e666c750afdf978226fe38e065097eb356e47c04e04e789506def61e7fd909979184a96e8d851b5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "998846d6745e2d377eeeff5aee2eef32906c8bdc988585d67c997fd618ed0bb91489005d9676738216d1f5804f868605", + "result": "valid" + }, + { + "tcId": 329, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0488107b87ceb80a48c6d178f7e6d8dec905a648b3af4ef19356edefa1947f975ca1f21ff7a75042bd4a74170b09b1a37c50a3099da5812ae5ed49cc16b13c97b233bdaa4e937672eb3e4b44027165c0dc0752e1b112fb3d0080641e87fcfd4594", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d19c4805602c0dea7f4160a7f43149c6cd9bcf6d503498d165dd2912fb018780ee60803fc6c975f132ab9c96e7f43eb7", + "result": "valid" + }, + { + "tcId": 330, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bce2889c43de296f915bc9a5225cbc089f06752f1465bebb69a392e7ec8c211344705459ffd86c689d6d3e4a89d46a530162e899f27be9744a507eca9895cb56bd35a5ebfa48223f9ace4266da8c301acca78a80ef0b39de65404a953dfbc1d4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a95de728d70d131cf4308134472ccdab7a534d198583ba0252d036dd45d0b64fa5572af166ae93262fe93b77ef5d39f8", + "result": "valid" + }, + { + "tcId": 331, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04370f1fb590885ed3624a9f931091d2fddc36f39311761e7b66327e5b6f94e34633d4450532532ce05226028f93dd7b184516d78f8decbec1248d6f8f9adeec09c72674b37a937750c102613936cd4c879803254ef876784d67756f4bffc94a27", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8acba00a74c3fe0d9983b63e19f8569570fa2f3bb5c1c8bf1eb605848c2528d23488c9cbb302de98b4986f4370af675a", + "result": "valid" + }, + { + "tcId": 332, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042224e73910aac92c4f8ab9f1a94d17c441bd7100654491122ec441bb08646dbf42d0c123fe4744923968f54912541eabe55e96cdfb9b5f068a8285a1e2a64efcc3cc4e96f5dc01a37b32470668921f374d18afbc4282c060fb8d944650fadc75", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "514ab18c1586e3750933be0b41fa6810e4b51c1050856e33c499f3daeb0b2ed39519a662c0e278cf34edb6b6c6f64630", + "result": "valid" + }, + { + "tcId": 333, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f84b17194b1452d4299e5a2d7f649328d28f328f594396b76e04aca9c8735717e24627079abfb787658aff0c8650e228de2ddc707d9a7f6267ae5c6894af88a4ead7251c69b5083318673313368e571f1072b1681a2d5300791a7609b017461c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8fd338f8ef6715cbe6ef892c518a4496c10b76846d738c9e1f86ae37e1b848464f50cc0784a9151fb719d4adee3a9c61", + "result": "valid" + }, + { + "tcId": 334, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049bc7910dd45e7764ed2bb8567c5b1f22cba2d7262b054ef5f0f48b6f349c75a23a5507e4699483c358b49c37fe302ac74daa96b6a19949c018632415ca38104d48e1c91aee2f869674f62dfe9a1a933a9cfe2ff72cbaad72c16cde80e06c89c7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8a1d601c8e9dd184e164392187b2c2450c5cd08d0a6afd74d6115305e49a9ceb9bfcdc94ba9daa24f3afa4d82da92571", + "result": "valid" + }, + { + "tcId": 335, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e8fda7416f30535745d3790e2491a300948af7ee326fdf6131384bee4e2c581191b3eca75106685e786e89d7d5526951199a317cbff246850ae00b2dda72d4d5819c1d8e351710b51b4208c3d901868e9ee3a6a2e7352ae602008f6cdb49f3f8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8a5e0aa8aa8584ba95e674e8f6ffe2c9e5944ca000992d935da496c83c585548c7b15b2f4e20e00c700965b4a848a632", + "result": "valid" + }, + { + "tcId": 336, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ddadc8323e4dbaeb0130f6bee04bd55537d10ae5740f00faeffafc45f589b5ececc0d5c3189a30407af9768280fccd3e0e24d0993f572f7d2b9f88f92103b7e9806fcd2a676f7496f6bb5de51f2a1eaac187e29f81651f71c6f6d4ff66700b22", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1c28d2a71df21117eebec6067cf5139ab3b4ab4dab367b1c3c5a83c9fddd020e4626b93e3e2e41ce65072b0b99db37b7", + "result": "valid" + }, + { + "tcId": 337, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04da6f906f2a9f43733390f6b0bda4fff21d2ad8dc6cadde0160886f56e13b9a65538103a8e0e539f56326aed4914249804ad1944a46efbe53d6e88c3cfbbc52d113ed15a94e358bb17df6398ee7948f7974c0fc735b482793b8584d47baa3f5ae", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ac1dd9c8e2278ddfc07a0d4dd4a1ed7ff82b45c067924e4dd36171018a5da11f81a72da4ec5e61ac69068eb71c34ad46", + "result": "valid" + }, + { + "tcId": 338, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b20df793cf1baa62d5c9e96afecf6aef46945b622b99d743e77100464e560603c7b6a86217299ddc6fba16ddc70c34b6e39e6c58dde6ad4c6697457985d08722e316e800287eadd08ccb1730da496ee355ac7a8393f0728078e46ef4ac4296d9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "efc8a62a5aaf612f79184fec252084f3a6ae5d4e076180a8cce23139492275727d962ad3d8d61df7bad7b0f865f3933d", + "result": "valid" + }, + { + "tcId": 339, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a6c20723cfe04d164d29d5cb3860a7905bf43d782eb2f2bef2586ec53aea69c52d7f9acb78aa3c77b07e8265f18fe8a9e58dd0754e5b91498d44e7a1f3acd4a0bd90d5a129f0ec5685aedb51643c78d76c53707e4c830445473859b3c2131160", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1c4eedb8db26fd4b705c70de913be656b1b98480917cda16906ac1e8c35b6169851e846c3aed17c407a71dae6db33482", + "result": "valid" + }, + { + "tcId": 340, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f97f4673f60f9bf7b6d9886388caaafb013c6b0bd830ca965b3f961e5914c6e5f06c4d1d493b30dbd421a4f584c410b2a8b420118c477abe8008a65268892dae37677389670c704eae6560b3a0f5a13775cba4b66a7e1f9286b1eb92f5a189fa", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "23249e7725ffd63c9f489bd56a38dd46794a43b4805e761e548a5152165382fd626f723e1154fff05156363a66b5659a", + "result": "valid" + }, + { + "tcId": 341, + "comment": "edge case for computation of x with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0432160135fb1bf2386872b66ad2f0a1c5ba6b76a89c46fe232d05a45cd49f2cef9bb52c3b387aa8e225a031118ad4d922c5d6885bf690ab209617e4ee5532e6300220c9af8b54db61fcc16684fbd505cc12ba3f952fb10927ee40ff8b5e2eea81", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "69b50ffea23195eb004d3973725c47ab51f0b9129f19a44926628d0a5b9584a3877ac5509dd6812cf9cf1eba7dd2f576", + "result": "valid" + }, + { + "tcId": 342, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fe33d84877937c9eb5c088b2cb54680abc71d9e803216e2e8607f0851fc1ed292ffdc63e52c8c2cc1560ed29d954a005ab03ee6c6d399804c431832debdf32ead506bb7583d526f6e232a5fa19473946e59e5ae84e9a1039965bd9e00c25e64e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3bc2637a686580d012c97c223190568934e9d3fcde4bae91bd0679d63c9b5b9f8443bbbc6d78f16907f342695ee0ed59", + "result": "valid" + }, + { + "tcId": 343, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04706a0e51fbecbc930738512ba4126819c733dda32d0d05b0d6cdf81fbbf94c2165321661c89d0e47e2a3d0b4e69d44897bf82209a8b169f37d0a155a24f44b48dce9cfa3b563fa92bef1df521666b2ef14043596f6bcd92d0a1aa180ec3a51a1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "de861397a4eef6446daffa626fe7ab2318e69692896982b68c530f257c7037ee4fd46f9a92b9cb903b7e0de28e60cf53", + "result": "valid" + }, + { + "tcId": 344, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041aeae1a5c65755e3b847b899874cba5f1987ce2d6f3ee02056420922f8488ff0d3f9db41e0e327d78b1cf90f9bafa3cea0741772fc57ffba992a3b4c9e45e1ed98adb68fc18ca99b168093bdbfafdec95ab6544a6207b49581836e43c4ab1565", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7e03c945cf47092c63b1cb5aa95a9673a5e23ef6aa10953ec658e238686f4d54f948cea2a7d9daf725e34c139f004eb3", + "result": "valid" + }, + { + "tcId": 345, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dcf3aaf077ba5248000898d39f1ee42f62ec1184da72063b09079849b1af779edcbbe4fe208080d5bb4a91af0e3a588a9bc13b1d04bc26d1b31fa1a8db544f57207ee2feeccfe2f6b9e3cbeab35629247ec623bd637b90d9fb677026b3e4208f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "188904e4caf54940f108740907d571d9c8cbbc34bb60e4a9d3e0934c061bc05884290b1e8c222de6c31313f8765dce3f", + "result": "valid" + }, + { + "tcId": 346, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0414ef011ec5c4b65ee01a0a600ece9f7838e18a6a26fbd71b5b5e50404d3302908d71a3bc5709bd1c8d7081c00bc0fb3c635ca3f2176f2f6846dc9a5a46de165c8f853aa146e5f1f04ea132f27069e8356f7a5c10b196f01cca7e1210659216b0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "291c8870d74dc7b6b4a5e2a3fe02a86dcd3522fa011bcae5489491231d3b857074a654bdb76cdf9e59c198b4089df0ca", + "result": "valid" + }, + { + "tcId": 347, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f758ae8b940110bef7269d3bd5529245a516246f881870dad0a1e6aeced45b8306156bd86afd2a7db0768fad8bfcf084dff9e35443696fc497d444949c11ccd956bb2a3cd89895d1aba7b8f0f3206a8715b85ecd46db6f28fd711bb40d1bb329", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ec0ef4efcc1155d5b5d71d4ed2d75d2c9c52d7f86ba512a908b7fa5470ffa7cbde3af026f08c05bbd39c38c0d8acbcdc", + "result": "valid" + }, + { + "tcId": 348, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dc4f06d671d86012cd5ce10377ffefbde657da08fa9259e4aeffe6211ac57f6e1c5bf8732989d44c1342a84fa6fd7fbad8eb31dc33f071f57425a6c13d4b4ad6b003fc9c19176bfc2bb7d0cac824561a0c94197171d12502733d3fe1a082313b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5a197a9a8793d94d8b84084c6dc36c36a293ac90337a1cf6a2653435d05e2f563bfd2933f23ed3aefd75555ead76e827", + "result": "valid" + }, + { + "tcId": 349, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ca1ec6798c5667813bfc45dd1815e82bec93eaa7081069767bec3685cdfa56267fc24da6c186d8b3271627a852560c5af68283be19ef1ad982540ada89c0b5b58b873a0651b47f455e19df53e0dd279664f8126466231f32b5ee97d1f8dd803b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8bf520337de6e5c6f27005161b3b2f1cf08759527c8fc7935e3621f68936f191ac6e931b794278d3ca1e3772dbfb19bf", + "result": "valid" + }, + { + "tcId": 350, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444b9e976b9e89aa31519fc0a35288c55e2d7630a1cd1fffd288cdac8c74bc2edcb0ff878fcccebbb78df9e7eb0afa6b1c7b87d475eec76b9a6b2702c49364b6ab18c273fbf585eac0c25a5bf060250c30ce5badcbe93ce90ef238328503d7b64", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1e56dc30dad33e34273535688605bb98ad7c6dd51d9267c90a62562d08e47dd684180d4ab7abb6cc14ae4c9bd6ae9e92", + "result": "valid" + }, + { + "tcId": 351, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cf661b71c2b8734f7cf5142a66edf787c56a33174303c20741f07e0c348e1b5425705d9ebbb459967621ded6eb56d710c8cc855e91e3091afce7de7b36bae0645ba827e5fcec04678cbc474c6cbb0c95cd67fef22a48c1c74321319a39805af7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "14e3a97e9ee69089410b72459870495a037d4077bba027eff4c499567d7e7f1af2720e1fedd07bd780509a4516fa5c48", + "result": "valid" + }, + { + "tcId": 352, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0450790908c043344e1cf42b27e4dc33a35d68a0b93be0ec2be05745b3c83c35f0a3ecc3ed27fb3188a5ed9f24cdbd29d14f0fc007a0280352b15a442742b3bd6ca0f6a8357fee3036c14148763b8deb18f1a25e90b22785acab811212b864f687", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "85a8ddb9997e2525cd555721f2d5f3b199ff76b57e91eec6fc7d2c95703a1a32f46e3d46952a90b51054c5fd046b3107", + "result": "valid" + }, + { + "tcId": 353, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c20f3fac4ec4643eb6953efc6535048e9597d828ed3907f87aaf9b7d6ea5c9302ce74656f6bdf4f32ebe5a4a17194463373520af6b16e815c42345678a4f3fc1a7463fd2744ec88536ef30498dab4127031960d3bc4c5a96479a688de43fb327", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7222f5a523f13e10f6b8294b35f7897065bb9bf38bbf66f3d0a131c174ac6e8a28f609b924c1cc989da385654deca7be", + "result": "valid" + }, + { + "tcId": 354, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043c2be67efb251c17076998cbfc69c965bf4edf8d8bd167dea3a6f10320a6ab5beb94cd61a7d6af706237b97a26193dd1f9b5c43615370d20d87405be4ba2d81c7623d000ebc4b548af86e77a1e4600419ae704774b3cfbe0c8d7019bd4444f0a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "61ba70526b3ce44aec398f8a4b94628a4063e945816bc5370764f0eca23eb2c6fece77f196bb18dfd4b8e31eee0ea4bb", + "result": "valid" + }, + { + "tcId": 355, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dab8d70bfbe9b15f014420f21942e8a21e78f47994dc248348701bb9a21290209a31cf57e6a82053021bc8c4321cc03105bc15420ac6364b34629d340889f69cd3e07f5c8d068ea04189c210201f1d72f545680411e1de23695c697ab9c818cd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c14735a1cea36f7ac06ae992d5d8fcc93688769be9a41ebedf5b1fbe855e11185314a643fa66a64a071d0a8a8f61bad8", + "result": "valid" + }, + { + "tcId": 356, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046fc38318b16f68fa93b597f6b2d11b8728365f22d52fede5dfbb053fbf514b39e288473b3136098da446a0392e3ae1d18ba7294ca64f65e2d4deaecce5ef00271a7c429b35ccfe31acf8aa3a9f694295329ff95c4cb61fd8a3282d1223e45b0e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1636137f759b01d2518fcd9e03a5babecd314119ff2955bf8412824f14e3699ce3eda10d0a7824dda2958043ddc11a1a", + "result": "valid" + }, + { + "tcId": 357, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0412907e8b3bce7e4828d7fbd56700c3476189e507bdaee425c55e7dbe1712ecdb5d23268c934fcc3e056729c0a357a00b301de6f2648784437cfe7ef65fc38bbfe6d6eb017acb6cd13cbaeedf1a84f537cb109e5534e92340f65e75fbee18f0b3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "884780cf0c8720a02bf88a8e5f24367bda3a276c40e3b38701dcf71caee834176c490ac40ca58da75dabaa438f4e691b", + "result": "valid" + }, + { + "tcId": 358, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f30692998ce9d4a212512c59f3bcd2588a376fd413f4b8f644dc24d298caa31f082954cc4b930ed4ac808e0c75844d36128b8af24115734ad4cd29bc97d5f641c846554d9d511f65b9a1d9a7472c54045fc69a44df5706b3eda9ec4c4c362a3a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "01ac0eeb0f236f73b69a1d7aeda68be470a9f65651516ecb7cd8d333564314f503ec838228f398ee2e624ec9689035b8", + "result": "valid" + }, + { + "tcId": 359, + "comment": "edge case for computation of x with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0450de002bf430cfaa52904669eabb36c0596aff6d9d022715b193b8fe971d47f34daa323abab9c7cfa78234afc2d4801b5a9d221e3b2cf9dfde428f6c00c3cda2cc3290d1687af5b13c4f085d2238e459ff4c90f291e9a44fe63f3d30632cf972", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f85c820c92133aad4ae0e05ea997f140da6d2c1421aae864b2ed9e5c30fb4967b7a6af8a3b3a531881f19fcf90436eb1", + "result": "valid" + }, + { + "tcId": 360, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043248d95e742d00f9d7e539d9a81f0b3d84c8c70f1abf3518c8afb16a416006fc135a44dccbafee96f4732d0437f69b6db586c078a709fec5a1504df78f5559ab05f37c91a827d65de95b8b08648f7f490dc69b30b5f77f3d13effbbba77d6079", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7eeea3ea8f86647314a4797d156f65146928cb46320be3b57f3120f050c831b5a2374a3fdb0dbb98514d68e881864fea", + "result": "valid" + }, + { + "tcId": 361, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047502d96ebadc2f00c76b99254bf9c0800cc66a08d36ed96a4e390a06f9ac82fccd01c88a17653dd17056be99de08124fdaa66ebfb9abcaf59ff27464d93b9301ec1859f4b6dd2b59f08603ca4d9ea7895e2cd4544c85db8993ce52d5370d9b5c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1030c27e31c16b1efa2f0df5cb9b6034464f6fbf341ff66b116a0119ce2b13ee3b0326e6e9cef63c5c7bab08e2526885", + "result": "valid" + }, + { + "tcId": 362, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04117db13c983b355eaccaba9e8580ca35274a973f21f6511e57be7cf670537eae509f0f5c285ec67570f0c47e3b6eaab6e1df5cb71945733ddf524325eeed7735a6286791213deb0dd7f35c1952ef004ef7fdb538f7a17fbc7776dc17448a7e73", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "780d5bedc3965f0a80c4372a96632d98bb6c1ceaf0621d75b82ea6c6ba1f663c86b6588a475ef41e54964b0f606d9b96", + "result": "valid" + }, + { + "tcId": 363, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a027ecf80a30eafd7eec9a8d2ac67e9da86b54a5720fce5709bc6c13978af9dcc6f80cabbf41319a42b8ded94c7dd7fd0dc148ddcd81623ebc9b2b4327fc925e23b0e93e729bd72a269b6b85614569a6b1547e1dfd56caf3a12e0d236269c161", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "704ac0d13bafd16991009657214a88eae47ca5ae4265cd531ef2e06add8cc6c608e3fcde67c83b0b3bfddcc225eb558f", + "result": "valid" + }, + { + "tcId": 364, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04140d94cf90d58e76c738a858f79be60016ce6637cf79c9bfb31d72aafd3dd8d83063c41ce5d8c142b7bbd4f449218bdf59455df94bac1e09bb77484c8ae121f109c09eaaece834f09c2a81d257dc16cf34b83863caa6f2085857861e9ab426e6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4dc09e34bd2d5c219436a0c392fd5711a0660495fac791568ccc5e4f18bf92dda38fb149da146c5237077c10a2123b3b", + "result": "valid" + }, + { + "tcId": 365, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046f5c37efa571ddfc59e7ebb5c79b605a93cf19d24aa269607d5b2387834a1e2e993c85b21772d677fa9deac6f144f0d4353d21f75db85dd424ff4e563be3e527ca97f8905f93a67f74e3be93763520948ad696585a0117f4fd14beb8d9f4a75b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af614719fcdf0994d1deb81876e40f48a6a99a8e6d7e05b43fc564d8092441a12c357c992658216859288ec73240fcf1", + "result": "valid" + }, + { + "tcId": 366, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0414dc9aadd3774e80cd23b0098531ca393431bf593a53d708f08e35626ad26cef19b0940a0dbecf6e526e3b611fa3d9a4caf858cb81a3a78db8e01e88e045632eeb08f2ca2dd347d0195c2b2ec64f51f246585235229e6368d2ad406bdaa80639", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b2ecbdb9ae5498dc5dd70250926e6d1a83e205d7fba9fe8095211545f826d310091863a8a9400beba2cf4f66df50bfa9", + "result": "valid" + }, + { + "tcId": 367, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a287bd74d501c29df23d786b7c34ea0daf10e4b3fce71d720f61a272f22151db2c5914867493028c01e103820b0ba6b1de34d67007688130de015711e49458264672533d5ba28a39c137cdcffe56409fa45b2c330117fb7d35eccc0c216f5eb5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "18dd1d7b6bbc6311afe5383d796a5fec13844bae25708725554de0b5f03ec0f7d2e63b64db5f83d4ee9890c61e442c41", + "result": "valid" + }, + { + "tcId": 368, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04df075fe1cc123df97a5a6b8606b3586abdf5bcebb99785fddcdcec4f00693b56e29271a66a2c0fe4f289a9d0047f4de5be6e177557f290f99a8842abaaf7fc93f5dc72d38510b9fd8ced512726d9c5c8fef64f590b3b72d85e8db206daa0ce2d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "25845cafd04fa50ecbe2fc7a558b20081438620a1878eac7b2f8f55bcf9f5658242698ff6c4975584c7507249977e1c2", + "result": "valid" + }, + { + "tcId": 369, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fe16c75827b99ac6b3853fd0b5320721a2329312b9065343ec9ec4cf92bdcbaba3798fadf4d3119335a8fb1bf44587c8c9097747e0e2998d0ad14995178f83039ec686604bb6272e84ebd3b51509c0d7bf05c2a0cd978e90152da438a42637b1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "475d8fe0c436dc71cc5da5bfaf88b7b5576b6d4a048c7864ec92d9fad3e2a5ce7869006d409c1a1f3f866cf32c1a27f9", + "result": "valid" + }, + { + "tcId": 370, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047b81a69fbfb10019c787f9bcb4c722bc9669db53e68c5bd24adf927064d967c7ff5ade181be893141cdeaa7afbc0f6065c37d1fd43e2d09e86ab7c0436b7b7aaf3205c25b7132d009105b0edfa98273d197fd5502fbb6a8944e67011ce1422c1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9aacb65efc964280790db129fef7bdba0b461132d05a919aee8b3aa3e3c8b710f802d798ec7a57290ff07f94c140315c", + "result": "valid" + }, + { + "tcId": 371, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04efab53aab6cf8bb9182ddae498919e6a84655f8110e2b524483d609c1cdc7e6a07a932e4d8bbbe43487a3a88da6db181262be34fd9a466bf308c63bc490121ba3c9bff96a39b9d99ff859dedda8a5f71f499c8b6cb98766c53b5202e9e0ee08d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5b8e2b375a9bddd130a0f3a7445c4214f9226b458e8634a9ae7a14259df5f5fadcce83a5fc76d3e8a36a797fcc0aca99", + "result": "valid" + }, + { + "tcId": 372, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049b48f023150dac7712f12aabbfc798ec0e06cf150fe56d00aa240d9fba2bfc0dc79681a87855dc8cf25a67b32f1dc10d2d8f9b00f2cf7866e20a22b3d4ca4d00a0ea7a6c8ad6d708f255543701f3509405d94f0e710d409c609e6e085c412da1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6f06ee0221a9221d751175c4474b6dd15bb2365f1e90c626bff79e2dcd0c350aa72fab40aa7ae7c7f2bbe6a8ef6f52a0", + "result": "valid" + }, + { + "tcId": 373, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fed37270eaa93b95e2cb7a05c113ac8d8d80619f51bafde03e235e706a0c21799c2bf8703ce9a969753783a1d557bf24411ce60210851388a4bef00e0f96abd89f1e15733a173da54ddfa927af885ea377e109f8b11954b482a608ce8f1077ed", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ac43930c81fe0e28875d2e0e284627d9d6ac0ac55742291bd2a067a5ca5276292fd6c3455168c44127410f1bc8ee1b6d", + "result": "valid" + }, + { + "tcId": 374, + "comment": "edge case for computation of x with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0413635e0291353241b809b0c078a8e51b5e22411d92bb199820dd5dd339b43cd065bfb44aaea2f47c681eef133512707af1620ff567d807b3c9921e0ea1073232bd84a4d140bed39f2c0bac6154dd083cc061fa696c44b45c228c60b0010a0783", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a5ac911093ce168309cc243d3405ac537bbb449bc184c24163a6fa46575ef263649992ff16497e3abf76f1dfc6de3665", + "result": "valid" + }, + { + "tcId": 375, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043462d0f03e51bbd9d3404e7a84f60f56f371cfb660ec777d9be9bc8d41982feed98c74845699d1c253b3c97978692f920d54235e16a17060df480745c657f0f6c02c97a9ad071213948b415000879c0eda5dde2ede4c51ed5c88f70bc085826f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "feefab22b7d24a54c21997e31f46cbad4b8b810e716345b563ad25a615373a26ea235fda17fc1b717f768f29ed616c9f", + "result": "valid" + }, + { + "tcId": 376, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421c1ac50ae44106e14c8edd4df48138dcb22af2b05032817fff9b0e7438810db4edbf9f2d7dd1623f9ed4224298818b62670205cb100a6932c26c9af8c4a3b0d397fbbd9b13cc753a9f1fdddb6ddecf64f1d63c239068e42c835212ad85305cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3f8d072f9d934aee1f9fb43a9ccf860fb84dac96ba313a976e6b5c137c8b30928c93d803a23c8708d432c0b9abd56362", + "result": "valid" + }, + { + "tcId": 377, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cbd26de1e303428cb75136445cfb94ff5119ed034436b9c0547545447d4c4ed361826da9c6a5383cb90ac70ff83f37286f0862cdde0ad85579651b554b61c696cf4fb743363e59dbd57ce5d769bd7e2159d14dcdbfb5e0dc01b03bcc27716c06", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "97570727a1d0483fce5b87d2159845d274c2421de222da4baa2baf6d5cf51d2251fce567285c0736c8cd22df57d1b08f", + "result": "valid" + }, + { + "tcId": 378, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048b18971c1695b7b75754d2afa7f6ee06de8ee205ac299c9f5383cbb6807fa9e1b25086b4b25c573658d4f257aa8ad9e01d820a138b56dc6446274714470f6c620dcc462b4f2a1adb103d5889469b20ed3b398e055133cfa5caf15c36497b6917", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8ceeaed813cde1e4601b1254e987522444c318073a7324ed4086a0e2400c82ca6f82713a8ff98cd587cd11e131e60737", + "result": "valid" + }, + { + "tcId": 379, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cddded459044ac9e2960637ef2d5f59cb7fe224c7decc6b2f0a1d7f40f20382c0df39d8cdc8a59f2ed187a7f424eb9fe0406bdbb243a86a5abf8ed6a82c1981d52ebd4d72e5af90a18297e2e7c35ede755eb36adf2c0ac63d4ede854b2bf2841", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bdeefb49711aeee7bada8277ecdefde4cd22291d5d93c5e3d8ac1e87da1050e07991a0a6d3824508e5175803b4b49f92", + "result": "valid" + }, + { + "tcId": 380, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044979365e5a1296c52aa9b9054a97c03ceecc4a78dc53bbe8789504a65d1baaafe7784c6c3d130420774ec1a071400181c33ec60b1befe7046fca23970c2d6bbd89fca5b6a5d1a05f54433265838c6868f10f651e62193abfb62bc16db2f9efcf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "128d638aa8676ee28b642b50fc2d183305117a713c0b8f4c242f35b89ebd5379d0e0342ddeb0ea70930163da9ed40000", + "result": "valid" + }, + { + "tcId": 381, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0459525e3653d73e9eb868c5ae406a4cf3768b95ebc02fd5b258369b54582d8807b4d91eb55ec0b4c05d90a949134ae6045cb019bd75cca3f0c421f0d22d1e593fdc6bd99904cfac8542c6da783b83ea171bd451955eeb5de0cb41ca7564b6ee64", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "85893b841be50c75570687421a1aa19112cc725eecd6db0657b5950befc0e4f9caec326f609c9cdd56f147da755dfd6c", + "result": "valid" + }, + { + "tcId": 382, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04aaf5ae1ac4491db16b57c075631de5148b471cedd4707a703e4647fd90cc2c60b4fd81522174c34ba5da49c583f29aa279010228646abc9dc1cea9b0487e45d09d6494034eced9695c26dc8c694636930cce079630a33c4284c585116efcd610", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "891c98f07c1bc9ecbca5cc0ffa8df2ab25509dbfff6ae2fb3cff5ac6765993167dff1b9603e6eb9d7173a5e547cf355c", + "result": "valid" + }, + { + "tcId": 383, + "comment": "edge case for computation of y with projective coordinates", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048d863091c369ecd142dadd4aa2e19f26ac105b0de8d8261d0d439af47db7bdb34a2a04796936593d7af39fd8ce89a166ac8a617a37ba12810e9fa2ce44100536402b6d6d06766a83fc1117d49440447fabb1c8a614dec9d7215f9a706b8cae25", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c23ee09ec1ede5cab3c6d9cb2684e7e9842872a2ad45b5117ba45f8c186dbc0c67c6a6576034a6937c7658680cffb696", + "result": "valid" + }, + { + "tcId": 384, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bf75966a34ef1ae360a73aaaa79e77ce7c75a42b1c68369fefd301e48c2b8968d07be62a64c9037dfbd50e3f6f63b578fb36a8a260bd5b028cae8381f2671a74ea0c22a0caec6fc61a983f71f8734f6ebe235c8e93192c7d544ab338e1f86e30", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4b7016d2216941265c6495a38a00088b032cb4dc9bd08f981bb563a11172c26cde707229825e33b53f8f6edaa6aea35d", + "result": "valid" + }, + { + "tcId": 385, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f18e4dff547f3cd7d4dcb10b4b2f96926baf7b708c6bc404ec82ec6e60846d32146af4b7cba2b1246acae5473e1408c8bd3ce7ec4bf761d0d940c31a1ab086470c56e5f65165815ee70f26ea79052545e2c52e1ed5da04c154e7c01600645d3a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "09f843911781f1480985e43b1174475e7080e8af8f87c7a3e0af39c024f7dbef16af4d32d34d23cedc1f701f394cb0f0", + "result": "valid" + }, + { + "tcId": 386, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044ea6b3a2b3caf57fc7174a517b4bf50f31aca7fec4cf8c8e960c0dd8605b7d774a098a9c6234d16f0daab687ee06fe16b605c9c482f859796277c221d8ad13386c2eaab74d17cc904401efbd7e97e7250611e83d732671fcfad3533c57487329", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "28e9fe8c6b7e404859a6ec01ee3f5128474846e895c0b4b23b15c814fe636b9ee9a894fb64d6febdf6c8f50baf831094", + "result": "valid" + }, + { + "tcId": 387, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046403f26f8bc8c277b1fc9f0b59b4d6edc8b2e45e3b3fc2a9737d8006c5589f9136a825b398c480fce86e257c47fc4fc19fd8d1555dc3879429940797e85fe61f3ea7fdb2626090c10897b94fec17654aa2bc510ff9ae945d86a3696496c61aac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "833da9efc3ece9aa9cb39b966eb747fe8010afb6e739f31e3d58c47d24e38f43c595719aa2bc4f76f6ee4bed3acb57fb", + "result": "valid" + }, + { + "tcId": 388, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0419e8574b14c0996e9331c1a2ffa017ea4269467b4cee43d4a3d435404cdfd5b5cbc51fb6dd3596002e675972a69629aee85b8ab34f89b01b112098260749373d42c452872e01bc1a26e59ed0be4b02fe9f8550b98c54c476e02d1a56517774c1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1568f932ae877003a8f31db64160d93291448279dfa47e2dc5646113352869b42dfb6b20c46ab0e4f0ba434728c4ad2c", + "result": "valid" + }, + { + "tcId": 389, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046a74552641ddbc9429dda04b01b15b691822934024584955064a816d7d244a3443c5233373cf7343f1c468d59fab95be307c4c160e07c6cb01821f1e744e7b303091dc4d849dcf2d77256a0508e8b22ecf2b10634f6a5ea2f3f5288abb3322ba", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7cf94c8b92d7b5ea335f67e2ac62086e4f8c6dc0ae9293abbc8c2076ce5c82ad7ae42b7cceb171b977d0c2195802bc4d", + "result": "valid" + }, + { + "tcId": 390, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046055b668fbb9008be468ca188b3f2f8ff6021441e7502b4bd48fdff4617513104d8fe2bdcfe07746f29486c3fb15e86a90f424f1d569bc43eeb30d38ca4d1678bb657ba593e3fc1c0d4ab47c6177c40972d69464be084d962cb35165fe2c7be4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fb8980580037fe0f31c0dc6c43991c99f84efc73dd1aad7de65a10a002a7aaea7e6109702459cf78c90c801329920876", + "result": "valid" + }, + { + "tcId": 391, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04580f06e11814e4420f9aecb73bfc620613673e3bd96777fc28a282492f292050dd2d787dacdec307dec231553e596974be8fcdb94f48fb98682e0e9b255a0d4a2a8dce8cfc4861da8815acf0664b80d6db5d44adab1aa2bac66bd21b738e83b9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ef2800c3519129d69d99ab95bcca1f8f4fca43b905ae424e5b56fec30ea7d8faa281e18e06ffdd8c1d0f195581312123", + "result": "valid" + }, + { + "tcId": 392, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04238e33557e5f0622141d199d2b2d2598b7bf92efa67afb331c33d8d10ee4eb34f9731bb55720f65a2ebf6dcae7d53132a26ca3a80a039e4550eb9e5d269cc51db1230d95f11052371af15e9275a4fda8c87ede87dec1ac20d5ad86b71231c206", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cc3b2223aaf59294a38dea45454ea97d095892fbd463595967199c90d826a4fb6f778864dddc0cfb56e8c710a739b6c2", + "result": "valid" + }, + { + "tcId": 393, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d4e386f53b0b1f7e6f0c281c8af7e12a9165664d9ab2b40d449f7927acd54ae441be0df6b393ceea35256b65775d67e7dfbb9a065545eaccffb77dbe796fd365dd0710062367bd18955a46e78a31d96df23d404fa331d84628bb6bc1b9aa770e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bd1ce12a9c094c00a936a055003c4b5d23b61161d61e8d6c29f780c69afbc40bdfe82597ddcf384cbf2a7960756044a2", + "result": "valid" + }, + { + "tcId": 394, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048f775fceaa3377bc79edce49a89addded0555b8bdc78d1175acaa214545d5f920306f71c2262e136f2effe7c22530e1a506a6354f188c59bc4ba2f2fbe2adc2475418bba599cbfabc8ae1275740529c2c77541fc2ac574eb3a3febde1fbced62", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d115a91c99ed1ca8abd08640164abd50ab3fd085c19a59fb155b5bbad186b9f0646092bbe8943ac191325da0137ccdf5", + "result": "valid" + }, + { + "tcId": 395, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c38f782fe8783d8d5376f91dc6a391ed48eae3c8cbf61f5c83b80ca927534b656e7e2bef36019b3c740a72fc0e818a05ea2e284ecd9cc71be1f94c398281ebf77bb8008594e75436a7bf41bf0da4ee6997f5bdb1fc3452e05025783324682a88", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4b50a7107385d1dc35a69594284e64c7b298e8227e9f99a16e668bc37d811903bf25afd892f6e9735f7161af4dc2a22d", + "result": "valid" + }, + { + "tcId": 396, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ad94024a4fd7925bddfb5aca4390095f77969d0a60afca7aa0213ce7e31a6150be053c324ae770e46a40592fabe0ff07f321b2990cdb02c017682a23bb2c2e83db121defcc514a271667c252c23c037a0ce886147f62b8d042dd6704d13dfea9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5181f9d881d1a586db827cf3adf54b26651ea0bc202ba943a350580ca3d3f112274bfc5bc50440aae6ea6d1142a282cd", + "result": "valid" + }, + { + "tcId": 397, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0435f689640796dd65fc4105779f9ba7357546a911cf80879257691d79b0ac074848b2d5b2898db024f617c3a9ffd6290aed9ec7e9d352c8d8ebcda75667360a5be9ce738f9591af088e36d7ae23f5a57d05bdae49aba7d81e629f0928e136b390", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "877f910a291586b0756610941a7bacdfbb23ccecfb4caa0bcff232678cb73fd1c5bfac81da5b598e9a46dfbd47eed82e", + "result": "valid" + }, + { + "tcId": 398, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c3ba5dfbc80468ebdf0b1b6bb44d608bdd91af3ea865ff6745a74b632ab68f2688d89ddb289407e97f2c8f74dab44a4428ab8bb103a09e4cd3ec4bc9af2d32a1a3424a395ab54b1abbb3b0258ac81b21478150d546a1eb078ee37d79a77e7aa9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "42f277d541bfbc4d25aaabc857b896fd12010dd06b84bd21d06e5d56d44dae509122e864d5f2a3c05283bb4a19f2ca15", + "result": "valid" + }, + { + "tcId": 399, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0439607fcee866c0473d59df23768c24ea69444828240f05e8a27e6ba01c4bf64d3060eda9b5ca3fbaa40c127923f2a49877b7861f3186b0f1aeeb35c9a2222c00e8c1a6d7d8647eb4c9228839e62b529ffa80857391f09000e9efbf3c319a00e5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "43e453174566cb02d4d2fae0a514249c31801b09157f8bca2b20bdc0b861d205146753de30cc923fdcd0b53d41d1f33b", + "result": "valid" + }, + { + "tcId": 400, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040305d43c96c328fb1d0da3d6140c7f9caf80e970935b90440caec8af91d7e5366a3a51b26fb7a8e290bc4aa4d45ceb314e0ac0d5179b8f795f392ea38a04d976abd2315f18acef6e720599e938e8e29835c43ab155879168dcef4be965f95fe1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "87da1b2857202d12c09350c1b012766cf71887c2fbbd5481be91cddce119c39a53d8a7555e588ac610e0d7c673fe3d31", + "result": "valid" + }, + { + "tcId": 401, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cb4a2e597fd8a9590608e36360a53be94c67d54e2fbf7b853ed3295c63746086f3843fd704e00f8260d8b1b92113117d0224a03e9a5128327890ce13a66d1a524f14f3d9788399d89a9702d3f6f083902825514ade33361fcb14f6ce83326a6f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b715d6392e8f17debb4ba4c19a30f17055b00e17de9bf6669803a248940fbde89e9ea7c450e257ad541ae3c01ec4ab0b", + "result": "valid" + }, + { + "tcId": 402, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a96d35ed2c1037a4837188841da64fb7604c75cae0e076b965a621d29590ae9e1cf75163c3fa9766a0e86638c248582d6c44e0c9991df77c0c940dcdb9daeada8ab5ac40ba1d4c02c5bc7ccb723dcdb202198e5afc4ddbd271a3d7eb451651a4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8b68db0fdf0229ceca556f9c0c288bc0d5ad5dd8df3f492cd6ed557b6a6986ae6352c59dca7b11f596ed401b1f257934", + "result": "valid" + }, + { + "tcId": 403, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0469cb71085bf5381faf2663303f4c9dfdf8052d4012db82f404cb4abd9776efac89cec464d1722405ca53327da869b176fa0cc8361ceb29719de54b70ad30a660d273fdb84858ae28dd562795bc1795e7dd02103e534c588a185bd248685f5216", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fce3330a044d3c8ef0b5621e2c439ac341a44848bcd3f8f0bfad14588c1b3786115adbb630d625b6496001770ac95296", + "result": "valid" + }, + { + "tcId": 404, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e5caf1b1e351d2ab88e509f4120ba55c8629d9f8172fea928aa5bab6f70b839cc4d4682532e9fa553fa4e6b552bc2f2c5af3c74f1fd54e2624a051773f2474ff10e7da1acbc82920d33accf0ef9f071b18e77ef3569cd241510e899b31390860", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9efa8a8c38dbce0d9f5cf3d94a50c28c49317e1fc481037285d3f3a3cb3fe126b7f3d0d2973964078fff1710659641d7", + "result": "valid" + }, + { + "tcId": 405, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04258613305aacd62435b13abc43ff62fba3a99cb5a95687f5bed42280415118b04d720749a83d8fa8e5ff5618d6029a38b420342e950c76ddcc9b7ce949ae44c0b870cbb0806d46b7287d591a1698bfe18bf6a2ac07c1e48479502e31cd71aace", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "266c99104e656843f49497b661ab6d339718c98b25510350fcaa666268ccf90bbcc3daffe120075fe56378a74b09f19f", + "result": "valid" + }, + { + "tcId": 406, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04455fad653fc5edc2eadb3973ca294f4603a402513abb65415ca0ad59d47380fa01f162e227fb05488c77fa4982a2d475472b3bf1f8181fc1e7dd63df46c02613460b2f2cc1ccda12e1d0101ea07df8201ce6c88d8df1f52334faeeb1ba1ea1ea", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6054b6479bfb6333de25bb69ea98562ddac023088f36bc4430b4e8e18c923063b5e6efe5fe478160b6c7cbf8ff041149", + "result": "valid" + }, + { + "tcId": 407, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043f1f084c585a339431da86d5e97e528a0b0b59f0749758c67c2c280792134abab060c59114d992621bff2720111d5c690e80b77a1c1eae27e634d5e47469306abe429382ad5fb3e4658a4c2cd297aa0530d5c994ea3626edd8e5e2ead7f2ca8b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6ce9c602c6f350a3f3819653d74c331b2e09573d97e38ac58beb4f9073ce9bf6238d64246132bb203b3e74369c36e4c6", + "result": "valid" + }, + { + "tcId": 408, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049319ffbaf39853881bc77e8f6bdc6a6e585ab814b3cc510b1089679da5ba1b9279d8463313d13e033500984c675c70d98fcb5a3a94a57e444dc3ebce3ea7a220b81488a226a5910617330813d66c490661353767f007c851d22b799245b0ba14", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a5fd3e98db92e0383d3ba9109b57c70dbed16266e5fec6437e52952cbf7448b514915a4ca132f7885f610e2b60aa9a41", + "result": "valid" + }, + { + "tcId": 409, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441e2ee9aae04919136a89bf1238ff0c6f84e7179d52c22a7bfa54b0fe2530c7fe9692e4eb7f71d710cc637d7e142d64649114a95d45fd2efac1dc196ad0a4c454298cf19ab277e1225def37872f909d45f7c8e1069766d05d8de8916a6c5db03", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "09446ee88ac22c8157e4ac03530f37825471db8a0f811277bb00d12bf3b2e619bf5860e05fe01288ce2b26e4801d915b", + "result": "valid" + }, + { + "tcId": 410, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0443cad515a405f0e97ed89869a6970f5bf9ffcc3d11d3429ffaaf67f51697b5883096ce098d276433de4fb269e9c74caa9ac0f9e90bd65d70d2cd72a7a6b0dcc16db4aad04d4d287bee07bf3347d0aebbdc7205035a9af0b4b04b75ca3ba01984", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "76445402c2b023ca089fada4391d18823d4c808e7e002282d0cd1eb82ac5365e231145c5b881db1c2025cef3b390b377", + "result": "valid" + }, + { + "tcId": 411, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ca4c833ec48e1158ab9126467b29c387ba272e8976a70e74f8399ead324fe3e755420b7e877f61676a3a025596ae87b446f37c0de35da84e9a9b166c6cdd8ab82a66636259098e1ede66d911cc9d6f4c3b059d150a22fe1864f869a7bb1dc737", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b0ce1f1bab5c135968dbcfd1419199b54f97e94c81faf6b2a24e462dbb9ae5000cd55c4a59fc94de5f7fee3de80cec3f", + "result": "valid" + }, + { + "tcId": 412, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e21cbc53438d826ea815097d5b3843b4e8479a6865736cd92b649da659ce445022027c28e7da35ce75e9ebc28ab18749a3ab1733390a3958da7ece584ac1c4d749d296b5dc53686ec85c0e728826703a3452f1c30532fbed266c08b38b41a76", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "32bfa3c56e1e9f1ba46dcc2dab8c6bae104ae946ce55b1dcb965c8d585273d6e02338a2a039fdfa3a5de7db5a2872676", + "result": "valid" + }, + { + "tcId": 413, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e6cf32e01d5e673dee1ae965e6d2f1b7f680003f5f1ec6970bdef22a5e11ac01a117d5860edf7e6ee159a63c502c498dc65ace2e3817bfea9487c6a24698254829ddc2aef12d6e21494fe77b01b9dcb6d51e207518c86b75c0e37a2c31b7327e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49fb96a59efa39a11cf0e1bb5f25da106bfc0540051dc1c5b88f923ffaed6da77d764974c6a5347dc6a56e831d78cc65", + "result": "valid" + }, + { + "tcId": 414, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dd0e7adc42d8951082b18bb01efe053cb61bf8b2cb69673d0e16fd697bc68a0edcae6858faf808300e914d8a6fbfa861e87746a66d778880caced03cbf333a9e78530be5e6e8ffab531f01a06eb5f4e0b732ae959b1dec316d6f516a1479d727", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "77cac047ff502791c221d9a808edbf463affe393c2d00eb1dc68c78488c2a957221be63d50d6152af78074904fe3fcdc", + "result": "valid" + }, + { + "tcId": 415, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b78d95bbb31b339d6e70d7677b07b24291564bf38ec202900fdc1292faa1ab5096448d83340a9f73decdeb4d41f9fbd36724a475ba263802dfdcc4301894c4576894acc929c6894b65398dc22d8f8df37ad94b8fea7c3b0951ef707d760fdb3a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cb7d44b974cf2cdb6dda06afbbf24505992d39122a16bfe8324e72e29d94aeabc6ada38553802a1bc21f1664c33752f6", + "result": "valid" + }, + { + "tcId": 416, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b05df4531f23f7f4390900116edb9f7b2d62e0c32a8f485bcd1ec223a2a48dc089795c86ce40e3c2df38571db616d7f632571ad6eb4e0f07f4e771ba097d845d09be8f63cc3dbe41600d33e1946285cfff456ccd8f714f71b0c787e2a8ae7ea0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "994dc9474b717903e9007f89ec3628bce0e9e52b5d9a6f51071ba8e19e24f90f9d15db55f96c858fa687ab511de01c97", + "result": "valid" + }, + { + "tcId": 417, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042a96b945d07cc4ed382afc377ed05eae34c4c03b06c25d4ff6595d1fd35d0caa3e568394dd085a49aa6c1866d40e7bf824709ef849204afcaa250122bf1842b1c68478d7ad23873fa467bba8f30bcfe80bd902247e7aa00953a276416b2241db", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9979c64ebae0d283011686aad5c11f83ea1304fffb27feceec71f2785c37bd3601c4182b2bf21da284fd965501aaf399", + "result": "valid" + }, + { + "tcId": 418, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0405f892e563f484380a34f363b89069942b6dc87353d9adb930dfeb0625ce3d167cb2fee2a8e246a5d7464c88ad7940271b634ea0a1a317132058b7a5dffdf552ef590f90767d57fd2091428f28db2e14b6f806bd09a83771184640ea7bb108cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4e85063c1b58540ccaf11231ad499c6e5b6f2c81538a92d49e556b78a92db4a2d552bc235e24af1944622ec2d4355dcf", + "result": "valid" + }, + { + "tcId": 419, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040859b9c44d4d1c4fa0f425eff25d3c7d1a34b0195251b9a1cb1c01dee06fc8a1c94d968f95dc3c10c75154af595b28427710ef357c226b3df383516f2d274f02eb6fe8272b4821e387e3666f3ab70951eee0e674973ecf4061048109612425c4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "192456204a75faefcb4617b60f524f235582cad45731cb81d3695425158392cdab1607a449ff6884f77dfe20b0f3da90", + "result": "valid" + }, + { + "tcId": 420, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045114a4992befbc0801ae70541a3acaa5ec29069bf858dc8dbc8b1e4d2a1270a909b073113a32e512dc5f89eacc22394980f547fd4424e26dcea08d5e84dbf52acb45e9c42ae7329135445c0a9515ac6dc5cf2a6a11df40a839856978ef7aeaf4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e61172563796ff0337432eecd27df973f297097b0e11757d8dd27c54bcaba0f8144c8f00db5d302bcdef01c8390019e0", + "result": "valid" + }, + { + "tcId": 421, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049a6a210b0db19c3e84da406f214aa5c9e5968c3374a26f89382bfd24b500c76cdb00ae10a7ec7c27b52e9ab17c2e78838a7585aa5b854bf99815ce18194235fd10d08b36481981bcb7f681d071b29709feb8141395419b27adf955ca9e8bfeed", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cab76253fe1fbc55697a21c8e9d9503774224a844fff473d0a3e5fd4f11c68ae1577fc6bee4addbecd962fec025cd327", + "result": "valid" + }, + { + "tcId": 422, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f66922346dc86ece11c5d65f83ee853f89b6c185344c509168011bb2c5f98757dee8b52cdb6e50b8f26c2e3b4213ad608fc479e842ff432c0aa3e2b8acdc13dac2655b1248a3c5be4f55618ce022ef53115189172376c5e8b865f2b4486a0053", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0c9d5aef0406ddadce69f3f682483b9392f2fb1bc11e4ac7aa4d4ba3c189b8555003dc939d9556c08acfe02de3299947", + "result": "valid" + }, + { + "tcId": 423, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040bda260a0df6728d81fa0f93823836dd3c726ca818d1e1fc8ebccce64911ac1e70312e666a5724885623d079ba73f6d94158f6ef3d1a838cf709c91ceae0a6a2afd88891e2efcc3d761a5eb5b44827a98bfa7744c8db434910e7dfac451cf07f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "080a6dd5215191a48092279220f5774fa4cfa03956b70703f6b61fda03f08f066e7bfd78c152a20051cc1325f3385808", + "result": "valid" + }, + { + "tcId": 424, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04edb761ff03f2cb5900a28c9848f5746ba735f435824153f74fc55303507c14b244b6bfddac0329c0971a95702915502bd1bd8b631e952dd3d22512c38ec46b69dd275fd93d4e7ae12d19aee7d3e28eba4b09d00c8fca43e3e13cd3cf11a41918", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "74cc08d58747139e9d8733eca00a3f841dbedf9adcee9938ba94e278e7fc6d99cff53700644f6b0aefe0473932857105", + "result": "valid" + }, + { + "tcId": 425, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04948ecd5f604e43f133cb72dd9ede3ede6291c355ec6047aee2cbe666546153adc5b6daa387c069ddcddb959c014919e530ca9d687d7d0c701ee4da4c0211d6cfbe41ef63b42104c3caa784388c848e3812cfff0e47f8f0ce14dce1923517d28f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d7bed800f1e124ba32350a09447d94257c227bf8f46e43768baf5988c4f81cc3f14aa79ffbe7d9c58ae65688e4b8067b", + "result": "valid" + }, + { + "tcId": 426, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ea00dd288c0c345f8bc32f375329f87ffb9fa15aadb36b08463ed4569be6bff856998848ac6a241aec2ef8fc49cb2fcee791202177d3c7d9eb938f4d498f5e9202f3a4c7f2d4165410413a74d9e8a33415144d4be543da6d1462a2cdadf3c82a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f249733527c35319d9519cce6b0e74b7869ebc119e5fe04b8dd0c5c2d455d522d6d3d5be55ca85269169d906fb50ccaa", + "result": "valid" + }, + { + "tcId": 427, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f32348a7e1fb2c5274bd8bec1dafaf1e664f215618a4f764a10b98249988624cc7f8a3fc62661f2a01a05da376f893432e09031a65286aa7af651eb413709c6c0d4ed7c4827f34a23e69cb3209934f4afcd322239e7bd7c97ef74ae4afeb83be", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6285c915e528fd0b15b42d12873aa0543c6d6aefc683f09af61ba514bb3d14166aa2f43dfa255837912c794a35e4d59c", + "result": "valid" + }, + { + "tcId": 428, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cf9e0e01ff7395fa54720ed2d59ed60f90bda46b2bd8305e04e6ec76353a856723fd28f7bbb054d67a423ae21842079451f118e357af2e3097aa108eeded455c3f434648965d742854ba3cc78c30af019a4b751c6ebf428563e9016348659154", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3807874827aa90eaa5de4116b7e1c127298e37fe33c9eccb287bba168e39534d809d301d6e782daae14c3e5c1e6b2eed", + "result": "valid" + }, + { + "tcId": 429, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a8bc8cad611d67bfbcb6d11e15f1bfe2a2eb5464cf1663f08c53b9043057f76328882a649bb1048579d6460bf9e9daf4b5e692877ef397b5d0ab543a0217e674ce1ede49bdb6fd8f0ea1f26d39b29efb631e9793fedad4d900a4220ab7af765b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "12d518f59a87f6c5d760a08bf8f41f51b94d3fd2b712ed559c2df97f08fa5ae5a5886d7c8b858d3cf1d9e0dc06d605ae", + "result": "valid" + }, + { + "tcId": 430, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042304820d17aa8561ace994339abc7a28ea388ad1f695c2b607b5e712a288d319187b608bee3001b0082c961a74ca963cd41d54363e260ad510f60cfcf34f50468fd8856c835a2ad791a5d13db3e1102af99e85ec51a4597dc6f243ec6e447686", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "19fa90f8a49f1726523130f9d1815b186dbf8a158a5a5e674b20497673b90569718d03b120cf59732e7cbe50ed15bbc5", + "result": "valid" + }, + { + "tcId": 431, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042426a3bbec8b9d8b11a38ce65564bd629da26d71d2785d24478b03d21f1fbf3a32613b2e9aab67a29bec31342d6f9f6583150e171526a3ae333d1645d3f54caf3db909a263022500ded997483f428e38940e405a7745e58705d49d44d414b5d0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "757a5349ee6f82c794f4e940b47b4005fac4c234b4945e6ab90141bd0f1efe512888477b04e5ea1001f14a988f3e7d66", + "result": "valid" + }, + { + "tcId": 432, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b5cdec1def102903bc8b464fb0508c9ff3fecfd4fa0cc81429d4602fc508006318a3b4d04bd912e92a15d130df83feff4b02fbd1a4e8acacbe6c4f086e59975137eca507867d379a76588e834274bc9daacf990f3f6565aa5fc66ba2a98d7a82", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5d4d8e8cc33ac647c9213b8604229a79341fd629d71572a3a51ea760bb36b63a31aff94ff81cc90866faa73854d46c44", + "result": "valid" + }, + { + "tcId": 433, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04137680e8925aaeb81c4db6f2c9680500807babd91f1ac57b5316fc3529db8298b548b341b34db58038021efd6510af5fe2d6fc454033631b376d2f9fea4660dedc6e0dbfd96d7a07d28702a8f95b826909249cbed373a982e774e5cdfc5be630", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "94f20c67f92384796ce2f0568ed8dd148b0a6851ac6575c2aabf4549eb32edbb1d2b71c460d06d7b4376a2bda430dbe1", + "result": "valid" + }, + { + "tcId": 434, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e0318f10866842a983f0431ef2cd06880164bb44c193bb530790a51cbb2454062a6d3d2882b512a33af5ccdc0d25edd9898039c001a7a3a473573ada3970010af2bcc24fea89d80ae4011cb681d5c046d94a5c5a10bc77fdf346818bfbe50f45", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8edb82ad4c18757a2164c40258eeba4d75214e3af202c2848d1a839d93243cf3a6ea19be835c7fbaaed1241f264e38dc", + "result": "valid" + }, + { + "tcId": 435, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444e186c90836f9f5841ed8664f3b2845932e86d735b99c5970562921efd82fbb890c4d8f650e9ad34dec03917124854f458fc335d1f7cd91800448d6a3a21a19fe597f01ce89a2ca3cf272c262433902a7f4e13696d650593e4d1aa614b09dc3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "93bd20f6ca5e9342db8de6596078c78c988f7df77f7c287191e3730e18c0475ef903b24baa6d43ea192f3fce7d275ace", + "result": "valid" + }, + { + "tcId": 436, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042a2bc2db002bfbfae2ead8485947be6acba6b4900f0413293140c915471716ea1086acffbc73a7c831d953eb5ad2d120efba69b10bc9aca66e95f5e5bb727818c4a0d8fa18b73634fc1b1d2d1edbe49774ca6105cd6775ee97a0fea032c9a8ef", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5ee307c38a6a81e9c17500a0a77c8bd1711b1026c04322e64a2c78e81017867a90d2799dc92b3921a8b8ca11394711e9", + "result": "valid" + }, + { + "tcId": 437, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04da71fc268ffe4978d0952ce86f14f17e02e4d9713c46849ed49c16d41e2119812d8df2a7eb748613b645f0da23afaa9c0487760ac5f30a9371f36849317cbb5b1387e677ecc614070147a7621a14add0354514ddb9a6893c95ab3f9fa061f9cc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9ae253b2020e0127033b7c7c809ab289911909b5863e22e261c9d74999e1e3355cc745b1df956da8f31625b14b35f15f", + "result": "valid" + }, + { + "tcId": 438, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b4da7ee6bcc5d4739c8ad8c000ca1446bde097799111a0b67f7723e00da438e47a2a4b0a5804c61a6bc2be65761985e19eb66a8b495c98c9160d147948b3824e48ae2d28e78fc9557d30b8cd2e85968d7340769947fea86a9f60884224a31a48", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b17845cd8b646357067ff8d7159e0c80e263eb9487678007de8634a53b0e5e4cc158e1f29acb2c79a971c8ad77a2f9b5", + "result": "valid" + }, + { + "tcId": 439, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046b50826eeaf437acb6e0895b596a8ba31a0038962ea077427dead03c48f9521dee0d8b4413bb1d51f65cf708a93bb8183b26b0e0820e7da8d4f396bada527eb6409afb6b298bcfe68c08021d152385693720a6c4f84309f534ddb4927bac93f9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6acb118de69a37493e37222530e1771618d8c7b3849aaa6756ce218162e126c1a30f54947dd1239d8664c098e1b7d5cb", + "result": "valid" + }, + { + "tcId": 440, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e23339f06514b23bc75cc94046ba13698f477878f6b223396c7736b78067ec5cf66918ed17b978f7befeec357a07c4b3a0a25aa5e83722e38daa374a30ee2eb91a09fb23d0cca5d403498a85a1b4bd103096e5f96b4f57256e2bf13c91c1b4bb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2d4cab23f93d9e7f45aad4ee23f30b49558ee71b10c5b91b3dc155a53fb78eaafba5ebf24434729f9f597f3646c90a30", + "result": "valid" + }, + { + "tcId": 441, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041b921351cf243744c32348a01d1a4ee396243c6526077634db8df01e3ec943d240013efd2193986f1569ab2528ccc98c22cc1008450318df6ad3d33ef44a7aaf53ac1f24acbb0c5b5df41030c059a617902401921ad9d985daaf231a3a984320", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fe4c3e38cea5066e5f61b1bd4a53d9ec3ec30dab9c3ecbb16284cc208eb377e7a7b01068c89cd45fc9afc34340703eb4", + "result": "valid" + }, + { + "tcId": 442, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d7c7079f3fe71ba84dec471108498683f15554139b108af93e0574c705a9c707c6d55fc98a5ff0bde96074a2f336fbc50e96ab86da216d6a93b24569a9b0c08b9affdc1345cc29912b24580b2e28c4cfefcde142efbee2ae34f8eb1aab3bfc46", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0c8242d64bcdaab717f384dd8bf07c8823a5ca6b7a5684d861af8da6516862fd7db3234bad5716c7a470a83a01cf154d", + "result": "valid" + }, + { + "tcId": 443, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04170f54785962e79822727acceb3a13c21af7a10a6df806bfeffd03eef0fd33176a783a918e92ace072e807c307a9117ea8a95edcc1776958aea93a0d2e0a1561a1b9e5532a8f60d17628bf6d37849c2667d65102ffe0f364496997c504df7768", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f61dbab8966e947e213c24adbf4422cd6cb0fa360b8ad7b645429d5294ef0fa36f9f839efda4de24630c30f39fd201c3", + "result": "valid" + }, + { + "tcId": 444, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0457be67bed535404cde9d3fbe1976bbb2912d69ec98e6df30ead45f9121933cca4995bf6651297b6247bf8af5619a1c6dfb9870004d6061631a3b8650c054290f71239e34dd9267890f5435b7dabbd28e4b89eb5859487402ca8cae415f98338e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b4d03383de6cfa1ffb5e03abdddeb12b57025b1c651cb5e70be1f6fa541e2084b3642cde119453c34fd4a071674e053b", + "result": "valid" + }, + { + "tcId": 445, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049e68d1849f2c87ec0907211adf27934df5a0456c2caef2e66fa67e5db133604b2693cf9a1276614edfcf6f915886b5511107e4e370e7623170d5787140241af75bdffc102a8cdeec672c1042741cc9428553693808975b3a624ffd937570604e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "729a7d0fff2d577974802b69bb92d29e4ce63196f4ac29e267902799cfac7714249f87f06e1a5486c08d12e27affccbc", + "result": "valid" + }, + { + "tcId": 446, + "comment": "edge case for computation of y with projective coordinates in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048e5d95f8765518133013b4dad8865d73ea4008b1eb12ef9a04b9b9d4744554e2964dff7e9dcd98f0fac3f0d9cd7502930659a17fad72c785d95761537929c14bed62a31a78435f6e006d7e8db6371f82e465551c150b41bcb816cdbbd95f82a4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f31e82d264c265a27a8c0b2079502f42ed036d165386ab78c0947dc243e7ec8864b71ab45dc697c2582ff7ef57167b33", + "result": "valid" + }, + { + "tcId": 447, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0417378eec45f592a5240fba9d61bb4592070de4c6d08bb172411ab42156fd4f60b9069b7edef72574118ad61cd87e982fbe2e14b52f8c2a691f2cade6e4c56c9ac7405fc1ce462e33eedee1dbc61a5611a9fbea4261c0690bffb29b97a7d20df1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fcaa769d2bac643c9261ebd874b1ddaa529c5fbb39a5e7044b0c7ea8948541378051c82d115718ee0f8bf75a6236c254", + "result": "valid" + }, + { + "tcId": 448, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0491d898dd4166e3b9a3c43a706498360a18a9f03c055df7b5697f754f5d571a7cecc5dc3aefc5efe991c00b1648e282cb4b7b09743e12ef10a214b3e78b6b5d049b7e2c4b7cd07d445c5d41974204a6730da947c23ed3328c591bea12bff19fc5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5e2ec5ce4b5abe0ddb0f4a457eb0f72e12e12354422ca1cb5bfadddaaa51c520f51b2955dbe4a54288bc17030d8b9eea", + "result": "valid" + }, + { + "tcId": 449, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e2cc71315f918d6abf3e61a10ddef186d766d7992d2225a5559dd605c8e59a9a19ad947f05cd7d2ce1fda513497054951a5261b2e7cf60ff72e849a53f0ba39d7dc6a3f63bfba0988d7d21bf6cee47d57bbc625a36c9f4fe6ac6c854a2f0951c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2c57b47a135c6d61cbae2a1a77678ad6b55503faba480bd49ab719901b6c5fb26445f1080226351ffad36cc7f5e9e1df", + "result": "valid" + }, + { + "tcId": 450, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a0bc8e06ca4cbf5baee95b889af298819e8fe4b222f28ec666a9449da623047644188d9142697dd9ee7875be838533665bc87b7119d96ff94c604f206eda58f9964e1b293434dd3b249c105ca6ca0e3e7869d0490018189bb2ab6503647ddadc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b29eb5c013a1fe15e1586f832d1c3765925be6150956050782d3b6b68510ccc2d4fbe3d35cf64a7e871287d464e1591b", + "result": "valid" + }, + { + "tcId": 451, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e879317645feee9df81067e46459a9c8d950f085593fea7012faa2acf1c829a6c27832413aa2c85ac70ccfe2851ba477fb67adc1132ab96e7de764a6650b909e65779d0359c5e8c828af88231357fda83490d9cef98f9bb944e747e591e67f56", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "56c947688a1608bd65ae5a2d6c66fba64ad0ec448bac51ddf6df3aae6ce0884dbff189916460bfc8994e50325bc94207", + "result": "valid" + }, + { + "tcId": 452, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048727a008492249a7c50bc07f7122cafdb53ff4b224fd923102ad4a9e2baff2178c8b254fa6427f664b734a18b1362cf975473f791379ee745a70ec5bf16d14615f0b5c826eee7e01a8ff15480d57e8adf996adf7f87a4ec73ec53a41763151f2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8164aa40e19bdd7bef1b61e4314623753f464b14267f6cb68fa65dec58c674899ac407cdb41ff28641a6da1ff5eed19d", + "result": "valid" + }, + { + "tcId": 453, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04163c3b11540be5f7f0ad79f6b300cd35367ddbcbbf1b4f0d307050ce78593652977fd54c6befac1c1d50c477a2eaa8b6f5a362156e82177284b37aa8ae3d5193daeb4e34da4c2b3f86ca8348a80b16328c99349c467662e52b2691c48014ab6c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e76e261c7d4306f1c9198e83d844446e6d115f2c3aef1d0b97b9be9f201205b931f11f7ee244662ac7cbbd01fcab222c", + "result": "valid" + }, + { + "tcId": 454, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040352be4fdfbfe81287e174cd890a94df3b10083564cdeaa96fa251ad525ab607cf45863e95ee57e1425486670b55aee40977c7b0e7c12c6c7e8707748f635762d6ae9d5a71ac44ff2c90492d29ea38b24c37fcc3d6325b709fa1ea1afc46355d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "faae4d03b4d5518e3984d9732ac86e5c437c204c3434794663d3b06a1cab48e73c531efaec06ed1ca6dc821e8cb54b4d", + "result": "valid" + }, + { + "tcId": 455, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044ac925821f3a4b962f026bef2f8b17cb328cea1f9e5e1819c7004349cadae178472126cdcf410cce69b7b9c3fad4566ba0de1bd1a570ac062bfe8066a241779ae3a44a7c0e614c4b7c2016bee30fc591dce95ef352e87d77c8fe54b75a7955a0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "156d955d98c527f0ea73b1589b29f0909d70fb0eefefe4c98049b5f49d418b9d57393e6567a6b85e8696a43f03c6b096", + "result": "valid" + }, + { + "tcId": 456, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0458f9af65e3a5a5293faef4be01343e6572905637477057d0faaa3667e4b00b3bf107fb3757c75a77e54e3ca5000584cbed00bda80bbcf027fd312683d1d15e73b9dd9a8fcd72790ea0c5896f74b0231b4e60d9586a33409b62df28acdb5ae859", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b5b3b0c19eba8984c4922a16f5c8a88448a53f95c2583c537f169b7e5a19ab73b40e673d1021b135f4c2820f7b85a4e4", + "result": "valid" + }, + { + "tcId": 457, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c8664ae2c28a85e7fbd5de0a50166cf8dd0096d4a52ce3d1f14fa67e0e6b99292bf3e41e19e7ffa19b459a693aa84cf31570ab86f0b77548a86b4714b772187774b038a51a3afe67f8800961f37e9c4f78408980595061fe5b22721ff5b6303e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6bc0385a67d0f1b143e81afcd21f345d46e00958dcb606747a4f548518d06ef1ca4e1268d68c85819a5bcd9b1c4c8fcd", + "result": "valid" + }, + { + "tcId": 458, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dcc80dbda7188f815bab712c388585bd10e346fbad2907057dbed12f613cdcc7c53d8635c26fb06b2abe2f8244364d55051813cd290c59878b8c27a60014bc996c29260fcc0b7ca1d3b3772a7a49eda79345d0c43c3bfb88f92269601d7f050f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "56537ef48cbfaaceb51d722a2dfc9019135466c8054ed425995148919335ca0f1c2e736b8190954c2593cf3f7c72d654", + "result": "valid" + }, + { + "tcId": 459, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04042ae6b74b4c0fa695edb18337129c7cf894788220b91310a0b725302cbcf77cbeb61af34e9888d502b5b08f9fc416769d4fa2a0d7fff3ce897ba6164360a2dc2051f7d7db26da013a8c4f9f37dee9e89c14b62ddf0ddcaac6ee73676bfb6fb4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4db9f2b25fbf2cfcd4e0bae5842ef15a42599bb503ba15474fc7eaedbfff6f727c7d09a52b8a9ebf4dd83fa819f768d8", + "result": "valid" + }, + { + "tcId": 460, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0451dc7c9a170872c08554e89cc5d86e3b21f502f20aa763c42021a371321ae153d34bb98ed5769c0dc9a5996d7bd23fa0c4aa755bf21ec4f95e806e8f3e0d27bc543c45e94e1c2965034e19ac64893a44f4e2a3d001350e47282b28b9f5d77a93", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8bdd9f7d4b2bc51e6ef0bf987b9a8f849a6f87be4316bfbe3d9b10f8f048932b110642dc0c49e6bc6720c60163153d0b", + "result": "valid" + }, + { + "tcId": 461, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f0e3bd4b117310cbc45af18d109639fa49d21564dd0a9073f97125b8e50c41a6cd601ee2769628d0b8c1ebb69fa5e0d338defcffc019b1bbeb2d17cb538afc5431d27ae173f231f521f47cae26fa8f2cd513ab7646451b0a0497e035a1f39649", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "830df4201ac5b0e624ad10b09c4b3424ccb0ecc8e8decb39d3be071154737618711e2e9d5f6848d2df1981efc0ed3627", + "result": "valid" + }, + { + "tcId": 462, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fa8852b36d94134540a5e3ab64ef955aee788c3b4cff7014ef1ca943f7116cd31d81b0e2e2cd0d62cefd4f12e4d2e04ef78360ecb9c788d176cd875a7c6d8515d7a6305329a8762f13b5cdb99497a33845c2cc062a33fda77e90b3ee6e978459", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "233e533c0089c74a6690cf22cd99d2378386a397468f8a0adc87f6cd4440f7987dee7d2c9d1141f03d5bd619e97f1c40", + "result": "valid" + }, + { + "tcId": 463, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ddc1cd20c25825afd4216d83dd28337f5f6f5a3264b2e95ac30a76a0dee12ed2ad60a837d9954d166823d02a844d9a9515a2a49f62417a3880cd1d4f9876fc99208a86d6c54739b8a40532bb511101d50cc626e177d23f342c9e9184067a9780", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9d70544e74bf4eea4720f18edfe469cdafc91490c4dfee643c2ef64cf319991391cf9b0632a5080edddc89b8b8dd0bbf", + "result": "valid" + }, + { + "tcId": 464, + "comment": "edge case for computation of y with projective coordinates in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0478bb1d1263ad4b8112dfcbd69268275e55a662cc7c6c87969469c0418560b81c4cb650cbf8a92027254d1e867ebd70313e7992b32cf2c0492d647ad0cc702f0ce6addfaade41f4942311e4cbe3471be1c3a12edb46647b2e5811bdbfdd7f4b61", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d2f44285bdb93b8d1dcb2d61ffafcda6d6f702ca61e9439dae4a2ac3de472609dffa7335e72ca062cf9081f30a956713", + "result": "valid" + }, + { + "tcId": 465, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041065999c045ef78065a449a4a615204ba7301e82082619d9efa7b95c1f3537e5ac815db77da58adf975a349e1142a03781f26df31cdf9d9c7eb38463008be4c8e928c3ef2bc432d8be3296775976ac6b31bef5750e53ac9041cd202fd49a1da2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cc37ca631672024132e055a2ef9eaa2594c3dac0887d22c520359ae98fb2ab3a145ea3b7040861425ba8792524103b85", + "result": "valid" + }, + { + "tcId": 466, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048ec0a50aa4dbba227faa1ea51ed3e41508badd794051379a9c90f5164f70676dbe8c3d72278f4173936983b7e8d0fe9c6c9779729d9374243c779297b33448cbfce401240e125d7791d3e2b1fbe28673591abee602a4d89bfad9e58b05f4e9a3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3b45f13eb328839bd7b35933e499cc9dcd541d9e8a62c1cc46330ef123c709a5dfab4ca70f87a7859c4e389f3f8f72f7", + "result": "valid" + }, + { + "tcId": 467, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c5f73ba8696df9fa96a8a239080429362206c87f8c43498688d96431d616dc1b19dea16514c8551d141b3b8a34c84b73d297d41da6b2ff0dcbd2adbe36b8c12abc7ea724fc31e16a22504b68ac9bf02461bbb7344f66c276d7908f329c8c0999", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6d5c03e2e494c1292c4d6e23cd7ee49123821d45f5f4fab25ffc74b24998606415a93f46600d740f22b1a35fe62ed218", + "result": "valid" + }, + { + "tcId": 468, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041a6612e5686e9fbb14939c23589e80e89e9ef9eeceeb00d43475f87d472e48ef86d55768364beed1efe572b764fd4f3df3c983f82f87d0b22623a4d1489514bcfeafbe7143494e101b26259a70ee6b1bfe17c92684f7ab629282ebac3a7ce1e2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "adac1706dadea134a6ab15f36546963e60a5f952a0d992e460a1251d91efdbc72d7e9bf4bfd2e4fb960054eed6c399b4", + "result": "valid" + }, + { + "tcId": 469, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cc75500e71b1334bd31352d4e313faa1ba653157f6ffa818f2991c3474cbf176ad29154a849823888536d96bc0df0f5463ab985e534c3d9b62e99be7a34ae6574c313b2179b3712e4a5b484c0c012c63bf4af98e4742c9d7c949514a1663e2a8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c95f6770fcfebfd51482108aceb43bd895046e852d99deacce3043c87ce3d63e66a90b0d13487ade6922a8462ea8c152", + "result": "valid" + }, + { + "tcId": 470, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0415484b26c2bfc0bae797a5f6a3979884c062e9e769457de0301ea30579d20308fe68126b400eabc44b36f95781e0138ad50ab03f24d4c729eb611c2be466cc9813dd077bc7f1dc7a4d0d0985fcc4a99cefccb93da3b80e3d91a94f43616a2ca6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "88b13886543fb8ede48d02e8254b106c2c69308c9d7d7922f8325022284264914727cb1e39e647d9b9fdf596ac0c7826", + "result": "valid" + }, + { + "tcId": 471, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045fb1b24463deb3b143a4ef41cf1c43811cc9ec5e42f2b5105e066a1c7b27c1b0c9bf0962f674966e75b0be2ea0dc98fb89a0acb42b5914017f100a9710456547cadf90992183436973aadee650f0ecf4105997040b64439c90c97e60d6a4b887", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1b321dc98396a31ff1c53fa04c2b2792f6869d9f119cc7ed1ddcfb5cd9e60224a95965cd7d9dcc621319f84fe6d09cbe", + "result": "valid" + }, + { + "tcId": 472, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0421f41c223811b451baa228a203f90826579ae82dfdeab1676ebe9cda9266ca26e306cf0f7b04b692e24ea9b57c89f945951ccdebd4db1936ed85e725d51a747594be93b9d4a820ee89167f9d9a0d5ad5246e93eb763b2171bf676ef9882eabf7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "eb81c531c79b12699aaa42285f9ac4ee05b6711b45f02262a89614432b95be32e7fc61619ae240f306bb086335006f61", + "result": "valid" + }, + { + "tcId": 473, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043f98957c6441eaa64cef241b41aa72a3a2f6d0d38a1a52d09e0f36796c9015792e33f8b82658895fccae2b996c0d83cc73ee06adc5afd12075e95b0f47a90d5cdf1b7e34edd2ee4ef2becebc9105cb135a03f92d48d40f7b043165518ee9bc10", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9925a33739bc7930c1822a8afe0f054b10f77eddb6e706c899afca47cb183c62c8855085221668572ba38b43136c8992", + "result": "valid" + }, + { + "tcId": 474, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047a694e195273344c96127ff85697be5b192a5583a49bef2ee7dc7d07cfd56ba406dc4274775ab7527e3fc8249fa845e0680f40b3b76f1740989e1b9e4b122767a1955d53fa1c8da3f6e57885baf633a78f3946c4a97e773b11aee77f98b5cee7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d2bd256e75a7b5f468c5185468a309dccc5b9d97042905fe70638a576e8b07ec7366b135a7f9ac6b223386d4e9ae0392", + "result": "valid" + }, + { + "tcId": 475, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043f2cb6365281cb7b70394a4105f2b518ff1ff0b6387d30fd5704a831a59bf6fc31875f1fd44fce8eb884b481d27f89fec350dd59e1f70b650de9d95e370e0d3501e87086441a14c970b4e0d33e923140fe0af8f6a0c9ebdd652bd880e1ebdb4d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c380a7d1ea94bf4f695d440296ba4463fd956b9c06b4a6851a0bb3377ffb5dbb7fb6be73f9456190ffabbbbf1c842dcd", + "result": "valid" + }, + { + "tcId": 476, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049020db3c80bbe43ef6a0a8291731d84733e6a2f60cb6df7cb360b36e5e61f9baf029ed78090c03b13618b1cfdeaef7dc3239a0aa3ca8ba34e158dc3b523ecfe552b7b632bbe592fe80ea2476480aa0d4c72e4af046a093590e3aa518ee2fb482", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2d14ff7bf6c6117c37aa00c904d2c4628cb951ee3e8c995cb379cab499e4add961ee10cecfbd4851e4bb5a1ca599007d", + "result": "valid" + }, + { + "tcId": 477, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04096d21ceb2037b02a9901c8ffb2ba8e1b9b2c3aaefd3aa37caee9e84b10c55b6dd04fd45f405614cdf75129ce640d0ded0567ce43e6b79a75c8b4bf0640b2ae7e9f3be95ed95d15e471d206f20a7e882a50113f8e6e04573ec7fbcf8ba00c996", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "146da3147b7de29184ad54eef009cfb525f47d869aea1346a1cbb9333f5039bed1a929f5633d0dfb4ad1a05c4e102324", + "result": "valid" + }, + { + "tcId": 478, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0450e7f1be1d89620a1b0e931052b525a093257d77bf23fc1c924b9c214b9b8ca48efa01067eac68297cc8b90c07dd110be21ca9a167d921272b61651b807f1404ec7c483a9f11cb2d974c0877f5fa6991219d336e9b0ec377c743f7fc9a2088de", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b170f38deaf9d792663faac617d6c8617f2bcd57bb4856a0d0aa73ef99654d875680f257e27de09a558c026bc11d045c", + "result": "valid" + }, + { + "tcId": 479, + "comment": "edge case for computation of y with projective coordinates in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b4601cb8a87206f118457f295e4d5ebd882f89e840a8fb93a012f750dc28b87138f18b81526017cf8c5b6fa79abd887b62f39571d83bdb755f64877137f77fb09392eda27122806d08377a42f7fd09bb1f9871a530ba0d1cb9822b898a2a0737", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bef6a74af809ebd5aa9908435f174a797474d61025853d55bc6a51239e49bff31ac3d8ee9f986f08be7207b8e1eec6d9", + "result": "valid" + }, + { + "tcId": 480, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003cf99ef04f51a5ea630ba3f9f960dd593a14c9be39fd2bd215d3b4b08aaaf86bbf927f2c46e52ab06fb742b8850e521e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "96876e9ed89edf3e3dfd8ead06dcba0acdce7763eb98aded82976fa36181c79ac4e833df385af5ee860ca1f20df4cb72", + "result": "valid" + }, + { + "tcId": 481, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dd607e954556c62e39b432d1f1b2fe6652d75a1fe33cd15c799ffac9d13d5d521899d25940da653d0824ad8456ddfb629f4142e08a3bd1d87bf6119a9ef4b0a80dc712a4d6c001bcb2794c4d1a03b1f1d392dc088c89ef844f93adb139d956b8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "60d597a99c86a432e144bc2b0e0a89b91c4a72f3e1ff8e56e7f07d53b2e563e979c09e27b34be98bb19865e808d4290e", + "result": "valid" + }, + { + "tcId": 482, + "comment": "point with coordinate x = 0", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04826d71ae4f7b3ecbb2a9bdf59512949542d0116f616440a550168f4b58812fd6c1ab94f310385fdf246db5efc0fd13995de099bdfcea355ee63827cf2a2e2d868f5cf0b487e41245df54fdc735eed6eb726cfc928bd5b4d01719d1644967ed1f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "85961906edaa9adfa9c9b8279da66158f57fb350ff9b15dc4d75b8cab64b9d34f5ce912f1aa512a54c71821c6e31ff8f", + "result": "valid" + }, + { + "tcId": 483, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fa8919e4524e7040489cc17aa3d620f88276ef248d1ecd1e9a6637c7a06765f6f1d593b1febe331b9f696e82c5be61a4a074a912309662f44ce0825bf134582116cac3310577d5a00722ba513e6334cc17101091223346db67063cf6e7bffbff", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "43484dcf01492eab684d39881908da7f40119fe7183bba625c32fdc14da3c4236dc3397234e7db41857495cd0d09491b", + "result": "valid" + }, + { + "tcId": 484, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04aecb8f15ab87579a03f5b8fcf33aa094337e4c362359c9f2727634909c6913c321be69f3f8aed693a31059989997fb32d4f4a37ff236d8f6237186a3a721a82a2ba22f8a628d7273ef3173e21ecc69969a47e669383ecf0cf5396eb02f46c3ed", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "65e6133929c8b061c25fe0bec9142c93d52c9f1695061b105f6c7da1347a967b5a3f1183565645f7b8fad8863f9a6345", + "result": "valid" + }, + { + "tcId": 485, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0440dc66d81c4e15e1a4c009c60c3441725fff08b2543773b0dde00db231f44badd77a8bc9619479bd5288e40da153b8ddc3d530262b169a6fa700ee32a5cd057baf43d29627f342fda8f6f0fb21b1fa35be96a452ab4881f417c9a4e4136b1e6d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0773673dae337a1688c2c31d1a600c0ed72604a171c665b5307ebaf740fd518e4a7c5c91e4f86f65905640ee37f4f830", + "result": "valid" + }, + { + "tcId": 486, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0453b5874738275a2e1d734e51f83636f89179c16fe89f46f4d8e71f521c594769d31725f6404122f21112943a1a22ff07586b41bb24bf303ae8545b25f7b98425ea62c4d3bf51d23d9d85e07719b828777efa0a28fb30f33b899980de3c532611", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ea25b07a161f318a81a693f6604810b8142843c4fd26658d9b64fedb58a5eba58c217c4176569cf33fa47ac9f2b3d7f5", + "result": "valid" + }, + { + "tcId": 487, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042988addf62149e6ac08219d2f036d3f5720aa862905cf3fe7bdf136dc08b845e8a61be43db86d71a26dc17bf55374a9d53ac99c5d07de10ce74ed3b1c413686ebba700f49260b08357f95daf5b31a555345c076079f25d8690fc1ac20c71528d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a8d424068fb7846b0d43a5cc13029d054b11c97e508ee0f92e73d35ac8351a462eedfc9da9dd1279f12812ba46c06053", + "result": "valid" + }, + { + "tcId": 488, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04494b59de1b69534b4b62d75810ee3dad05a19afa41c7836db5ca78630208a800388d04034baf2923ad5af6ac72ee05f989df6d08f9a6400858d084fe770c0ddde298966cdc56a921a43184384d5a13f31c1eb4e834e23bed3069c10dfed6b63c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "296f5d6fe4ddd8c3c7304beadd45f6cd3e3fcd4230c9d2ba1a13bd9b9498a3c8d1ef0ab6ee2a450b0c68e89a83711fa2", + "result": "valid" + }, + { + "tcId": 489, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b64c49ddf18bce79cff3b8cb7b0e58d48421eb6739f59d271fc4f54dd2fcb1cf56dd3b3c69173a5eab50ab1a2e0616d05d92b864cbc9e4a3f75650eff39e0eacbf87c4c010088f3338842cd97832724f79bb15986bd3fa85255816350473bbd3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "db1edbbb1f3ac6df9f46128812bce7818b5d745c75322a9abe89983be868aa1aac555f4d60ec272730bb4ad949a53d38", + "result": "valid" + }, + { + "tcId": 490, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a40b1ca1a51a8ee6bef5b58aaabcffe2e15f74a3087edb2620885d7d933e4f50d625eaad93b87b8dff58f0565792b174ab89717ffe87cd29ffbf3cd7d938b1173747bfc0311b78723684d7c9a1c2be3b597bf9236eed090028eda2146c477e65", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1f84c641ade162a274ab2efc7cf6582f5a5d91ce7993af6956d55eea0e1b7fbf040da9750486b0fbb2bd70d9ccabb785", + "result": "valid" + }, + { + "tcId": 491, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044e7a82ad74a1b7851995f6e1a18141bb4584ac22e839d4d916018b150fed9cd0cce427bd446798522744d395e90ee4b63445c1a6a4cd467c20cdb298854f1e270afbea053b7784976b504d0e1339c5c86007cec363839958a1fa51e9483de561", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "54efb9bb7269d86b06282b1d7dc28a940cd7789ca4e104c4bb7c5e5736676c3e5370cfd97849e1200a031b668388d8d0", + "result": "valid" + }, + { + "tcId": 492, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049b54678f8581ce665108abeb0c09cb7985bb5dd858bbb71c88e05344de5b45b4e67f33ab58d359dca2da8df1149dd1bbd09ba7f63a8d35848b40746ed5fec7944ed44fd9a9a2fc3d13ebc5c05ff94d5f500ee15072d1b4c1375fd6ec4f32125c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1e96c829cc8a79d73fa6434bc159dc432c2ace3b49ad2e74380e7b02feb53b3393446a0331b974f2bf219ae95d2b23e7", + "result": "valid" + }, + { + "tcId": 493, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0486cb7a3ff3aedb2f39ae22f2e828ec0817d94b831ae654dd66aff31a4d84b33fab46fec1abe1a9e6bbfac5c99565fd3bb2f72d565d2ff5c5c24f375448dd7bb442dfdcb61e073e48402707bbcc26ad43d4788a9f44715f1b8e5b62bf49ceca65", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "84e7af176ddba3ec3ce7b7fc43df1ed59b4e3228fa3f6fb41a01f413b0a6c7404e43f7747118ba264b7b026d714e90d0", + "result": "valid" + }, + { + "tcId": 494, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ccf5a5b80deba6318b85f57a0d563e95765c7fe30df5ac88837f35329dd51070e29896f4d96ef40bcccf36244df835614e8785f8065f81c5e9270fd559b6a380b483874d298d0d382eee1edb6a59d9c163296ab7a068186b0d23f33737dd0eed", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "82864ef4d5fd25204ae1591c619f3ed813c762baa009ba3b49ac38c57b2f46652f719adceabfbcaf985b29958d1f420c", + "result": "valid" + }, + { + "tcId": 495, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c7f77ad286c68b88ffa64fefe4aaab3dee1f9bae37b7d069bb92bea82089e831a70dd9ed007ba6dce14f9c6d5e744eccb319ad6ec134376cb059a1c86984ea8bd154d826ed3dbae8d8d8e06aa0cbe0127ddfc32621bbc1f731f9d90e687a7cf5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1d0d3ed8c1e0d28f5e3766f193da7bdca1cc08376293f9bbde7bde0e9b1ebcf4cfa3c683dc63bcb42b2d9ede54242bc2", + "result": "valid" + }, + { + "tcId": 496, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04aac3b4d280fc70a9fe175e1882a69eaca2482a0c9ded9200444028ca3dbf501fc361f7658bffec321ad577b48c9786b07f596bd868d51e73f0f7c25db956b12171cfab11abd4abb00a59ac432c0b0f058f4cca44fb581bc5803e472a05305f33", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bf19548bb1d7333f46cff4d9d2a81dbb48ca82a52faec2b20c3b27bde392a66b8e44780c2098a7b5253157b014b40e51", + "result": "valid" + }, + { + "tcId": 497, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04747efb595d03dc05dd50c17155e1018ca14715054592906e671a2e2204acae552b6f5d345d3fcf9b4171892afb3e5587d8e709b083a8b5363663492f8a2a9af64c3ad01c64d8fa4764d61f43e6901a2445ce94b586f6090ae0687af0090fcd47", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "32d569310f61af475b6c6d075599625a3381b0a5b6a0b8c27c7165d00e2fd4dc8b2cf8e3b33e28ad4005525384227fb4", + "result": "valid" + }, + { + "tcId": 498, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ab14764bf24f8313b1c49c4bd6e367231275b303c601c66f7e8b3105c6b02a90b60f38745d755ce4dd40681ed15a1ac93e14cf2fa708300a2b279f2c37fbc0da7175c92c1114c57ef251467f6f3de79fbc38cb1e3db70e4d95225fbd8ad96889", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "266b261b6dd9eb51770f6c4c11b87134abff1629b65171107a9b20e0c7d168e1efc3cbc402464f36aeb3c027b9198e10", + "result": "valid" + }, + { + "tcId": 499, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041e1fe9730fcd5b87b065fa90a69534036be45758513443f79c6427dbc31fc403e894043fb9c7f9f58c0a3670b1c0d80359db8f6a48970ccb9918cef04f352a4d91a204502119b2b7efc6c671a6ba4537e82c196e6d42685c5a6f559e4e8af704", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fa9f208dcedee597f51122e6274b86710e36561f2361e76186fcb73d1d7f2928426d98c3f69e4cf48d3001d64970425e", + "result": "valid" + }, + { + "tcId": 500, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0483fcea208c79227cbd97319a86597f85cbfc19ef60c5ba7a92fc521c685e208cec7735be9be27c737d3f9d2faa1c3f4695a32184d58fc9001402436ce00b52b8885bb1150f61e660eceba10768d0f41d5e4e7c21d4fd909aceaf61a7455dd0c6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9a1ddf3d9feb190a26f20ed925ffbd35df1017c4a4c9485d344cb8f81c7f452b2ff3aec44baf34e50886f183480b6325", + "result": "valid" + }, + { + "tcId": 501, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042bf26936c9164ba1072544c410757630b97d4e853fdb7844f1811507d04a687d951fa65a34364e894cf8b0815db95f5e10664627bf6f72330a2d6f212361a233155abb79da54343b8572e30eace8c8f5480200e751c2102078528812c83f3cf4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "47e4608e9bccf6a3296e41fe34eb7181a1b5ec306a93aabd5fb38e75e3d75e8e2ee4c1c44a7d08660681b9fa66642910", + "result": "valid" + }, + { + "tcId": 502, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bb583da5de4c352e8a4fad31e9f71297bc963134ec182e96379c6b28a11d25fa4b77a4a0f947085db33b0ea77b9da09be1a0bd1300383ebd60b5aa6eeb20f03d56dd14df46157465146278536ebc28c5471a94f095554c4c085ac9dceb1da55f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8393a2689b376a228f3233ac61578be1aa2de1dbfbb28b03ad24f11ad9d77f8543e0977aea9a761d84e115b61507ae59", + "result": "valid" + }, + { + "tcId": 503, + "comment": "point with coordinate x = 0 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e37791595b54e9b17cc30726d2425eeacc9672f5fbc91fc108cf8c84fff9b66ea65483841b7618694815e1a415186ba727af3ae6c658eb8c485d6ad8e49c1eade751457562d6003de75cd1f1e13ec15ea1d0413602ed7f6a6b7b84efd8a3056e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "209417da721b49d64dfa09983a8683520e5e300a52b2e8f1677772ee3c086b339a1da25cab2be6e44de4526c31f4ebbc", + "result": "valid" + }, + { + "tcId": 504, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047f12cb987b08c235523465146b42258584398062a107429ce486b4b2f26a9628293ae4d30aa61c64bf92f97e6c08aea8d6621cfce5270cd7fa69dcb038ed8ba428afd77d528c230f8e5c9b83ef659c7e573f6671a18d8b8c4ceb20f2d760858e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e7eac460eada6eb99988cc39f6129a74d9510d2ec39601adae76b2b8fd6122407b79411f8e7adfbc4f0dc50da9f2b82b", + "result": "valid" + }, + { + "tcId": 505, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dc4f06d671d86012cd5ce10377ffefbde657da08fa9259e4aeffe6211ac57f6e1c5bf8732989d44c1342a84fa6fd7fba2714ce23cc0f8e0a8bda593ec2b4b5294ffc0363e6e89403d4482f3537dba9e4f36be68d8e2edafd8cc2c01f5f7dcec4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5a197a9a8793d94d8b84084c6dc36c36a293ac90337a1cf6a2653435d05e2f563bfd2933f23ed3aefd75555ead76e827", + "result": "valid" + }, + { + "tcId": 506, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ca1ec6798c5667813bfc45dd1815e82bec93eaa7081069767bec3685cdfa56267fc24da6c186d8b3271627a852560c5a097d7c41e610e5267dabf525763f4a4a7478c5f9ae4b80baa1e620ac1f22d8689b07ed9a99dce0cd4a11682f07227fc4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8bf520337de6e5c6f27005161b3b2f1cf08759527c8fc7935e3621f68936f191ac6e931b794278d3ca1e3772dbfb19bf", + "result": "valid" + }, + { + "tcId": 507, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444b9e976b9e89aa31519fc0a35288c55e2d7630a1cd1fffd288cdac8c74bc2edcb0ff878fcccebbb78df9e7eb0afa6b1384782b8a1138946594d8fd3b6c9b4954e73d8c040a7a153f3da5a40f9fdaf3bf31a4522416c316f10dc7cd8afc2849b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1e56dc30dad33e34273535688605bb98ad7c6dd51d9267c90a62562d08e47dd684180d4ab7abb6cc14ae4c9bd6ae9e92", + "result": "valid" + }, + { + "tcId": 508, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cf661b71c2b8734f7cf5142a66edf787c56a33174303c20741f07e0c348e1b5425705d9ebbb459967621ded6eb56d71037337aa16e1cf6e503182184c9451f9ba457d81a0313fb987343b8b39344f3693298010cd5b73e38bcdece66c67fa508", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "14e3a97e9ee69089410b72459870495a037d4077bba027eff4c499567d7e7f1af2720e1fedd07bd780509a4516fa5c48", + "result": "valid" + }, + { + "tcId": 509, + "comment": "point with coordinate x = 0 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0450790908c043344e1cf42b27e4dc33a35d68a0b93be0ec2be05745b3c83c35f0a3ecc3ed27fb3188a5ed9f24cdbd29d1b0f03ff85fd7fcad4ea5bbd8bd4c42935f0957ca8011cfc93ebeb789c47214e60e5da16e4dd87a53547eedee479b0978", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "85a8ddb9997e2525cd555721f2d5f3b199ff76b57e91eec6fc7d2c95703a1a32f46e3d46952a90b51054c5fd046b3107", + "result": "valid" + }, + { + "tcId": 510, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042395d00779b6c7d4dad8cc9a8918496c28b2d4077e6886d0a1bef515e3125ddd813e5a9ea0f185cd009a69ea92210174b676775f763183c86f6fa50551ba137d79a83e8e32ff2fc09a2c28cdf80cddafcc0f40693e3985f28fe5c7dfe2d8b275", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c269465cfb336ed8c7e9c0377349193aa4dbdb92a9f4670dbf7fa7a1f7556e8e4b240d5b70edeedd1bf5ce769cb8415e", + "result": "valid" + }, + { + "tcId": 511, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045634ee155263c07d7d1e346b868ddd80e9a282fcef93bf6df8e8bc4ea34ff02e119a9f707816d06368ccb94c6e4802fbaadc33991574dde851e547e47027f54353e02d70be6bfa9f73953ca259011f23a4a80cbbaae8805d9d094ef150e0c54a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6a21f244472522389f084e2e4ae99b747b39cbee996ce9a3fa05353219b60c20fa3834d39b0b826f1096b7a467e8a218", + "result": "valid" + }, + { + "tcId": 512, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0463aa6c3c249a32ebbccce65ffa1c56a205644b2c40b931b1ec9b042b52c1e99cd07e538299fb837fe67586aae71b4706166ac450fbd6d4921b442a11679f7786ba5a772ab33db00543a941bbc015e23581ba625a72c0e4eb44838e5f406ca1dc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c469919f58d80b1e45d5d53ee28d616bdf827a88e0b2f499291ec4f76c3c89f276776ea96a6b9053cf02776698864526", + "result": "valid" + }, + { + "tcId": 513, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a287bd74d501c29df23d786b7c34ea0daf10e4b3fce71d720f61a272f22151db2c5914867493028c01e103820b0ba6b121cb298ff8977ecf21fea8ee1b6ba7d9b98dacc2a45d75c63ec8323001a9bf5f5ba4d3cbfee80482ca1333f4de90a14a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "18dd1d7b6bbc6311afe5383d796a5fec13844bae25708725554de0b5f03ec0f7d2e63b64db5f83d4ee9890c61e442c41", + "result": "valid" + }, + { + "tcId": 514, + "comment": "point with coordinate x = 0 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ba406b46c1d92d4ba3f40b7b1fcf1e182289b84cdb387f28e5ad20f1ed8c43fe5ffa37128462763051e87f0d5ebfcd9d9dd4107ce4d92d783d0f0f81d7a998b76060735b6fd63bfcd971ca70132fe6dc9fbf8534ecc74b501ea01cd2e4f6c564", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d639b9c31ad3ceddda7745d19e82fde272a86d31f8e6c203eed53bcb705e9ff58d659f8e9d66aa0492da545a399294ec", + "result": "valid" + }, + { + "tcId": 515, + "comment": "point with coordinate x = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002732152442fb6ee5c3e6ce1d920c059bc623563814d79042b903ce60f1d4487fccd450a86da03f3e6ed525d02017bfdb3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3dedc59aff8e4755f28f8e8a27bd45f9196a7e910b61f8628158f1915222647621d37513219d003df62ecf4823d83594", + "result": "valid" + }, + { + "tcId": 516, + "comment": "point with coordinate x = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0436ce2519696c9f87338fccaa72b6baf2716c6cecd0d4cbeb5384b873817ef6c38dc528df8174f5b01b876f9aa17a44318e111c5bd4c51cc4eafed385117b273c713dd880844186828285bc40c6336c7a81a6594ca92a7e37730f62ae31ed0ff3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f8f67510770c84b657c554e82c259a9e1ffdd5e6adac967647331b64eaa02a900e6ab76fdcfe1e62026d98e05cb98576", + "result": "valid" + }, + { + "tcId": 517, + "comment": "point with coordinate x = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047c99edab7a540fe0aae8a86be5d3a69b8cd8d27066d59bbcc4d4c1d1208230ab12c12f22ba5a1f98127cbb4d8ec97b6b137ba2aafa9cb0b524bc89f2838c7e27c54b727f70514e10914f57d49ab2a49b4b069496f23796601fd2a047cec9982f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "92d75fb57889f97baa0608f54fda2de965084045a653d2b036c3c1e839f830021e6f2880a5ed567018c8c2dcda4c8c27", + "result": "valid" + }, + { + "tcId": 518, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043c6ed8a05ef83ae416c1600c9281deb49429649a3c41a613aff2436caf248561f4884a2bf7cfdc76e0a4afd1ab3cc763b612ff25de4b21323cb4e38db413d22dc3cbe507c0705e97442bcc3bf656c29f9e0edca8612f50082649caea515b16b0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7130c43ddd9bbdd7ec3d743f0cfd0c91ff9afdb74ab34364d9e397d747cdfeeb61b16e7789175eb9589ed46b232c8c32", + "result": "valid" + }, + { + "tcId": 519, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043c1dcf9b4a264473a3cf2a4153abb8aca401d699d20b246329dc73901e8fc0262cdb264136dc8ba9a6e49949b5d2dbe5cf469a4d47658fe564519ce924e8c603936f97740f21fcac094eb70faa3a456634ec1a7551906ab163c44754789ba60f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b836a3c9ae0fc8d89407738cf920c90b97d35e260c51e746dcd0966ce68b8496e8d6bd517060e3413d2e4aa4cd49413c", + "result": "valid" + }, + { + "tcId": 520, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b2e82c7ca2da16dc0bf10aaa159c90082d87e3ae90fa0e18b229f57b6bdb05c05e218244ec1576f0632c1f0a1223c6c068317477e5dee3e06f3adf76f1d972e7647955675d428d8f46b21b2ac93bb236abf1dc1c6e026a8b7095a491bfa5a7ae", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d4bd5f966822dea84d55f9de5ef4480fc046e6a0a51bbdfaaafedbbb285b72e8c9d071bf101857a5ac61d4249705790a", + "result": "valid" + }, + { + "tcId": 521, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0422748c169ab5461c0e71ece24a2397ecbe253ab1c2a97e6a288f0c717e997f2cc1abe4229d8e70556a0e5a99d854ece9f07e6bb64d2fd9949268aab37841cceee1b8f683542f08cf5c45e0faeca05a43af54c6448898a43b21efdbb032fc03df", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3855a2b1c846df9de268374b855fc8f6dfd84bd793ede0f4bbafd9abe4646f02471c265fd88a6062e0f64b5ad0841411", + "result": "valid" + }, + { + "tcId": 522, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e3fc9790ed5252d40fb65a28506adfe5571a517f33c96997d00f047aa897659c9314577dadb952f936f11e7d078f6069619ee8c9892760ad1d147783845e96fa5c345c62aa84b5987d4e53dce65cc4e5fcbdd6c1857fe7b2889d7c1cea8f0ee0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b783af4f6e339b71eedd46ea7ad5f856f5c8aee7f2ffbb772e3dc8dfd8ae4a01bf9e5116ffa513557700924cdb4f0179", + "result": "valid" + }, + { + "tcId": 523, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04be8cb40560f30941046331195ad2f3ecd63a01022aae5a77b089d10fbcf079ad065a3c3da894d4446c734ae913501ee888a0d019138326542535c4bc45f12858e78d2ea6650129ceef22d52093db20998f21e5251c0216612bb04100401c680f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3803c9f9c9f2ede86f561648cfae217b5edee99ca09d2b4f3ed6cfe008ab41fce87ab5a584cbb424ab301f25d561718c", + "result": "valid" + }, + { + "tcId": 524, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048cf3a702443f0dcc2e23e59eb5bb60d60918770bef5a66ded1f3adfe2d911f2d045967827dbcf72a70ea54eefa4c3c125f362b7738db3b459f5d0b341c4f61f03c14bb8a0f351ef9cefb9d98e83aef7c98a03e4135fecb706e124577aa303ec1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "02befd4968dad3d04a3d16f67c148173c2ac00aa441114d908f4cb7ddfe167a3e35583729083db20d5508e2e5c0bac3a", + "result": "valid" + }, + { + "tcId": 525, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0498d02bde0f6ad04d6e72a403994cf5713de9106db35fae0b1b75d51f7931a7ce3570d1cf8307b63236ad14040f928b6bf88a072c78d9ca65cf76d3ba548bb1463e7d03d762f310a9247ace3402dc10f7a63d222f2f6057cb656b52d88ef94cad", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0ba8381c8122c9f58e8c0de91cd671647d6427cd868acc12315e5ecfc9e0139600f5c81a5e3012b74949c0483fc42a53", + "result": "valid" + }, + { + "tcId": 526, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04de490d60010eb5fc9b18b83a3131d7ac063b507ae8f3944cd7d1146b861f48724566ae82dbe7099b052230d27023a15b941ec0561d53a8ecaa3eabab7da3bde2010223a014f79d9d8ba551109a94982ed03d5a8807cb3c1865d7f7b80768a263", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49a1430cc29fafb9beba8820b85b8b2469f2b04b82604f2c584c04681f0501c7610e1e6ebdb0a2ff87c0a5c7d82456f0", + "result": "valid" + }, + { + "tcId": 527, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044bdc3e636b003a14e8c495979e2691154ad20dc77aef6a5e2e614f9ed2b5eb7b6eeb70b8841e74478cda1f8fdbd0f1564a2c85187ba78066db1e41208303d5e14f730609e0a2a70e7e8f4f8632e1cd629a9905f91ffe2a6b64b4d40178bd304e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "46a87ce022eb080b7e5fe874f3728e093d24abf03ef59276bcfeacde3c1be4abffcd2a5ac918c528293a0dc95ba18934", + "result": "valid" + }, + { + "tcId": 528, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045d6c3e39215f139c55056cb6ffdc007940fe9d785759ad6aa750d01fa8d99aa6784e9a52ae20e4d297f8a4e64ec75ee063f93be203f9f4560250ac1608a5a377330af3900dc245ad2866c033df1074b7fe4c82b5c1f3dbe9a24892539e2bcd83", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "88375218528b75e4336c97ecc150004accf719e8ce8f2f0f7268f361fd5c9fbd3dd31af5191f7688200c972d001fff1b", + "result": "valid" + }, + { + "tcId": 529, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e5dfc4e90ff3dd8ba11ddf30c722162f43567d9145c4f4f2241d827697b460b270008066fc43c8c55b9b3ade51b43820a301019fb8ce30526c457f1447f8909178d99a998666f22154816f47a748900ac6ce9fb9f85f5f5209bcc826fc7c253", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0430e0a48bd1f85ac66722e4350128508f19ea23be0bd6249d179599bc95fadbf2e55b727c0aae963fe6d6e63cbb5926", + "result": "valid" + }, + { + "tcId": 530, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dbb7eb68ec208ddd3fbb3ff9ac9026bb4354381a26a160e9d4fe4f5a4878ea993e6eb91eba404b495386b0e516a36c0e573cb69a356549b1c9597a07027dec88c8265a5074cdbbb26573955d0319a47ef42c6105c5e1c89a24659acf004d1cd9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "91c30f8d4b9f58ddadb3b6fa42091a2fbab4d18054c0243e1d5076321156544b43a1b41776bc093dedc9cb86ffe349c3", + "result": "valid" + }, + { + "tcId": 531, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0458c1dd1f0b862b56cce2021353f4b4c44bdead7ce4e8f1e2b8a19ca56dd9f278897250c58d5669decf447090d317693ef6eef65bef938f19a32f3dd5724b9db50d86f14bd60d207381f4fe376a780f8e863b5ae2cc9a952f7b2cf7b98105ae4c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f9ba129247b36f1d0ab4db9f17c4b36855b96dc2eec1f9dcb0f233c30973fb6657e46bc4a7e73488dec13f4a0109ba76", + "result": "valid" + }, + { + "tcId": 532, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0497fa9a56e71bcb8fdb64719657bca5c0b22648efed306ca9acdf158b1645ea73b35c484aedd7b0079d6726565898653e32c8c889f3f56ee94b4bd714cb033788c3daedc0c6cc04d1b0b384cb9660a031c344c656d4804c30b92679876bf5128c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d91f8c4498bd498eff0e05339847b731acfc08d1060e47178a99930a910c6d26c3b39f7eb111a1e53c167476aafefb22", + "result": "valid" + }, + { + "tcId": 533, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0469a5c2c1e816fb0a74baf3c7e4e1e43e39fa81fdff76368463b74f2676e41f7c5adea4ad4537fe2517c3fc61a79329c5c731e929fab4968fab076fcc6a4b1d411645279884bd1d518704f2f3abfe96b5df85fc9753e1417a4c6d19b2a5f3240a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "68f6f1f93cd20bd597d63d64da41b2d9340362bca2a5bfeec0927ad0a33198022b02085ea91da0f882f583c07f2d7ec4", + "result": "valid" + }, + { + "tcId": 534, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042650e8d0b0d42aabdf86f509a57e1f4baec60e53d8ddcd9e15f715877b245f01e2e7dd91cffa4db75ba0631a8ea555c39371b59af9a6b7dde81244846cf7b785eda8dc966f0ffb35154d1bcfae8b16c9704f5972baec9dc84643e9701c131705", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b8551bef5bdffac082508a44cfa16acf4a16a7b78e4989411d58a2d85236e67b52b53195c6db54bab44356b1ddc06e13", + "result": "valid" + }, + { + "tcId": 535, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0486cbb104deaec5c331b2851e5d79c780171ba49e74b76c9f4a2f49214231bb3cb9e7ae6a7abf5921ae1545e10d3814163a290b3881e6b4544bcb28bd73d8cd2480d846dd2a7337cec42d76b322506b22ecb573d1c2bf2caae12a7c431028e2e6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d21246c7d319a619491a7ce7e6925571a4427e02910b63eaaee00dc60af2e49574786e02b0d6a45e1d97f702cb59f948", + "result": "valid" + }, + { + "tcId": 536, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cdab9abe5d1da0f11a4474f8ccf336376331417589f2c667194df29caf4773e90b287ea3de94099f3896af237f4b86839bc5744654580ecdfcb6a745bb4314407f9e43b423bf210ac3acd1214155925d14a21582d47e6fac139a3b2c92bdf792", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0285f15f60f7c814f68915757b5401c654271d75de701494fb0677f98467073363ac9732926dea72fc1428d3256e2f72", + "result": "valid" + }, + { + "tcId": 537, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04031e256764ebaeaafae8cc0447a5ffcf2f01303a971229fc326927bb72b910b0824acd75ed677ad6ff04d440fe1752b9f1648c7920b49e26f8831963906f60ab6cf8393983950f0f49ec4aa0ebfc21585ac663463c576f2a28821c83b5a0fb1c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b1cb35523a1a81d13ecde563e8fbdb8e535237bb7848c756d8679b90dc30c815e96b5a33969bbb377f2aec70cb62f9fb", + "result": "valid" + }, + { + "tcId": 538, + "comment": "point with coordinate x = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04670877eb7029d712b69967716a356b53a663685ce64acb611c5cfbad2f349e58b31b5bb3a6f09bd757387d9e7406965f321d0bb69f7ba58b48b75850d46a897af216ea70e61f95084c09d5dae915efda65bb75ffad3d20d8e3f2e0f1d01637c4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6c8db78d0f12541dfaa98645a8d5fedee8044751288b1d91818f1327904a3faaf4614eed7d960c9add82fe73efb79b60", + "result": "valid" + }, + { + "tcId": 539, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d368a53dd39dfe7a51b99ab088185e564d7eacf8e842c6a3a44f8dea05761452572b2ca9bd9034eeedc08f7c938337be621936c6000dc02ba6631e5979c753439baf7ecdddfd78dee5f5fda12e6bb2c932816ac6339a5474e68cbebdf0107266", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bdbd8cd333f2351d7d046e9af4ee208a3230904a095d1f82a58e9ed60545ff958b21a8f5cbcda47c0dc566a0706839dc", + "result": "valid" + }, + { + "tcId": 540, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042c4069bc8078236eb23a8c4d575bde9b537b13b79989688c40d89d898a8c29bd7ac61745797b7ee55aca60ea7d6c2a84cf030412e75dafb99e1fdac3bc1b841fe6bf17e034d29a5a1afeeee687fa66b53a2da4f39f2187deb8947758cbd5f420", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6ce9bffb8901baa801d1b19e92b5e5f47f5bee10c15fe44b8209977572cc8bd7902ccfc0d7ae98f6b58bb87f316a5792", + "result": "valid" + }, + { + "tcId": 541, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444bc1cb2d42ff974e72bc883dff784e86978501f918eef4d96d6e5242da6f5651a29cf5205c3dc3be33332fa2defc347770770ab612878cdf9cfdf22c03478daea4da1f778ff1c15346da218981612081760f762b061f0b277b967fd6c998092", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c6dd2d372d5a5173ac63f6d5ab5dec972e8ae44d566c7f826beb7f2693e200c470ddedb1c9929c11ed86d135f44c979f", + "result": "valid" + }, + { + "tcId": 542, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b824eb72c43edb5b3ce9af94ebbd33b446b4a7233b89affe1cfa3beb53cd199fb119a356772bfec178c03b077df12f530667ae0414668e0030d6529e45b7b42fa7ffc92355a60bf843775b8e3279d47e5e9c36e4909b9fd4908ec6a74d093d02", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0299b7fc3e5506926fea66d20f65b9791fb6c88c7179f7d4701d68c13427ab56ac0f9e1da96c1d5f3d1a65ff3122c153", + "result": "valid" + }, + { + "tcId": 543, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049270b8cefb61a5d52fbb5e6b3b62361f3afa5d1a6b01419db9266e2dbabab36aea5b1961318eaf8f0bd7cca75ff2df5b81ac739cfed58c08884da1e8c82bb0243d66589d7728434a837b7b38e36449b9cdba0dc5493920cd767bdbc8c4b3fcf6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "13d78b7a4daf8ddd62e347ba235c36486fb2eb4a75a3e17a137ec6c2de37abaf45da92d1cf1b2966ded8d5381fd2319f", + "result": "valid" + }, + { + "tcId": 544, + "comment": "point with coordinate x = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0419e5c28657479eb41d3718f63e0678be0daa58502a5406d65913567df7b86ab25e905ec846789530d81d8d1fc2a8cadeb550ece5f3303865db4377636acdb6117a4b61d5e405ade9801df21d6919b68006feb3d22f5fd50452e0630053c26db2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7b0863fc6d72c4bd058576cff7a4aedf86482d3d9bc9c5fc55bd8fac84107dd0bf9f27d7e8d624edb0aa6ef1b9cc2246", + "result": "valid" + }, + { + "tcId": 545, + "comment": "point with coordinate x = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c7cb6e680d888babb9a66609d9c5b8db13df5b7ee6a9ed522800a3d71b814773d822386d5362d5d2b9a6f76380d705a6145d3155cf6ba275a679630b239a3440073123001ac5618aa95f812e5e71eff891a57d06ff283d3c51c2bffca6820cca", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b341c77879420ad78ef17ff2f4468b25277f134285b0fe5f966b49769c1deac7c06d59ed1a516ef1bc012bf6e124ba86", + "result": "valid" + }, + { + "tcId": 546, + "comment": "point with coordinate x = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ad1aa405e66da6ece1726ef204d58c8da2b0bcda3cb191c0a4defec4d870723797ad1cf97ba68e9e27e87c9f2005674793ae4b655eae0856c9f8042ac9c33e1ab2297b1db93b7ffe83031eddd2659ff82299127f153c54cc4025721d63ca8800", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "58c55fa3ff187925acc8e4974f5d857e3e4e9519c018e3b6e497547e690d7b55afbffe2f54dff04bbfe855fd49317768", + "result": "valid" + }, + { + "tcId": 547, + "comment": "point with coordinate x = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04922365239395d3fb7f8147465458faa0f9805b5745d34ffaf0922683dda0bd26b0f07b11b4e7e99964fec2a497f48a6ce15813017eeea693020cd6667a83b655fe138fa32d76324af7dbbe7b2fabfd5c8779fa8bedebdbaf536d31820b8a7783", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "dd4f2fd94a7be3851dfd5025d068937c8b328604c7bc4229566ff7b5073ca7d9d655d9b388b2d88ce032250c0e2952c7", + "result": "valid" + }, + { + "tcId": 548, + "comment": "point with coordinate x = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049ebf8d313da3e5ba237ee33e6dd5be770390f837c9528fbdd440a9eb2ba1cffb27837d865cbe1b32ff9c7995d5dd511c55beda13da72e7d11808e8c35e2e8ec651ec19f8d53268f45a9092afcb160ba15c94d1378bcb641de970cd450fb065ce", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0deeb01decaae0eee55e2c29501cdd9cf7d4db2f1679fb72efcaa5db6e05cc4a658480245c59fec9984c613501411b0a", + "result": "valid" + }, + { + "tcId": 549, + "comment": "point with coordinate x = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04964b583e54b0262b890055368d73568763be4f4a10c97b96259dcb809aba487b1ff67e93e991c80709d8546c86a3175fb880a55883de56d84bae0d9d1f70b4e8aef0fda888614c73f8b169f8d3adce96d5b897950ac07ceac337544b767f420c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a36d7bf354836bc96acd0b9c9dba7e8ce322eda4c4b969e20b4fe79a61c55ca1c1088b357db49ccffc6955c5f67eac7e", + "result": "valid" + }, + { + "tcId": 550, + "comment": "point with coordinate x = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000036660041b1c7984620e8d7fd7ccdb50cc3ba816da14d41a4d8affaba8488867f0ca5a24f8d42dd7e44b530a27dc5b58da", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "aec62d6b8544c9d6c22711d2d140479829a79c5b0db2f9b13b6f9b2068068c23932b6cd0126fb16393e3dee5bf008324", + "result": "valid" + }, + { + "tcId": 551, + "comment": "point with coordinate x = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0484be04fc5bc9a62621c22bc4449fadede24205d38c9b917cc76975d2df7b57f52a4fbb4806e255d3db61278bde42e498f2825a23796c7a43017b3c756cc24d4a0120b001ce61696231d3bd45e8efeac260c5a35a63f4ff22337cca3c3109c91b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "86dcbce36cf6b0ff17206efa1a80102dffc61845a9844310b743b94d0a9d2984d8363e7ba324ef2c22292996f42036e2", + "result": "valid" + }, + { + "tcId": 552, + "comment": "point with coordinate x = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b03c52329bce1085cd25d1a7478487c7784a6e2c9ca5f37c776f1fe48a81cb637c89b75d588ec1adef2348ded9f32ea26716fc97f7302bcca3b9024882720d155444fbef06fa5e7118c0ffc3e058f7f124243c62e2178fa007353010e13f174a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4a297f2b62a262fb3367563b79c280be7a68eac56660843bcf466c199418294c48bcbbdbf9d63489ff3dc0d84fe1c06f", + "result": "valid" + }, + { + "tcId": 553, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f0428dece48eaaeae58b105677ed87645895361c50eb2db518bd5d83c424bae1d278aa5037bd6ff70aa291b2122272b720e6ec89a5ab4bf9622aea08999e7fd7b6258d79887ed56f984883a353ca2152ab685ef105f3c96f4724d1a22de36dce", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "712b2f6db58d1318af53337395f94920ddd86eb6143ef7c6de83c3a28807e9646706df85d6242fe5d6358d57c271a4bd", + "result": "valid" + }, + { + "tcId": 554, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044277aa577cffd36c744f64bedb33bd0e5d9ba58d46236b2fe804b6f752ef17a54ac45b577101ce0f819fc82c560f021eb8e6bac642e5393e6bdffd3f197f9d64d6339a8ed32c93bb665c332c114920cfb7f8a5d90d6f8626f6e2a4540156b0c7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "749df696874ba3517ad6aba65c43058c08ff06d2a907690d0932f5f91af18a832628b4dbe43fc30992345e6043883350", + "result": "valid" + }, + { + "tcId": 555, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dec6cebdebfd4f333780a1cef49710bd22915e4cd82b1430e60b83afc6ce7b406186826cc260cec97d13f6a016f9113d2004c7eb000e57cc6530d3eab68797909e01c05b61d31d20aa3b6bf382665d143f9a3994a0259f79eed6cbd4cfa04129", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "228b4fab6b96b30a542667dca8aa114fa8124a93c6bb975824bf2c5d962f01eed6040440bb4ecaee57ef3c9dd723f110", + "result": "valid" + }, + { + "tcId": 556, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041b7dbabbd7495eafae67f0c7bbf3b706e4fff0b1c05a301404c349d82ec4f8f1d65cbc7a5f05522b428c0c97a38b0940521221bf50c37378a4a5b5a899204d39c073d26b84d3feea824e1c353a22d5cf99ad6a93cd68bca2b54a1d8523a5b360", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af87b839cc77dfdc3900b7bda4ad98e699903c52d148e6879e23fb3700f7ad9bc515ccc2634bbc8a6e4b9998906c2780", + "result": "valid" + }, + { + "tcId": 557, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ee59771f4a1fa6d445d7e9c5b9abcadf982603a8753a1e80190a6870735ebe55ae8f6b03fb94498b28ec2674aac44f5440b82030ee840bfd2812cf5e6f29eb999e9ce144b8e247e3cd3175e92a08bb90bde5604aa24de8658311d55e7ba422e6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9bc4ad68daa3a08afa6cc4437912746c5b0539d3aff9974b252d1599daf7e872a7537a144f1f52c20bb29e1131d6d6e1", + "result": "valid" + }, + { + "tcId": 558, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04506ed2b75a3bd14cac775d2cc175b2570c126b09098172fc12d173a55d5dbcc58595b0bc2d900fd0e1b1c74ae31596e0d2b54eb80687419a110cef75d72e3e4f3a45e7c7ea31d872731e548e44e1302a39e6923e8530b69435aae5662b3b5c62", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2348999af049dfd14d777c1222a9f15b4e9c270957f398b2964ecf88b8c000d22cf99c0441d7ba7199e11b75081dfec7", + "result": "valid" + }, + { + "tcId": 559, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046a90c2694f8fb502a1ffe1edbe1a9ba0e5ccc5e0ef83b21a5d33f57d6ae543581a8007041307a895ea1c6e6358ddf93b3f88ceef0bd30b084b6dc68f5a7e825e49c1f2653b8c843f29454260cebefa4173b7bf529061383ff7bb05fecb35f0bf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "56999db2fa84ed8b11627026d72549946ebb917a868ee894994d9eaedc5fff52d985310000735015193ec998928470ef", + "result": "valid" + }, + { + "tcId": 560, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043a2734f5c50053c652f2b5928e396fa1868d94f3340083e765e09e829205086096f472f1fe1352683cd7f1c12b5ee6949db26f716a3d22bbba260abea647884e7a3d5611c1e1359f8b4c4499dd75a907ce041f302a2940f8e88b76ec099ace0c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0aba82cc5af63ba1a1bad7923a4951ef20c39292e0db5433ecd1faabdffd8a8bbd4ac577c5dec917355372afbb58fde2", + "result": "valid" + }, + { + "tcId": 561, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042ae538038adc690d105d29aebc4158e655cbe9cebe638ceccd0ffcb38b8bb8c3364ef84d0f0818ff8a11c7308e0f81adee42246c0d7d5a57582a9a40507c0e351e19e4113f881f74cd2aa842f52979f92e8089c47dac254e69cb8ae4f6e3da6a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "69a9f6e65f194e070ecf0d225c053a23fa6c77e534fbd3df45746ff14f84ac78a27f4c0555de0122d1d9e22679b9b902", + "result": "valid" + }, + { + "tcId": 562, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044f19aff67bd9d55e936ca48f607db71d083edddaff96ebb53712ffa655fff57c1ba4894b971e4077a8c3b2eeed6838a8ffde422a460a7f777f20ae6a4ba08bd65aad89af5538e10557ef3a3b28da9612b689e3a280f80397c5e7fed7261d1c7d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e53aaacdcbe8597d113a53ce5237b6c589720717c1811490e9add9d99e1ceff7ba4af7e97c362b75659c7d0f021298ad", + "result": "valid" + }, + { + "tcId": 563, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048dd57c5810c1cf759bc5faaf81938bf9f040b683088cc6f2edbdda3f51ced4f62806146110d449cfca4f4fa6d9d4170b989c0f028091c4397fc07c3749fff12ff813d25fa14105592971082f3796325bb3e6dbaaf81a369cbb6ad86f589b88cb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "515c22f994aca1fede5b155f5964bf0836dbb5e61949f72d65b8d8345a080b2de8e9d27fefaa5d0ea0a59b08be4592cd", + "result": "valid" + }, + { + "tcId": 564, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047610dabea6853a49d659b93ed24f98c7aac85425a948c2b4a152d69b93bf5e10b4dc62f71863df5c14525631dff26d1b1209b0743ec269bd3ade45f1d7cef98296451d0f9a87f29f1bbd4306eddb4724cff49c52d6251650904b4d00e5a67bc4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "fea2f7108417b64c7ad651fffc78f279dceebd9921886b7f2c262171ad09d285210cc66ab9b04fac7b9a7b6efef5272d", + "result": "valid" + }, + { + "tcId": 565, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f0555c6f790a1470a94e6dd36e159f8e5796065d25da9aae08a3a12cae935fe5fe24fb447da299e93338226b52d6f2db858b27a96e320ad261be24553a2c1882dad3424d5f61511bd5b582ea6adc68ea4edd47802439880dfc4773d2c52628b4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7ab70faf35dfb09ccd4681d77da3c93ee4ba4b9c715593ccf4d865551c0b0d33b84c7a6fe9f3325b7ae7a82dd4c26a31", + "result": "valid" + }, + { + "tcId": 566, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04996c75651b279edd4476cc74a3b77bbc7b4deb0dcc9ad93abe9cc0f7755934c7a517609f25e77f78bcafe2604b94fc808f44b081de9088f8e6f7cea806578178efe34ae90a5247fc7ed90498d9d1b3387963fc8d30d88e3967ddabf88001dfb5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6f779d503a8b45462f0cde3130385cb66863160de6dd739e3a1a73723b32a9461a5e5dbb9be991145b60e20a7734e317", + "result": "valid" + }, + { + "tcId": 567, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04087e168b1b16baeb7b6956311b2d212b3289702a61647e02a70c35ce02ae1836f166ea5651ce771f403a2507b51df84b1699df6009e6aa2391b797da0981876ae1a912f2349f70320901619de7b891776e40b398778573f910fb089bdc82c545", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1f549358fad310b8f42c85927342dc46830b6adfba1974082642163adaa48b95aa8bdf69619244f298e535e4deba3f4b", + "result": "valid" + }, + { + "tcId": 568, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04903c9072af602bdec82e8de32cda9bbdd19a9154d1668ee1e07f4bdbca149c7fb423aa240a367a086b904a0bd1ab026f1e2b9b9bef930c0eb22ee29f31ad5f83ff366384ff7217d999d1d18a1f6bb64822e7f7c7aff290cd2801ac92694452cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2ec13936fc52be70a9ebdce885ae7c615c9506c1561d8d6e40c9826d17614113c8ad79cd31b6e4d5350114c4e0c98e99", + "result": "valid" + }, + { + "tcId": 569, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04185ba009d42a23e535a1a01b8c79c4e6bc6e402faab785833bdddadad644b487a2c458b8962313d8534f93b222fc1d5de233703c059dafd0f666876c6206c5d5dfd3af270a4627bde784777f4b793041c4951db17722a75ee3215f0ceb6f40b8", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ec678fd504458e3bcbcc3122810c13ccb4d8fc80f1c4a862063397d06b7615a547157c9598ed16490a92b6179c187b5d", + "result": "valid" + }, + { + "tcId": 570, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04614bd1183e127848023ecabfd4c4ba6bd49fdacb445a7a7f9efdafc362cd666ef72cea58e9c1d304f0dee2fc8a1e9b5025f1834b7f76994fbc2d103bf8263baaa049040b082b25a5a071562224707f17a5c2198ac00720440f055b00bed7e45d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e18f85ad699fc4638b0848bbc5934a38314a8ca575e30a549bf63745804b42d471b0d5528f5f67cdb0c5d11786c117f8", + "result": "valid" + }, + { + "tcId": 571, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043b01bdacde2ba4422937ed2c44cc7ca1f7d0c3785f087c9bd2a1bfaef831147667704ee9b2fcf09a54c908ddc46eb4ee1b641a086ad3b7a3bec26e5495d7c14d877831277c95939dc73bb9064e9bf3ad36df9960d8afd32228a27db7966d9c8c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c025dc95cb126903c6c37070288ac0e72fdf5a2fbcd4fb86542c52c31b57261574f55ee23d984605b341306b19514344", + "result": "valid" + }, + { + "tcId": 572, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041993fdb71e8c9cf8d634394b3e3a070b9d2e48f890a133ee5181e5ef2309de87014716ab7cc362b3ab18a13c4ca7bc8b34345e32880060e2c9910f81438b6b98b25426455e29ac068b1c7897781e32204709a1b3d145a8c66936d25a4043f302", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e9cad77fec300e9932a009403e21534ccfc59c7f4cccbb7231708a2a61ec15ebdc3c600c029d81d9221f308d01715c09", + "result": "valid" + }, + { + "tcId": 573, + "comment": "point with coordinate x = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041429c695674f4ac245cb54c4056ffb4d7b1b296c38714e10b056063f7173b49001e1ad4c3e240984fd4aff46cfaa82d088957fe0ee43a768251bd4de9cd67cae5f465a909692d9e7cbc498bbbe1d90e2389b48a69cbcd3287d45b174621a84d2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "35b60a52cf3b29ad5fdc3fec1249b7ae7f2f48522b1688b65826d379920986791056fdd7684a10dbab715589094d11c8", + "result": "valid" + }, + { + "tcId": 574, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049d5fe82ef8a0b941e209d6fd927ae76e70f60980484c78e9e7a9e2c6b18d16d5b2006212fe145e0b836af67d0689fc55156eae9000cd9d013bdea880c9d11ee7c7a6c75556a36a24726cc3f127a34db21a0559835ee6713acdd29d4e3976d1e0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "602d453cd2ae2f18ded2bab5343c0c90cb6c5c9314c5c62c64513b49f64392189d424d5babd91d0a1f809a9ba4f6abcd", + "result": "valid" + }, + { + "tcId": 575, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047567143dcd3d1c6e086ed9ebf4e75db38a1c05d6d54fb3da61e2cc225f2c6e489544b9e47d650f6ba69b4e5dc58a89b9bd8bb460873d183882792884882387f28c3775d087de2c6beeb5a7e6ceaff08b8300d709ea21a9ccbd1827336edb9488", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8d0fe8f13a94b7be250dc636c004c949ce35d72eb9ee78a746c83469bc353a0a0bc3cff3c292eec5d74fdc083dcc5d32", + "result": "valid" + }, + { + "tcId": 576, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04154f62c67eb8be22f5dfb822d5ad0f4c023dcaf3baef95ce914cf675bc6f793482e18d2ec79b07cc512f1072089fd774bbebaaf3a5ee8db1ec1eafa201d47a09398f222a2edb3dd13b4ded263171bc08959c431bd321c8c1b064992af4213179", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "583004dd974bc9ede0a525200c90cde3e46e121b299c15ed7e9f90c520009ce24c479e7d3a2ea80b66dbbcdfda64b603", + "result": "valid" + }, + { + "tcId": 577, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046f3b68c27721b320fcaf45f3c16be6218067e196ea5505020a1ff07a41988e3b22dfbd20f377e6addc6d1baf3f94acda4f1dd0800e95c04007619b8bd85e2fb82a3f0ad3a868b3f0aaddf93cf635afac39cfc1b2368a68fdc7d2cb54cf2768ed", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "454bb7f33af2367f9ee21485a55e61faad18e10c37362a8c517804fce404bc75802ee43c1d99023caf429fddbcb3cc8c", + "result": "valid" + }, + { + "tcId": 578, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f1cb88a29714513da149fc3c7abba6862adf17a7fa7edbd86d85ead3254bd2571f2344a411a00296f2d3fb92496580dfe5534b307fd5025a3811da15ad8f3688be12b0a08c4383e3e771d15128689567b835ec555df8183446faad177ee66b99", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "15b3562e773ff1524ff69a15db5304cbdbcf6799c3cda0e96f64e5490bb15e3bcb9ecf623d4be9b0d4a8d059ec541844", + "result": "valid" + }, + { + "tcId": 579, + "comment": "point with coordinate x = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047dc1228f3440c5f1849d57449ed4bf3504e8d33962380917281d4993ebe3d686beb7fbd41fda8d41a92db86827916e7903da89654fed5d874c0aef32024163bc23de0cec97f4cfdbdfec495d0568c0fbb0c57c877800cd347b4811ea38daae28", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5183a281319ba19e916c1128e02e81fd96017cf1954b91b8348ed0c224794c7fb702ab98276321e924edd2ec9cb457d4", + "result": "valid" + }, + { + "tcId": 580, + "comment": "point with coordinate x = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041f61487f10abd759778e3dc723fb4d1510a6955a0a40b0f5a8f850050fb920382c180484794e77a909f269a7cee01bd54ffefe1ab55c7953d8c83f7d9bb28ed51e94e7e2525ebd212c804e82ead4fa024300afeef9b339cad5b6eaab88a80774", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "62670cffe31d4c38b9056c28c069fc676d7eb0a38e840ff8e8d09cae2bf8412bbb37f69cb31d6baa69bd17c39900dce5", + "result": "valid" + }, + { + "tcId": 581, + "comment": "point with coordinate x = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c4939b53015c969d943ba448eadc8c51b4c489bb6cfabeea131d173123d0014cf93391afb59ee0ca611e52d26c50c2cf689bd7d6c090d8c48bedb9c7b6388dbd028ef80ef47e91eb8b52233990734c60b7864f208a38ed2bfc2b38d5b2d08306", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a1497d6cafe9e99313418b90e00f98b33027e898b95776a7340db898bc0f9f42bf46838878f48a6c8c660d1ec1e069dc", + "result": "valid" + }, + { + "tcId": 582, + "comment": "point with coordinate x = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bb07bf6b65ef99dcd6996c0675ae0e30919ee278b06424456a76309605329af753175760ea51979bcdc73e881c445b01ee7035dad3d9347d89b44cb2d94fadb11969fd62997fec83859849388edd44e0214603cb73e5873d57ad4448f820c965", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a164a1b7aaf34aac8f725c92098ebbe31c417fde051a8c22a60786438412ea9562d6683f8a5a0832ed2978b077346247", + "result": "valid" + }, + { + "tcId": 583, + "comment": "point with coordinate x = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0458a00997e4f576c9dfff78a951b245b48195e7a6340cc323b8c12e0f3f05602d0d9123b4a6813c519fe6a197abb0b28a45db31be52cd443d363231d565af0049f21d7117c916f40989c5b8b7c922f0d31674f9ee91c954ee800dec55c5f061c1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9179bc3de7e24fc50cce2de7ef53a905d75c5f558550d10ef9744265b4d12469af1b5492a911a63cbdbf575080cb53e9", + "result": "valid" + }, + { + "tcId": 584, + "comment": "point with coordinate x = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0402e2347f4f1e61ae916772172f0e6dfbe09923894af822c73b03022a594d3e7457fc5bb5c8a22b5cea66f13579e8ff28a39c61aed4e36107cf28f24ece4117dea11f50131e3b3a08faa8302119865fc130c7e2b44668a87ca1e87403440b244e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2d91c2abcfd47da880c51dadb9af6d97263833b68c3449de9e11d511aa1adaa39b0f7b09416d892786db182b69550304", + "result": "valid" + }, + { + "tcId": 585, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042261b2bf605c22f2f3aef6338719b2c486388ad5240719a5257315969ef01ba27f0a104c89704773a81fdabee6ab5c78000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c923fb0d4b24e996e5e0d5df151d3c26b1f61c05b17b7fb39fc8590b47eeaff34709f6f7328923bdcaf7e8e413d77ddc", + "result": "valid" + }, + { + "tcId": 586, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d39c38aafa095233ef1af8c0f4aaf357dd684131b4ac58a534f3d9446196b60092072dc7e538106b7b2e66dc33cac7283a1b203fca47828e6f7a09af645af0f729802ca2f4000c4b9773b08c5af40e201a27493ab3eba9cad7da157f89f14a2c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af3904f83b9a0e95ee0b86b06155993ae598d14898366e5dcfc643de9d5ab72fc5fbef17d0a8fb36ebfddce46e5d4455", + "result": "valid" + }, + { + "tcId": 587, + "comment": "point with coordinate y = 1", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0486da578567788ea3cc0f2a9da8d1393ed3a4447a75c18ea86af9d84b0cacc3b03749199890ef8e5d3188d4f1d041d46e433acd5d9f5542439eb2384ec1de0847d056058ea92489a74e083ffd6e030d060fad674f6a2a9a7c2198b8be9e465bae", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1124bedd4c538ae71293085f2c95cf6b13cfe741f21d62c1f02a1e911667d5348b16d8afb544021acdc3cb7448d4d358", + "result": "valid" + }, + { + "tcId": 588, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04111447d242f6b421ca91f561d04b2f1d2f0d9212d918bb4a0ffb1ae6459d078e21a312b2a12594fc8c78fe944c81d513d3c981d5e9cda06c4380d1a842ca5bb51ed3a712b049dda3a50ce10a9fbd0b69dfffaff0787c74d83237ba9c4686a01e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "69426158a29971ef44b11783ef559ef4297246611c994d4815637128869d5f6a0202632fe9b5ad7c365b63050c9f2d08", + "result": "valid" + }, + { + "tcId": 589, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d7cd5024c4481e27d1653566152efba3284b50ba2a141b2643ffda18f300fa64b81b234b8f646cab4728b4e7a97024d76850aec0a2d131c6acd5b298b6f905cdba18e68564bc31f882fed51b28786a2e72f8812668c976f9ddc042695595fc6f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6597401c837fb498ef0780a382decd4a0dd580e1af5f24c44ac164e256a4884ad5bd2fb1f6c964682cb0bf79e2c7a6c6", + "result": "valid" + }, + { + "tcId": 590, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e31487548037c0423e5710fc60e746ab6e47352561e416b583123a6d45caa911762cd88a60bce57b29a2ec1a1dc97fc1bd4b604038e6ac016dbdd48f0e6bd9f4b5daad8d68fc28838c6ab4a4eb5ab0eaea2cbdefa61dc57a3e04ae71242938b6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "89411d9c8149b951fa0d5bea1e141bdfc2be7ed56d5e61473935789016bfd2daf6a40ac7bf5b1b0c0c02cd3aa0b2d95f", + "result": "valid" + }, + { + "tcId": 591, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041e17e173d37ab9838283f84f24a0a25caaa60c411fbfea582c44f8fba2560ece028cbe397b0eda69fc872d80d9ebe065789c0723eafcc9e9a2bad431b11caf7c5d7598ca999074056ba808a5d07977c678f9534de152ffdaca3f63cba3f97894", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6f0aa11ab74ae5034e231ef2630bc76cda6eed26325d123642fce6a950b50f904bc0269f8f589bc4d38107332b14da84", + "result": "valid" + }, + { + "tcId": 592, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0476efcc8322f0af8d62e736a0e110f66b3aad5c87bf7a77333fce864f4ba6e8dfdc16d6add2c542c4805589a71f0e48a3c268feab02714c892f826622b25bd21ce2a33514b16c9ee84c722b523b19ec5fc34d874133080e158981849355e1f50d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7eb9962e0449ccd2e60b4f8094d5a7b461d0d4b06af0ba306b74ab0d60ad5cf894fbfc282ac8dca3da196d7a296baa14", + "result": "valid" + }, + { + "tcId": 593, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c147d6c235d740b388e6d2afafcf85d5b7166e0df4ea21294088e3049b5c27d7633c93d30fdcf2b9375e1814f51b57bbefb2c12575c2234ee1f6b147b2e04c104a4d2b29cd8458f59b57bff75cab9b6acbe854fc4d96fb73372d6054bb768390", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "790295bed69f5347ecaae9befe15cd3499759cdfbe51974b1f1c4bc576e7d881cefa93d5e8bf2c21ebb982698e1c7aeb", + "result": "valid" + }, + { + "tcId": 594, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04849c98fff5e31b108aefb16cc5cf5c7e88439d8b3ef188f2a5bc53f30901dedfe294abb38fb8cb46547a23cfe47909d656449f8a09aa88f8e260598ea2772df74d26a4431a03785934373be7b0ec9187b8215965761723e79591176960eac014", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "58a11a17c4ada4d446c08b83aa05687fee8fd6e78303648b8583262197f87be97dbe0bbd274e444a384e221696530fc9", + "result": "valid" + }, + { + "tcId": 595, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0457cf645578dd242c714d100dd23568b16d3745da809708d01eb6a7168e6f71dec2074c5a6c23bd05523dfccc97dea6f08da195daa2056da0576bbc0ffb5e73bbdad03b04d23b4b602451a5ba91b17dce302f4ad164c6a4a2b58e3f0253a5e9d6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9260483a165690d54c10cb867a9f896bbd123d4768a18d322300d420aac88ae20f188b57f8e97afad55ebb815728f49a", + "result": "valid" + }, + { + "tcId": 596, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cab2d9d36c8ec09f18baa0abb521372a5cc2f624848f95460a8615238e68c11c1b43d22b84d1e535ec1d85560de293ce1fd5e6e7ac7eb6f173ad27b63985fcc83b9532aa56f2b59b53a9d116098fda9aba49d57c1eed0f063bcc701bb10f6c2b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b4679af80a2ad34ef86eacf2c2191556bc0240c7913fb14c4c1f8623b5db41b854d630dc65738d1faf544aa42979aed0", + "result": "valid" + }, + { + "tcId": 597, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d71df4095c138523340a4010cfa976b3b27af48ca83e8c6bb4596f9f8e8f13e38de4e25ce1d379b41a95f9d7f8a84606b28c69704b68788eb6a35c8bcaa7d9718e00c9bc567acdc458b6732aa87041d27b6a574d51e95437855bdc86748c5cac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8a34de8beb884364b583c9cbce390969967cc2a50090ee132acbd49bf780ad7f092ae3ebd4686a70ba554efdd6acd4ed", + "result": "valid" + }, + { + "tcId": 598, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a5761775850a25985a32430442d660aadf9e1e388b57e6e1bfe41495b9a05a8240f77f3397c5cdb0c83d73945984abedd2c7cfa5d5d91738c6577646658c0448f0155b5bf839575a36d1b26d87d1b2b3afb4f68653a6bfa5edfc57aa8529e622", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "790dfcff4721ef1701e3ff521e4221be51ae242f95166b9292c7aa2fa3c9b799afd353987a535690ff20d66f578f38fc", + "result": "valid" + }, + { + "tcId": 599, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0454fc2f89cde6f6e86b6cf3286198f9a9e33c8d662c2151205ddcff12e2d32fa891eec2359bc07224d64c5e339ff9d58918a3b79372d142fb341df3b15b54b30e8f956b079b1278276a33b4d8508920940ca63fb8e970ff98f91ecc7986275edb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cb861053c1d685194ea58413d8f9981e07145bc573ba924bdba2e29c5f98e9e70ea0cd0412d6c387449e9ae767dc4330", + "result": "valid" + }, + { + "tcId": 600, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bfbf3fab1acb39ce28f063d78cf250772bd00bdca98b769e1f1fd442b77f4270106a5f7d913c1905bea0dc75b31f87a115c566dbff0cd1073325450a91096fe5f5d601a636407cfbc4f5720f396fa6cb16987370ce70e29bb7ed2f447425f10a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "375ffb90ad6c518668e5d25941acd5f9c017346d06f893cf95752258bcc5f9a25996a80f42e0475a80443dc4197bba6c", + "result": "valid" + }, + { + "tcId": 601, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045757577480f32aedac6e19765f9197cc278cb0b1a21fc6b6423c8f6c6cdea1d324c93eea8bd7dcca8fd293d69876524360b1a4825522acd833d38dbd61508547358a2f5c281b496abd57072ab14f9a2235bca02545e0427526bc2bbc9268349f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d1a02a264ab15aef52a534eb5000e2943d8cf1f77255a27f845e96e1f81df47ee903c3e921539d77d72f55b7efc9dfbb", + "result": "valid" + }, + { + "tcId": 602, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041452f5eafbb5cc563f2c7ca403b803f6f8d66479062508a2258a8d988a769b80e077735b45efab1f297ceebd74347f584f2badbca55457404866baefabfa99b70fbf105d17f352347f6799647448708f788f8a145bdd96d4af2d7e654be7e5f1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ccaa37769d035170bb5c19c135da2291446efd7ecd3be9008612b8ccc29f6e9d7a45dd4e0479123f03e7e304f34729e9", + "result": "valid" + }, + { + "tcId": 603, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ad27a365e4b6994c5ed135fc4794d73eb71ec26d787fec10f1382b19c1b5cd1d672999feee86d5f305516d601fd1c6aaf8664858988f02f36c888f71872007870bb32654aa75530fc3b7a235f7fd2bcd815e303445526960f6ffcdd61d2d1340", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4ae94d3eda5839f4b8b9ffe6d510144cf28bde98581e82726f2d76d933919adab71d2cdf4c4310f8abcc74d70eba3a33", + "result": "valid" + }, + { + "tcId": 604, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04733041f3a60468bc0711d5a5073a71ef6062d0ae70706af51316033580cae058fc4ac99ebba823b19f48f309e34fb02933670dcc75ed47744771f60238ccebcddccd42d64e41045fd8ebc35bbae0a37b43388ddb87356cbb525a13d57f47a2cd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "062b8a968e45435c2b5b54b417f55e89f935b66dec44882c06ab8d6cda8dcfb553a78361d382a9211191871e9a34220f", + "result": "valid" + }, + { + "tcId": 605, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0481885804ee931988cff3f218c9af1429573ccf8c8f3df40c698d976e8bc7c12881953445ddc4f1902b2f2f3153304e82d7094b673b76beebfa5d84c49b01ce168c459201cb8192ef96d891010e4bc88f0acc4fbb40ad61966e787b9a298a2bba", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ba41c38d33b2ae342797ee69723f042a71dd7fb15f3dc80dae403d4f88acae28e2e51f2ca9d52b4aa4e2b3e58257e24d", + "result": "valid" + }, + { + "tcId": 606, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04167915d962a405f8d04d6d6494270d883fe7594e9a21f7b57715750f8d78ec0714f0fb85a9fe5aee4e6d10344e4b12f91f00441c8bf567ff84e6ee4298b9d3392c78fb32461958102e1d29d2f4c4732104242cc4bfee22aa8f4a172aa510ac88", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c6af4eae5999e0d0658505cb4b395e9d73592a3d9d0b3c07caeb2bef1b03ca4d603b33e6f6bbd90f9416c4aa0022e584", + "result": "valid" + }, + { + "tcId": 607, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0466e1fe893f72ffea5e24ea5a4f0d6558fdbd3222dba6e3340753c82979ac59530dbd37fac2f51355465d56afe1de582beaca9104ad269b0f848d8b4d71182afc30129147369a74193ddf4ddb3b6ff128f94168ce0bc60e7791b4b1ca2e29431b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9e364adcb72b15a42cbd6fa79114889e22b93b533b0119afd90914b181128151b8a17db49004ec39ad5db5603fb9711d", + "result": "valid" + }, + { + "tcId": 608, + "comment": "point with coordinate y = 1 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0462ebaabff2a07a852af9aab8126e93c31109e893cc61b354a72a1744cb409a02cec6e6195845957a53bde97dec7a87c25ea11b003a694e371c2be1cf5db5b7fba278f6968f54c5fb6677987bbb6b55dd9072e8325b365c25262c5024f68b2e5b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "23104806dbd85f71d8fc38101b0cd0bbcd60331d8f74869f0643116ac362b5e933db8743ff80dfcc2df5cbcbf027185e", + "result": "valid" + }, + { + "tcId": 609, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04276a5a274b46a0a36f811cf64bc7a644d5ad9c124be002a6fdd1cc111880655c8d2987674ea49e7d70d2a0ae820d1a7d4ec3bae2dd1d77af082fabcd68ac20f209e8fa446478794223be1d63d71987e964e45f0bcf6a2ea0a12c633445285a46", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "283502355b21189f7361e89457550974f86ae2b66d025506899c15b390da248e14fd1b4f25c8584d1a71e7f8c93fa976", + "result": "valid" + }, + { + "tcId": 610, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0498fee314cfb3c01cc2d9fd7c2568336027840008bcfbfc8292421ed6b0727fa20b7002a5726a685d44963ad8f74c695da25a542b8e0bb9a4858be64f70800da93af6776bb795bb169f4c9d151795f3a5a37a3c82264cf6870c4ded684a71269b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9044be70566664ed91dab85aa5ff644d7a346810d2678d27751917c3820c4c825034b78a957b8fd1d47e86e67e5ba9f8", + "result": "valid" + }, + { + "tcId": 611, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d16d0b11d0a326bb2725b3c9cd598746af11924f6172ce53b19a942b965562c2a2875fd15ce1f4869156d5cf08780c74d4c4927ca175b5327c9f321cd2a7b1acb58fce351160daea5d5c64d76d38d3ab17f7c1432093ad4d620053f6f675864a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1fa4c8e6dec89088a8fe725530f5c154672e84488baaf70a08b2e96565962653577402161424294b7f377208fc936139", + "result": "valid" + }, + { + "tcId": 612, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0410526e3b097a99ea507ba6795ea1f77718690460117bfac9ed95bee311db5f8a1a2767c134b19db3c387a1fb45be7029312c75d7bbeeee48bc15b55dfb716511c5634d719d26903bcace1c60a8e030496156d9ccac97cac724e093574ae4bc83", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "04f4029d372332b4b226c9f32521ea39a58b655d24e35190ce04d58f0c04814be7f6ffcb8a4a15134224134f029eda9f", + "result": "valid" + }, + { + "tcId": 613, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e632cb201288b643f235533c44846b11a28740ee4137a22cff7f542054d6337f46363849c8310e20d8b29baddb3109ff948d42ae959c3ae143d4f02d268726bc2b66bafed7657b1a53e23eed48094c5ca8d28d16121aa6237d8150ad6c326655", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f41f912165827cea27ab8147a46abeb30c1bc73cfe0520d7d8698df8f9529afe26eac707340f38b49ec5e741d646b9a7", + "result": "valid" + }, + { + "tcId": 614, + "comment": "point with coordinate y = 1 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04088330380613adb0b8e531649809fbea340edbdf598af028e74ba0b4f18e2d50118531b9a92b07753b2c13ceb87d3c8e38e625b500f4b9bd2dc781892fff96d89271909d3e561a63e415467d6d455d0a4c19c36f16dcc2417a3425c2adda9034", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6e437e26316eb2596400d8fdda5be90caa94d62c425f27df5ca67898a8ffdf3cde577c4d2d66f6522498f0b295d77a2e", + "result": "valid" + }, + { + "tcId": 615, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d9a9d1e0aacaef4aecf241d690ee4101df74d7a37f18ce3181128f8d4255cd34702b17f116b2506cb8f577d9357e3629966e62e6f95c9eb7833ccc1f22956a1e2599a875f8139d9a2b31e2000611b4d6db1d23e7f0db5b5c17bb44e150ea2695", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "854772b9b77d4687571f1934061dbce0016d47b90a8b5d38229475c213cd5df25f960b775ae72909cccc5ba14dd03448", + "result": "valid" + }, + { + "tcId": 616, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04535d22f39c8a5591e7a1deef7a6c34965fb5d1e616f14bb12a7e6310d520350f2f75836f9c8189ec4503ef74a0b850d4abb05ab1e5c6061884d1eff3d2be78c76759b986dde70552aa1e97bc014f333c0d5af8b46d61e1ae06774e2f86267312", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "037d459a54fe6b69d893f4d3094a5e0a93251d5254cef5b022e7065fdf52e3be8127f2ae2e336e261a71f6e41aacb2e1", + "result": "valid" + }, + { + "tcId": 617, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0489402a143d57ec585aee1243d3a7adfa87eb80c60bd09cbb56b64eb0a1b7f5927318d8573c6239c6feeaa58dc2ae2e40d605189ac4a66bd6b9e708bdbccc4647543c0dd1d3c64a2c160c32f729f2b15dd95852c9b207508651d7746395a5a490", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e8d03dffead2e40ea915db4c9c67abb45aa60992422b70374239caf58b96f86716600c1cc4449362dc56ca057bfc5e5e", + "result": "valid" + }, + { + "tcId": 618, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c2a9c52a5936910c05c4144315127bf662c292b8f0681811c2bf8f4f9cc5bd7ab693f7cbddb5724e7e29dd023d155ffd335e8b872ae1b7a91293ae9cc8f654f05ff4767db208b76c73b6b34c5626512e6ba92bcc937c9bcca9447dbec22ff106", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e820f997928a71186ce09b96923c317cc128cb761c87e97073a851610ca12f219937938789bd227a8d72b2b406c471fd", + "result": "valid" + }, + { + "tcId": 619, + "comment": "point with coordinate y = 1 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dcd0224ad2219dc3af05eea5d27974a75fb1960d0d721c39f107bf45346220994e520ca5a646701e9319ceb08017a302e0b1bee292cd1cb99f145ead3d12285903b1e549fcce7591a101a1675fb9b6e30e678037f4d58d220c1e36a4e79f883c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0aed8ac7d04af070b73a03f37ef711296db8ac64bab13e15418df6373aad81d8e0fa789b9292933d7f11b8614076e074", + "result": "valid" + }, + { + "tcId": 620, + "comment": "point with coordinate y = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04742b1363c46dbf7b0856f75f64c464dcbe246ff7966c1498faa711c4cf9c00f1e800d93cc04a3455923800cf11c812f4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "abe3cccf507d0537ba0d383492f9e754ff4c6ea73c53a4f97beedf1052e5be0474f364159e1abed97f043cfc22647c45", + "result": "valid" + }, + { + "tcId": 621, + "comment": "point with coordinate y = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b1fe3827e00682e85fbd7d7dcbe54677b4e5797c66082db4b089fe9d1186c7af5bc1c8e3cdcf89bc80df8900af88398b212143cb9a7febc91f945608380b5a84719e1faab17d788ce0c7ff5ed77a08e2ffe1a0cdd390811deaaf6ced77c07a60", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b99f00f5ff782b9bd3641fce232836c3a760cd169fc00321c8e21b11fdccbe1a4014223d0ad3b1b0cd47b4b233c910c8", + "result": "valid" + }, + { + "tcId": 622, + "comment": "point with coordinate y = 2", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04030d90967b90736454a7eb43912c17bdbf5f8d09e7ab845d449fc3414c1246cda72846bee91edebb19a032961cc79fe93528ffb79992baab0492d3daa9c4e3a68fd1a0a96651c74842ab2888fdd57ac7a77d27a9cb32a7f54fdf2a869dca4e44", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ab148aaf946247c73247bead86af85c51b1884fafada6a1377515956a18f5fdaf93d6e1e113ed9ac04dfe03fc01488ae", + "result": "valid" + }, + { + "tcId": 623, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04144b6c2552d496325b285de190257082189d620a0baa936b1c99a5600c6ec1285f03b8dba76a9e2536fddd45a76c04daa5a30cef6687ea4942522f6ff2c1133e712416282748c67146205b603fed9619dcb00a23dbc8ed8a4a087ac4004a7f01", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2f8762b460f3d265625225cc0e3c6514b2465970e63234eb4f57718ad83ad1986f59b146c34326dec811e3c947a7192e", + "result": "valid" + }, + { + "tcId": 624, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a403dc99a51fbe0a7cdc35c762cd5dcfa57c52c406f6460b36aad36528f62f9c7f81f478ba057d0270dc40f38b05b38ebdde0364bc99faa67076eab79c1f27e90bccc8bf366111aadad42b4d89ef00c7a31aff8637a6a630a78d199b2e546e16", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4ae7ffab54f1ed22bd238902a5e5334f50b6b68fd40693f6190e47e3a7fd1a2e7542bbbe545ce10b9c321417ee6ecc37", + "result": "valid" + }, + { + "tcId": 625, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04259294fc5dca42584a11fdfea0e78a36026137a11c3d77db4a1cca61732f607fbcbbf46eead54df42718f45a67f01747d50a83618e4e2341358f9dfa8c9aa891897c81e50d32d9225759c12ef8b01cf7d00583037cbd1b6656d2e4359ff72025", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0a261c6332d37bc4df00a98092a216b28b4dfbeff7901b7f6fc4574cee1c71dc2fea7638038ccd549ec56e3296d7fb45", + "result": "valid" + }, + { + "tcId": 626, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c08378c18c2c222691486286bfa13cee24967c64f86016122d134fc781e9e6789c5fcb441ca76a26410a32a1c79cff7e14a2cbe45126271a3c46a87e82bb4a658e93bae6b60d598d41078b6b5e949efa39004f8a885235efcc3731670a21d4f5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d9904211cc4f73d904e81a22226d40437275dbe4ec2357ebbcf859a223eb72f84bac2a535c78649007aee114c7ec74f1", + "result": "valid" + }, + { + "tcId": 627, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c8a3e43f125b416239f063ed60a923a3e544d248fe9a23122a487fd857ec2f0d4c193a69b51428df6176d18f5b82b5722f9eb6891698fab365c36593bf765c8e61708ae67a54fd46d013fb653058e84076347424ede426c977178091d1f6dc62", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b148223bf31d87b4be8eeb18e5de2296e6738329409fa1f63aab24bba13e092ec370b7245bfcbba81d2378b565c215d0", + "result": "valid" + }, + { + "tcId": 628, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047f86ebdd06db5545a7da7f68b03b8da4057864780c504072b4ebeea80ec28a3dabde9a1a96998b3073067d7add3947a4865ca0926a9b504c1f896d369d2238dfd11129b14f49d970c5957dbb91826a40ecb00d1b685ce54f1eb262c510cdcc74", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d8305221d4448778713b4a28e402833d8ab6cee6d7112a13b9d28923456a96f2236951c53b7d856f1f3d2d83110ca2d5", + "result": "valid" + }, + { + "tcId": 629, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e86dcfbfd1b8a49509658a20f063f46f7c3709a077366a041d53550338174d3223c329d96dca2e580dbf3e8bc727dda3bf8d57316105654c56f1cbf65beed69f8e824e33ef8380381e17b9df3de680f0c03be9fca7199999a73acd5f8f8c3ca7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "136d36d795d522c9d0173f62e5eb63585c1c7a2115b487edcb81934f9912f72d48a6ef60e1fa3162b5ea7917a88a97d4", + "result": "valid" + }, + { + "tcId": 630, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0453c906afb711da747d8672cbaebb8b75fc1c1069dcb1bf4edd4b96404f8587b2bada67dae8a2f40ffb2b3db5bde5a15f86b9226087f0747a807aeaa741f0edfdb013431981621a7223da1689c5676b49e8004dff1f92f7cdccbce0de965584fd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af6805ac65bf8c32c95be276aff4023c544b2a4a39f139c2895f745d14bc9da60a3aefad7066d7227a044005890f9b03", + "result": "valid" + }, + { + "tcId": 631, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0440243650fd683f6cc917835046ea43a69f4adcb4c377abacd9315a15ad1af218a37ddb38925f3be92780f4697ab3ce897548ee09dde2cf7e1eb0ee81b8676e9fbc7a217e383501f8400dbcb8ec1f6891a15ee71035187ed5fdda5ba65d363e5f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8262a467164e27cb60401196992629e6cc533e3969a17cbe515a8970188895e2ba1b5498a75e6f74729c180f915aff28", + "result": "valid" + }, + { + "tcId": 632, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0463295e47d94469a48ee313ed6d8f2bec02021c3b73229fd3ac4fd23073fbeafc4c1de26156efbd1682a27a44a9fc67e52a9298f1460d1e7af2c9bef2d6ecc9e6b99ee0a8fb6a9c9028c51e5404cb260d1dfb3d70bd6c76a8ff17929908d59a18", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3c91b821ddf02543a96ec3fa4bff05e044c49a8eff4ef1c28f56d91d2455db7a26772238e171aac9bac9606d20def8df", + "result": "valid" + }, + { + "tcId": 633, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047e3da07e7be52eb8c9c5d7f98ea340941ca69ba36f94568a193936a256920dc8401b12b5108feb5d874d8039d8e95075e179ee86b8cee2d17132c185960fb4bf15dc7b9d788baa395f458ab3cc2c61958fa973373cb27b8b0ed88afa04847041", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5464ce4a94809fec1c041070843539aa785beb52774bd48bfc5d0cb9781093a4a9ccb6efb087a5532f8284c75adeccc8", + "result": "valid" + }, + { + "tcId": 634, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0448daa1baf2260e9f2779eb640b938a745fb3422d292af077a75019d87a43bfe1e1a95b7459cb9c180761893c530b1a1903064f3031636052bc317de3f9d41f3bd5f14cdb2c74abf062e8fd2e26edaaabb33b950bd71a1c7708d065ab673dbd9f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3a4be7ae78691fe6ea16012205011028ac1ff2f0d8bd20b27a0cb8c702d537f71d144a626e030d94d4fab1e5666f368b", + "result": "valid" + }, + { + "tcId": 635, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a506fddca75c3340faa8029ae0aadb592f22bba385121aa774009826d9ed1bd0c63bec8080ec590d46e41960b7e21f593f409c6d82a12988f250a1a14f637b0930dd8e9b8c64cc3a53169daaf9a72dbe44f63991288f4c05fe064f9f086b5414", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8632a0dda8bf369b4f26fd28e3b200264a5646fdeaed1ee87438006f441140b1020f4766f760059ff68fcb8fdddf5508", + "result": "valid" + }, + { + "tcId": 636, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04abf9b76342bf67b65c5c92818dd0f8b22a013b08a129c60cafa2711693f6433efab3a00eac1daf5e7fc01c274a9d3ef40f36eeeff7df050b89d2a33081bdb2548792410fdc1bdbeb3a29ca968e44b0384ab7c38b0ff679ef96b96364575f1915", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6b9e72fe941c2f8e023fcfd0ef463ce59d023cbc6ab21660b3062622a855052e6324d48897db525b3b5c46816b7192ab", + "result": "valid" + }, + { + "tcId": 637, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cac36a2ade8e459d4333484ba1536bb0e91e17070fb1b93c5e9602826bc951d68d92e98836e02e284fec977131224aa7abfc4d7c4f6ff98b35d66a0dfb1d5b19a96a4a4e9522a8f7b5ab157eeb38c656ecb1bd06c4cff97e4dc5c2a8bc642229", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a9b02afa37898d76aee1d271fabb7de50383cb7a4322c39e74b9d0201193fe5f99cad0f129aa957aae74a4e220379811", + "result": "valid" + }, + { + "tcId": 638, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044ddcb9d9bb8c78ec2e831271014bf5c8d7a38dbadd6851b98638873833bf23c68ea7896aa5278e2210d70255b7460e7ed4c6ce1e4b85afe2e22b671df587bc3352f05f369845a4eed5c4d5fd5148771b247a1525c41852f72ea809b2726aee00", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ddcd8745ce37bc7db5cf275e7901b00b610f45c02dfab15d5b15f329f2de18a0a4e9b55bab48e9a1d3949ef4ab1d9d80", + "result": "valid" + }, + { + "tcId": 639, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047320af1dd6a8bdcbe6adaf38202afee8d658f39b500c6b73fa6d86714077b4c90f2c28d79a49dbc6fa746b3484bc157098e8c8415a76d06842b08b82fba2495d3e9a76d022d423e293edaef3e1e323f1c5c7f5b54abd6ea2b37b529ba46daec3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6bc5507d07717d08d19e5ea5696fb6b2f6584c4a0d06130e292335d662c2174a9f09af91bd53a7092974a789afe93d4f", + "result": "valid" + }, + { + "tcId": 640, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04161629a960ba3c0b32e31323e49b357f5f2361b099796f220e66da0f15b9c3319ac8cf0a406d3c6dff7b2583a73e040116b6ae0d58e9fae2394364d2b6d878caf3d7ee0a18417b78c92f302a363fc6da4f609a134d9c42f1d188373b52c4720b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c9e44833638af4636775eef64b9c2ed7f56e3e5727cdd053be782f853f525f806f9054ce67d7a97359c8dfa10a30b244", + "result": "valid" + }, + { + "tcId": 641, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04227ca14b587bc0651084b9805ac7bba49778f99fd43ddffaf743702219b39e9e2699603d38eb4000e7e85fda388cd745a1f029b79ec20c739d6e560498aa82053d38a9992eb779788ecfdd219f5ed5604ec2aaac9edefb2ba7cf4b14bc6a0b7d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c3f19595b6c9a3be4fb8573aa3e84474d7b74711306d97d15f21c4d1a6a501a49edfbf3d00979490737abe70333151c8", + "result": "valid" + }, + { + "tcId": 642, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e87143f679352dbf3a84f1a2826fd55ba6854cf4b2634faef4bc74235e07a7698d907f6d80a83e24cd1b0b1f4d67e34831dc3d3d07eff45ce067e6d24d83a148405609af1fc8e9c124916ba1149b5f5c3a99792926fe5296e8b22c172a9e39c3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7457d2fdb7b65736c34a8f9ac6839c66e47107519413486a659b6eafa92c8fccf67a30fb9f95baf367242ea4daebc116", + "result": "valid" + }, + { + "tcId": 643, + "comment": "point with coordinate y = 2 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e7c6ad297d371eccd5c20d5b309226bf80e1b6bb0ed66029896ebdb373aa3331aa12843ec5e6380bd948c3aaff87b240a10f4537b849823664ab1de11424ce01daea456cec48553b316f6943d7ed47c1611c8600d1ae69665a1dbd3e9867fd44", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a1c195e54518c0daeddb9189853041ba7fc1eb1bc1ac9c3d17f76f8d0017bc3eda08a3ff07448197c5e9bacf13cb80bc", + "result": "valid" + }, + { + "tcId": 644, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0494c4448e99d429748c5f82596d5c7329ea5ce93ce897cd7ab8fbfa8003912fa9b309e7958b6a64eba4f11c2a699b6dfc7d6d15ec8f22e0fe9e5de2e93e394364af10d151facb202c80998c39b75e45e3682bf0afa49d1795d30120d697179ea1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a868b00945243e3bd7ecf6d45aa26d44288869b1940f2997e146dc526f0779ec08a6bbe747ac67fbbd6fac2a3d682588", + "result": "valid" + }, + { + "tcId": 645, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ed5f78271093beca51cbbe43e7bdc4bc8f7a3fa9ac223cd81cedb8f89a5db9d7592c20cc2f4a1131dd132f502982c21d6f7811c930e1e6e13cf4cbb072cd9fe601695d48a0d2a6f49520c31d742e4eab500b4d3f96ac6098532e7b3d186efa25", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3e64ed87912de43b922285499cd9835badfaef254d288b50fbc8f749cc2a3bc6244dffa0d95f2de26bc0808146704823", + "result": "valid" + }, + { + "tcId": 646, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dcf4f38f64fe0c2ce60acd945c0b026622c31101753b9ee5cb0b2153f15b3c57ed6de944ea52d1eabb433d260f40ef41085ccaee134cab7554471c32ccffee1d53cee6cc528fe15023f3fda52069830a047723087ade11a6032558ef871efd1e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c098d1ad5f9040d4c2641e3f45875cf7d37ff95f8c28983345c42d57506ec70a7c5cd95f8a8d3e4a16b6df79909182f2", + "result": "valid" + }, + { + "tcId": 647, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0465b9e997cd3c22a96a6dced523c7c4b977c1b888fbafe3e79f2aacb4292f20881cdbf6f2d2cea9d7d893e973d45461d6907214c358c19ed7c84ac743ab8d9e59e611bba2ca0024b632d53fad4ab93835464f8a54de14a6c6d197eeb38e452c70", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7e610615c5b52424ad32a23d3e6b5e9eed7fa004f859183ebaf075f1ecdc6ee901f77063baf12c10cb832a8d4deb522e", + "result": "valid" + }, + { + "tcId": 648, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042fd64786f1a962fc149f7671c6415b7310c716cf11a89443722ab276d2cfab03b550a6e1567fe78ad04bd805a88fc1cb686912f3969779d17ec2786d54c2466271eada61ac1ef1cfc790d449917d43aa8040b3fd09a20c4864f285ba5b9dd041", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6450724cbf82640d00f277402f8b215f97b525f6153081c32bbb91126d918dc7a66467e14ddf1141bbf2eed3a1b5481d", + "result": "valid" + }, + { + "tcId": 649, + "comment": "point with coordinate y = 2 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046e717a14c7bbf3888818ddcefb9546ef31372178ca48b1e1580d9cabba58931611dbe447575b5ce1faf2edab53af50110f135ebe317ea6f3c3e82d3ce27ac89c745bfa68e15137d4452d50a9514e5c205dd52bdf3933dd9426371dcff105e5cd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "542e4e78ceead2557bd49f4c9289c9f2cf111fefab8a533868fa34dec2955cd375ec5b3d7c607587a1f76576e84e6572", + "result": "valid" + }, + { + "tcId": 650, + "comment": "point with coordinate y = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048f5ad790ceafe7f3f61aa37b25c4fd9ed7816e6ff01967707e85956562eccf112489e91620596c4ee921f001da4d708c93769fc9431370eb85ba044d201464a010df4eba574504297502cc4c5d18fd363c369965daf32c4537221ead8e72279e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f2c55c07e60f12d2438d854c9811d11ec38b55ae19fa9117ea6f1999c71e5e938971b94500afa6e6371a829917ac7c66", + "result": "valid" + }, + { + "tcId": 651, + "comment": "point with coordinate y = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043db9db3ddf4ac3f3abecea36b951444e25d1e35b1b463ddbbeb763f241564eb85f9a601677171caad46d5f5ed8d3318c0afc2a605d095b67ba3336eaeeb26ca894003b9ca3003b4175d535d934f93fc0e03455b7b756ae80f0b061f8377ed199", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b28ec729005e757af47c34eac9710e46b17f44795396bd78461ceb93801315424294cb4bbd57bcdba02f4aec809355d9", + "result": "valid" + }, + { + "tcId": 652, + "comment": "point with coordinate y = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04f64ce516aac9fcd55a1ca4ced69405ae206f001a681ffeaab144680fdbdc4217e7d61f5b502471f684ca3c80d5871ba04bd655d5ab304121421955cd6c219d3367e7b83e464482edb2986d86d95de0ce8c33f78ceb1ad36c762f9c1992360a34", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cc0cdf8790f09de71c1ea2108a177fde6e4ee8a2e85dab32c815d0a0a2295b8656ecc077a30515fce7c686488f4efeb1", + "result": "valid" + }, + { + "tcId": 653, + "comment": "point with coordinate y = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049d02ef80bce3f018045145be83ac5f5f9f8a79b099f94a5313cb80600919b4b59315963fa19ad5683fc0b965e781d564a73ea43f61707596675e30ceab660a256d117aed3ca4c9f1a9c13eecaeaf2c46eb5b71c5a7678967912783d441399486", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "56a3858d134e0acd227d710cdbb1f6801e421c280fdf297c5490a11aa70d4745a7df4129e95739a2bcc6b2e7a6ea366a", + "result": "valid" + }, + { + "tcId": 654, + "comment": "point with coordinate y = 2 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042fc1db3ce83382b19410e55ba6f2c0bec142300d432c0fd52f5da6eb07b15f5028aed5212234db2ade297f3135c32806468c37b25570590fc53e65003cc6becaf4137f323fdaba3d2b75187554f6915d2159c18eae4fa1750c89f4fbe743879a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5ed9545f6552fb3ba8f9617d50c8db4e51930c8827557068dbd9be2e6380d260359061046c8476671cd78f33f95583e0", + "result": "valid" + }, + { + "tcId": 655, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049191a271dd990a43bd7c161f39eb0da671e729aad96215af4a9b75047f5b0e964fdceef9cd468abc0fc0ba0c2da5f786000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c9399d4bdace4627fc0681546c4feb01e79347dab4d75aabcdf5fe1f4f74c9b9185d6bd9c062d68d332e0a5a201a5a34", + "result": "valid" + }, + { + "tcId": 656, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04b001b964c8b734aad9ec6042c0cb017762cfb785ae2f5441ea6135859a414491cfcb5551703727b581ada54f47457730686e9fae47547c27336d3c70321a23a5a65409b43f8c672557245167f28dda1158d10d0d3c850221f6acd6b4bb15042f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d03c82cf0894cddc058a6cb9ab53aa77bf75d2cb32153b28c63fdfaac4d551641a0e859085bdde4b2683b3c16ad88e95", + "result": "valid" + }, + { + "tcId": 657, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441b1cfe15587d174257b54b6a3cd9bd5e720ead62ce4c8cc7437edccce441e2356eb8509d4edc8b409124a53ea86838426d6032b8c1bdd5ae57bb56c8d07bf30f85eb6bc567fdb9c1e361bf82a97205013d306210b448a2f0d2d37c8d85263cd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a2a1f3ec4acd11da3389ed4b2a280fda76f9846aebd5698f452f2f8a790ef071555c218e2895c0f637a21e2ec0724bf4", + "result": "valid" + }, + { + "tcId": 658, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c644b36c276ea16f8d3c17b3cfc85ac1658045e4d40dd81eb71c542323c01d1d5b2271bff064e8665224b0b42967b08c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6763dc1c0ee1ec39f2eacdcc17bd70598e1b6f64af048e9a98273606107a7e6a7dd4d4e112e58a196d55bc4ec0e1e97e", + "result": "valid" + }, + { + "tcId": 659, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044b67bf4ab0a5994c5ae58b9f8bb299e4af60a7bfea1357417bfa9d2479159a9dd11aa68ef45fb6bd0418b889e4af2ece0ca8432cc4d421c1757b6bfde888b5b18304578ed24098bd7572fe2a20e144901008546a2a566aeb9587dc0894edfd40", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5d596dec38336518d584129886e028f4a777dccb9307a9331e4a9491f3f9df05ab6a9c78f5b2d092b820e2e6dd1d600b", + "result": "valid" + }, + { + "tcId": 660, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ee19021a325cb62e9a38a1cc5bcff9ad05cfb7bf91ea5e5b20ca0a7af57829aff3d64dbc5c3af840098192a3897e1dee7e6ae60b6f09556455bcc5dc85566af9e0ac6b1a66a72be9185886181fa9bfefc5b38171d34d4dec30d24c8827df23f1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8d5f04df4977caf2557ddc8651a93c81a3cf44b2802f193df2a98aacb1ec3e6df602484233ca2eeb182514a6be103765", + "result": "valid" + }, + { + "tcId": 661, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a829aa21faf8544cb547d22cf64c97982898907052901231fe4836d85ce4d44a55009f4442548cdd9e1a9541a8f257ec000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0de5a23eab8b69be2c2dacd89b5d8a610a4b1b3b912a5b65ef336c9f8253e71e9f2f26b6014b4fbd165aa14d230ce2a7", + "result": "valid" + }, + { + "tcId": 662, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bd15907d2598da983e7869b992f198620e9eb60bf62c5fa37d3da4a101bd53d74764bd5b49ee5a9b9a7f37106022817657836819c80ef066e399c7edfa888b88588de5918e894fd8a914713f96fd02506f4d8222cdd895fcec20291d89e3c52e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4a0a51d6991eef90eeb6e6d2ddcf05ded994681a9843c55ee758b1339a5b34e2f926d26c79bf2567a4a73341925f961c", + "result": "valid" + }, + { + "tcId": 663, + "comment": "point with coordinate y = 3", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04dc306faa02cae6c2385ca2aae85988fc40a49e57c75f6b40bec17d62de59298f6708590a49f92547420d056a034c032cd942fc0a503ecb327c0e8b9d2db0e3fee7eca183d463da7bab8c580cbbd4eb13e35ca7da2b93d41a686a7ed40aa1e4bd", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7c07d4b2bd4100f7b9a7b56fc1505a46c509f94d3fd1dfb79de328b8646fdef5982cf86a76f627ab682d528fdff5db4e", + "result": "valid" + }, + { + "tcId": 664, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04cc363d581c7125ee8e2da1f936f6519215813357a31f8b296775e47a363e643c12ba0f97c4c075d0b9f7799b56c80874083efb1dd735550fb5de2ea6cbf0742315ea1ccb2f47a46b2105757576af5f8fd2255b5b83cd234bed906c29556d52b9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af2d3a6f0638565a05620155d435436e5637db7ee3ff6d924ad9bcd157f274cfa43a6224c8407b029f0583b112f1d489", + "result": "valid" + }, + { + "tcId": 665, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0487e7cf6bee0f4c7561fd3826f5f5f7573df22ccf534ee787199159a2ae153f2f6f51c1f1cb5d5bbe9ddcb3e46c9d173eac01dea05069108987d6da721fcb6d20cfb308fb178fdf60ee4c6d628851eaec65c0b38c6bc01ba13ce1c39b16265d4e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d26ab7d38b23aeeb4b532bdd82e470fc0187fe4caeb98bbe9230e61eae73e90a74de03f6e10eb853fc78102405314b71", + "result": "valid" + }, + { + "tcId": 666, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04305933343e07095ec8f90ae9a68e55c8e58df5ab85c65b31c22c44551f8f173269534dccab457817334360225d0b4995d5f893393f63e0bb59d0ce0ccc06c8c42bfc9e5b8ba12d7769c72ad31aadfff4b8df16a2b46a9d2c6cbc10cd061106e9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c52359ea17ccbf331413febfa8906a6f613d52132251d6419ae4ad0334ada1b792cca35a851fe16f8453e48a2ba611a7", + "result": "valid" + }, + { + "tcId": 667, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fffc33f99fd7eb09e262c5080761131d705b11fa8ac170cd7b6871d5082cc713d8506aa923fa78b4705fcc0c099062db4bbe542f6b20599780b5ee734aa83aa8ddb5d29e98153096ea5e505d35e048a6c84109b77debf915b9e94d8e8c65d8c6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "de291cd16864e130866a897aeb0ff390d1f1313d8ad579ec66df21012cb51810bfe6eda8609428c9f5f6849512874c0b", + "result": "valid" + }, + { + "tcId": 668, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c090252b8d8c7a30065e8e2ccb1bdcfff426e1bc70f834aa7d39ee600dde6982025392c8559d06403b6592b7bfdfe5f02c159a1d2806ca12f34d5f213e9c0b0c1d52eb1aeb75d6bb4da2e5d2e75ff411714a6d3af82c4c3125e230f693ba8013", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b638a6be07e016fec3836450b2e2d5cec64ae1909d4b8fcd4c9bbb98f7e9c4934e4ab0953ac0b1eab87b45c67c8af9c8", + "result": "valid" + }, + { + "tcId": 669, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04fc39572e9e59b7c0cc3f3c848836055badf7d84e67d7c8ff6efc2d2e9b685234bf865166027cbc64fd8a35bcd5d42d4253d549ceb8bf156d72ac3ffea9cb082c0ed09f436f987f7901e8fbabca51c538a10623cf5e08f32ac283bc88ed87c206", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3e4932f75df3c64ca351f10d3dc7fc45574cf2682e766dec617f29eb348bafd982fe06bee0b9c47725a52d3d58448fee", + "result": "valid" + }, + { + "tcId": 670, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ef5f1550b32e45c71ed099c84941dd047e166b649b216ccb179c4c1ae9f1b95efea1d38dc624dcb7d7161bb3341329133c89801a5ee4286c2ce03fc012142573f48a836892215fd731f54bb8a623a3d8bd76cc04323ad6e4582c6dbb7afc90e9", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8d6c0679d23e55421d10a2925951607dca0bc9b7c2b6cad0de92e6ab02feb6cd0da3abb398628571310ac7af1b36c95c", + "result": "valid" + }, + { + "tcId": 671, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0416616403f2c05615b36948bed1e4bcd805b750291a1a40faf51d012db0f7cdc014ec948228d7f223eccec8f902d7778500096849a87a0675e516481621ad1f1fbec5c1c77f854040db5f02922bfe15379fabcab6c9a512332f1071b5687e0e0c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a626301303bfb5545707d75dcaed2040abe3bd96fc2e0119dc718705f76e243bc4afa99738addc68e1f5217a0f670907", + "result": "valid" + }, + { + "tcId": 672, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d5c364c4c1582f301f615bdc437a9fe34b1f7018f864ef54104b7892c6f173193cc0f3f75fae744250f8ceaf883325591c251a43aa6d35c3df1f58c750733ff2588d165ede6404ef89285a0dee5e7bfea8ebbea960f89112c5e655580720fd2a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "82d2cacd5f24613595a70e8768f66312964498cde0e3a1007b3c3944fb0e0874f0d4ea3818aeb975c742539ecaf234a3", + "result": "valid" + }, + { + "tcId": 673, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0481e2a69ea9441c2710f1dfb81219d3223f9abb1b5c17e3fd644fc1295ad846f6856add24e3c8879cdd7cdb1215697b3725549e4ac1657ea4d84e2759d81d1661f748067641cd7c77a3b94c3eb01593e063c57c27e8640e406309c41bbe4fb282", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "42fff314a6830d0c13d8dcc5f9ee83aab63e0492c20b8b579d837db8ec0f31530be1c3358e87b99d5476b638744509ca", + "result": "valid" + }, + { + "tcId": 674, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ac426f33d9a1262ba12dae4d1d1e59f89a133ad579d7b716ec6ff39b52d4447e3a41ca89532f635cfca878afd23beb1db8101884c06589d62a36ad9a99445428eb5594e86869868420a89ad119024730c441e94db23f02d25d01dd884c2450ba", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bf84b5e66084ea5d45bb2c0eea275d1e8790f8bab7b567c1a4ca3feda458f2bdd65ad4b9583df7e48cf5569bc8b2a11b", + "result": "valid" + }, + { + "tcId": 675, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043fca69ddab3b09a7eb40644f8a112b4a565cc59c6db0f80d70417aba78b842ad1e29a10f8891df2d8b5c82daae5e85f802ef21bcba440229c8ff66762611f3fa6aa979c2211af5b1769a67b69e94bfff579a28d5775c257688515b61c2f5d4c1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2257cef1f821d62e6af0ddcd12c64bbdead66d3818fbb1d3b8f90d15d1cbfcd50650078252894b938696188311c18f46", + "result": "valid" + }, + { + "tcId": 676, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0444670de6f8a35139ed33329a66660da152ddbffe5d1d91b8dd8a34f9a5c6a60d9f587d4810c5abfe88aea086595994b2f4e58ef72cd5c9ff0ad78b0eba2f0b4edd3350dc9b52e6f5c7ac361b10fb5e5253d47f51104d3ed8b6f99f6f5be14a7f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "70d7ad81c6ba82840553c818cf41257746849aa1db256f2c9b3f8e1bdc302a5fccf230dc010b07cc0007b17be542804b", + "result": "valid" + }, + { + "tcId": 677, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04208bd9ee3209731dc52fdb19793cc44c415aab59d162798fdbd8c5a57ec3ad062683a4af5727e687e259f70e20cbb4b213514480dfe0789d3bfed47105956fc68406021db1b60150987b4cf24528ffa6a3f1f03e41239fd732b70a9161779374", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e4f4eb39afcd8d2a805e8c5c5d96a6876acb779f26d54db4cfb005afdbfe07c1a7e52b718f9544af2f2b0cbee9b403ba", + "result": "valid" + }, + { + "tcId": 678, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0440349444b83f2b20f1b2ca5f1d217cc9ba1e4876396b85faaf20d0087233992588d0824a01864b7231ee0dbf5b1f87268922ccfde3957186b827715d6d820bf3a5d8749da3291665bf365b9960cc7ec7557171fc0c971f78e495ab8588c75b48", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "231fff3fd53d75f637bbdfde45e9054ed68de01303791c187f25e1177763b481c8381452feec3ba159b841d70b972c44", + "result": "valid" + }, + { + "tcId": 679, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0407b693047d411fa64d7a3beb7e2971cddf5cb06118ac72755e1cca19843886ff67a64c6ea64a183c5f9abd863c564a499f16f7d17b1ec58ed4291293d1bdabdd55ebad39f3c7771955f3499d6a55b7c687d18df8bc2176cc5eb16ba41fabdabf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c167a0be43f97c44e037a6b93100114f7e5b0586112e79e5bcdbaac2cf30232d1fb0fc3004025fb9eb174057a6088cb2", + "result": "valid" + }, + { + "tcId": 680, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041c5b0c25be8d2c81f26912eb7d80c489ab1da6cb666bf9df68088d570397de0111b318a8c1049e06c62b7e4cfdfe0b1defcbe15d6570146a3a6822ee5081e539802a39b153004305262a8e551b5140e4524d6837737d5d664c2fdc386c6b947c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8f5461dd6e6cc9077881bd816a62fa3e370f0145cca6d9d1e92f0f6a6a8df486fcb7cad046b4e3a8b197d1381dd82dbe", + "result": "valid" + }, + { + "tcId": 681, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046fbdded6d3b9b6920d2718a46097de24dd75cd359509685f44b9c1bb987a5e3f5fefafe7279957f7e1109523171be227cc80847030a4361aba96071f6c8dbbe129ecc4aa51b8f5d88c98cb8730998fdb49d54c36a7c2f98173d8e06e6e8a5b30", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2114489cbcfb51e228b6a20cd09a37d0dd315a947c18568255e3e3463661f55d3814edc1bc1746f04a00c65c19c6be86", + "result": "valid" + }, + { + "tcId": 682, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049fbfe65966aeb56c8c4c71482b9425b94a633850052a2f97cec55f3e95fd729fe349340bb706612592553f1a6a7ee3d4215a3bf95f7e6061eeaa07e54de292990a2e7cfdbe353f3fe2bb79538d8a95110d4ee26ecbfb3d6d4b6bcf2916a8295a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "554975d3bb72538d6fd16b4c70ba0966682069c38e0817293e86472b060acc8c9d84fe7a3689cd8171380ef3ad5caf09", + "result": "valid" + }, + { + "tcId": 683, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a65ce938e0eb6e8e9438965f39ffd8cfcf5a1b5e7abf5587f592c645c0b6433bc90b90f0b07c91de03f2f5b5f4c1bdf186b6800b51a779a4fba3a2990958a7a570d365f8a5b7273dc3b5075bd4bae7de523fbdb0866d019185571fe9815bc9cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "72877ae37e324484ff60d999e045cb3fd5f2909645fa1cdc8ef1b60c48a0def816bba801e8fd6c104cd9bde159582280", + "result": "valid" + }, + { + "tcId": 684, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04491abe7ce4ac535e4f0879010eb712d7b884e999fe4278392ed8c232a518eb43525e0f83382730e7c3aa77ddc647faa6fbc0fa2d38f0e4a7cc0fdfaee0ea2d77b56b11cf23322d91e1e40a1d54a45316038afb6db80329c5b0651688e0b0d080", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d30977d25fbe1e5a8149f27b866d8082751170a1e109258f7a4bb93ac99dfa5517ed30bcce9dd87cf1991a3757c27478", + "result": "valid" + }, + { + "tcId": 685, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04a6d96c3b05a09157542d93da81bc9ae6b01a3328529c90a2cf78b36a2791a144ebfe53d4fea54dd9cf526b74c029b5cfa8e93d33928280a4a41e303c5835d8468d169844c9f96f383b64b8e9a7270916f4055c7bbd259484f3eaf6457b0f099e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7d8b42be30d3692946b333623a406cb7410302cb60af28bd3dea40ed5e07467de330eb4da42db7f2103e59ce0978bdd1", + "result": "valid" + }, + { + "tcId": 686, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bd3d2f5f192af836d16530c392e283914b900310c16eae4da2d610767fed2b56780ab36e5e66e70211f2809f501ae9a904bee54c58ea065bc17077c70056b336d62ecccae95c2b7bb376b0751f39ad0880c666d12793dea8969d21998a473b74", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "820d6984664badad3478b59b81562f95498d6a3902b36911e8b3d7791ac84e461f7e153c2931377f45046ce3341088a4", + "result": "valid" + }, + { + "tcId": 687, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d22f4e253b463f2d78ab05829cdd37f767066712a30e5ec16bec682e48a77204abca1fa4769ed9f6b06a25838995bf532b186e5f559fc9e44e7a97cae3d1fe425be09d245993cd5dfee61b5fd6ba3145c7bdf4709173e47daba555cdbf42d8e5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "c44bb616d4b25c54d049e768f5839e8708d98d9c6a9a196855cbbfa0213c1dc0709bd9c0e8aa6992e30aa9caaa571745", + "result": "valid" + }, + { + "tcId": 688, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042316fe12557292d198a4e0ad99493439f128ccd7c23e1c318f5aa818d541b23bc4630344340d02182461e8fe0c2203c86052b6c054afc2729a35bf43388e62d2779369e30ebeb6b99333f4ac3b216d19f769a223996d15071293a1577120a726", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "747cbdfdf4ff7e6f9013c711fbd87e5e2a3d81ea80b7b4e4774bb5dc3e6db891bb11a76e2a9380805792cb54a31bb975", + "result": "valid" + }, + { + "tcId": 689, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0451aa434a6e326136d8be1147bb016efc011f85e6151209be680bf2baf5f2258e866c36f269362777b34d15a365440e2fb517b33f699c564f6f3a9756ccb18de2f441ade628968a2b9c14df85030c48fc9b5c801bd953727c1edc291a79cc5afc", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4c2fd7e95cb395130b0b3eb56bef8793649e8f2fd0b9a7d3dde52f42e109e852c73a7687f5b184efef3e9651146251ab", + "result": "valid" + }, + { + "tcId": 690, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bc420137e3d9a5b7422db1bca69768f2423b33dd06237128cb69cf94274da14b984094f0f8470e5378de972d217d8e62922c077a8ecb5ac74f738ae1fb9233ad88af871656e16c1d6e6bcb4404306b27ea011f2bfac52f931ee91a9dd4345ecb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5b90b9c243667edd6d455e478de6c7cc5ee62fb223c1309e91ff34c358a622f478f39006d13d7856e53f3a42ff9bc088", + "result": "valid" + }, + { + "tcId": 691, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04980121ee3358a636cdb8e138385758639e54eb9b83f6bfe3b4edc308316e8aac34075082b348f61a9d80ebc2f537968190079dc5cf69e28f04a1ce03aa100d3f9eb60bf5aeb50e20a536c3628cbe61e0d819df8492588c068adfe0db269af51a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "137b16a66e614fdd2dbd3c536d42b4127f6d9a4e45fab54a46471aec0c46fda0f8568d807a0f4aae88769e330764a860", + "result": "valid" + }, + { + "tcId": 692, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d7ef3b96dc54c3af87dce680a3af3fbd228fc586e6050f5a1cf85dbb3c9df0729b7341a079aef6690328845ccfd8394e90a68cf5c4013a43d50a91266d70e373c45f15c474eb1ec1fc992319273f001020a694e2379beca7e851a7f6c7b59312", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ee1b9820da6bd2f485c1376f6e056f672b9f96b4550bd5f41fe47eedd97dd1145e7f13835b82b65ca6c7929dd8e53704", + "result": "valid" + }, + { + "tcId": 693, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043fdd83fcc43827f621ec0942e835ae1fee1b9aa890d49fda2616c085a575d73a7a941db67bde08468ab1f88efe554bbbf8690d0f78c92068078541f90b9adafc76b9963aa33aa758abf7b6e0b1918ab0a21a5f568d88c13fa2e5055ee0a1029f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5f4efd1bf3977a0eeb58e375b8b434889ef147b11b5c4d0464d315f04ba381cc77f15d09947432747a9e4c7eb344aadd", + "result": "valid" + }, + { + "tcId": 694, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04da5b80afb6d4ad805bdf51e526c230257c3aa35059fc971889ccaa1405fbbfadb4b36c029a81fb18ccfb641e96e3d0732ceccd93272ab296d6f33f50d5a9d47a3b3162042ef3aab7488b425c29495e29e7ead56c9169c7d66539b31a459344c7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "abf0f4849bca64cad8136b59169612c96469a8136c6970b2cf6813cb5e8e9c9a5ccd9caae749fb93a00dd7ac9e28b058", + "result": "valid" + }, + { + "tcId": 695, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04be4c17c2d202344020f3ec0f20613288cd097738bcd356e8cfa7b0bb0f748cd87df26e2a28352bc4f19f3f4f27015efb66c000b6d073c0915ff9080265b9d685584f15e53d672924d09222519a27701ac0d74f6f09c4cb1d22c3df8aeac53da7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b5967aeaa5cfe1c5504939c02424f104fdf8e740c9d0dd4196a9964ae7b93457b15523b6b41db432f110d1eb07eea986", + "result": "valid" + }, + { + "tcId": 696, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04db86bc2d0e095978a099f451032f1d2be42e6e16857abf6ce02803e709b9e021e964af1a01393fddf15f249c58619116434cc4b948cd80b3c416da2fc4c34e791e56444600a6ec73eb16bbf37fc2919cdadd227f0ff2a19d3f04693742091b1c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bea329ab6731146be0e155bf37072d29dec3943fa545f9d717463edb562343584b03454262f8a3e919c4985fa2dae6c1", + "result": "valid" + }, + { + "tcId": 697, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d90a5d73268f58149aaa52ecd539406151b695ca91c3bad3e6ca4c04855bb951d4528f10ceee464ab2cf6e5d67bfab5c2c97adb12dd186f51ca883d1e715fedff01f92a0e73da6595b00d6cbb89379a9c578b5d771944c8733ed885a2ea1a158", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "956a0e4604ee36e6bbb505b5a076888814e1c98f5c13803606862e177111650ab4eed5166259f8bb636d1862f46ff459", + "result": "valid" + }, + { + "tcId": 698, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041873663187e57d16f70fc224e1030bd09a39877228eedfce3a29ae75c38fd57a58e592306b2afe9688bb2ac3b20edcb5d108873b93f5a8dc2e7404a7aa24e6a1b68b9bc96fa6534555fd9f7239205fa489e8b85a55692467d2a6df0e550104da", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "197f6164e4a2408913ff39b7b89c0cc6214ab0e2f9f720350db8bb90b1dc374387fa54a0b12482fbde81d68e76a33702", + "result": "valid" + }, + { + "tcId": 699, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d9bce59b413e14999253c3cd7095d329aea5a79192e976ec11bed9caf033af312b7afb8d1af1b5678e51dd974e1d32876f617fcae872c46c7b55b776e6365e0c42a64652daf995684b6b479569b9468cd7f00ccce21ec16839950e58f0b8ff69", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "09b2ca69e84634801589d4f4e20d7f8b56a97a55802a6da7bdc7afa03a7dbf174e1691a3f0061d92506d8b93a8cb2d32", + "result": "valid" + }, + { + "tcId": 700, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0490e8b1f5696e6b111493f49972e5f7d8e12b0a8595fd9136ab9a5d133579b93a7c019c5da4306b767276ed732beea1f6c34ad84d6147de851df92870a8754674d31b143c667e237bf5160fdcacdb31b00d12c575e853b9edb3507b98d2de2445", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "dc7199bd53dd3e8a84d39b96de2ed98e3177260ff79883354716c3754c07b78d180bb277fc48a7f730ace276396a281a", + "result": "valid" + }, + { + "tcId": 701, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ef26d2824db828c75eb2a344aefad6ab0bd2cfb052efb33a2391701921313e96afc2854cf46b95935b00aec63dfe40e24e22483eeb0f3d33f330c4c85d29734a3e67cdddd0d9f7f089e3dafc5577b68d05e4c00b57e19474e5e79fd472d1f0a0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6e7a9274b33ccbb2766b1f34a114a94c138e1010213bca8c28ccf20f84f404b98963b6be2395e12ce559bc44fbbbee23", + "result": "valid" + }, + { + "tcId": 702, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040933d2bee5be50c0ab0820cc40994b72b1992fc1297ab16d222a4b38b152a752d597074e18d6fd74629f56e5960303237c09e13e0732236732c3990e05117ea878c93157d0b832225f689a04d942a0b17d9692239da9299d4b0eae0400d345d5", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b826425002c9b689433fb4e5457533c484920539be1fb30d86ab57ab394c8e7bca840949e8688cd38722b95a217d029a", + "result": "valid" + }, + { + "tcId": 703, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04700c7c4a0929acda28403cefa0b6067bd292430d3b1f50f6d8417b087cb149c9b34e4f7f6e92b59f8f1dc6a6b267c9a867e1d9ef11a2abc3185e3fb636661e0370a86bf1f9777a07f4d6cc636b9b395edec1883109fbfae991b89f93ae44e3d3", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8a5776d73d597f78be98fd35b4b60f963e2f57911e2035286c952a20225abaa40c0808c229f9f853880269d870975a29", + "result": "valid" + }, + { + "tcId": 704, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c872586aea2ff8f588bcd4ab86396c8d9a24964dfb0c8b48e4cad902d189d0571b4768b5bab77112542a4d2c8321ab077c88364689cf93c5da117ed17f66caf3029a15d0940e76a91785b867433d6e5c7f60ed45c5cee1c40eceeaf50d355096", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "03d24b962a15fbcaffd4320558367fef1edc567527092d74bc6017023a7354727742ac4df0a03f020d90c316d48a5fd1", + "result": "valid" + }, + { + "tcId": 705, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0466b85418e939e7999fd117f0c0a3fc6b6d3da5515c706881c85430f61c1d8652ae3c63eaa88d3f2131d5575f3b1ec2e2603bc92e1ef90a0fef0f8b44164ac5f04d85d113562aa5e429e7a0a05cb56f500bb9a89e17943ad8e6be00df6b28d6fb", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "af45bbf463e098a596f69c41c2fed41008e5af727359563edcccb51bd563f4f78aeec8bb26dea7f67be04019878604d6", + "result": "valid" + }, + { + "tcId": 706, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04d272006d6a2dc5425324708a99d0364b5d8c548ce03e6c1da15f34b0c49caa2a8c66965bbc3876fb78bf42a84c09c0f9efa6aa226faedbd8afa905e0d34065e9d58b264f2f58e5163a12dacc4a79cb54e9421e98f3e1f6fc60a502cd9c880849", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "11b56dc79aa08d82902b856e54d6b69822f45340a28ac8f1f0c1ecc84534e636c9815a0024ac2f9ea028b4cbe5696820", + "result": "valid" + }, + { + "tcId": 707, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04ba4d3105402de1f6e9627f617bdea34e14dd4af79496e0c3874ef96945599d06605e07dbc89112e1fd426e0dab1defc7965b047e2f40a9db566aa98a76907498d86a6f5b0ed6a14e22fff235b9d5903cb7fefa556e5ba5fa5173463b60dcd245", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "716f98c90850d054d5593348beaa2a3f04a7a40a441a61eb615f7168775887396c767275fd2ff5075fbd80a44efe0bb8", + "result": "valid" + }, + { + "tcId": 708, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04861941a401c8ad49a071ed4280de572dc14a3f2e0494507a92362aa7e8f4b651d7c2a1967124196b935a61211f6329f774b5ab70324bd070891ace75e3d4b77f0a1504e36e0bf9dc94c48ff311a90cf8367fa14da697e980e60b2a5112715ace", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f7eac9433bc4f697bb049587107ed191afcbccfcef62ddf60fb163f773465b23df92a8b0f03d7394a9654be457cb0aff", + "result": "valid" + }, + { + "tcId": 709, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "048f31ba37a6e5c2c1e5e3f04232901268301c2bb3f18aaa6539814ea4d7e064b499d5e39721f61e4d83f3934108e99010b7518d1df9a853861eabcfc981db76377c5e6560c91debeb67123192a3e18841146c2bfc78931a701453a685a3416ab1", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "a88c8cb491b247526c7a4a667e598006fe2d220f9af72d3f4ae52a7d49abb93d0ed6c1364205d216d82f99c272f5559d", + "result": "valid" + }, + { + "tcId": 710, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04af9264eae1bf6bcff3b591a41423463ad4a2464c5ac33f1a65515bf8a95b3d0422c1d011a0c0c1aaa4bf3536b5cd9de30e2af6d8c6719de5b4358698b3e24ef38da0ecd3593ffb021afc34f38f8110888e3f96f423c764b23d8c431ba6cf5982", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ffff9195585190da09fe76c33f85c640dfe3e8ae67f5034a4c0f4cb644da5e2e07dad14a6a937dfb1895a6af84c303fa", + "result": "valid" + }, + { + "tcId": 711, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041f4e2e226a04cc8c50672c0c74ac9902c5f82102d0a5cc3eceedbcfc3b47e48b6c9527f5dc08ebc9c31cf2c7c3130a780101cec2758c8f122e2fe3225792a72d30edb444a17bba968615e24c73926ac1a2aeee46bab8939f559e22cca71bdaef", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7ad3f184b163e008f22b30c9015acaa83189b82e5cbae7ed7a08ea7edb018ee891248ba4f3c9c8de58f44cf44803e1ff", + "result": "valid" + }, + { + "tcId": 712, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bde04025731f7cd359ac1f84b66f81d619f04a97e5ea31ac967babcb300b028ec51b7a0c5a7a7f7df2694b3bdb0b7c51e602896535f597a6f30346102963fe6891e72b6705b610a36c305c0041c465f90120c7c4fa5f31b4569076cb28807c2a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8aa4392279d16b73f5b9ade7fd627bba15cb9077fe6ddfdb186407045276b06a12ad37e31bb3b382736a6951de453a4d", + "result": "valid" + }, + { + "tcId": 713, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "042c37b45a47a5b96d27bbc78d393a33955f5365cc3641ca406465aac1d8adcf9a9001f2a08405fbc4e446d200d912b7c1cd2a60f1419204a9ee0f0ad2413ae705d42c13467ebdaa37d65c2cb413f5e3c1893311637e312ea72c4dd00e6b86f55e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "be967dcbf2bce45128f13ece3b7e6c6cde1cc86ca6690b775def0c24e2e4f86f8fabe2bcdf6984416895a13820451222", + "result": "valid" + }, + { + "tcId": 714, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047275f42bb62bdea9de689ef2f203d753443f599d6b31dd1806ff7bbca226085bdf09732b0a45ed90ec3c102622ca668c3a9016d0cbab223b7508a85366c3df65dcecc93825af0e24081a9822e490d3cd4cf896f7c363b644e84b7b9f9c91c534", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d8d43520f3bf05994e72dcd3711f21852e253bea2fc6909e6361885fd966edca08f73ead8d80b952f7f5cd80a1707951", + "result": "valid" + }, + { + "tcId": 715, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049028414bf18ce79c27c90b1f54265c4e0849dc6736d5ab6d104b33312ea9d100e18590927e24aaf00776ec07082dbd554160b5e4233111b0665a4bbc6ee4f4986dbae05b3e66bfb4f691f758277ff6465dc96a00e4d920d3d65c9388cc2eb617", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "0a30d032306adeec8aeb2446694ff872e05011afd7675e5845845ceecb580c0ab9626e890616aad6a87f88a55a62b1e9", + "result": "valid" + }, + { + "tcId": 716, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0442b3bf794c52bcfb9391fb46cab1d114c79283019f4c2ca3ba1c8a7b620ee5e6fdfe4ba0f3749b086d935127a43097dfd64e3f3eda1a13967a3b17a721e0d417140fdd160ddf86ef085c6fd3e840a6adcdeaba83bcf8daf4a45ed3c5b59567d2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "23df10071e2038ac05996ac5371139ce394f8e99e355db19721975776eb0bb2a3848c7d40d9cfb083409c933779f410c", + "result": "valid" + }, + { + "tcId": 717, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bf0ded15e66abfdc186b10a634f82cf2a311546a6e1940d880c4312ce4ba97101d2bf71ff0c10544e50bcefcb7d3f720692dbf900375d473148d7106d96c6ecbcfa2dae6a8854b60703641ce370ddbcf890190f1988b25d2a97fe2b67fd7f81f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ea04c66dc33bc6c7e4666b8c1b92594e0a70dae3de959155a16f6ad9484a24e0e73068157b65bffda88266711dad8c4c", + "result": "valid" + }, + { + "tcId": 718, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0456421686d9fbcc08127a06c4550b5c9ce427bcc0d59b1729ce4f54d287dbdeb4bdfe59fff982a450519620e1cbe5868df6472f7b8394d08b2dc0a6ab0e8bd623153fdcf3a1b0555b2a9741b4e204bb499ba0ddc98f99ffdb6a2c46665b155baa", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "988e65673b4bf4b20a4509c725a5cad7a6fc7ba8e46633f86ee97b1c914b9f6aa038fa788d85be8a4a45a1ff56fa57d6", + "result": "valid" + }, + { + "tcId": 719, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441b4aa4b85cfe14fca49aa5ddb23a43dbb7e2e75a3efcb0e7417525080c19f188411ae58d422d4eae8247ab35ac1510cf7bf7e26034415ad16730aac4c3edf698d8b401a9d09e6310d98236082f8fa84a8ab04fd8df5640689c07ab2ae4a54f0", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d2fe7bd840e0113d8a83dba7c4fceaf9bf736334e496e1b6144741561d5b70adccf4385c41acdb61c7e54e0a55f668fa", + "result": "valid" + }, + { + "tcId": 720, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04763bc7e51197c5f23f043f4fd48ef6ac7189570c322430260391fb04ed7b41798844ba6791b889f9cb15ba2440a5bc63ab78cbc60b013e21177251a4d5ae4a6d30e3b28c8861fd382bf5bb7ca5200d937a6e067aefabc92fb3fb32be901d9d7b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8d159839bcff596bf32d0320ac83ef7def12b9f07cd02f2fb3018d7e1235d09c5124e3414e0941e823684197b9dafe3f", + "result": "valid" + }, + { + "tcId": 721, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c6742b39d3f81c1b10d274288c80393bf756c27571806b7b3512b085de93adc1a9cb12a06574d7cdc8e76c5972deb833a18039f1c95f79e463be502fe3dd00b0839aad80a16f238724fb16b574ff175468aefac205bd3b84db3c69d489549e39", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5ffde67f763bf34149c1779707102f13a2c700fc906067502660126e34356f0ea8242506c7bca86ba1c1d0f18386c1ce", + "result": "valid" + }, + { + "tcId": 722, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0439e4e52c83a7330610ba9a64065e7557a3ce32340477707231b7e300b8207661addca9baf443469db93de8de251d4a134f8d183a7d89d72784a5866cc9584b34d4438bc96f426de212203092c25e4ce98bd6acfaf5b81e232815799ece2a676a", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f9dfce879a463f610e6916f8a33edf6e3f9ed5e9552e9e96b8c2c5f29ebd59962f8a193b27ed90e38cd9c2a3e9268149", + "result": "valid" + }, + { + "tcId": 723, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bd031fcd5c7bb8cd7ba8d8f665b68319158544675b635b0ab934c45e6061298b308348f5cd206cf2385022b2120aa87074856e31035bb70e8f1897cd608dedbbe3804d6ab4d3a93d5e2a7d9c03c84a3150fc5f68decaab2637c6a0ee9b92374b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6de2d39012424876d56d0dddeb866ffa16dd5f3862bbd76865ac828223d15fcc29462738c96e95587d59551b81f9cad5", + "result": "valid" + }, + { + "tcId": 724, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bbb80842c109e51e70e6ad5e626ef403dce1127b0a8cbb99bbac5a6e001f436629f05180061911c1378497e8f976a9a2d3a1609fc79e14a7f5e235b9b2ee9f970ddac167b126be54fe7031624527b5ac53f704362aeb464fd0fe4663d00a7c70", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f4f1a22fb6d5f5f449871869b8de1890a6352a801881b4b469bbf9565d93b8f70285e4867badbc0bdd31a050493f13eb", + "result": "valid" + }, + { + "tcId": 725, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0473e42e18634c92fb50511966524424883b8dbb2b0aac6d890c55665275416b54ea839f6351cec228f8d01488539eceac8ed742bca01663f10c288ba795bd3f16da647b6e6308cd651e35df9322d7d18f220dc4bb68c746a15a97f83c7b06cf3e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "111903c1194106db9aded86c1e646b1df7e1c0eb1f5ba23c571dafc389aa185d11b2bfc342ecb4323a2370bb5095da8e", + "result": "valid" + }, + { + "tcId": 726, + "comment": "point with coordinate y = 3 in left to right addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04964b7431168c06d04e552627a10bddb2bed69fa5cfadc7ae3c851463a1809ddd27748171833915f16c0c4f0ebcf5f006bd4dea4d3df408337d8fbd6a0a9f21f6791938d0f4e32c2fb6c757ab55b49868db262bb006db5e2a7817718dc06fc501", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4483870fe543dbbd548940f9a0804f56f72538b75a341c14616d5f2b90317d5304c5b21ff4fa6ef5b009f2d7a9ea86ce", + "result": "valid" + }, + { + "tcId": 727, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04282362c49bbedef495aa245d5d471f561bea53a32554e5eff44f3efe4910e01b84716f526da2e8c44f6c5a5d2e3ea1cf68c6d0952ad8d3a51e7c6736cb48e1c8619a954688a48cc4fe32c1056e5da62fc17576a6fc3ab4b0f45125e3099b388b", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1246944fa37f6f0b98a1e66ad783ee396f6b329508e568cca9209034ae120bba2a61176e38e3c81973b962d0d36c6975", + "result": "valid" + }, + { + "tcId": 728, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0445aca87c12117e0b0eb8fc19a0ae3c330d6ed1da839bb22f5777402a0d50e6820550535a4ec4ca2a88a034c174c26b13d75d2758e50fcc1fdd385d601a64d014c46e49a080f205f17276e4890a616c3606cd02bbd785d251913a2b3850b60383", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cabd0c2be228667047bc2dc347cf689fcaef4f1057104e936c835fb2533ed48cb81be49633a61f0d06255d3748cd966b", + "result": "valid" + }, + { + "tcId": 729, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043deca225a94096912cbf78f4c9a1e6619466daaa4bf43ac31540ad10f9e8ea0b002a756f0c9bbfc5eac7e1e659955dc251602f0c8344c36037506c4f39bacca6903ca0f43cf17da5d8ed7e500fb465d3635cd3fd86b426a684922550feb5f081", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cdaa8ebb69d9eb8271de65dcae9fa15b24f5a194079718a6084e0a3d03a06b3127e53c677439741575f6ec89338852b1", + "result": "valid" + }, + { + "tcId": 730, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "040a38bf1bcdf2891f104ab44e422e4d59ace70a5a7b4459fd4fe6273dc08e7d33ae4927edb0bc196c8e007e7706c07a8c68c1794aab25b1ea1d5e7188b990cfbae441da0f6717562b9ae4a1a07e5888a494664f29ea8fa8ff7df7fa1f50e92d79", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e56bb6b240007087ab220c4127d72e31f4d68aa44c5864c11fb34a203b410f91636ffa41bf110616e01d2cecf264c53f", + "result": "valid" + }, + { + "tcId": 731, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047ac8c07fedb3d3a41f1727f53d73a713edf93503952444e73a433833b7fcab9c0a160e1f248fd20c2af6ed5a7dce13851c59dc8764736401b3fcadfe1161e7ee75554ef227151ba588a2ea459c8631617f7ac2fe8ba463d7ddd52baae4c3d8d2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3fc1827392910aeb83910dd7cdbabd9c5a23f13b40a15a1412d2b34217f756f91647b05d7ba88ae5f04fc768d19d920a", + "result": "valid" + }, + { + "tcId": 732, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e0ae3299d5030263c1f7422fa9567e1e3728af17a08133e38600ca36093342d2c6b0fbcd1e66538a41b501429ac4d6a28ce43695815b28ab4555d1cf445ee984b9605a2a1a9415896d6b233df91070ecf6938fe08875761addca77c15740ebe7", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "d7bb3b26d2429f218f90ad33c81da786b8d87309a93258f240b63d67dd0f20758656346bca58008881fa69a063fcd3f5", + "result": "valid" + }, + { + "tcId": 733, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047f1d6c79d37272a8e6c393655af03532debfa975a3ec4df9d543af947a2a1fc29949a4bcf1d4a980155cd0197eca95f05f53e64efb2ac673c8b21adcbfb7bc707e537a07fc8631f308b9ee33e863b7551c0df301d9195cef06c67e2c5a081f2e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "9cd76678ebb929e9815153f084d445cb2cfb4032272b22a939b88394e95de3d0530c504d1490af9f5eaf36e12fcfa6f6", + "result": "valid" + }, + { + "tcId": 734, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04de047b79e1ff562e57628bdde872535608b9770220dcab2041ca67edecb93a5c2ace93ad837be7852a6241d39e6de7a4216defd658728006a6dd6a6e8ff2f5973ad383f2d8383f78752a4347a4375b41d6530aca2872bb7b786fa47008612f1f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cb1f6e5874ccacccbabe44b47f1bae50e8c35760a58bb1874aa85b91a1c598994aeb80ab990de569f08660ad577cdf2b", + "result": "valid" + }, + { + "tcId": 735, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0441eb7dd3b1004736af53009cc1658261aa1835c402e6cea265b76ac3803a655357512e54be8f2b673f1d6c7f950ac278cf28aec1922fd755aa2f1e040bc0775c0dc333ec9916911c126cfcfe576c3b68048ced966584aec980f310c81f89ca47", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "5de88b5d64bdcd8a357d4dbd51026b522c9043b1d429101228660eaaad622ac5a72e2f181d7a15909b8fdb1eea6182a7", + "result": "valid" + }, + { + "tcId": 736, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0407799c9f90521a5286a42a9591e2adcfc63670270ca1525ccdd4420d9a616e1fa703cd0d14571905ebe7f223461302b3ab96d8044f3d647f461c759a8adc9da0fa200472d2bf749159ef6f9ea4a1b481fb38cd95dac71f6cbc08b79f80aab59f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "3d9e578fde8ee8172dbc02191df54e32b7b00457fdd8dede0cc9300de7f1d8ac211ac8a58762a84fa67712185d29ea10", + "result": "valid" + }, + { + "tcId": 737, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0477829eb6d2c99567d72f6e6621a1d44a6ce442ca14c0bb24490f519e3b66cccc67c0948bfb8e68f31c8bee78032a177b271dd7b9cf38d5c582445826baa19b91740d7797f2a7463c5567b725231989fa9787a44d82e3ffec599c5ed34bc27c4c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "94d1fbca6def67a431554a5e9729697f547a697f9f35f0438f1c7bf1af3644db558ea461cad4308d154dcf7afe05e770", + "result": "valid" + }, + { + "tcId": 738, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04941bf7f1a33aeefe38e51f9585a257211ae4b03cf13622a6372de0d73d36cf2ef39eeacb6e57e9d434571f62aaa8df26c7ea6ddb3737d489d8b8993ff901904961155705fcb19427ecd0f4706839505b56d598bff2f985380306c6e3f69e68cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "077a7edad16426d283b2b537d31529b568523ef637ff211cc554a33bf9b1cd81833da93925ba43e0a2c76a0b38cb9810", + "result": "valid" + }, + { + "tcId": 739, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043d4e751c093bda22b0f08fed25b08cf285fcc579f85672476721c6c4e7b889093564811419b0e978757b3cb6e7af9cc70419817e9b14327139d93b5603f8bc4c9be293e4f1b3596a9c7c8f4e2b9e0a5754b1dd95b6b25cfc3725ae5edf136a2d", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "49801c4993728552b292c64071445833da5d9a366bcd344fb52b7bd2b8fad24cdd306026feab3f51df5782cd17f2d80a", + "result": "valid" + }, + { + "tcId": 740, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "047740407229b6af755d4a0d2b7d703b5af17de16c2691d53ea725f3961536572a8ec5445a2c3cc3bade93018a0b5efe18b3cc4b206bbde8515a62d9508ea47d0cb666ac1f5306c685ff6911888e1685a69bee79d9a65d763db18ac5efcf40e9ac", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "e166da9473ff659180d979aa705af4769be5dcd9574ec32b42b29df102ce5461d2dc3d5ff255fa3d486f4b834c54a9cd", + "result": "valid" + }, + { + "tcId": 741, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04764988e84b3ba429a18604c0c7310f42df195117ffe24aac769c08e9b4d25a53e58e6ef30ab5fc84ad47fc11a1df1e95652ad4a395b21e03683d70048c8382f6f109e064de52d9071d0065dec2dcea366148e1593660f33683da8c791ee40e09", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "276bd5a17a9713afeff49c8aa406680dc90fec0ed7b0d2885d2e934391f3eb3be459f7f72a105a994bb2bc0e19b3c3d9", + "result": "valid" + }, + { + "tcId": 742, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e40bff8c67b838eddccc73202d7d1f8d3819a00f08534131da3c9947b2d07011a01059d479d5d6e96abe27a7b98f7f0e58779e85208b7d73afd7922b5bf8a52df0c2872a2b30d78cb43bb9924e61816a9e00ddf965e8396b8955d62105653ed2", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "8c105103aeb0ad95a681bcae97869be35f83986fb683c37f3760363d76963cb8ca2f94653720ec8185c8acf20ea2adf0", + "result": "valid" + }, + { + "tcId": 743, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0493c7eb72997f3977cff177804158773ed3d00943c8a1e1015588e0ecbbc425cd761ad018321ed9d91ed63fcb04002ec317a33f14358fc63d40e73879d5ea6bc558a93bf8d7824d05c0fdd1ab521d16a0ffb06b271376f7cfec03a05a9f84f52c", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "dd1a4f026e97db1df7af899042cb80bb2b8e3fcee6c2867c0e823d94740dd949b58d122b7d7f099353d2f8814d25d024", + "result": "valid" + }, + { + "tcId": 744, + "comment": "point with coordinate y = 3 in precomputation or right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04261ec67a59d7858f82a28d2bbc6b3b891894fa864fef9e5b50996887ff5b0586f34e83dca912bc9238289eda00b243fe490c581e1dbeb546d7d261918aac0d57c027fc32573d9f888627cb167d3a52d3dc342761eed12548cc22eb218382f3da", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "b8ba51b8ba08185a6c198866496dc824cc23a9898cf92f863cb5e1f77c80ad9f9c43b26a348c56ce9928a4d3273d9640", + "result": "valid" + }, + { + "tcId": 745, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04989781d39b82c02febe6d7d68186703a2c8ac54e301085bd823bb84feebd50cb38cb38589237aa0c40422b2b656946bb1076019d401d9faed3775e92aebaba28b8a754449b0f7b2d1d617870d6f7aae7875e48430f3e0eaf75cd80332bdf8462", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "bbf52203321a68301d20edff5cf809e1ef180b48e9e1867f50c0df6dee1ca45fb48f68e7479a3376ce5dda0f7b445068", + "result": "valid" + }, + { + "tcId": 746, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c5348488968d317d9c6532f6d088cb317adbf219897f37645dc1cae48e7629f6a55bb5012fc4de18b955395adcf4beafe1b3c0e5afe41ca79187a4ec8e96846b29b6ec4e74312afc39cb4edc8bf9006685f9f7a8a8f23166f0e4fd49bf82ad15", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "cb0d8781da453a322aed0953170ce14ea1e4e7fc78ec4776d905d47da82d2cb4a466bc1da5060cf2487299f477d328af", + "result": "valid" + }, + { + "tcId": 747, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "043934b41d7ba1ef3a1096cd3538f4327225e86aa91bfa1812b953328259d21c3b18fc8c0e7bb89b22503c553ee099986a18ad9a96d4acbe66a062cb001b2301e096b8bb1abf3601af4cc7b361909d79d4aa70922cb25411920a8846ee749da4a4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "7a7591f98515f0962a94b67be0241b4df909b4044853797ad032e05b56b71d1e97950b64fcf87fab351b316732da43d9", + "result": "valid" + }, + { + "tcId": 748, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04bde89a0e52491d7f4858b527f7ded8e0a46e73068f06e77f2587001c08e2af30ff7844037d15f4313ce60e2a733189309e19123cfb213a93c03d55092f7675d8cbc9c73e3c93496be0ed7db83e48efd33ba80b5fd6b89743bb0747f4eb0901cf", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "873645e36af0f6e6c58f00c1975a0ff11d0f644a53d23d9b5bb8b9e30b0e71d929af63e89a610dc292ff3a00f33ee24e", + "result": "valid" + }, + { + "tcId": 749, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0450392412bb8cf9249be1b6eb42dde74cdb4836a8e637c366b3f3615e77975b4616420deb15b658d2dfcb264df112224f6e069e34cd471083b879a8a250402c7dc93e975698c371de98f5de194017e284123c46f2552bba209ca6250b874c7f93", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "2e0c22b92c2078e90e8e13942a3a9619f7c022cea91a0999f6eaf2b8e115b8116eba176f24a902dc48f2587fda126cb8", + "result": "valid" + }, + { + "tcId": 750, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04701f8c6116bc370d3b0f1b89e7ef952264863e137ba92254bbd78f83a866166fe255a02c22828d3a1687117d47c6addf02ac0dc2ab5201eafec69cc6f52e38fd0b8c5701772216b2f774fa93721c97749df45ba650cd6edf41da4ea46efd4c17", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "523eee028e57e9f1bc6c6bf47c496e0771e8253169fe4b9f64eb9baa5ed002ea61a5e79347a507af5fd031fac7707de0", + "result": "valid" + }, + { + "tcId": 751, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04814f8935e6ddd983f389fc5d9c01c22c50ac0a5366fe0bcd4cd1f1376be840500f9032c39ea5dd1572daddd055a91bf9f3b4b6ed13a1d17b3685a420d2b03d844cc091a964d4d6bd5e0f48d9ae59790326fad4f7d5e36e05d5211e3fcec96197", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "245d7546b1b4e4f527027169a38993b78516d6fec518ddc3ccd2e8f09365b8062e8d0cc6036566526699b9df08e1a2ae", + "result": "valid" + }, + { + "tcId": 752, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04c9caf1163281abaf2ff385d7d8c495eb23585ad39aa7123273928ad53c1bf1ad3b679f814a47a8fb70906ce0da36ae78eebaebbce5f37b36a2fea696bb82fdc5d7d9350d9b99a6cf7ab86b46eed4a0739eccaccddaa09c775152123ac0ef9292", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "6a8e0c8b26b4716e749de0663cb5cc68a7c2e5206c08753d3bfe085468acb56b7463b53d4c5b8dc96232db6fd28accc3", + "result": "valid" + }, + { + "tcId": 753, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "044fdf9296afe4b78dba72f623bbe8296ee6d3a6130a0b83b9d9aebfeaef51adb5fe8c5080f0dd0d8672b977219a3ccf7803e600a19a0535dbb8c6264fe0d18229d8d41f07875a0bca0a872b21b07cdcdb1412cd5b781c1926f2f412708a7618a6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "804d225cc26adbb78c9cfa129008c0c90bb5ccdc43bc207b25cb0c767bc23f1aaf53e46ba7a4df75cbd0a540cf6d070f", + "result": "valid" + }, + { + "tcId": 754, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "04e6038254c35b1622bef1d32ada82adfc66767dfba1ce06d346c3f192f7a50eff8011079b5ecbd4b5cdb68ff3cd5a14228b92e5bfb2d7bc3fc0c250b73bf074fea326f632d4f599652bffba07cdb3d566a3b8c63e21ed6efac22f0c43e6fc8f9f", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ef33c690784c25c8d1edb8ce4ba034b8fa6d280c6068b05c08b954be88b14f08a0f9c09fe8105412ebc73bebe14d33a4", + "result": "valid" + }, + { + "tcId": 755, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "049f618492e151a3491112c4f00e250a365acbd735ffdbdad628f6ee15ec7e337104508c425c695df30ad15b01041d97c0f8bed9fbaca4e76b3c29001a0c79fa03e76f9d1d1170571535cbd4bc31de3f12bc2696e9569984b86384d55ba8c093b6", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "ef5ceeb44df2abb97c467736b82d2494fb335ce6114af1d5e84c9319f8971f33391e749624ebfb1753457a03209b0005", + "result": "valid" + }, + { + "tcId": 756, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "041dd8b65591caf9b0f5c14ce5c93aeecc35e78a5dfb37489f75797821ec9ca86571c8d6a734c19d914f4cfdd9138f6641a7c98d977d5efe2f5176519335f3fbc622dafde0a546c9b2d4c01369bbfb7b05e9a3388f4252313027e3d40d0bf46e85", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "45a7c52e166fc01744363769d37bd8f1713efffe58d3ec88b9b3be6730ae111aab60297838cb159404383b281384aaa6", + "result": "valid" + }, + { + "tcId": 757, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "045e48eb9e377cf4a242909b219de06d306f81ab9e6528638a6c14ea783e04f0e4ec3e622e94a8b842b9a164f0ae47435753c8cf0c01121f802e085801b959d271bf775c12d9f53d4bea230fd90440e2590494a1b8b2e7dfa6615d3ab22bf7fdd4", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "f4ea77e7d09bbedbfff5bd6a435b5c8b62491d0e66e54aced512bc82d7735115cda7ade3913569ab1b75c88728e6c6bf", + "result": "valid" + }, + { + "tcId": 758, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "0482e3a00a4829dacf6ff7d41b969e41e38c7d1fe5bf576d6adcea8e78d6ef169b2ac6bdcc1bb4f07cdcb85cf4b4832980a75cea60f210587dc2fcd10dff0a9948623c38f27b94fa96eda053a1f9502e813522df9a0e3fdfc6ffd961b59d096898", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "1da43bb8eb44b1b0afacc8c8796636fb5a7ceb4bb909bb9262816b1de3e9f1698cdc9854a7fd730113d8f6648abdf9ad", + "result": "valid" + }, + { + "tcId": 759, + "comment": "point with coordinate y = 3 in right to left addition chain", + "flags": [ + "EdgeCaseDoubling" + ], + "public": "046058e344185d39375c55df10253236b7cff64237b916b04dc7d9b82767eddddc4768181fd6b7aaf38f5a37149f12ecca31976d9a3286e2180b4c41def32048f96148b6ed99c0d095a7acf7376f4b98d833963d3520ca3803e389ce611513f39e", + "private": "00c1781d86cac2c052b7e4f48cef415c5c133052f4e504397e75e4d7cd0ca149da0b4988b8a6ded5ceae4b580691376187", + "shared": "4705ac5ec0425004c5126bcc2f076a50b7766aec5597419182df82c1dcb955317e795d670092634155fd40112eb59d38", + "result": "valid" + }, + { + "tcId": 760, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "03", + "shared": "455aea9924330bd6d2d6403478327900e172e93598e254cf6d8eb13f0a3d21be51a46107333844e61dfa3d80df6928e9", + "result": "valid" + }, + { + "tcId": 761, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "shared": "db1d8ef1117282870db8113aa4f58723c756ce598686eb8ea531aa4d39abb1b982b1e7bb2648a6c268d2d351204db8d5", + "result": "valid" + }, + { + "tcId": 762, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "shared": "e98062df47ef884c9411e16466af84ad271d586008b1fbc50aeb3b36836a35a770dd42e0db84d39b26f4dcd2dc03d90b", + "result": "valid" + }, + { + "tcId": 763, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "shared": "898aae0ebf1cb49fb6b1234d60f59006325421049a8a320820e1ad6af6593cdc2229a08c500aa55ca05999d12829db9c", + "result": "valid" + }, + { + "tcId": 764, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "shared": "83f862f496ab8af12b82a8a0c047d836bdfa36281324b3a1eb2e9c1d46699d81cb125cbe4b93939fd84e1ae86d8a83cb", + "result": "valid" + }, + { + "tcId": 765, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a779ecec196accc52973", + "shared": "9a26894887a0342ca559a74a4d4a8e1d6b2084f02e1c65b3097121a9a9af047d8810fb945dc25bbf02222b3b625f1e0a", + "result": "valid" + }, + { + "tcId": 766, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecdc196accc52973", + "shared": "8a8d9dc194a26910cbdae7908d185b6ad04b620c94c5ee331e584ed804e495bebc2290a2d7006a06e65b9bcace86c6f6", + "result": "valid" + }, + { + "tcId": 767, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aece4196accc52973", + "shared": "d57f6aa12d3f07e8958499f249e52cfbe5be58482e146c5414dbbf984fc5333710350e2ce96b33beb7678381f40f1dcb", + "result": "valid" + }, + { + "tcId": 768, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec1969ccc52973", + "shared": "188e8041d9a5f0b6cfdad315ada4823beda0146774fad65b500e6ef94376ebf8af7a40ff6f6b45019a09dde7d7fb5552", + "result": "valid" + }, + { + "tcId": 769, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52959", + "shared": "2ecf9dc47e8b07ae61ddbd1680ead02698e9e8469f78d5a28328e48d0c9d7a2ac787e50cba58cc44a32fb1235d2d7027", + "result": "valid" + }, + { + "tcId": 770, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52969", + "shared": "06ee9f55079d3d3c18c683ba33e0d2521be97c4fbf7917bf3b6287d58ffcde2df88842e3f5530b39549ac20974b1b60e", + "result": "valid" + }, + { + "tcId": 771, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "shared": "455aea9924330bd6d2d6403478327900e172e93598e254cf6d8eb13f0a3d21be51a46107333844e61dfa3d80df6928e9", + "result": "valid" + }, + { + "tcId": 772, + "comment": "edge case private key", + "flags": [ + "AdditionChain" + ], + "public": "04e9dfaaab808b3aac1ccca7cc6242a7ee583249afe8ee8f66b904cc8eec34ad334456e00f33a94de8b5169cf0199550c020156e9651734ff999c5f3ea62b83d0083a6093f234457251ecf72c41e4df7cea2420b5454a7f690034380bac981e92e", + "private": "00ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52971", + "shared": "024c5281487216058270cd1cfe259e948310e4adc263a9edaa4da0bc3f5f8ce8ffc88ae41b2c050bf6dd9c8c66857237", + "result": "valid" + }, + { + "tcId": 773, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 774, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 775, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 776, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 777, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 778, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 779, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 780, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 781, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 782, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 783, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 784, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 785, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 786, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 787, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 788, + "comment": "point is not on curve", + "flags": [ + "InvalidCurveAttack" + ], + "public": "04fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 789, + "comment": "", + "flags": [ + "InvalidEncoding" + ], + "public": "", + "private": "00c6cafb74e2a50c82c7a63d13294bfea13d0bc504ba2b08a392c9081bf3815d9e44d969ed7f05ffd1d8594355053c6147", + "shared": "", + "result": "invalid" + }, + { + "tcId": 790, + "comment": "invalid public key", + "flags": [ + "InvalidCompressedPublic", + "CompressedPoint" + ], + "public": "024424530ea70bace90601f8d5869e4179a6cd689b6a18fdfec50cecf17cb836d24820211ada67815b42c2c2606303f69e", + "private": "2b9e57572da6cf4fb58cb94eab8df19383a136f219f2a515776a8bf48e1538dd1d811946c16d9f0184c9ce5cdf1dac51", + "shared": "", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp256r1_sha256_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp256r1_sha256_test.json new file mode 100644 index 000000000..19c951dbd --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp256r1_sha256_test.json @@ -0,0 +1,7243 @@ +{ + "algorithm": "ECDSA", + "schema": "ecdsa_verify_schema_v1.json", + "numberOfTests": 484, + "header": [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes": { + "ArithmeticError": { + "bugType": "EDGE_CASE", + "description": "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurrences.", + "cves": [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature": { + "bugType": "BER_ENCODING", + "description": "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect": "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves": [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey": { + "bugType": "EDGE_CASE", + "description": "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication": { + "bugType": "EDGE_CASE", + "description": "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding": { + "bugType": "CAN_OF_WORMS", + "description": "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature": { + "bugType": "AUTH_BYPASS", + "description": "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect": "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.", + "cves": [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature": { + "bugType": "AUTH_BYPASS", + "description": "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect": "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.", + "cves": [ + "CVE-2022-21449" + ] + }, + "MissingZero": { + "bugType": "LEGACY", + "description": "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect": "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse": { + "bugType": "EDGE_CASE", + "description": "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect": "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves": [ + "CVE-2019-0865" + ] + }, + "PointDuplication": { + "bugType": "EDGE_CASE", + "description": "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves": [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS": { + "bugType": "EDGE_CASE", + "description": "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect": "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves": [ + "2020-13895" + ] + }, + "SpecialCaseHash": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature": { + "bugType": "BASIC", + "description": "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups": [ + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx": "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy": "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 1, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "", + "sig": "3045022100b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a02200177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2", + "result": "valid" + }, + { + "tcId": 2, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "4d7367", + "sig": "30450220530bd6b0c9af2d69ba897f6b5fb59695cfbf33afe66dbadcf5b8d2a2a6538e23022100d85e489cb7a161fd55ededcedbf4cc0c0987e3e3f0f242cae934c72caa3f43e9", + "result": "valid" + }, + { + "tcId": 3, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "3046022100a8ea150cb80125d7381c4c1f1da8e9de2711f9917060406a73d7904519e51388022100f3ab9fa68bd47973a73b2d40480c2ba50c22c9d76ec217257288293285449b86", + "result": "valid" + }, + { + "tcId": 4, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "0000000000000000000000000000000000000000", + "sig": "3045022100986e65933ef2ed4ee5aada139f52b70539aaf63f00a91f29c69178490d57fb7102203dafedfb8da6189d372308cbf1489bbbdabf0c0217d1c0ff0f701aaa7a694b9c", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "wx": "2927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838", + "wy": "00c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200042927b10512bae3eddcfe467828128bad2903269919f7086069c8c4df6c732838c7787964eaac00e5921fb1498a60f4606766b3d9685001558d1a974e7341513e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKSexBRK64+3c/kZ4KBKLrSkDJpkZ\n9whgacjE32xzKDjHeHlk6qwA5ZIfsUmKYPRgZ2az2WhQAVWNGpdOc0FRPg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 5, + "comment": "signature malleability", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802204cd60b855d442f5b3c7b11eb6c4e0ae7525fe710fab9aa7c77a67f79e6fadd76", + "result": "valid" + }, + { + "tcId": 6, + "comment": "Legacy: ASN encoding of s misses leading 0", + "flags": [ + "MissingZero" + ], + "msg": "313233343030", + "sig": "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 7, + "comment": "valid", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "valid" + }, + { + "tcId": 8, + "comment": "length of sequence [r, s] uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "30814502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 9, + "comment": "length of sequence [r, s] contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "3082004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 10, + "comment": "length of sequence [r, s] uses 70 instead of 69", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 11, + "comment": "length of sequence [r, s] uses 68 instead of 69", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 12, + "comment": "uint32 overflow in length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3085010000004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 13, + "comment": "uint64 overflow in length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308901000000000000004502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 14, + "comment": "length of sequence [r, s] = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30847fffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 15, + "comment": "length of sequence [r, s] = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30848000000002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 16, + "comment": "length of sequence [r, s] = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3084ffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 17, + "comment": "length of sequence [r, s] = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3085ffffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 18, + "comment": "length of sequence [r, s] = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3088ffffffffffffffff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 19, + "comment": "incorrect length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30ff02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 20, + "comment": "replaced sequence [r, s] by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 21, + "comment": "removing sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "", + "result": "invalid" + }, + { + "tcId": 22, + "comment": "lonely sequence tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30", + "result": "invalid" + }, + { + "tcId": 23, + "comment": "appending 0's to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 24, + "comment": "prepending 0's to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3047000002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 25, + "comment": "appending unused 0's to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 26, + "comment": "appending null value to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0500", + "result": "invalid" + }, + { + "tcId": 27, + "comment": "prepending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a498177304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 28, + "comment": "prepending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30492500304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 29, + "comment": "appending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3047304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0004deadbeef", + "result": "invalid" + }, + { + "tcId": 30, + "comment": "including undefined tags", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304daa00bb00cd00304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 31, + "comment": "including undefined tags", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d2228aa00bb00cd0002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 32, + "comment": "including undefined tags", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182229aa00bb00cd00022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 33, + "comment": "truncated length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3081", + "result": "invalid" + }, + { + "tcId": 34, + "comment": "including undefined tags to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304baa02aabb304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 35, + "comment": "using composition with indefinite length for sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3080304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 36, + "comment": "using composition with wrong tag for sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3080314502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 37, + "comment": "Replacing sequence [r, s] with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "0500", + "result": "invalid" + }, + { + "tcId": 38, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "2e4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 39, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "2f4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 40, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "314502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 41, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "324502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 42, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "ff4502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 43, + "comment": "dropping value of sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3000", + "result": "invalid" + }, + { + "tcId": 44, + "comment": "using composition for sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30493001023044202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 45, + "comment": "truncated sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847", + "result": "invalid" + }, + { + "tcId": 46, + "comment": "truncated sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3044202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 47, + "comment": "sequence [r, s] of size 4166 to check for overflows", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3082104602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 48, + "comment": "indefinite length", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 49, + "comment": "indefinite length with truncated delimiter", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db00", + "result": "invalid" + }, + { + "tcId": 50, + "comment": "indefinite length with additional element", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db05000000", + "result": "invalid" + }, + { + "tcId": 51, + "comment": "indefinite length with truncated element", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db060811220000", + "result": "invalid" + }, + { + "tcId": 52, + "comment": "indefinite length with garbage", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000fe02beef", + "result": "invalid" + }, + { + "tcId": 53, + "comment": "indefinite length with nonempty EOC", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0002beef", + "result": "invalid" + }, + { + "tcId": 54, + "comment": "prepend empty sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3047300002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 55, + "comment": "append empty sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db3000", + "result": "invalid" + }, + { + "tcId": 56, + "comment": "append zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db020100", + "result": "invalid" + }, + { + "tcId": 57, + "comment": "append garbage with high tag number", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dbbf7f00", + "result": "invalid" + }, + { + "tcId": 58, + "comment": "append null with explicit tag", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dba0020500", + "result": "invalid" + }, + { + "tcId": 59, + "comment": "append null with implicit tag", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847dba000", + "result": "invalid" + }, + { + "tcId": 60, + "comment": "sequence of sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3047304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 61, + "comment": "truncated sequence: removed last 1 elements", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "302202202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18", + "result": "invalid" + }, + { + "tcId": 62, + "comment": "repeating element in sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "306802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 63, + "comment": "flipped bit 0 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e19022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 64, + "comment": "flipped bit 32 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af8bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 65, + "comment": "flipped bit 48 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cd6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 66, + "comment": "flipped bit 64 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30432ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee858b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 67, + "comment": "length of r uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "30460281202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 68, + "comment": "length of r contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "3047028200202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 69, + "comment": "length of r uses 33 instead of 32", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502212ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 70, + "comment": "length of r uses 31 instead of 32", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3045021f2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 71, + "comment": "uint32 overflow in length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a028501000000202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 72, + "comment": "uint64 overflow in length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304e02890100000000000000202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 73, + "comment": "length of r = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902847fffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 74, + "comment": "length of r = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30490284800000002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 75, + "comment": "length of r = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30490284ffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 76, + "comment": "length of r = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a0285ffffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 77, + "comment": "length of r = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d0288ffffffffffffffff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 78, + "comment": "incorrect length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502ff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 79, + "comment": "replaced r by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502802ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 80, + "comment": "removing r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3023022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 81, + "comment": "lonely integer tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "302402022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 82, + "comment": "lonely integer tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "302302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802", + "result": "invalid" + }, + { + "tcId": 83, + "comment": "appending 0's to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702222ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 84, + "comment": "prepending 0's to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3047022200002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 85, + "comment": "appending unused 0's to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 86, + "comment": "appending null value to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702222ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 87, + "comment": "prepending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a222549817702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 88, + "comment": "prepending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30492224250002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 89, + "comment": "appending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d222202202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180004deadbeef022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 90, + "comment": "truncated length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30250281022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 91, + "comment": "including undefined tags to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304b2226aa02aabb02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 92, + "comment": "using composition with indefinite length for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3049228002202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 93, + "comment": "using composition with wrong tag for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3049228003202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 94, + "comment": "Replacing r with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30250500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 95, + "comment": "changing tag value of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304500202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 96, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304501202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 97, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304503202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 98, + "comment": "changing tag value of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304504202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 99, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3045ff202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 100, + "comment": "dropping value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30250200022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 101, + "comment": "using composition for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3049222402012b021fa3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 102, + "comment": "modifying first byte of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3045022029a3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 103, + "comment": "modifying last byte of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e98022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 104, + "comment": "truncated r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3044021f2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 105, + "comment": "truncated r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3044021fa3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 106, + "comment": "r of size 4129 to check for overflows", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30821048028210212ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 107, + "comment": "leading ff in r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30460221ff2ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 108, + "comment": "replaced r by infinity", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3026090180022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 109, + "comment": "replacing r with zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 110, + "comment": "flipped bit 0 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847da", + "result": "invalid" + }, + { + "tcId": 111, + "comment": "flipped bit 32 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b48156847db", + "result": "invalid" + }, + { + "tcId": 112, + "comment": "flipped bit 48 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c124b49156847db", + "result": "invalid" + }, + { + "tcId": 113, + "comment": "flipped bit 64 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304302202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1800b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4097c134b49156847db", + "result": "invalid" + }, + { + "tcId": 114, + "comment": "length of s uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802812100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 115, + "comment": "length of s contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180282002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 116, + "comment": "length of s uses 34 instead of 33", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022200b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 117, + "comment": "length of s uses 32 instead of 33", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 118, + "comment": "uint32 overflow in length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180285010000002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 119, + "comment": "uint64 overflow in length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304e02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18028901000000000000002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 120, + "comment": "length of s = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802847fffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 121, + "comment": "length of s = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802848000000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 122, + "comment": "length of s = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180284ffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 123, + "comment": "length of s = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180285ffffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 124, + "comment": "length of s = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180288ffffffffffffffff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 125, + "comment": "incorrect length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1802ff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 126, + "comment": "replaced s by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18028000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 127, + "comment": "appending 0's to s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022300b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 128, + "comment": "prepending 0's to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180223000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 129, + "comment": "appending null value to s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304702202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022300b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0500", + "result": "invalid" + }, + { + "tcId": 130, + "comment": "prepending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304a02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182226498177022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 131, + "comment": "prepending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1822252500022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 132, + "comment": "appending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304d02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182223022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0004deadbeef", + "result": "invalid" + }, + { + "tcId": 133, + "comment": "truncated length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180281", + "result": "invalid" + }, + { + "tcId": 134, + "comment": "including undefined tags to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304b02202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182227aa02aabb022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 135, + "comment": "using composition with indefinite length for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182280022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 136, + "comment": "using composition with wrong tag for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e182280032100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000", + "result": "invalid" + }, + { + "tcId": 137, + "comment": "Replacing s with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180500", + "result": "invalid" + }, + { + "tcId": 138, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18002100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 139, + "comment": "changing tag value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18012100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 140, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18032100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 141, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18042100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 142, + "comment": "changing tag value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18ff2100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 143, + "comment": "dropping value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "302402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180200", + "result": "invalid" + }, + { + "tcId": 144, + "comment": "using composition for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "304902202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e1822250201000220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 145, + "comment": "modifying first byte of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022102b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 146, + "comment": "modifying last byte of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b491568475b", + "result": "invalid" + }, + { + "tcId": 147, + "comment": "truncated s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304402202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847", + "result": "invalid" + }, + { + "tcId": 148, + "comment": "s of size 4130 to check for overflows", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3082104802202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180282102200b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 149, + "comment": "leading ff in s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "304602202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e180222ff00b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 150, + "comment": "replaced s by infinity", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "302502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18090180", + "result": "invalid" + }, + { + "tcId": 151, + "comment": "replacing s with zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "302502202ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18020100", + "result": "invalid" + }, + { + "tcId": 152, + "comment": "replaced r by r + n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30460221012ba3a8bd6b94d5ed80a6d9d1190a436ebccc0833490686deac8635bcb9bf5369022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 153, + "comment": "replaced r by r - n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30460221ff2ba3a8bf6b94d5eb80a6d9d1190a436f42fe12d7fad749d4c512a036c0f908c7022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 154, + "comment": "replaced r by r + 256 * n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "3047022201002ba3a7be6b94d6ec80a6d9d1190a432be6dfbb2cb98d6d4d72972df620817f18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 155, + "comment": "replaced r by -r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30450220d45c5741946b2a137f59262ee6f5bc91001af27a5e1117a64733950642a3d1e8022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 156, + "comment": "replaced r by n - r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "3046022100d45c5740946b2a147f59262ee6f5bc90bd01ed280528b62b3aed5fc93f06f739022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 157, + "comment": "replaced r by -n - r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30460221fed45c5742946b2a127f59262ee6f5bc914333f7ccb6f979215379ca434640ac97022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 158, + "comment": "replaced r by r + 2**256", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "30460221012ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 159, + "comment": "replaced r by r + 2**320", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "304e02290100000000000000002ba3a8be6b94d5ec80a6d9d1190a436effe50d85a1eee859b8cc6af9bd5c2e18022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 160, + "comment": "replaced s by s + n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "3046022101b329f478a2bbd0a6c384ee1493b1f518276e0e4a5375928d6fcd160c11cb6d2c022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 161, + "comment": "replaced s by s - n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30450220b329f47aa2bbd0a4c384ee1493b1f518ada018ef05465583885980861905228a022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 162, + "comment": "replaced s by s + 256 * n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "304702220100b329f379a2bbd1a5c384ee1493b1f4d55181c143c3fc78fc35de0e45788d98db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 163, + "comment": "replaced s by -s", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30460221ff4cd60b865d442f5a3c7b11eb6c4e0ae79578ec6353a20bf783ecb4b6ea97b825022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 164, + "comment": "replaced s by -n - s", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30460221fe4cd60b875d442f593c7b11eb6c4e0ae7d891f1b5ac8a6d729032e9f3ee3492d4022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 165, + "comment": "replaced s by s + 2**256", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "3046022101b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 166, + "comment": "replaced s by s - 2**256", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "30450220b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 167, + "comment": "replaced s by s + 2**320", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "304e0229010000000000000000b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db022100b329f479a2bbd0a5c384ee1493b1f5186a87139cac5df4087c134b49156847db", + "result": "invalid" + }, + { + "tcId": 168, + "comment": "Signature with special case values r=0 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020100020100", + "result": "invalid" + }, + { + "tcId": 169, + "comment": "Signature with special case values r=0 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020100020101", + "result": "invalid" + }, + { + "tcId": 170, + "comment": "Signature with special case values r=0 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201000201ff", + "result": "invalid" + }, + { + "tcId": 171, + "comment": "Signature with special case values r=0 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 172, + "comment": "Signature with special case values r=0 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 173, + "comment": "Signature with special case values r=0 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 174, + "comment": "Signature with special case values r=0 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 175, + "comment": "Signature with special case values r=0 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020100022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 176, + "comment": "Signature with special case values r=1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020101020100", + "result": "invalid" + }, + { + "tcId": 177, + "comment": "Signature with special case values r=1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020101020101", + "result": "invalid" + }, + { + "tcId": 178, + "comment": "Signature with special case values r=1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201010201ff", + "result": "invalid" + }, + { + "tcId": 179, + "comment": "Signature with special case values r=1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 180, + "comment": "Signature with special case values r=1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 181, + "comment": "Signature with special case values r=1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020101022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 182, + "comment": "Signature with special case values r=1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020101022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 183, + "comment": "Signature with special case values r=1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026020101022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 184, + "comment": "Signature with special case values r=-1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff020100", + "result": "invalid" + }, + { + "tcId": 185, + "comment": "Signature with special case values r=-1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff020101", + "result": "invalid" + }, + { + "tcId": 186, + "comment": "Signature with special case values r=-1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff0201ff", + "result": "invalid" + }, + { + "tcId": 187, + "comment": "Signature with special case values r=-1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 188, + "comment": "Signature with special case values r=-1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 189, + "comment": "Signature with special case values r=-1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30260201ff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 190, + "comment": "Signature with special case values r=-1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30260201ff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 191, + "comment": "Signature with special case values r=-1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30260201ff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 192, + "comment": "Signature with special case values r=n and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020100", + "result": "invalid" + }, + { + "tcId": 193, + "comment": "Signature with special case values r=n and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551020101", + "result": "invalid" + }, + { + "tcId": 194, + "comment": "Signature with special case values r=n and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510201ff", + "result": "invalid" + }, + { + "tcId": 195, + "comment": "Signature with special case values r=n and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 196, + "comment": "Signature with special case values r=n and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 197, + "comment": "Signature with special case values r=n and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 198, + "comment": "Signature with special case values r=n and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 199, + "comment": "Signature with special case values r=n and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 200, + "comment": "Signature with special case values r=n - 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020100", + "result": "invalid" + }, + { + "tcId": 201, + "comment": "Signature with special case values r=n - 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550020101", + "result": "invalid" + }, + { + "tcId": 202, + "comment": "Signature with special case values r=n - 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325500201ff", + "result": "invalid" + }, + { + "tcId": 203, + "comment": "Signature with special case values r=n - 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 204, + "comment": "Signature with special case values r=n - 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 205, + "comment": "Signature with special case values r=n - 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 206, + "comment": "Signature with special case values r=n - 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 207, + "comment": "Signature with special case values r=n - 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 208, + "comment": "Signature with special case values r=n + 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020100", + "result": "invalid" + }, + { + "tcId": 209, + "comment": "Signature with special case values r=n + 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552020101", + "result": "invalid" + }, + { + "tcId": 210, + "comment": "Signature with special case values r=n + 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325520201ff", + "result": "invalid" + }, + { + "tcId": 211, + "comment": "Signature with special case values r=n + 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 212, + "comment": "Signature with special case values r=n + 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 213, + "comment": "Signature with special case values r=n + 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 214, + "comment": "Signature with special case values r=n + 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 215, + "comment": "Signature with special case values r=n + 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 216, + "comment": "Signature with special case values r=p and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020100", + "result": "invalid" + }, + { + "tcId": 217, + "comment": "Signature with special case values r=p and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff020101", + "result": "invalid" + }, + { + "tcId": 218, + "comment": "Signature with special case values r=p and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0201ff", + "result": "invalid" + }, + { + "tcId": 219, + "comment": "Signature with special case values r=p and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 220, + "comment": "Signature with special case values r=p and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 221, + "comment": "Signature with special case values r=p and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 222, + "comment": "Signature with special case values r=p and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 223, + "comment": "Signature with special case values r=p and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 224, + "comment": "Signature with special case values r=p + 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020100", + "result": "invalid" + }, + { + "tcId": 225, + "comment": "Signature with special case values r=p + 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000001000000000000000000000000020101", + "result": "invalid" + }, + { + "tcId": 226, + "comment": "Signature with special case values r=p + 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff000000010000000000000000000000010000000000000000000000000201ff", + "result": "invalid" + }, + { + "tcId": 227, + "comment": "Signature with special case values r=p + 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551", + "result": "invalid" + }, + { + "tcId": 228, + "comment": "Signature with special case values r=p + 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632550", + "result": "invalid" + }, + { + "tcId": 229, + "comment": "Signature with special case values r=p + 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632552", + "result": "invalid" + }, + { + "tcId": 230, + "comment": "Signature with special case values r=p + 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff", + "result": "invalid" + }, + { + "tcId": 231, + "comment": "Signature with special case values r=p + 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000001000000000000000000000000022100ffffffff00000001000000000000000000000001000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 232, + "comment": "Signature encoding contains incorrect types: r=0, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008020100090380fe01", + "result": "invalid" + }, + { + "tcId": 233, + "comment": "Signature encoding contains incorrect types: r=0, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100090142", + "result": "invalid" + }, + { + "tcId": 234, + "comment": "Signature encoding contains incorrect types: r=0, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100010101", + "result": "invalid" + }, + { + "tcId": 235, + "comment": "Signature encoding contains incorrect types: r=0, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100010100", + "result": "invalid" + }, + { + "tcId": 236, + "comment": "Signature encoding contains incorrect types: r=0, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201000500", + "result": "invalid" + }, + { + "tcId": 237, + "comment": "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201000c00", + "result": "invalid" + }, + { + "tcId": 238, + "comment": "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201000c0130", + "result": "invalid" + }, + { + "tcId": 239, + "comment": "Signature encoding contains incorrect types: r=0, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201003000", + "result": "invalid" + }, + { + "tcId": 240, + "comment": "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201003003020100", + "result": "invalid" + }, + { + "tcId": 241, + "comment": "Signature encoding contains incorrect types: r=1, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008020101090380fe01", + "result": "invalid" + }, + { + "tcId": 242, + "comment": "Signature encoding contains incorrect types: r=1, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101090142", + "result": "invalid" + }, + { + "tcId": 243, + "comment": "Signature encoding contains incorrect types: r=1, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101010101", + "result": "invalid" + }, + { + "tcId": 244, + "comment": "Signature encoding contains incorrect types: r=1, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101010100", + "result": "invalid" + }, + { + "tcId": 245, + "comment": "Signature encoding contains incorrect types: r=1, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201010500", + "result": "invalid" + }, + { + "tcId": 246, + "comment": "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201010c00", + "result": "invalid" + }, + { + "tcId": 247, + "comment": "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201010c0130", + "result": "invalid" + }, + { + "tcId": 248, + "comment": "Signature encoding contains incorrect types: r=1, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201013000", + "result": "invalid" + }, + { + "tcId": 249, + "comment": "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201013003020100", + "result": "invalid" + }, + { + "tcId": 250, + "comment": "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201ff090380fe01", + "result": "invalid" + }, + { + "tcId": 251, + "comment": "Signature encoding contains incorrect types: r=-1, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff090142", + "result": "invalid" + }, + { + "tcId": 252, + "comment": "Signature encoding contains incorrect types: r=-1, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff010101", + "result": "invalid" + }, + { + "tcId": 253, + "comment": "Signature encoding contains incorrect types: r=-1, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff010100", + "result": "invalid" + }, + { + "tcId": 254, + "comment": "Signature encoding contains incorrect types: r=-1, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff0500", + "result": "invalid" + }, + { + "tcId": 255, + "comment": "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff0c00", + "result": "invalid" + }, + { + "tcId": 256, + "comment": "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff0c0130", + "result": "invalid" + }, + { + "tcId": 257, + "comment": "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff3000", + "result": "invalid" + }, + { + "tcId": 258, + "comment": "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201ff3003020100", + "result": "invalid" + }, + { + "tcId": 259, + "comment": "Signature encoding contains incorrect types: r=n, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090380fe01", + "result": "invalid" + }, + { + "tcId": 260, + "comment": "Signature encoding contains incorrect types: r=n, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551090142", + "result": "invalid" + }, + { + "tcId": 261, + "comment": "Signature encoding contains incorrect types: r=n, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010101", + "result": "invalid" + }, + { + "tcId": 262, + "comment": "Signature encoding contains incorrect types: r=n, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551010100", + "result": "invalid" + }, + { + "tcId": 263, + "comment": "Signature encoding contains incorrect types: r=n, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510500", + "result": "invalid" + }, + { + "tcId": 264, + "comment": "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c00", + "result": "invalid" + }, + { + "tcId": 265, + "comment": "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325510c0130", + "result": "invalid" + }, + { + "tcId": 266, + "comment": "Signature encoding contains incorrect types: r=n, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513000", + "result": "invalid" + }, + { + "tcId": 267, + "comment": "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3028022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6325513003020100", + "result": "invalid" + }, + { + "tcId": 268, + "comment": "Signature encoding contains incorrect types: r=p, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090380fe01", + "result": "invalid" + }, + { + "tcId": 269, + "comment": "Signature encoding contains incorrect types: r=p, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff090142", + "result": "invalid" + }, + { + "tcId": 270, + "comment": "Signature encoding contains incorrect types: r=p, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010101", + "result": "invalid" + }, + { + "tcId": 271, + "comment": "Signature encoding contains incorrect types: r=p, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff010100", + "result": "invalid" + }, + { + "tcId": 272, + "comment": "Signature encoding contains incorrect types: r=p, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0500", + "result": "invalid" + }, + { + "tcId": 273, + "comment": "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c00", + "result": "invalid" + }, + { + "tcId": 274, + "comment": "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff0c0130", + "result": "invalid" + }, + { + "tcId": 275, + "comment": "Signature encoding contains incorrect types: r=p, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3025022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3000", + "result": "invalid" + }, + { + "tcId": 276, + "comment": "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3028022100ffffffff00000001000000000000000000000000ffffffffffffffffffffffff3003020100", + "result": "invalid" + }, + { + "tcId": 277, + "comment": "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300a090380fe01090380fe01", + "result": "invalid" + }, + { + "tcId": 278, + "comment": "Signature encoding contains incorrect types: r=nan, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006090142090142", + "result": "invalid" + }, + { + "tcId": 279, + "comment": "Signature encoding contains incorrect types: r=True, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010101010101", + "result": "invalid" + }, + { + "tcId": 280, + "comment": "Signature encoding contains incorrect types: r=False, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010100010100", + "result": "invalid" + }, + { + "tcId": 281, + "comment": "Signature encoding contains incorrect types: r=Null, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300405000500", + "result": "invalid" + }, + { + "tcId": 282, + "comment": "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30040c000c00", + "result": "invalid" + }, + { + "tcId": 283, + "comment": "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060c01300c0130", + "result": "invalid" + }, + { + "tcId": 284, + "comment": "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300430003000", + "result": "invalid" + }, + { + "tcId": 285, + "comment": "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300a30030201003003020100", + "result": "invalid" + }, + { + "tcId": 286, + "comment": "Signature encoding contains incorrect types: r=0.25, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008090380fe01020100", + "result": "invalid" + }, + { + "tcId": 287, + "comment": "Signature encoding contains incorrect types: r=nan, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006090142020100", + "result": "invalid" + }, + { + "tcId": 288, + "comment": "Signature encoding contains incorrect types: r=True, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010101020100", + "result": "invalid" + }, + { + "tcId": 289, + "comment": "Signature encoding contains incorrect types: r=False, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010100020100", + "result": "invalid" + }, + { + "tcId": 290, + "comment": "Signature encoding contains incorrect types: r=Null, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050500020100", + "result": "invalid" + }, + { + "tcId": 291, + "comment": "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050c00020100", + "result": "invalid" + }, + { + "tcId": 292, + "comment": "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060c0130020100", + "result": "invalid" + }, + { + "tcId": 293, + "comment": "Signature encoding contains incorrect types: r=empty list, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30053000020100", + "result": "invalid" + }, + { + "tcId": 294, + "comment": "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30083003020100020100", + "result": "invalid" + }, + { + "tcId": 295, + "comment": "Edge case for Shamir multiplication", + "flags": [ + "EdgeCaseShamirMultiplication" + ], + "msg": "3639383139", + "sig": "3044022064a1aab5000d0e804f3e2fc02bdee9be8ff312334e2ba16d11547c97711c898e02206af015971cc30be6d1a206d4e013e0997772a2f91d73286ffd683b9bb2cf4f1b", + "result": "valid" + }, + { + "tcId": 296, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343236343739373234", + "sig": "3044022016aea964a2f6506d6f78c81c91fc7e8bded7d397738448de1e19a0ec580bf2660220252cd762130c6667cfe8b7bc47d27d78391e8e80c578d1cd38c3ff033be928e9", + "result": "valid" + }, + { + "tcId": 297, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37313338363834383931", + "sig": "30450221009cc98be2347d469bf476dfc26b9b733df2d26d6ef524af917c665baccb23c8820220093496459effe2d8d70727b82462f61d0ec1b7847929d10ea631dacb16b56c32", + "result": "valid" + }, + { + "tcId": 298, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130333539333331363638", + "sig": "3044022073b3c90ecd390028058164524dde892703dce3dea0d53fa8093999f07ab8aa4302202f67b0b8e20636695bb7d8bf0a651c802ed25a395387b5f4188c0c4075c88634", + "result": "valid" + }, + { + "tcId": 299, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33393439343031323135", + "sig": "3046022100bfab3098252847b328fadf2f89b95c851a7f0eb390763378f37e90119d5ba3dd022100bdd64e234e832b1067c2d058ccb44d978195ccebb65c2aaf1e2da9b8b4987e3b", + "result": "valid" + }, + { + "tcId": 300, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31333434323933303739", + "sig": "30440220204a9784074b246d8bf8bf04a4ceb1c1f1c9aaab168b1596d17093c5cd21d2cd022051cce41670636783dc06a759c8847868a406c2506fe17975582fe648d1d88b52", + "result": "valid" + }, + { + "tcId": 301, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33373036323131373132", + "sig": "3046022100ed66dc34f551ac82f63d4aa4f81fe2cb0031a91d1314f835027bca0f1ceeaa0302210099ca123aa09b13cd194a422e18d5fda167623c3f6e5d4d6abb8953d67c0c48c7", + "result": "valid" + }, + { + "tcId": 302, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333433363838373132", + "sig": "30450220060b700bef665c68899d44f2356a578d126b062023ccc3c056bf0f60a237012b0221008d186c027832965f4fcc78a3366ca95dedbb410cbef3f26d6be5d581c11d3610", + "result": "valid" + }, + { + "tcId": 303, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31333531353330333730", + "sig": "30460221009f6adfe8d5eb5b2c24d7aa7934b6cf29c93ea76cd313c9132bb0c8e38c96831d022100b26a9c9e40e55ee0890c944cf271756c906a33e66b5bd15e051593883b5e9902", + "result": "valid" + }, + { + "tcId": 304, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36353533323033313236", + "sig": "3045022100a1af03ca91677b673ad2f33615e56174a1abf6da168cebfa8868f4ba273f16b7022020aa73ffe48afa6435cd258b173d0c2377d69022e7d098d75caf24c8c5e06b1c", + "result": "valid" + }, + { + "tcId": 305, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31353634333436363033", + "sig": "3045022100fdc70602766f8eed11a6c99a71c973d5659355507b843da6e327a28c11893db902203df5349688a085b137b1eacf456a9e9e0f6d15ec0078ca60a7f83f2b10d21350", + "result": "valid" + }, + { + "tcId": 306, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34343239353339313137", + "sig": "3046022100b516a314f2fce530d6537f6a6c49966c23456f63c643cf8e0dc738f7b876e675022100d39ffd033c92b6d717dd536fbc5efdf1967c4bd80954479ba66b0120cd16fff2", + "result": "valid" + }, + { + "tcId": 307, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130393533323631333531", + "sig": "304402203b2cbf046eac45842ecb7984d475831582717bebb6492fd0a485c101e29ff0a802204c9b7b47a98b0f82de512bc9313aaf51701099cac5f76e68c8595fc1c1d99258", + "result": "valid" + }, + { + "tcId": 308, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35393837333530303431", + "sig": "3044022030c87d35e636f540841f14af54e2f9edd79d0312cfa1ab656c3fb15bfde48dcf022047c15a5a82d24b75c85a692bd6ecafeb71409ede23efd08e0db9abf6340677ed", + "result": "valid" + }, + { + "tcId": 309, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33343633303036383738", + "sig": "3044022038686ff0fda2cef6bc43b58cfe6647b9e2e8176d168dec3c68ff262113760f520220067ec3b651f422669601662167fa8717e976e2db5e6a4cf7c2ddabb3fde9d67d", + "result": "valid" + }, + { + "tcId": 310, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "39383137333230323837", + "sig": "3044022044a3e23bf314f2b344fc25c7f2de8b6af3e17d27f5ee844b225985ab6e2775cf02202d48e223205e98041ddc87be532abed584f0411f5729500493c9cc3f4dd15e86", + "result": "valid" + }, + { + "tcId": 311, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323232303431303436", + "sig": "304402202ded5b7ec8e90e7bf11f967a3d95110c41b99db3b5aa8d330eb9d638781688e902207d5792c53628155e1bfc46fb1a67e3088de049c328ae1f44ec69238a009808f9", + "result": "valid" + }, + { + "tcId": 312, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36363636333037313034", + "sig": "3046022100bdae7bcb580bf335efd3bc3d31870f923eaccafcd40ec2f605976f15137d8b8f022100f6dfa12f19e525270b0106eecfe257499f373a4fb318994f24838122ce7ec3c7", + "result": "valid" + }, + { + "tcId": 313, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31303335393531383938", + "sig": "3045022050f9c4f0cd6940e162720957ffff513799209b78596956d21ece251c2401f1c6022100d7033a0a787d338e889defaaabb106b95a4355e411a59c32aa5167dfab244726", + "result": "valid" + }, + { + "tcId": 314, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31383436353937313935", + "sig": "3045022100f612820687604fa01906066a378d67540982e29575d019aabe90924ead5c860d02203f9367702dd7dd4f75ea98afd20e328a1a99f4857b316525328230ce294b0fef", + "result": "valid" + }, + { + "tcId": 315, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33313336303436313839", + "sig": "30460221009505e407657d6e8bc93db5da7aa6f5081f61980c1949f56b0f2f507da5782a7a022100c60d31904e3669738ffbeccab6c3656c08e0ed5cb92b3cfa5e7f71784f9c5021", + "result": "valid" + }, + { + "tcId": 316, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32363633373834323534", + "sig": "3046022100bbd16fbbb656b6d0d83e6a7787cd691b08735aed371732723e1c68a40404517d0221009d8e35dba96028b7787d91315be675877d2d097be5e8ee34560e3e7fd25c0f00", + "result": "valid" + }, + { + "tcId": 317, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363532313030353234", + "sig": "304402202ec9760122db98fd06ea76848d35a6da442d2ceef7559a30cf57c61e92df327e02207ab271da90859479701fccf86e462ee3393fb6814c27b760c4963625c0a19878", + "result": "valid" + }, + { + "tcId": 318, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35373438303831363936", + "sig": "3044022054e76b7683b6650baa6a7fc49b1c51eed9ba9dd463221f7a4f1005a89fe00c5902202ea076886c773eb937ec1cc8374b7915cfd11b1c1ae1166152f2f7806a31c8fd", + "result": "valid" + }, + { + "tcId": 319, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36333433393133343638", + "sig": "304402205291deaf24659ffbbce6e3c26f6021097a74abdbb69be4fb10419c0c496c9466022065d6fcf336d27cc7cdb982bb4e4ecef5827f84742f29f10abf83469270a03dc3", + "result": "valid" + }, + { + "tcId": 320, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31353431313033353938", + "sig": "30450220207a3241812d75d947419dc58efb05e8003b33fc17eb50f9d15166a88479f107022100cdee749f2e492b213ce80b32d0574f62f1c5d70793cf55e382d5caadf7592767", + "result": "valid" + }, + { + "tcId": 321, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130343738353830313238", + "sig": "304502206554e49f82a855204328ac94913bf01bbe84437a355a0a37c0dee3cf81aa7728022100aea00de2507ddaf5c94e1e126980d3df16250a2eaebc8be486effe7f22b4f929", + "result": "valid" + }, + { + "tcId": 322, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130353336323835353638", + "sig": "3046022100a54c5062648339d2bff06f71c88216c26c6e19b4d80a8c602990ac82707efdfc022100e99bbe7fcfafae3e69fd016777517aa01056317f467ad09aff09be73c9731b0d", + "result": "valid" + }, + { + "tcId": 323, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393533393034313035", + "sig": "3045022100975bd7157a8d363b309f1f444012b1a1d23096593133e71b4ca8b059cff37eaf02207faa7a28b1c822baa241793f2abc930bd4c69840fe090f2aacc46786bf919622", + "result": "valid" + }, + { + "tcId": 324, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393738383438303339", + "sig": "304402205694a6f84b8f875c276afd2ebcfe4d61de9ec90305afb1357b95b3e0da43885e02200dffad9ffd0b757d8051dec02ebdf70d8ee2dc5c7870c0823b6ccc7c679cbaa4", + "result": "valid" + }, + { + "tcId": 325, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33363130363732343432", + "sig": "3045022100a0c30e8026fdb2b4b4968a27d16a6d08f7098f1a98d21620d7454ba9790f1ba602205e470453a8a399f15baf463f9deceb53acc5ca64459149688bd2760c65424339", + "result": "valid" + }, + { + "tcId": 326, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31303534323430373035", + "sig": "30440220614ea84acf736527dd73602cd4bb4eea1dfebebd5ad8aca52aa0228cf7b99a880220737cc85f5f2d2f60d1b8183f3ed490e4de14368e96a9482c2a4dd193195c902f", + "result": "valid" + }, + { + "tcId": 327, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35313734343438313937", + "sig": "3045022100bead6734ebe44b810d3fb2ea00b1732945377338febfd439a8d74dfbd0f942fa02206bb18eae36616a7d3cad35919fd21a8af4bbe7a10f73b3e036a46b103ef56e2a", + "result": "valid" + }, + { + "tcId": 328, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31393637353631323531", + "sig": "30440220499625479e161dacd4db9d9ce64854c98d922cbf212703e9654fae182df9bad2022042c177cf37b8193a0131108d97819edd9439936028864ac195b64fca76d9d693", + "result": "valid" + }, + { + "tcId": 329, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33343437323533333433", + "sig": "3045022008f16b8093a8fb4d66a2c8065b541b3d31e3bfe694f6b89c50fb1aaa6ff6c9b20221009d6455e2d5d1779748573b611cb95d4a21f967410399b39b535ba3e5af81ca2e", + "result": "valid" + }, + { + "tcId": 330, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333638323634333138", + "sig": "3046022100be26231b6191658a19dd72ddb99ed8f8c579b6938d19bce8eed8dc2b338cb5f8022100e1d9a32ee56cffed37f0f22b2dcb57d5c943c14f79694a03b9c5e96952575c89", + "result": "valid" + }, + { + "tcId": 331, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323631313938363038", + "sig": "3045022015e76880898316b16204ac920a02d58045f36a229d4aa4f812638c455abe0443022100e74d357d3fcb5c8c5337bd6aba4178b455ca10e226e13f9638196506a1939123", + "result": "valid" + }, + { + "tcId": 332, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "39363738373831303934", + "sig": "30440220352ecb53f8df2c503a45f9846fc28d1d31e6307d3ddbffc1132315cc07f16dad02201348dfa9c482c558e1d05c5242ca1c39436726ecd28258b1899792887dd0a3c6", + "result": "valid" + }, + { + "tcId": 333, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34393538383233383233", + "sig": "304402204a40801a7e606ba78a0da9882ab23c7677b8642349ed3d652c5bfa5f2a9558fb02203a49b64848d682ef7f605f2832f7384bdc24ed2925825bf8ea77dc5981725782", + "result": "valid" + }, + { + "tcId": 334, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "383234363337383337", + "sig": "3045022100eacc5e1a8304a74d2be412b078924b3bb3511bac855c05c9e5e9e44df3d61e9602207451cd8e18d6ed1885dd827714847f96ec4bb0ed4c36ce9808db8f714204f6d1", + "result": "valid" + }, + { + "tcId": 335, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3131303230383333373736", + "sig": "304502202f7a5e9e5771d424f30f67fdab61e8ce4f8cd1214882adb65f7de94c31577052022100ac4e69808345809b44acb0b2bd889175fb75dd050c5a449ab9528f8f78daa10c", + "result": "valid" + }, + { + "tcId": 336, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "313333383731363438", + "sig": "3045022100ffcda40f792ce4d93e7e0f0e95e1a2147dddd7f6487621c30a03d710b3300219022079938b55f8a17f7ed7ba9ade8f2065a1fa77618f0b67add8d58c422c2453a49a", + "result": "valid" + }, + { + "tcId": 337, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333232313434313632", + "sig": "304602210081f2359c4faba6b53d3e8c8c3fcc16a948350f7ab3a588b28c17603a431e39a8022100cd6f6a5cc3b55ead0ff695d06c6860b509e46d99fccefb9f7f9e101857f74300", + "result": "valid" + }, + { + "tcId": 338, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130363836363535353436", + "sig": "3045022100dfc8bf520445cbb8ee1596fb073ea283ea130251a6fdffa5c3f5f2aaf75ca8080220048e33efce147c9dd92823640e338e68bfd7d0dc7a4905b3a7ac711e577e90e7", + "result": "valid" + }, + { + "tcId": 339, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3632313535323436", + "sig": "3046022100ad019f74c6941d20efda70b46c53db166503a0e393e932f688227688ba6a576202210093320eb7ca0710255346bdbb3102cdcf7964ef2e0988e712bc05efe16c199345", + "result": "valid" + }, + { + "tcId": 340, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37303330383138373734", + "sig": "3046022100ac8096842e8add68c34e78ce11dd71e4b54316bd3ebf7fffdeb7bd5a3ebc1883022100f5ca2f4f23d674502d4caf85d187215d36e3ce9f0ce219709f21a3aac003b7a8", + "result": "valid" + }, + { + "tcId": 341, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35393234353233373434", + "sig": "30440220677b2d3a59b18a5ff939b70ea002250889ddcd7b7b9d776854b4943693fb92f702206b4ba856ade7677bf30307b21f3ccda35d2f63aee81efd0bab6972cc0795db55", + "result": "valid" + }, + { + "tcId": 342, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31343935353836363231", + "sig": "30450220479e1ded14bcaed0379ba8e1b73d3115d84d31d4b7c30e1f05e1fc0d5957cfb0022100918f79e35b3d89487cf634a4f05b2e0c30857ca879f97c771e877027355b2443", + "result": "valid" + }, + { + "tcId": 343, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34303035333134343036", + "sig": "3044022043dfccd0edb9e280d9a58f01164d55c3d711e14b12ac5cf3b64840ead512a0a302201dbe33fa8ba84533cd5c4934365b3442ca1174899b78ef9a3199f49584389772", + "result": "valid" + }, + { + "tcId": 344, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33303936343537353132", + "sig": "304402205b09ab637bd4caf0f4c7c7e4bca592fea20e9087c259d26a38bb4085f0bbff11022045b7eb467b6748af618e9d80d6fdcd6aa24964e5a13f885bca8101de08eb0d75", + "result": "valid" + }, + { + "tcId": 345, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32373834303235363230", + "sig": "304502205e9b1c5a028070df5728c5c8af9b74e0667afa570a6cfa0114a5039ed15ee06f022100b1360907e2d9785ead362bb8d7bd661b6c29eeffd3c5037744edaeb9ad990c20", + "result": "valid" + }, + { + "tcId": 346, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32363138373837343138", + "sig": "304502200671a0a85c2b72d54a2fb0990e34538b4890050f5a5712f6d1a7a5fb8578f32e022100db1846bab6b7361479ab9c3285ca41291808f27fd5bd4fdac720e5854713694c", + "result": "valid" + }, + { + "tcId": 347, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363432363235323632", + "sig": "304402207673f8526748446477dbbb0590a45492c5d7d69859d301abbaedb35b2095103a02203dc70ddf9c6b524d886bed9e6af02e0e4dec0d417a414fed3807ef4422913d7c", + "result": "valid" + }, + { + "tcId": 348, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36383234313839343336", + "sig": "304402207f085441070ecd2bb21285089ebb1aa6450d1a06c36d3ff39dfd657a796d12b50220249712012029870a2459d18d47da9aa492a5e6cb4b2d8dafa9e4c5c54a2b9a8b", + "result": "valid" + }, + { + "tcId": 349, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343834323435343235", + "sig": "3046022100914c67fb61dd1e27c867398ea7322d5ab76df04bc5aa6683a8e0f30a5d287348022100fa07474031481dda4953e3ac1959ee8cea7e66ec412b38d6c96d28f6d37304ea", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "040ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e", + "wx": "0ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103", + "wy": "00c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200040ad99500288d466940031d72a9f5445a4d43784640855bf0a69874d2de5fe103c5011e6ef2c42dcd50d5d3d29f99ae6eba2c80c9244f4c5422f0979ff0c3ba5e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECtmVACiNRmlAAx1yqfVEWk1DeEZA\nhVvwpph00t5f4QPFAR5u8sQtzVDV09Kfma5uuiyAySRPTFQi8Jef8MO6Xg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 350, + "comment": "k*G has a large x-coordinate", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "303502104319055358e8617b0c46353d039cdaab022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "valid" + }, + { + "tcId": 351, + "comment": "r too large", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000001000000000000000000000000fffffffffffffffffffffffc022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c58220455419235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45", + "wx": "00ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c582204554", + "wy": "19235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004ab05fd9d0de26b9ce6f4819652d9fc69193d0aa398f0fba8013e09c58220455419235271228c786759095d12b75af0692dd4103f19f6a8c32f49435a1e9b8d45", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqwX9nQ3ia5zm9IGWUtn8aRk9CqOY\n8PuoAT4JxYIgRVQZI1JxIox4Z1kJXRK3WvBpLdQQPxn2qMMvSUNaHpuNRQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 352, + "comment": "r,s are large", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254f022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0480984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c5611feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95", + "wx": "0080984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c56", + "wy": "11feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000480984f39a1ff38a86a68aa4201b6be5dfbfecf876219710b07badf6fdd4c6c5611feb97390d9826e7a06dfb41871c940d74415ed3cac2089f1445019bb55ed95", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgJhPOaH/OKhqaKpCAba+Xfv+z4di\nGXELB7rfb91MbFYR/rlzkNmCbnoG37QYcclA10QV7TysIInxRFAZu1XtlQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 353, + "comment": "r and s^-1 have a large Hamming weight", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100909135bdb6799286170f5ead2de4f6511453fe50914f3df2de54a36383df8dd4", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "044201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c0595c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e", + "wx": "4201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c05", + "wy": "0095c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200044201b4272944201c3294f5baa9a3232b6dd687495fcc19a70a95bc602b4f7c0595c37eba9ee8171c1bb5ac6feaf753bc36f463e3aef16629572c0c0a8fb0800e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQgG0JylEIBwylPW6qaMjK23Wh0lf\nzBmnCpW8YCtPfAWVw366nugXHBu1rG/q91O8NvRj467xZilXLAwKj7CADg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 354, + "comment": "r and s^-1 have a large Hamming weight", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022027b4577ca009376f71303fd5dd227dcef5deb773ad5f5a84360644669ca249a5", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac9575d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b", + "wx": "00a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac957", + "wy": "5d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004a71af64de5126a4a4e02b7922d66ce9415ce88a4c9d25514d91082c8725ac9575d47723c8fbe580bb369fec9c2665d8e30a435b9932645482e7c9f11e872296b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpxr2TeUSakpOAreSLWbOlBXOiKTJ\n0lUU2RCCyHJayVddR3I8j75YC7Np/snCZl2OMKQ1uZMmRUgufJ8R6HIpaw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 355, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020105020101", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b15726170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5", + "wx": "6627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b1572", + "wy": "6170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046627cec4f0731ea23fc2931f90ebe5b7572f597d20df08fc2b31ee8ef16b15726170ed77d8d0a14fc5c9c3c4c9be7f0d3ee18f709bb275eaf2073e258fe694a5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZifOxPBzHqI/wpMfkOvlt1cvWX0g\n3wj8KzHujvFrFXJhcO132NChT8XJw8TJvn8NPuGPcJuyderyBz4lj+aUpQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 356, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020105020103", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bfef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813", + "wx": "5a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bf", + "wy": "00ef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045a7c8825e85691cce1f5e7544c54e73f14afc010cb731343262ca7ec5a77f5bfef6edf62a4497c1bd7b147fb6c3d22af3c39bfce95f30e13a16d3d7b2812f813", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWnyIJehWkczh9edUTFTnPxSvwBDL\ncxNDJiyn7Fp39b/vbt9ipEl8G9exR/tsPSKvPDm/zpXzDhOhbT17KBL4Ew==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 357, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020105020105", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c73770af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1", + "wx": "00cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c737", + "wy": "70af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004cbe0c29132cd738364fedd603152990c048e5e2fff996d883fa6caca7978c73770af6a8ce44cb41224b2603606f4c04d188e80bff7cc31ad5189d4ab0d70e8c1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEy+DCkTLNc4Nk/t1gMVKZDASOXi//\nmW2IP6bKynl4xzdwr2qM5Ey0EiSyYDYG9MBNGI6Av/fMMa1RidSrDXDowQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 358, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020105020106", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "042ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2ea8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76", + "wx": "2ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2e", + "wy": "00a8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200042ef747671c97d9c7f9cb2f6a30d678c3d84757ba241ef7183d51a29f52d87c2ea8fb2ea635b761baefc1c4ded2099281b844e13e044c328553bbbafa337d8a76", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELvdHZxyX2cf5yy9qMNZ4w9hHV7ok\nHvcYPVGin1LYfC6o+y6mNbdhuu/BxN7SCZKBuEThPgRMMoVTu7r6M32Kdg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 359, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020106020101", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995", + "wx": "00931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf", + "wy": "058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004931cc49cda4d87d25b1601c56c3b83b4f45e44971998f2d3e7d3c55152214edf058dc140abbba42fc1ddbf30dab8eb9b46ee7338b3f7ee96242bf45e1df5e995", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkxzEnNpNh9JbFgHFbDuDtPReRJcZ\nmPLT59PFUVIhTt8FjcFAq7ukL8HdvzDauOubRu5zOLP37pYkK/ReHfXplQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 360, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020106020103", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3", + "wx": "00899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed", + "wy": "47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004899a4af61867e3f3c190dbb48f8bc9fc74b70a467a4a1f06477b3af2f39ab8ed47ac000f9ea8a3034939bf48ad5d061a69fc8495ae4df2dbec7effa03a0062b3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiZpK9hhn4/PBkNu0j4vJ/HS3CkZ6\nSh8GR3s68vOauO1HrAAPnqijA0k5v0itXQYaafyEla5N8tvsfv+gOgBisw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 361, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020106020106", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c46d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46", + "wx": "00d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c4", + "wy": "6d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d03eb09913cc20c6a8d0070f0d8d2a7f63527fafa44117fce6bd1ef2aa4ae3c46d5df3f45ac58fa334c6d102381b3120b7a2455600dcaff3d1a845514f12bf46", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0D6wmRPMIMao0AcPDY0qf2NSf6+k\nQRf85r0e8qpK48RtXfP0WsWPozTG0QI4GzEgt6JFVgDcr/PRqEVRTxK/Rg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 362, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020106020107", + "result": "valid" + }, + { + "tcId": 363, + "comment": "r is larger than n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3026022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632557020107", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04", + "wx": "3a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da", + "wy": "592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043a72476291571193b4d109b2c37b59f2807e8fe9cffd804eacded903e77ca0da592dbc74fee0ca7508cc7bc282b0c51a143286ff53c60131668e7a0929e4ed04", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEOnJHYpFXEZO00Qmyw3tZ8oB+j+nP\n/YBOrN7ZA+d8oNpZLbx0/uDKdQjMe8KCsMUaFDKG/1PGATFmjnoJKeTtBA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 364, + "comment": "s is larger than n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc75fbd8", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1", + "wx": "00d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9", + "wy": "00971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0f73792203716afd4be4329faa48d269f15313ebbba379d7783c97bf3e890d9971f4a3206605bec21782bf5e275c714417e8f566549e6bc68690d2363c89cc1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0Pc3kiA3Fq/UvkMp+qSNJp8VMT67\nujedd4PJe/PokNmXH0oyBmBb7CF4K/XidccUQX6PVmVJ5rxoaQ0jY8icwQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 365, + "comment": "small r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3027020201000221008f1e3c7862c58b16bb76eddbb76eddbb516af4f63f2d74d76e0d28c9bb75ea88", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "044838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05ffa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b", + "wx": "4838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05f", + "wy": "00fa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200044838b2be35a6276a80ef9e228140f9d9b96ce83b7a254f71ccdebbb8054ce05ffa9cbc123c919b19e00238198d04069043bd660a828814051fcb8aac738a6c6b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAESDiyvjWmJ2qA754igUD52bls6Dt6\nJU9xzN67uAVM4F/6nLwSPJGbGeACOBmNBAaQQ71mCoKIFAUfy4qsc4psaw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 366, + "comment": "smallish r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "302c02072d9b4d347952d6022100ef3043e7329581dbb3974497710ab11505ee1c87ff907beebadd195a0ffe6d7a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "047393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526", + "wx": "7393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64", + "wy": "00e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200047393983ca30a520bbc4783dc9960746aab444ef520c0a8e771119aa4e74b0f64e9d7be1ab01a0bf626e709863e6a486dbaf32793afccf774e2c6cd27b1857526", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEc5OYPKMKUgu8R4PcmWB0aqtETvUg\nwKjncRGapOdLD2Tp174asBoL9ibnCYY+akhtuvMnk6/M93Tixs0nsYV1Jg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 367, + "comment": "100-bit r and small s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3032020d1033e67e37b32b445580bf4eff0221008b748b74000000008b748b748b748b7466e769ad4a16d3dcd87129b8e91d1b4d", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b", + "wx": "5ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5", + "wy": "00fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045ac331a1103fe966697379f356a937f350588a05477e308851b8a502d5dfcdc5fe9993df4b57939b2b8da095bf6d794265204cfe03be995a02e65d408c871c0b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWsMxoRA/6WZpc3nzVqk381BYigVH\nfjCIUbilAtXfzcX+mZPfS1eTmyuNoJW/bXlCZSBM/gO+mVoC5l1AjIccCw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 368, + "comment": "small r and 100 bit s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "302702020100022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "041d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9", + "wx": "1d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509", + "wy": "00dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200041d209be8de2de877095a399d3904c74cc458d926e27bb8e58e5eae5767c41509dd59e04c214f7b18dce351fc2a549893a6860e80163f38cc60a4f2c9d040d8c9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEHSCb6N4t6HcJWjmdOQTHTMRY2Sbi\ne7jljl6uV2fEFQndWeBMIU97GNzjUfwqVJiTpoYOgBY/OMxgpPLJ0EDYyQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 369, + "comment": "100-bit r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3032020d062522bbd3ecbe7c39e93e7c25022100ef9f6ba4d97c09d03178fa20b4aaad83be3cf9cb824a879fec3270fc4b81ef5b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e", + "wx": "083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99", + "wy": "00915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004083539fbee44625e3acaafa2fcb41349392cef0633a1b8fabecee0c133b10e99915c1ebe7bf00df8535196770a58047ae2a402f26326bb7d41d4d7616337911e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECDU5++5EYl46yq+i/LQTSTks7wYz\nobj6vs7gwTOxDpmRXB6+e/AN+FNRlncKWAR64qQC8mMmu31B1NdhYzeRHg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 370, + "comment": "r and s^-1 are close to n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3045022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc6324d50220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca", + "wx": "00e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4", + "wy": "00cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004e075effd9607d08d5f34e3652f64cfa3bd6d20c58d0a232f058491260ab212a4cc61760ac8b0680c1b644c03cc628ba9dc4a3c0561368489c692bd40f43aa3ca", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE4HXv/ZYH0I1fNONlL2TPo71tIMWN\nCiMvBYSRJgqyEqTMYXYKyLBoDBtkTAPMYoup3Eo8BWE2hInGkr1A9Dqjyg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 371, + "comment": "r and s are 64-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30160209009c44febf31c3594f020900839ed28247c2b06b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342", + "wx": "00cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8", + "wy": "00dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004cffb758c3073ea3c08efd9f7f17a85b6ae385c5a140c146ad5f1f5a826718bc8dfdc6bebc894144c6d418ac5d97339726ad2ae925df868426e5628e9f4e62342", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEz/t1jDBz6jwI79n38XqFtq44XFoU\nDBRq1fH1qCZxi8jf3GvryJQUTG1BisXZczlyatKukl34aEJuVijp9OYjQg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 372, + "comment": "r and s are 100-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "301e020d09df8b682430beef6f5fd7c7cd020d0fd0a62e13778f4222a0d61c8a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498", + "wx": "00b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549", + "wy": "00c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004b98740e69e61a325d5f772e3b5c4f67fb7150b16a9afeca9ddc4afcbb6fa0549c446e814138e4ebc82dbf86a390056d4595dcf45e381fef217a4597d7bd51498", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuYdA5p5hoyXV93LjtcT2f7cVCxap\nr+yp3cSvy7b6BUnERugUE45OvILb+Go5AFbUWV3PReOB/vIXpFl9e9UUmA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 373, + "comment": "r and s are 128-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30260211008a598e563a89f526c32ebec8de26367c02110084f633e2042630e99dd0f1e16f7a04bf", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0484536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46", + "wx": "0084536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b", + "wy": "1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000484536a270c3932bb2084732adf2c768efc6d3977e5220229ea9a44888b8f9d7b1766398cdac2fc8000017b29a7ba15a58f196037f35f7008ed4286ddff00fd46", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhFNqJww5MrsghHMq3yx2jvxtOXfl\nIgIp6ppEiIuPnXsXZjmM2sL8gAABeymnuhWljxlgN/NfcAjtQobd/wD9Rg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 374, + "comment": "r and s are 160-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0bdf021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "048aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e1937387405bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d", + "wx": "008aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e19373874", + "wy": "05bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200048aeb368a7027a4d64abdea37390c0c1d6a26f399e2d9734de1eb3d0e1937387405bd13834715e1dbae9b875cf07bd55e1b6691c7f7536aef3b19bf7a4adf576d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEius2inAnpNZKveo3OQwMHWom85ni\n2XNN4es9Dhk3OHQFvRODRxXh266bh1zwe9VeG2aRx/dTau87Gb96St9XbQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 375, + "comment": "s == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020101", + "result": "valid" + }, + { + "tcId": 376, + "comment": "s == 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30250220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70020100", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0461722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc", + "wx": "61722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc", + "wy": "272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000461722eaba731c697c7a9ba4d0afdbb5713d8aa12b0eab601bb33dbaf792c5adc272cd993b2b663aba5b3a26c101182ff178684945e83879e71598b95fe647dfc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYXIuq6cxxpfHqbpNCv27VxPYqhKw\n6rYBuzPbr3ksWtwnLNmTsrZjq6WzomwQEYL/F4aElF6Dh55xWYuV/mR9/A==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 377, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022002f676969f451a8ccafa4c4f09791810e6d632dbd60b1d5540f3284fbe1889b0", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a347316594afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871", + "wx": "00c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a3473165", + "wy": "0094afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004c4c91981e720e20d7e478ff19d09b95a98f58c0f469b72801a8ce844a347316594afcd4188182e7779889b3258d0368ece1e66797fe7c648c6f0b9e26bd71871", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExMkZgecg4g1+R4/xnQm5Wpj1jA9G\nm3KAGozoRKNHMWWUr81BiBgud3mImzJY0DaOzh5meX/nxkjG8Lnia9cYcQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 378, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204e260962e33362ef0046126d2d5a4edc6947ab20e19b8ec19cf79e5908b6e628", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f6317216deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634", + "wx": "00d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f63172", + "wy": "16deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d58d47bf49bc8f416641f6f760fcbca80aa52a814e56a5fa40bab44fd6f6317216deaa84d45d8e0e29cc9ecf5653f8ee6444750813becae8deb42b04ba07a634", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Y1Hv0m8j0FmQfb3YPy8qAqlKoFO\nVqX6QLq0T9b2MXIW3qqE1F2ODinMns9WU/juZER1CBO+yujetCsEugemNA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 379, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220077ed0d8f20f697d8fc591ac64dd5219c7932122b4f9b9ec6441e44a0092cf21", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0491e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0", + "wx": "0091e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb", + "wy": "3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000491e305822e5e44f3fdb616e2ef42cd98f241b86e9f68815bc4dba6a945e4eefb3c5937e2ac1d9466f6d65e49b35fc8d75ffc22e1fe2f32af42f5fa3c26f9b4b0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkeMFgi5eRPP9thbi70LNmPJBuG6f\naIFbxNumqUXk7vs8WTfirB2UZvbWXkmzX8jXX/wi4f4vMq9C9fo8Jvm0sA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 380, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203e0292a67e181c6c0105ee35e956e78e9bdd033c6e71ae57884039a245e4175f", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0424a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861", + "wx": "24a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46", + "wy": "00b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000424a0bc4d16dbbd40d2fd81a7c3f8d8ec741607d5bb406a0611cc60d0e683bd46b575cad039c15f7f3dffcfc007b4b0f743c871ecc76a504a32672fd84526d861", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJKC8TRbbvUDS/YGnw/jY7HQWB9W7\nQGoGEcxg0OaDvUa1dcrQOcFffz3/z8AHtLD3Q8hx7MdqUEoyZy/YRSbYYQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 381, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022013d22b06d6b8f5d97e0c64962b4a3bae30f668ca6217ef5b35d799f159e23ebe", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a", + "wx": "00d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b", + "wy": "7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d24dd06745cafb39186d22a92aa0e58169a79ab69488628a9da5ed3ef747269b7e9209d98faeb95355948adae61d5291c6015d3ee9513486d886fb05cbd25c6a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0k3QZ0XK+zkYbSKpKqDlgWmnmraU\niGKKnaXtPvdHJpt+kgnZj665U1WUitrmHVKRxgFdPulRNIbYhvsFy9Jcag==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 382, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002204523ce342e4994bb8968bf6613f60c06c86111f15a3a389309e72cd447d5dd99", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "048200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63ece795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb", + "wx": "008200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63e", + "wy": "00ce795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200048200f148e7eab1581bcd1e23946f8a9b8191d9641f9560341721f9d3fec3d63ece795669e0481e035de8623d716a6984d0a4809d6c65519443ee55260f7f3dcb", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEggDxSOfqsVgbzR4jlG+Km4GR2WQf\nlWA0FyH50/7D1j7OeVZp4EgeA13oYj1xammE0KSAnWxlUZRD7lUmD389yw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 383, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022037d765be3c9c78189ad30edb5097a4db670de11686d01420e37039d4677f4809", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024de85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7", + "wx": "00a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024d", + "wy": "00e85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004a8a69c5ed33b150ce8d37ac197070ed894c05d47258a80c9041d92486622024de85997c9666b60a393568efede8f4ca0167c1e10f626e62fc1b8c8e9c6ba6ed7", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqKacXtM7FQzo03rBlwcO2JTAXUcl\nioDJBB2SSGYiAk3oWZfJZmtgo5NWjv7ej0ygFnweEPYm5i/BuMjpxrpu1w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 384, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044237823b54e0c74c2bf5f759d9ac5f8cb897d537ffa92effd4f0bb6c9acd860", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc7273273181735a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34", + "wx": "00ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc72732731817", + "wy": "35a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004ed0587e75b3b9a1dd0794f41d1729fcd432b2436cbf51c230d8bc7273273181735a57f09c7873d3964aa8102c9e25fa53070cd924cb7e3a459174740b8b71c34", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7QWH51s7mh3QeU9B0XKfzUMrJDbL\n9RwjDYvHJzJzGBc1pX8Jx4c9OWSqgQLJ4l+lMHDNkky346RZF0dAuLccNA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 385, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220266d30a485385906054ca86d46f5f2b17e7f4646a3092092ad92877126538111", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc", + "wx": "077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef", + "wy": "4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004077091d99004a99ee08224e59a46a70495e6fba4eff681c3ce42127e588681ef4f1c16c77dfa440dde18245c9de76243d8f2fd9dea3f2782d6c04974d02f25dc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEB3CR2ZAEqZ7ggiTlmkanBJXm+6Tv\n9oHDzkISfliGge9PHBbHffpEDd4YJFyd52JD2PL9neo/J4LWwEl00C8l3A==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 386, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220538c7b3798e84d0ce90340165806348971ed44db8f0c674f5f215968390f92ee", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154", + "wx": "616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5", + "wy": "00bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004616a8b8e57d82c11678f5827911024cd23a16cb52a65f230fb554a7b110c35a5bb466660be5cab3e4b587c12b45bd998bd56c7d66c2f94d03a1a6d2028d8a154", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEYWqLjlfYLBFnj1gnkRAkzSOhbLUq\nZfIw+1VKexEMNaW7RmZgvlyrPktYfBK0W9mYvVbH1mwvlNA6Gm0gKNihVA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 387, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206fef0ef15d1688e15e704c4e6bb8bb7f40d52d3af5c661bb78c4ed9b408699b3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0471dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326", + "wx": "71dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513", + "wy": "00f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000471dc92b2b1baa7612c4a53427a0d2dfe548fa9cf829bb6b248f736a5eb30b513f91c7dff1144cb36057c2b859f35bd666a7961833b06de0f45159fbae208e326", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEcdySsrG6p2EsSlNCeg0t/lSPqc+C\nm7aySPc2peswtRP5HH3/EUTLNgV8K4WfNb1manlhgzsG3g9FFZ+64gjjJg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 388, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206f44275e9aeb1331efcb8d58f35c0252791427e403ad84daad51d247cc2a64c6", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0", + "wx": "662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931", + "wy": "00f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004662f43ae614bd9c90ff3fcded25cf0ef186b6967a47aa6aa7ae7f396594df931f5f94a525edd50d3738f7a28d03d7a2a70095c8f89de9bb2c645fea8d8bac9e0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZi9DrmFL2ckP8/ze0lzw7xhraWek\neqaqeufzlllN+TH1+UpSXt1Q03OPeijQPXoqcAlcj4nem7LGRf6o2LrJ4A==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 389, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022021323755b103d2f9da6ab83eccab9ad8598bcf625652f10e7a3eeee3c3945fb3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170dcb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc", + "wx": "00dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170d", + "wy": "00cb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004dff107959bd2f7386497a5624430a0ab35e552c1a4e4dc9c298caeb96353170dcb5065d7947a676c76287ca8e430324f8a534b0ba6f21200e033c4b88852a3cc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3/EHlZvS9zhkl6ViRDCgqzXlUsGk\n5NycKYyuuWNTFw3LUGXXlHpnbHYofKjkMDJPilNLC6byEgDgM8S4iFKjzA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 390, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002206c50acfe76de1289e7a5edb240f1c2a7879db6873d5d931f3c6ac467a6eac171", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d7528258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385", + "wx": "00bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d752", + "wy": "008258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004bd0862b0bfba85036922e06f5458754aafc3075b603a814b3ac75659bf24d7528258a607ffca2cfe05a300cb4c3c4e1963bbb1bc54d320e16969f85aad243385", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvQhisL+6hQNpIuBvVFh1Sq/DB1tg\nOoFLOsdWWb8k11KCWKYH/8os/gWjAMtMPE4ZY7uxvFTTIOFpafharSQzhQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 391, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220755b7fffb0b17ad57dca50fcefb7fe297b029df25e5ccb5069e8e70c2742c2a6", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f2871b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47", + "wx": "00b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f287", + "wy": "1b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004b533d4695dd5b8c5e07757e55e6e516f7e2c88fa0239e23f60e8ec07dd70f2871b134ee58cc583278456863f33c3a85d881f7d4a39850143e29d4eaf009afe47", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtTPUaV3VuMXgd1flXm5Rb34siPoC\nOeI/YOjsB91w8ocbE07ljMWDJ4RWhj8zw6hdiB99SjmFAUPinU6vAJr+Rw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 392, + "comment": "point at infinity during verify", + "flags": [ + "PointDuplication", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a80220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd", + "wx": "00f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86", + "wy": "00f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004f50d371b91bfb1d7d14e1323523bc3aa8cbf2c57f9e284de628c8b4536787b86f94ad887ac94d527247cd2e7d0c8b1291c553c9730405380b14cbb209f5fa2dd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9Q03G5G/sdfRThMjUjvDqoy/LFf5\n4oTeYoyLRTZ4e4b5StiHrJTVJyR80ufQyLEpHFU8lzBAU4CxTLsgn1+i3Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 393, + "comment": "edge case for signature malleability", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a8", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0468ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d94697bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30", + "wx": "68ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d946", + "wy": "0097bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000468ec6e298eafe16539156ce57a14b04a7047c221bafc3a582eaeb0d857c4d94697bed1af17850117fdb39b2324f220a5698ed16c426a27335bb385ac8ca6fb30", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaOxuKY6v4WU5FWzlehSwSnBHwiG6\n/DpYLq6w2FfE2UaXvtGvF4UBF/2zmyMk8iClaY7RbEJqJzNbs4WsjKb7MA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 394, + "comment": "edge case for signature malleability", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a902207fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192a9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0469da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b866d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002", + "wx": "69da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b8", + "wy": "66d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000469da0364734d2e530fece94019265fefb781a0f1b08f6c8897bdf6557927c8b866d2d3c7dcd518b23d726960f069ad71a933d86ef8abbcce8b20f71e2a847002", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEadoDZHNNLlMP7OlAGSZf77eBoPGw\nj2yIl732VXknyLhm0tPH3NUYsj1yaWDwaa1xqTPYbvirvM6LIPceKoRwAg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 395, + "comment": "u1 == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca605023", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff3233e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1", + "wx": "00d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff32", + "wy": "33e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d8adc00023a8edc02576e2b63e3e30621a471e2b2320620187bf067a1ac1ff3233e2b50ec09807accb36131fff95ed12a09a86b4ea9690aa32861576ba2362e1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2K3AACOo7cAlduK2Pj4wYhpHHisj\nIGIBh78GehrB/zIz4rUOwJgHrMs2Ex//le0SoJqGtOqWkKoyhhV2uiNi4Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 396, + "comment": "u1 == n - 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab7858db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe", + "wx": "3623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab785", + "wy": "008db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043623ac973ced0a56fa6d882f03a7d5c7edca02cfc7b2401fab3690dbe75ab7858db06908e64b28613da7257e737f39793da8e713ba0643b92e9bb3252be7f8fe", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENiOslzztClb6bYgvA6fVx+3KAs/H\nskAfqzaQ2+dat4WNsGkI5ksoYT2nJX5zfzl5PajnE7oGQ7kum7MlK+f4/g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 397, + "comment": "u2 == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c700220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9", + "wx": "00cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1", + "wy": "00e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004cf04ea77e9622523d894b93ff52dc3027b31959503b6fa3890e5e04263f922f1e8528fb7c006b3983c8b8400e57b4ed71740c2f3975438821199bedeaecab2e9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzwTqd+liJSPYlLk/9S3DAnsxlZUD\ntvo4kOXgQmP5IvHoUo+3wAazmDyLhADle07XF0DC85dUOIIRmb7ersqy6Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 398, + "comment": "u2 == n - 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30450220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70022100aaaaaaaa00000000aaaaaaaaaaaaaaaa7def51c91a0fbf034d26872ca84218e1", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff773504f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206", + "wx": "00db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff77350", + "wy": "4f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004db7a2c8a1ab573e5929dc24077b508d7e683d49227996bda3e9f78dbeff773504f417f3bc9a88075c2e0aadd5a13311730cf7cc76a82f11a36eaf08a6c99a206", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE23osihq1c+WSncJAd7UI1+aD1JIn\nmWvaPp942+/3c1BPQX87yaiAdcLgqt1aEzEXMM98x2qC8Ro26vCKbJmiBg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 399, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100e91e1ba60fdedb76a46bcb51dc0b8b4b7e019f0a28721885fa5d3a8196623397", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff", + "wx": "00dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f", + "wy": "1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004dead11c7a5b396862f21974dc4752fadeff994efe9bbd05ab413765ea80b6e1f1de3f0640e8ac6edcf89cff53c40e265bb94078a343736df07aa0318fc7fe1ff", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3q0Rx6WzloYvIZdNxHUvre/5lO/p\nu9BatBN2XqgLbh8d4/BkDorG7c+Jz/U8QOJlu5QHijQ3Nt8HqgMY/H/h/w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 400, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100fdea5843ffeb73af94313ba4831b53fe24f799e525b1e8e8c87b59b95b430ad9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd", + "wx": "00d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9", + "wy": "00986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0bc472e0d7c81ebaed3a6ef96c18613bb1fea6f994326fbe80e00dfde67c7e9986c723ea4843d48389b946f64ad56c83ad70ff17ba85335667d1bb9fa619efd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0LxHLg18geuu06bvlsGGE7sf6m+Z\nQyb76A4A395nx+mYbHI+pIQ9SDiblG9krVbIOtcP8XuoUzVmfRu5+mGe/Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 401, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022003ffcabf2f1b4d2a65190db1680d62bb994e41c5251cd73b3c3dfc5e5bafc035", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c326337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add", + "wx": "00a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c32", + "wy": "6337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004a0a44ca947d66a2acb736008b9c08d1ab2ad03776e02640f78495d458dd51c326337fe5cf8c4604b1f1c409dc2d872d4294a4762420df43a30a2392e40426add", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEoKRMqUfWairLc2AIucCNGrKtA3du\nAmQPeEldRY3VHDJjN/5c+MRgSx8cQJ3C2HLUKUpHYkIN9DowojkuQEJq3Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 402, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02204dfbc401f971cd304b33dfdb17d0fed0fe4c1a88ae648e0d2847f74977534989", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b73877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd", + "wx": "00c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b7", + "wy": "3877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004c9c2115290d008b45fb65fad0f602389298c25420b775019d42b62c3ce8a96b73877d25a8080dc02d987ca730f0405c2c9dbefac46f9e601cc3f06e9713973fd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEycIRUpDQCLRftl+tD2AjiSmMJUIL\nd1AZ1Ctiw86Klrc4d9JagIDcAtmHynMPBAXCydvvrEb55gHMPwbpcTlz/Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 403, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bc4024761cd2ffd43dfdb17d0fed112b988977055cd3a8e54971eba9cda5ca71", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71", + "wx": "5eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e", + "wy": "5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045eca1ef4c287dddc66b8bccf1b88e8a24c0018962f3c5e7efa83bc1a5ff6033e5e79c4cb2c245b8c45abdce8a8e4da758d92a607c32cd407ecaef22f1c934a71", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXsoe9MKH3dxmuLzPG4jookwAGJYv\nPF5++oO8Gl/2Az5eecTLLCRbjEWr3Oio5Np1jZKmB8Ms1AfsrvIvHJNKcQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 404, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220788048ed39a5ffa77bfb62fa1fda2257742bf35d128fb3459f2a0c909ee86f91", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47adeb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9", + "wx": "5caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47a", + "wy": "00deb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045caaa030e7fdf0e4936bc7ab5a96353e0a01e4130c3f8bf22d473e317029a47adeb6adc462f7058f2a20d371e9702254e9b201642005b3ceda926b42b178bef9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXKqgMOf98OSTa8erWpY1PgoB5BMM\nP4vyLUc+MXAppHretq3EYvcFjyog03HpcCJU6bIBZCAFs87akmtCsXi++Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 405, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220476d9131fd381bd917d0fed112bc9e0a5924b5ed5b11167edd8b23582b3cb15e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b0986237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf", + "wx": "00c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b098", + "wy": "6237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004c2fd20bac06e555bb8ac0ce69eb1ea20f83a1fc3501c8a66469b1a31f619b0986237050779f52b615bd7b8d76a25fc95ca2ed32525c75f27ffc87ac397e6cbaf", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwv0gusBuVVu4rAzmnrHqIPg6H8NQ\nHIpmRpsaMfYZsJhiNwUHefUrYVvXuNdqJfyVyi7TJSXHXyf/yHrDl+bLrw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 406, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0221008374253e3e21bd154448d0a8f640fe46fafa8b19ce78d538f6cc0a19662d3601", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4", + "wx": "3fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced", + "wy": "03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043fd6a1ca7f77fb3b0bbe726c372010068426e11ea6ae78ce17bedae4bba86ced03ce5516406bf8cfaab8745eac1cd69018ad6f50b5461872ddfc56e0db3c8ff4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEP9ahyn93+zsLvnJsNyAQBoQm4R6m\nrnjOF77a5LuobO0DzlUWQGv4z6q4dF6sHNaQGK1vULVGGHLd/Fbg2zyP9A==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 407, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220357cfd3be4d01d413c5b9ede36cba5452c11ee7fe14879e749ae6a2d897a52d6", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "049cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544", + "wx": "009cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114", + "wy": "00b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200049cb8e51e27a5ae3b624a60d6dc32734e4989db20e9bca3ede1edf7b086911114b4c104ab3c677e4b36d6556e8ad5f523410a19f2e277aa895fc57322b4427544", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnLjlHielrjtiSmDW3DJzTkmJ2yDp\nvKPt4e33sIaRERS0wQSrPGd+SzbWVW6K1fUjQQoZ8uJ3qolfxXMitEJ1RA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 408, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022029798c5c0ee287d4a5e8e6b799fd86b8df5225298e6ffc807cd2f2bc27a0a6d8", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f", + "wx": "00a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a", + "wy": "4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004a3e52c156dcaf10502620b7955bc2b40bc78ef3d569e1223c262512d8f49602a4a2039f31c1097024ad3cc86e57321de032355463486164cf192944977df147f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEo+UsFW3K8QUCYgt5VbwrQLx47z1W\nnhIjwmJRLY9JYCpKIDnzHBCXAkrTzIblcyHeAyNVRjSGFkzxkpRJd98Ufw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 409, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02200b70f22c781092452dca1a5711fa3a5a1f72add1bf52c2ff7cae4820b30078dd", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509", + "wx": "00f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88", + "wy": "00cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004f19b78928720d5bee8e670fb90010fb15c37bf91b58a5157c3f3c059b2655e88cf701ec962fb4a11dcf273f5dc357e58468560c7cfeb942d074abd4329260509", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8Zt4kocg1b7o5nD7kAEPsVw3v5G1\nilFXw/PAWbJlXojPcB7JYvtKEdzyc/XcNX5YRoVgx8/rlC0HSr1DKSYFCQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 410, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022016e1e458f021248a5b9434ae23f474b43ee55ba37ea585fef95c90416600f1ba", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0483a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e", + "wx": "0083a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8", + "wy": "00c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000483a744459ecdfb01a5cf52b27a05bb7337482d242f235d7b4cb89345545c90a8c05d49337b9649813287de9ffe90355fd905df5f3c32945828121f37cc50de6e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg6dERZ7N+wGlz1KyegW7czdILSQv\nI117TLiTRVRckKjAXUkze5ZJgTKH3p/+kDVf2QXfXzwylFgoEh83zFDebg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 411, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02202252d6856831b6cf895e4f0535eeaf0e5e5809753df848fe760ad86219016a97", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff", + "wx": "00dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7", + "wy": "00bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004dd13c6b34c56982ddae124f039dfd23f4b19bbe88cee8e528ae51e5d6f3a21d7bfad4c2e6f263fe5eb59ca974d039fc0e4c3345692fb5320bdae4bd3b42a45ff", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3RPGs0xWmC3a4STwOd/SP0sZu+iM\n7o5SiuUeXW86Ide/rUwubyY/5etZypdNA5/A5MM0VpL7UyC9rkvTtCpF/w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 412, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02210081ffe55f178da695b28c86d8b406b15dab1a9e39661a3ae017fbe390ac0972c3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0467e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0", + "wx": "67e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460", + "wy": "00a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000467e6f659cdde869a2f65f094e94e5b4dfad636bbf95192feeed01b0f3deb7460a37e0a51f258b7aeb51dfe592f5cfd5685bbe58712c8d9233c62886437c38ba0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEZ+b2Wc3ehpovZfCU6U5bTfrWNrv5\nUZL+7tAbDz3rdGCjfgpR8li3rrUd/lkvXP1WhbvlhxLI2SM8YohkN8OLoA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 413, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffffaaaaaaaaffffffffffffffffe9a2538f37b28a2c513dee40fecbb71a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "042eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0", + "wx": "2eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf", + "wy": "00805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200042eb6412505aec05c6545f029932087e490d05511e8ec1f599617bb367f9ecaaf805f51efcc4803403f9b1ae0124890f06a43fedcddb31830f6669af292895cb0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELrZBJQWuwFxlRfApkyCH5JDQVRHo\n7B9Zlhe7Nn+eyq+AX1HvzEgDQD+bGuASSJDwakP+3N2zGDD2ZprykolcsA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 414, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100b62f26b5f2a2b26f6de86d42ad8a13da3ab3cccd0459b201de009e526adf21f2", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0484db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f356d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe", + "wx": "0084db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f35", + "wy": "6d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000484db645868eab35e3a9fd80e056e2e855435e3a6b68d75a50a854625fe0d7f356d2589ac655edc9a11ef3e075eddda9abf92e72171570ef7bf43a2ee39338cfe", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhNtkWGjqs146n9gOBW4uhVQ146a2\njXWlCoVGJf4NfzVtJYmsZV7cmhHvPgde3dqav5LnIXFXDve/Q6LuOTOM/g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 415, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bb1d9ac949dd748cd02bbbe749bd351cd57b38bb61403d700686aa7b4c90851e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0491b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad66349aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd", + "wx": "0091b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad663", + "wy": "49aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000491b9e47c56278662d75c0983b22ca8ea6aa5059b7a2ff7637eb2975e386ad66349aa8ff283d0f77c18d6d11dc062165fd13c3c0310679c1408302a16854ecfbd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkbnkfFYnhmLXXAmDsiyo6mqlBZt6\nL/djfrKXXjhq1mNJqo/yg9D3fBjW0R3AYhZf0Tw8AxBnnBQIMCoWhU7PvQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 416, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022066755a00638cdaec1c732513ca0234ece52545dac11f816e818f725b4f60aaf2", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834df97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432", + "wx": "00f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834d", + "wy": "00f97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004f3ec2f13caf04d0192b47fb4c5311fb6d4dc6b0a9e802e5327f7ec5ee8e4834df97e3e468b7d0db867d6ecfe81e2b0f9531df87efdb47c1338ac321fefe5a432", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8+wvE8rwTQGStH+0xTEfttTcawqe\ngC5TJ/fsXujkg035fj5Gi30NuGfW7P6B4rD5Ux34fv20fBM4rDIf7+WkMg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 417, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022055a00c9fcdaebb6032513ca0234ecfffe98ebe492fdf02e48ca48e982beb3669", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc885ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72", + "wx": "00d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc88", + "wy": "5ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d92b200aefcab6ac7dafd9acaf2fa10b3180235b8f46b4503e4693c670fccc885ef2f3aebf5b317475336256768f7c19efb7352d27e4cccadc85b6b8ab922c72", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE2SsgCu/Ktqx9r9msry+hCzGAI1uP\nRrRQPkaTxnD8zIhe8vOuv1sxdHUzYlZ2j3wZ77c1LSfkzMrchba4q5Iscg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 418, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ab40193f9b5d76c064a27940469d9fffd31d7c925fbe05c919491d3057d66cd2", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "040a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cde6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489", + "wx": "0a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cd", + "wy": "00e6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200040a88361eb92ecca2625b38e5f98bbabb96bf179b3d76fc48140a3bcd881523cde6bdf56033f84a5054035597375d90866aa2c96b86a41ccf6edebf47298ad489", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECog2HrkuzKJiWzjl+Yu6u5a/F5s9\ndvxIFAo7zYgVI83mvfVgM/hKUFQDVZc3XZCGaqLJa4akHM9u3r9HKYrUiQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 419, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100ca0234ebb5fdcb13ca0234ecffffffffcb0dadbbc7f549f8a26b4408d0dc8600", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e868612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93", + "wx": "00d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e8", + "wy": "68612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d0fb17ccd8fafe827e0c1afc5d8d80366e2b20e7f14a563a2ba50469d84375e868612569d39e2bb9f554355564646de99ac602cc6349cf8c1e236a7de7637d93", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0PsXzNj6/oJ+DBr8XY2ANm4rIOfx\nSlY6K6UEadhDdehoYSVp054rufVUNVVkZG3pmsYCzGNJz4weI2p952N9kw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 420, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff3ea3677e082b9310572620ae19933a9e65b285598711c77298815ad3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb2769ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75", + "wx": "00836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb276", + "wy": "009ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004836f33bbc1dc0d3d3abbcef0d91f11e2ac4181076c9af0a22b1e4309d3edb2769ab443ff6f901e30c773867582997c2bec2b0cb8120d760236f3a95bbe881f75", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEg28zu8HcDT06u87w2R8R4qxBgQds\nmvCiKx5DCdPtsnaatEP/b5AeMMdzhnWCmXwr7CsMuBINdgI286lbvogfdQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 421, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0220266666663bbbbbbbe6666666666666665b37902e023fab7c8f055d86e5cc41f4", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0492f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697", + "wx": "0092f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8", + "wy": "033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000492f99fbe973ed4a299719baee4b432741237034dec8d72ba5103cb33e55feeb8033dd0e91134c734174889f3ebcf1b7a1ac05767289280ee7a794cebd6e69697", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEkvmfvpc+1KKZcZuu5LQydBI3A03s\njXK6UQPLM+Vf7rgDPdDpETTHNBdIifPrzxt6GsBXZyiSgO56eUzr1uaWlw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 422, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff36db6db7a492492492492492146c573f4c6dfc8d08a443e258970b09", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09eff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2", + "wx": "00d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09e", + "wy": "00ff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d35ba58da30197d378e618ec0fa7e2e2d12cffd73ebbb2049d130bba434af09eff83986e6875e41ea432b7585a49b3a6c77cbb3c47919f8e82874c794635c1d2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE01uljaMBl9N45hjsD6fi4tEs/9c+\nu7IEnRMLukNK8J7/g5huaHXkHqQyt1haSbOmx3y7PEeRn46Ch0x5RjXB0g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 423, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd022100bfffffff2aaaaaab7fffffffffffffffc815d0e60b3e596ecb1ad3a27cfd49c4", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "048651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28", + "wx": "008651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224", + "wy": "00e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200048651ce490f1b46d73f3ff475149be29136697334a519d7ddab0725c8d0793224e11c65bd8ca92dc8bc9ae82911f0b52751ce21dd9003ae60900bd825f590cc28", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhlHOSQ8bRtc/P/R1FJvikTZpczSl\nGdfdqwclyNB5MiThHGW9jKktyLya6CkR8LUnUc4h3ZADrmCQC9gl9ZDMKA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 424, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02207fffffff55555555ffffffffffffffffd344a71e6f651458a27bdc81fd976e37", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6def6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37", + "wx": "6d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6d", + "wy": "00ef6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046d8e1b12c831a0da8795650ff95f101ed921d9e2f72b15b1cdaca9826b9cfc6def6d63e2bc5c089570394a4bc9f892d5e6c7a6a637b20469a58c106ad486bf37", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEbY4bEsgxoNqHlWUP+V8QHtkh2eL3\nKxWxzaypgmuc/G3vbWPivFwIlXA5SkvJ+JLV5sempjeyBGmljBBq1Ia/Nw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 425, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02203fffffff800000007fffffffffffffffde737d56d38bcf4279dce5617e3192aa", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "040ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e15428911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3", + "wx": "0ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e1542", + "wy": "008911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200040ae580bae933b4ef2997cbdbb0922328ca9a410f627a0f7dff24cb4d920e15428911e7f8cc365a8a88eb81421a361ccc2b99e309d8dcd9a98ba83c3949d893e3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAECuWAuukztO8pl8vbsJIjKMqaQQ9i\neg99/yTLTZIOFUKJEef4zDZaiojrgUIaNhzMK5njCdjc2amLqDw5SdiT4w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 426, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02205d8ecd64a4eeba466815ddf3a4de9a8e6abd9c5db0a01eb80343553da648428f", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9", + "wx": "5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963", + "wy": "00838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963838a40f2a36092e9004e92d8d940cf5638550ce672ce8b8d4e15eba5499249e9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEW4Ev1SGq+mmDWoSczm+962mDtELS\nRE/nDhNMAn/EaWODikDyo2CS6QBOktjZQM9WOFUM5nLOi41OFeulSZJJ6Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 427, + "comment": "point duplication during verification", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc469637c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616", + "wx": "5b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc46963", + "wy": "7c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045b812fd521aafa69835a849cce6fbdeb6983b442d2444fe70e134c027fc469637c75bf0c5c9f6d17ffb16d2726bf30a9c7aaf31a8d317472b1ea145ab66db616", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEW4Ev1SGq+mmDWoSczm+962mDtELS\nRE/nDhNMAn/EaWN8db8MXJ9tF/+xbScmvzCpx6rzGo0xdHKx6hRatm22Fg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 428, + "comment": "duplication bug", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "304502206f2347cab7dd76858fe0555ac3bc99048c4aacafdfb6bcbe05ea6c42c4934569022100bb726660235793aa9957a61e76e00c2c435109cf9a15dd624d53f4301047856b", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a647e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9", + "wx": "6adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a6", + "wy": "47e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046adda82b90261b0f319faa0d878665a6b6da497f09c903176222c34acfef72a647e6f50dcc40ad5d9b59f7602bb222fad71a41bf5e1f9df4959a364c62e488d9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEat2oK5AmGw8xn6oNh4ZlprbaSX8J\nyQMXYiLDSs/vcqZH5vUNzECtXZtZ92ArsiL61xpBv14fnfSVmjZMYuSI2Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 429, + "comment": "point with x-coordinate 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30250201010220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "042fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f382065f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de", + "wx": "2fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f3820", + "wy": "65f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200042fca0d0a47914de77ed56e7eccc3276a601120c6df0069c825c8f6a01c9f382065f3450a1d17c6b24989a39beb1c7decfca8384fbdc294418e5d807b3c6ed7de", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEL8oNCkeRTed+1W5+zMMnamARIMbf\nAGnIJcj2oByfOCBl80UKHRfGskmJo5vrHH3s/Kg4T73ClEGOXYB7PG7X3g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 430, + "comment": "point with x-coordinate 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3045022101000000000000000000000000000000000000000000000000000000000000000002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d25045d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7", + "wx": "00dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d250", + "wy": "45d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004dd86d3b5f4a13e8511083b78002081c53ff467f11ebd98a51a633db76665d25045d5c8200c89f2fa10d849349226d21d8dfaed6ff8d5cb3e1b7e17474ebc18f7", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE3YbTtfShPoURCDt4ACCBxT/0Z/Ee\nvZilGmM9t2Zl0lBF1cggDIny+hDYSTSSJtIdjfrtb/jVyz4bfhdHTrwY9w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 431, + "comment": "comparison with point at infinity ", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30440220555555550000000055555555555555553ef7a8e48d07df81a693439654210c7002203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aa9", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "044fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280", + "wx": "4fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5", + "wy": "00d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200044fea55b32cb32aca0c12c4cd0abfb4e64b0f5a516e578c016591a93f5a0fbcc5d7d3fd10b2be668c547b212f6bb14c88f0fecd38a8a4b2c785ed3be62ce4b280", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAET+pVsyyzKsoMEsTNCr+05ksPWlFu\nV4wBZZGpP1oPvMXX0/0Qsr5mjFR7IS9rsUyI8P7NOKiksseF7TvmLOSygA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 432, + "comment": "extreme value for k and edgecase s", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc476699780220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e", + "wx": "00c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107", + "wy": "00bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004c6a771527024227792170a6f8eee735bf32b7f98af669ead299802e32d7c3107bc3b4b5e65ab887bbd343572b3e5619261fe3a073e2ffd78412f726867db589e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExqdxUnAkIneSFwpvju5zW/Mrf5iv\nZp6tKZgC4y18MQe8O0teZauIe700NXKz5WGSYf46Bz4v/XhBL3JoZ9tYng==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 433, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956efcee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6", + "wx": "00851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956ef", + "wy": "00cee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004851c2bbad08e54ec7a9af99f49f03644d6ec6d59b207fec98de85a7d15b956efcee9960283045075684b410be8d0f7494b91aa2379f60727319f10ddeb0fe9d6", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEhRwrutCOVOx6mvmfSfA2RNbsbVmy\nB/7JjehafRW5Vu/O6ZYCgwRQdWhLQQvo0PdJS5GqI3n2BycxnxDd6w/p1g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 434, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f", + "wx": "00f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f", + "wy": "008f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004f6417c8a670584e388676949e53da7fc55911ff68318d1bf3061205acb19c48f8f2b743df34ad0f72674acb7505929784779cd9ac916c3669ead43026ab6d43f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE9kF8imcFhOOIZ2lJ5T2n/FWRH/aD\nGNG/MGEgWssZxI+PK3Q980rQ9yZ0rLdQWSl4R3nNmskWw2aerUMCarbUPw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 435, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997802203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a06438673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371", + "wx": "501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a0643", + "wy": "008673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004501421277be45a5eefec6c639930d636032565af420cf3373f557faa7f8a06438673d6cb6076e1cfcdc7dfe7384c8e5cac08d74501f2ae6e89cad195d0aa1371", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUBQhJ3vkWl7v7GxjmTDWNgMlZa9C\nDPM3P1V/qn+KBkOGc9bLYHbhz83H3+c4TI5crAjXRQHyrm6JytGV0KoTcQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 436, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "040d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb343195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5", + "wx": "0d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb34", + "wy": "3195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200040d935bf9ffc115a527735f729ca8a4ca23ee01a4894adf0e3415ac84e808bb343195a3762fea29ed38912bd9ea6c4fde70c3050893a4375850ce61d82eba33c5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDZNb+f/BFaUnc19ynKikyiPuAaSJ\nSt8ONBWshOgIuzQxlaN2L+op7TiRK9nqbE/ecMMFCJOkN1hQzmHYLrozxQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 437, + "comment": "extreme value for k", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402207cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "045e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca215de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de", + "wx": "5e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca21", + "wy": "5de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200045e59f50708646be8a589355014308e60b668fb670196206c41e748e64e4dca215de37fee5c97bcaf7144d5b459982f52eeeafbdf03aacbafef38e213624a01de", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEXln1Bwhka+iliTVQFDCOYLZo+2cB\nliBsQedI5k5NyiFd43/uXJe8r3FE1bRZmC9S7ur73wOqy6/vOOITYkoB3g==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 438, + "comment": "extreme value for k and edgecase s", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2960220555555550000000055555555555555553ef7a8e48d07df81a693439654210c70", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667", + "wx": "169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e", + "wy": "7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004169fb797325843faff2f7a5b5445da9e2fd6226f7ef90ef0bfe924104b02db8e7bbb8de662c7b9b1cf9b22f7a2e582bd46d581d68878efb2b861b131d8a1d667", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFp+3lzJYQ/r/L3pbVEXani/WIm9+\n+Q7wv+kkEEsC2457u43mYse5sc+bIvei5YK9RtWB1oh477K4YbEx2KHWZw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 439, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100b6db6db6249249254924924924924924625bd7a09bec4ca81bcdd9f8fd6b63cc", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b548981487540a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5", + "wx": "271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b54898148754", + "wy": "0a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004271cd89c000143096b62d4e9e4ca885aef2f7023d18affdaf8b7b548981487540a1c6e954e32108435b55fa385b0f76481a609b9149ccb4b02b2ca47fe8e4da5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJxzYnAABQwlrYtTp5MqIWu8vcCPR\niv/a+Le1SJgUh1QKHG6VTjIQhDW1X6OFsPdkgaYJuRScy0sCsspH/o5NpQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 440, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304502206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022100cccccccc00000000cccccccccccccccc971f2ef152794b9d8fc7d568c9e8eaa7", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df", + "wx": "3d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12", + "wy": "00e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043d0bc7ed8f09d2cb7ddb46ebc1ed799ab1563a9ab84bf524587a220afe499c12e22dc3b3c103824a4f378d96adb0a408abf19ce7d68aa6244f78cb216fa3f8df", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPQvH7Y8J0st920brwe15mrFWOpq4\nS/UkWHoiCv5JnBLiLcOzwQOCSk83jZatsKQIq/Gc59aKpiRPeMshb6P43w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 441, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c29602203333333300000000333333333333333325c7cbbc549e52e763f1f55a327a3aaa", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b72e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316", + "wx": "00a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b7", + "wy": "2e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004a6c885ade1a4c566f9bb010d066974abb281797fa701288c721bcbd23663a9b72e424b690957168d193a6096fc77a2b004a9c7d467e007e1f2058458f98af316", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEpsiFreGkxWb5uwENBml0q7KBeX+n\nASiMchvL0jZjqbcuQktpCVcWjRk6YJb8d6KwBKnH1GfgB+HyBYRY+YrzFg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 442, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022049249248db6db6dbb6db6db6db6db6db5a8b230d0b2b51dcd7ebf0c9fef7c185", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "048d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d", + "wx": "008d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c", + "wy": "4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200048d3c2c2c3b765ba8289e6ac3812572a25bf75df62d87ab7330c3bdbad9ebfa5c4c6845442d66935b238578d43aec54f7caa1621d1af241d4632e0b780c423f5d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEjTwsLDt2W6gonmrDgSVyolv3XfYt\nh6tzMMO9utnr+lxMaEVELWaTWyOFeNQ67FT3yqFiHRryQdRjLgt4DEI/XQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 443, + "comment": "extreme value for k", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304402206b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296022016a4502e2781e11ac82cbc9d1edd8c981584d13e18411e2f6e0478c34416e3bb", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "wx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c2964fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpZP40Li/hp/m47n60p8D54WK84zV2sxXs7LtkBoN79R9Q==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 444, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca6050230220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result": "invalid" + }, + { + "tcId": 445, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3044022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "wx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296", + "wy": "00b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296b01cbd1c01e58065711814b583f061e9d431cca994cea1313449bf97c840ae0a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaxfR8uEsQkf4vOblY6RA8ncDfYEt\n6zOg9KE5RdiYwpawHL0cAeWAZXEYFLWD8GHp1DHMqZTOoTE0Sb+XyECuCg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 446, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3045022100bb5a52f42f9c9261ed4361f59422a1e30036e7c32b270c8807a419feca6050230220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result": "invalid" + }, + { + "tcId": 447, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3044022044a5ad0ad0636d9f12bc9e0a6bdd5e1cbcb012ea7bf091fcec15b0c43202d52e0220249249246db6db6ddb6db6db6db6db6dad4591868595a8ee6bf5f864ff7be0c2", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "wx": "4f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000", + "wy": "00ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200044f337ccfd67726a805e4f1600ae2849df3807eca117380239fbd816900000000ed9dea124cc8c396416411e988c30f427eb504af43a3146cd5df7ea60666d685", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETzN8z9Z3JqgF5PFgCuKEnfOAfsoR\nc4Ajn72BaQAAAADtneoSTMjDlkFkEemIww9CfrUEr0OjFGzV336mBmbWhQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 448, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100d434e262a49eab7781e353a3565e482550dd0fd5defa013c7f29745eff3569f10221009b0c0a93f267fb6052fd8077be769c2b98953195d7bc10de844218305c6ba17a", + "result": "valid" + }, + { + "tcId": 449, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304402200fe774355c04d060f76d79fd7a772e421463489221bf0a33add0be9b1979110b0220500dcba1c69a8fbd43fa4f57f743ce124ca8b91a1f325f3fac6181175df55737", + "result": "valid" + }, + { + "tcId": 450, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3045022100bb40bf217bed3fb3950c7d39f03d36dc8e3b2cd79693f125bfd06595ee1135e30220541bf3532351ebb032710bdb6a1bf1bfc89a1e291ac692b3fa4780745bb55677", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "wx": "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy": "0084fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f49726500493584fa174d791c72bf2ce3880a8960dd2a7c7a1338a82f85a9e59cdbde80000000", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTWE+hdNeRxyvyzjiAqJYN0qfHoTOKgvhanlnNvegAAAAA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 451, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "30440220664eb7ee6db84a34df3c86ea31389a5405badd5ca99231ff556d3e75a233e73a022059f3c752e52eca46137642490a51560ce0badc678754b8f72e51a2901426a1bd", + "result": "valid" + }, + { + "tcId": 452, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304502204cd0429bbabd2827009d6fcd843d4ce39c3e42e2d1631fd001985a79d1fd8b430221009638bf12dd682f60be7ef1d0e0d98f08b7bca77a1a2b869ae466189d2acdabe3", + "result": "valid" + }, + { + "tcId": 453, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100e56c6ea2d1b017091c44d8b6cb62b9f460e3ce9aed5e5fd41e8added97c56c04022100a308ec31f281e955be20b457e463440b4fcf2b80258078207fc1378180f89b55", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "wx": "3cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f497265004935", + "wy": "7b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200043cf03d614d8939cfd499a07873fac281618f06b8ff87e8015c3f4972650049357b05e8b186e38d41d31c77f5769f22d58385ecc857d07a561a6324217fffffff", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEPPA9YU2JOc/UmaB4c/rCgWGPBrj/\nh+gBXD9JcmUASTV7BeixhuONQdMcd/V2nyLVg4XsyFfQelYaYyQhf////w==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 454, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304402201158a08d291500b4cabed3346d891eee57c176356a2624fb011f8fbbf34668300220228a8c486a736006e082325b85290c5bc91f378b75d487dda46798c18f285519", + "result": "valid" + }, + { + "tcId": 455, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3045022100b1db9289649f59410ea36b0c0fc8d6aa2687b29176939dd23e0dde56d309fa9d02203e1535e4280559015b0dbd987366dcf43a6d1af5c23c7d584e1c3f48a1251336", + "result": "valid" + }, + { + "tcId": 456, + "comment": "y-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100b7b16e762286cb96446aa8d4e6e7578b0a341a79f2dd1a220ac6f0ca4e24ed86022100ddc60a700a139b04661c547d07bbb0721780146df799ccf55e55234ecb8f12bc", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "wx": "2829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffff", + "wy": "00a01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200042829c31faa2e400e344ed94bca3fcd0545956ebcfe8ad0f6dfa5ff8effffffffa01aafaf000e52585855afa7676ade284113099052df57e7eb3bd37ebeb9222e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKCnDH6ouQA40TtlLyj/NBUWVbrz+\nitD236X/jv////+gGq+vAA5SWFhVr6dnat4oQRMJkFLfV+frO9N+vrkiLg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 457, + "comment": "x-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3045022100d82a7c2717261187c8e00d8df963ff35d796edad36bc6e6bd1c91c670d9105b402203dcabddaf8fcaa61f4603e7cbac0f3c0351ecd5988efb23f680d07debd139929", + "result": "valid" + }, + { + "tcId": 458, + "comment": "x-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304402205eb9c8845de68eb13d5befe719f462d77787802baff30ce96a5cba063254af7802202c026ae9be2e2a5e7ca0ff9bbd92fb6e44972186228ee9a62b87ddbe2ef66fb5", + "result": "valid" + }, + { + "tcId": 459, + "comment": "x-coordinate of the public key has many trailing 1's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304602210096843dd03c22abd2f3b782b170239f90f277921becc117d0404a8e4e36230c28022100f2be378f526f74a543f67165976de9ed9a31214eb4d7e6db19e1ede123dd991d", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "wx": "00fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f5", + "wy": "5a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004fffffff948081e6a0458dd8f9e738f2665ff9059ad6aac0708318c4ca9a7a4f55a8abcba2dda8474311ee54149b973cae0c0fb89557ad0bf78e6529a1663bd73", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE////+UgIHmoEWN2PnnOPJmX/kFmt\naqwHCDGMTKmnpPVairy6LdqEdDEe5UFJuXPK4MD7iVV60L945lKaFmO9cw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 460, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "30440220766456dce1857c906f9996af729339464d27e9d98edc2d0e3b760297067421f60220402385ecadae0d8081dccaf5d19037ec4e55376eced699e93646bfbbf19d0b41", + "result": "valid" + }, + { + "tcId": 461, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100c605c4b2edeab20419e6518a11b2dbc2b97ed8b07cced0b19c34f777de7b9fd9022100edf0f612c5f46e03c719647bc8af1b29b2cde2eda700fb1cff5e159d47326dba", + "result": "valid" + }, + { + "tcId": 462, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100d48b68e6cabfe03cf6141c9ac54141f210e64485d9929ad7b732bfe3b7eb8a84022100feedae50c61bd00e19dc26f9b7e2265e4508c389109ad2f208f0772315b6c941", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "wx": "03fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e", + "wy": "1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000400000003fa15f963949d5f03a6f5c7f86f9e0015eeb23aebbff1173937ba748e1099872070e8e87c555fa13659cca5d7fadcfcb0023ea889548ca48af2ba7e71", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAAAAA/oV+WOUnV8DpvXH+G+eABXu\nsjrrv/EXOTe6dI4QmYcgcOjofFVfoTZZzKXX+tz8sAI+qIlUjKSK8rp+cQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 463, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100b7c81457d4aeb6aa65957098569f0479710ad7f6595d5874c35a93d12a5dd4c7022100b7961a0b652878c2d568069a432ca18a1a9199f2ca574dad4b9e3a05c0a1cdb3", + "result": "valid" + }, + { + "tcId": 464, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304402206b01332ddb6edfa9a30a1321d5858e1ee3cf97e263e669f8de5e9652e76ff3f702205939545fced457309a6a04ace2bd0f70139c8f7d86b02cb1cc58f9e69e96cd5a", + "result": "valid" + }, + { + "tcId": 465, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100efdb884720eaeadc349f9fc356b6c0344101cd2fd8436b7d0e6a4fb93f106361022100f24bee6ad5dc05f7613975473aadf3aacba9e77de7d69b6ce48cb60d8113385d", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "wx": "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy": "1352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015000000001352bb4a0fa2ea4cceb9ab63dd684ade5a1127bcf300a698a7193bc2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BUAAAAAE1K7Sg+i6kzOuatj3WhK3loRJ7zzAKaYpxk7wg==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 466, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3044022031230428405560dcb88fb5a646836aea9b23a23dd973dcbe8014c87b8b20eb0702200f9344d6e812ce166646747694a41b0aaf97374e19f3c5fb8bd7ae3d9bd0beff", + "result": "valid" + }, + { + "tcId": 467, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100caa797da65b320ab0d5c470cda0b36b294359c7db9841d679174db34c4855743022100cf543a62f23e212745391aaf7505f345123d2685ee3b941d3de6d9b36242e5a0", + "result": "valid" + }, + { + "tcId": 468, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "304502207e5f0ab5d900d3d3d7867657e5d6d36519bc54084536e7d21c336ed8001859450221009450c07f201faec94b82dfb322e5ac676688294aad35aa72e727ff0b19b646aa", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "wx": "00bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015", + "wy": "00fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004bcbb2914c79f045eaa6ecbbc612816b3be5d2d6796707d8125e9f851c18af015fffffffeecad44b6f05d15b33146549c2297b522a5eed8430cff596758e6c43d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEvLspFMefBF6qbsu8YSgWs75dLWeW\ncH2BJen4UcGK8BX////+7K1EtvBdFbMxRlScIpe1IqXu2EMM/1lnWObEPQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 469, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3046022100d7d70c581ae9e3f66dc6a480bf037ae23f8a1e4a2136fe4b03aa69f0ca25b35602210089c460f8a5a5c2bbba962c8a3ee833a413e85658e62a59e2af41d9127cc47224", + "result": "valid" + }, + { + "tcId": 470, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "30440220341c1b9ff3c83dd5e0dfa0bf68bcdf4bb7aa20c625975e5eeee34bb396266b34022072b69f061b750fd5121b22b11366fad549c634e77765a017902a67099e0a4469", + "result": "valid" + }, + { + "tcId": 471, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3045022070bebe684cdcb5ca72a42f0d873879359bd1781a591809947628d313a3814f67022100aec03aca8f5587a4d535fa31027bbe9cc0e464b1c3577f4c2dcde6b2094798a9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-non-minimal-tag", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "0404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "wx": "04aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad5", + "wy": "0087d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d0301070342000404aaec73635726f213fb8a9e64da3b8632e41495a944d0045b522eba7240fad587d9315798aaa3a5ba01775787ced05eaaf7b4e09fc81d6d1aa546e8365d525d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEBKrsc2NXJvIT+4qeZNo7hjLkFJWp\nRNAEW1IuunJA+tWH2TFXmKqjpboBd1eHztBeqve04J/IHW0apUboNl1SXQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 472, + "comment": "signature with non-minimal SEQUENCE tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "3f1045022100b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a02200177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2", + "result": "invalid" + }, + { + "tcId": 473, + "comment": "signature with non-minimal INTEGER tag on r", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "30461f022100b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a02200177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2", + "result": "invalid" + }, + { + "tcId": 474, + "comment": "signature with non-minimal INTEGER tag on s", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "3046022100b292a619339f6e567a305c951c0dcbcc42d16e47f219f9e98e76e09d8770b34a1f02200177e60492c5a8242f76f07bfe3661bde59ec2a17ce5bd2dab2abebdf89a62e2", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64", + "wx": "264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9", + "wy": "cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJk15ag2rmzdtNO6m/il93hx7c+U5\nRLyWyPHopoULtsnPUwgCDu1GDGSd2uYdTvi7eZWBE/EGvvr08Yh20SpeZA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 475, + "comment": "r = 5, x = 5 is valid", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3026020105022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04add76677e54a92e79bbee36a70e1754838273ec4b39295e4018a587290a7fc73f240d625642c943e610d80d953c5c6b8a12760a624ba3b90a0b7902755e1ae79", + "wx": "add76677e54a92e79bbee36a70e1754838273ec4b39295e4018a587290a7fc73", + "wy": "f240d625642c943e610d80d953c5c6b8a12760a624ba3b90a0b7902755e1ae79" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004add76677e54a92e79bbee36a70e1754838273ec4b39295e4018a587290a7fc73f240d625642c943e610d80d953c5c6b8a12760a624ba3b90a0b7902755e1ae79", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErddmd+VKkuebvuNqcOF1SDgnPsSz\nkpXkAYpYcpCn/HPyQNYlZCyUPmENgNlTxca4oSdgpiS6O5Cgt5AnVeGueQ==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 476, + "comment": "r = 6, x = 5 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3026020106022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64", + "wx": "264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9", + "wy": "cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004264d796a0dab9b376d34eea6fe297dde1c7b73e53944bc96c8f1e8a6850bb6c9cf5308020eed460c649ddae61d4ef8bb79958113f106befaf4f18876d12a5e64", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEJk15ag2rmzdtNO6m/il93hx7c+U5\nRLyWyPHopoULtsnPUwgCDu1GDGSd2uYdTvi7eZWBE/EGvvr08Yh20SpeZA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 477, + "comment": "r = 5 + n, x = 5 is invalid; r was not reduced mod n", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632556022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04e7e49dd82812432744fefe723f7f69663214ad1b85c02b2650b4ca0354743a325223c51c415f457aec69cb019bbe3d27585b38f8b79c39dfea6c27c2f0d8146a", + "wx": "e7e49dd82812432744fefe723f7f69663214ad1b85c02b2650b4ca0354743a32", + "wy": "5223c51c415f457aec69cb019bbe3d27585b38f8b79c39dfea6c27c2f0d8146a" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004e7e49dd82812432744fefe723f7f69663214ad1b85c02b2650b4ca0354743a325223c51c415f457aec69cb019bbe3d27585b38f8b79c39dfea6c27c2f0d8146a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE5+Sd2CgSQydE/v5yP39pZjIUrRuF\nwCsmULTKA1R0OjJSI8UcQV9FeuxpywGbvj0nWFs4+LecOd/qbCfC8NgUag==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 478, + "comment": "r = n - 3, x = n - 2 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3046022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04ce24c99032d52ac6ead23c0ae3ec68ef41e51a281fd457808c83136d7dcce90e8f7a154b551e9f39c59279357aa491b2a62bdebc2bb78613883fc72936c057e0", + "wx": "ce24c99032d52ac6ead23c0ae3ec68ef41e51a281fd457808c83136d7dcce90e", + "wy": "8f7a154b551e9f39c59279357aa491b2a62bdebc2bb78613883fc72936c057e0" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004ce24c99032d52ac6ead23c0ae3ec68ef41e51a281fd457808c83136d7dcce90e8f7a154b551e9f39c59279357aa491b2a62bdebc2bb78613883fc72936c057e0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEziTJkDLVKsbq0jwK4+xo70HlGigf\n1FeAjIMTbX3M6Q6PehVLVR6fOcWSeTV6pJGypivevCu3hhOIP8cpNsBX4A==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 479, + "comment": "r = 3, x = n + 3 is the smallest possible x with a reduction", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3026020103022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04c981c75ddfd3910387eb147098fe5658c43aaaa34c681cd6d514b6ad5b6baa6d14fbddb53a6e6db18e90602bc60f2e736d625765f7f2cca4be76f4eeccf12c18", + "wx": "c981c75ddfd3910387eb147098fe5658c43aaaa34c681cd6d514b6ad5b6baa6d", + "wy": "14fbddb53a6e6db18e90602bc60f2e736d625765f7f2cca4be76f4eeccf12c18" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004c981c75ddfd3910387eb147098fe5658c43aaaa34c681cd6d514b6ad5b6baa6d14fbddb53a6e6db18e90602bc60f2e736d625765f7f2cca4be76f4eeccf12c18", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEyYHHXd/TkQOH6xRwmP5WWMQ6qqNM\naBzW1RS2rVtrqm0U+921Om5tsY6QYCvGDy5zbWJXZffyzKS+dvTuzPEsGA==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 480, + "comment": "r = 4, x = n + 3 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3026020104022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "040ec505bc19b14a43e05678cccf07a443d3e871a2e19b68a4da91859a0650f32477300e4f64e9982d94dff5d294428bb37cc9be66117cae9c389d2d495f68b987", + "wx": "0ec505bc19b14a43e05678cccf07a443d3e871a2e19b68a4da91859a0650f324", + "wy": "77300e4f64e9982d94dff5d294428bb37cc9be66117cae9c389d2d495f68b987" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200040ec505bc19b14a43e05678cccf07a443d3e871a2e19b68a4da91859a0650f32477300e4f64e9982d94dff5d294428bb37cc9be66117cae9c389d2d495f68b987", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEDsUFvBmxSkPgVnjMzwekQ9PocaLh\nm2ik2pGFmgZQ8yR3MA5PZOmYLZTf9dKUQouzfMm+ZhF8rpw4nS1JX2i5hw==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 481, + "comment": "r = p - n + 5, x = 5 is invalid; r is too large to compare r + n with x", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "303502104319055358e8617b0c46353d039cdab3022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "04d42ce21e730f3d2a84e949828574b4dceeb77d4f89556735f34fba03028ee3ed32daf8bfd3f0a7a0821170840f4e032056722386b35d9bdd4f4f450696f4fb52", + "wx": "d42ce21e730f3d2a84e949828574b4dceeb77d4f89556735f34fba03028ee3ed", + "wy": "32daf8bfd3f0a7a0821170840f4e032056722386b35d9bdd4f4f450696f4fb52" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d03010703420004d42ce21e730f3d2a84e949828574b4dceeb77d4f89556735f34fba03028ee3ed32daf8bfd3f0a7a0821170840f4e032056722386b35d9bdd4f4f450696f4fb52", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1CziHnMPPSqE6UmChXS03O63fU+J\nVWc180+6AwKO4+0y2vi/0/CnoIIRcIQPTgMgVnIjhrNdm91PT0UGlvT7Ug==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 482, + "comment": "r = 2^256 - n + 5, x = 5 is invalid; r + n is too large to compare r + n with x, and overflows 2^256 bits", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3042021d00ffffffff00000000000000004319055258e8617b0c46353d039cdab4022100ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc63254e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-s-pow2", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp256r1", + "keySize": 256, + "uncompressed": "046955a72c0dad4ed60356f7692649b951fa8ea474bf1cc9549b96c68de4782dfae012ffc24e92c72be71ff2622ee7e549dcb59e7b708f6921c4d4ea29512e2aba", + "wx": "6955a72c0dad4ed60356f7692649b951fa8ea474bf1cc9549b96c68de4782dfa", + "wy": "e012ffc24e92c72be71ff2622ee7e549dcb59e7b708f6921c4d4ea29512e2aba" + }, + "publicKeyDer": "3059301306072a8648ce3d020106082a8648ce3d030107034200046955a72c0dad4ed60356f7692649b951fa8ea474bf1cc9549b96c68de4782dfae012ffc24e92c72be71ff2622ee7e549dcb59e7b708f6921c4d4ea29512e2aba", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEaVWnLA2tTtYDVvdpJkm5UfqOpHS/\nHMlUm5bGjeR4LfrgEv/CTpLHK+cf8mIu5+VJ3LWee3CPaSHE1OopUS4qug==\n-----END PUBLIC KEY-----\n", + "sha": "SHA-256", + "tests": [ + { + "tcId": 483, + "comment": "s = 2^128", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "303502205f6d3aa0d327c13702513d4299f297ab182fcf670f96291fab19572e7a6e01c402110100000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 484, + "comment": "s = n - 2^128", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "304502205f6d3aa0d327c13702513d4299f297ab182fcf670f96291fab19572e7a6e01c4022100ffffffff00000000fffffffffffffffebce6faada7179e84f3b9cac2fc632551", + "result": "valid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp384r1_sha384_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp384r1_sha384_test.json new file mode 100644 index 000000000..19df1b561 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ecdsa_secp384r1_sha384_test.json @@ -0,0 +1,7281 @@ +{ + "algorithm": "ECDSA", + "schema": "ecdsa_verify_schema_v1.json", + "numberOfTests": 504, + "header": [ + "Test vectors of type EcdsaVerify are meant for the verification", + "of ASN encoded ECDSA signatures." + ], + "notes": { + "ArithmeticError": { + "bugType": "EDGE_CASE", + "description": "Some implementations of ECDSA have arithmetic errors that occur when intermediate results have extreme values. This test vector has been constructed to test such occurrences.", + "cves": [ + "CVE-2017-18146" + ] + }, + "BerEncodedSignature": { + "bugType": "BER_ENCODING", + "description": "ECDSA signatures are usually DER encoded. This signature contains valid values for r and s, but it uses alternative BER encoding.", + "effect": "Accepting alternative BER encodings may be benign in some cases, or be an issue if protocol requires signature malleability.", + "cves": [ + "CVE-2020-14966", + "CVE-2020-13822", + "CVE-2019-14859", + "CVE-2016-1000342" + ] + }, + "EdgeCasePublicKey": { + "bugType": "EDGE_CASE", + "description": "The test vector uses a special case public key. " + }, + "EdgeCaseShamirMultiplication": { + "bugType": "EDGE_CASE", + "description": "Shamir proposed a fast method for computing the sum of two scalar multiplications efficiently. This test vector has been constructed so that an intermediate result is the point at infinity if Shamir's method is used." + }, + "IntegerOverflow": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified, so that the original value is restored if the implementation ignores the most significant bits.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidEncoding": { + "bugType": "CAN_OF_WORMS", + "description": "ECDSA signatures are encoded using ASN.1. This test vector contains an incorrectly encoded signature. The test vector itself was generated from a valid signature by modifying its encoding.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "InvalidSignature": { + "bugType": "AUTH_BYPASS", + "description": "The signature contains special case values such as r=0 and s=0. Buggy implementations may accept such values, if the implementation does not check boundaries and computes s^(-1) == 0.", + "effect": "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.", + "cves": [ + "CVE-2022-21449", + "CVE-2021-43572", + "CVE-2022-24884" + ] + }, + "InvalidTypesInSignature": { + "bugType": "AUTH_BYPASS", + "description": "The signature contains invalid types. Dynamic typed languages sometime coerce such values of different types into integers. If an implementation is careless and has additional bugs, such as not checking integer boundaries then it may be possible that such signatures are accepted.", + "effect": "Accepting such signatures can have the effect that an adversary can forge signatures without even knowing the message to sign.", + "cves": [ + "CVE-2022-21449" + ] + }, + "MissingZero": { + "bugType": "LEGACY", + "description": "Some implementations of ECDSA and DSA incorrectly encode r and s by not including leading zeros in the ASN encoding of integers when necessary. Hence, some implementations (e.g. jdk) allow signatures with incorrect ASN encodings assuming that the signature is otherwise valid.", + "effect": "While signatures are more malleable if such signatures are accepted, this typically leads to no vulnerability, since a badly encoded signature can be reencoded correctly." + }, + "ModifiedInteger": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified. The goal is to check for arithmetic errors.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModifiedSignature": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an invalid signature that was generated from a valid signature by modifying it.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "ModularInverse": { + "bugType": "EDGE_CASE", + "description": "The test vectors contains a signature where computing the modular inverse of s hits an edge case.", + "effect": "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves": [ + "CVE-2019-0865" + ] + }, + "PointDuplication": { + "bugType": "EDGE_CASE", + "description": "Some implementations of ECDSA do not handle duplication and points at infinity correctly. This is a test vector that has been specially crafted to check for such an omission.", + "cves": [ + "2020-12607", + "CVE-2015-2730" + ] + }, + "RangeCheck": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an r and s that has been modified. By adding or subtracting the order of the group (or other values) the test vector checks whether signature verification verifies the range of r and s.", + "effect": "Without further analysis it is unclear if the modification can be used to forge signatures." + }, + "SmallRandS": { + "bugType": "EDGE_CASE", + "description": "The test vectors contains a signature where both r and s are small integers. Some libraries cannot verify such signatures.", + "effect": "While the signature in this test vector is constructed and similar cases are unlikely to occur, it is important to determine if the underlying arithmetic error can be used to forge signatures.", + "cves": [ + "2020-13895" + ] + }, + "SpecialCaseHash": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "ValidSignature": { + "bugType": "BASIC", + "description": "The test vector contains a valid signature that was generated pseudorandomly. Such signatures should not fail to verify unless some of the parameters (e.g. curve or hash function) are not supported." + } + }, + "testGroups": [ + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0429bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc9a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3", + "wx": "29bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc", + "wy": "009a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000429bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc9a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEKb23bV+nQb/XAjPLOmbMfUS+s7BmPZKo\nE2ZQR4vO+2HvGC4VWlQ0Wl6OXojwZOW8mlJat/dk2tPa4UaMK0GfO2K5upF9XoxP\nsexHQEo/x2R0snEwgb6dtMAOBDran8Sj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 1, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "", + "sig": "3064023032401249714e9091f05a5e109d5c1216fdc05e98614261aa0dbd9e9cd4415dee29238afbd3b103c1e40ee5c9144aee0f02304326756fb2c4fd726360dd6479b5849478c7a9d054a833a58c1631c33b63c3441336ddf2c7fe0ed129aae6d4ddfeb753", + "result": "valid" + }, + { + "tcId": 2, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "4d7367", + "sig": "3066023100d7143a836608b25599a7f28dec6635494c2992ad1e2bbeecb7ef601a9c01746e710ce0d9c48accb38a79ede5b9638f3402310080f9e165e8c61035bf8aa7b5533960e46dd0e211c904a064edb6de41f797c0eae4e327612ee3f816f4157272bb4fabc9", + "result": "valid" + }, + { + "tcId": 3, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "30650230234503fcca578121986d96be07fbc8da5d894ed8588c6dbcdbe974b4b813b21c52d20a8928f2e2fdac14705b0705498c023100cd7b9b766b97b53d1a80fc0b760af16a11bf4a59c7c367c6c7275dfb6e18a88091eed3734bf5cf41b3dc6fecd6d3baaf", + "result": "valid" + }, + { + "tcId": 4, + "comment": "pseudorandom signature", + "flags": [ + "ValidSignature" + ], + "msg": "0000000000000000000000000000000000000000", + "sig": "306502305cad9ae1565f2588f86d821c2cc1b4d0fdf874331326568f5b0e130e4e0c0ec497f8f5f564212bd2a26ecb782cf0a18d023100bf2e9d0980fbb00696673e7fbb03e1f854b9d7596b759a17bf6e6e67a95ea6c1664f82dc449ae5ea779abd99c78e6840", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "042da57dda1089276a543f9ffdac0bff0d976cad71eb7280e7d9bfd9fee4bdb2f20f47ff888274389772d98cc5752138aa4b6d054d69dcf3e25ec49df870715e34883b1836197d76f8ad962e78f6571bbc7407b0d6091f9e4d88f014274406174f", + "wx": "2da57dda1089276a543f9ffdac0bff0d976cad71eb7280e7d9bfd9fee4bdb2f20f47ff888274389772d98cc5752138aa", + "wy": "4b6d054d69dcf3e25ec49df870715e34883b1836197d76f8ad962e78f6571bbc7407b0d6091f9e4d88f014274406174f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200042da57dda1089276a543f9ffdac0bff0d976cad71eb7280e7d9bfd9fee4bdb2f20f47ff888274389772d98cc5752138aa4b6d054d69dcf3e25ec49df870715e34883b1836197d76f8ad962e78f6571bbc7407b0d6091f9e4d88f014274406174f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAELaV92hCJJ2pUP5/9rAv/DZdsrXHrcoDn\n2b/Z/uS9svIPR/+IgnQ4l3LZjMV1ITiqS20FTWnc8+JexJ34cHFeNIg7GDYZfXb4\nrZYuePZXG7x0B7DWCR+eTYjwFCdEBhdP\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 5, + "comment": "signature malleability", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702301840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca03995ca30240e09513805bf6209b58ac7aa9cff54eecd82b9f1", + "result": "valid" + }, + { + "tcId": 6, + "comment": "Legacy: ASN encoding of s misses leading 0", + "flags": [ + "MissingZero" + ], + "msg": "313233343030", + "sig": "3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70230e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 7, + "comment": "valid", + "flags": [ + "ValidSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "valid" + }, + { + "tcId": 8, + "comment": "length of sequence [r, s] uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "308165023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 9, + "comment": "length of sequence [r, s] contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "30820065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 10, + "comment": "length of sequence [r, s] uses 102 instead of 101", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3066023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 11, + "comment": "length of sequence [r, s] uses 100 instead of 101", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 12, + "comment": "uint32 overflow in length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30850100000065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 13, + "comment": "uint64 overflow in length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3089010000000000000065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 14, + "comment": "length of sequence [r, s] = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30847fffffff023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 15, + "comment": "length of sequence [r, s] = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "308480000000023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 16, + "comment": "length of sequence [r, s] = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3084ffffffff023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 17, + "comment": "length of sequence [r, s] = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3085ffffffffff023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 18, + "comment": "length of sequence [r, s] = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3088ffffffffffffffff023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 19, + "comment": "incorrect length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30ff023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 20, + "comment": "replaced sequence [r, s] by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 21, + "comment": "removing sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "", + "result": "invalid" + }, + { + "tcId": 22, + "comment": "lonely sequence tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30", + "result": "invalid" + }, + { + "tcId": 23, + "comment": "appending 0's to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 24, + "comment": "prepending 0's to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30670000023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 25, + "comment": "appending unused 0's to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 26, + "comment": "appending null value to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820500", + "result": "invalid" + }, + { + "tcId": 27, + "comment": "prepending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a4981773065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 28, + "comment": "prepending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306925003065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 29, + "comment": "appending garbage to sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30673065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820004deadbeef", + "result": "invalid" + }, + { + "tcId": 30, + "comment": "including undefined tags", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "306daa00bb00cd003065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 31, + "comment": "including undefined tags", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d2238aa00bb00cd00023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 32, + "comment": "including undefined tags", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72239aa00bb00cd00023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 33, + "comment": "truncated length of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3081", + "result": "invalid" + }, + { + "tcId": 34, + "comment": "including undefined tags to sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "306baa02aabb3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 35, + "comment": "using composition with indefinite length for sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30803065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 36, + "comment": "using composition with wrong tag for sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30803165023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 37, + "comment": "Replacing sequence [r, s] with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "0500", + "result": "invalid" + }, + { + "tcId": 38, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "2e65023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 39, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "2f65023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 40, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3165023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 41, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3265023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 42, + "comment": "changing tag value of sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "ff65023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 43, + "comment": "dropping value of sequence [r, s]", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3000", + "result": "invalid" + }, + { + "tcId": 44, + "comment": "using composition for sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306930010230643012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 45, + "comment": "truncated sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f", + "result": "invalid" + }, + { + "tcId": 46, + "comment": "truncated sequence [r, s]", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30643012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 47, + "comment": "sequence [r, s] of size 4198 to check for overflows", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30821066023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 48, + "comment": "indefinite length", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 49, + "comment": "indefinite length with truncated delimiter", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f8200", + "result": "invalid" + }, + { + "tcId": 50, + "comment": "indefinite length with additional element", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f8205000000", + "result": "invalid" + }, + { + "tcId": 51, + "comment": "indefinite length with truncated element", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82060811220000", + "result": "invalid" + }, + { + "tcId": 52, + "comment": "indefinite length with garbage", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000fe02beef", + "result": "invalid" + }, + { + "tcId": 53, + "comment": "indefinite length with nonempty EOC", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3080023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820002beef", + "result": "invalid" + }, + { + "tcId": 54, + "comment": "prepend empty sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30673000023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 55, + "comment": "append empty sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f823000", + "result": "invalid" + }, + { + "tcId": 56, + "comment": "append zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3068023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82020100", + "result": "invalid" + }, + { + "tcId": 57, + "comment": "append garbage with high tag number", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3068023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82bf7f00", + "result": "invalid" + }, + { + "tcId": 58, + "comment": "append null with explicit tag", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82a0020500", + "result": "invalid" + }, + { + "tcId": 59, + "comment": "append null with implicit tag", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82a000", + "result": "invalid" + }, + { + "tcId": 60, + "comment": "sequence of sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30673065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 61, + "comment": "truncated sequence: removed last 1 elements", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3032023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7", + "result": "invalid" + }, + { + "tcId": 62, + "comment": "repeating element in sequence", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "308198023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 63, + "comment": "flipped bit 0 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306312b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d6023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 64, + "comment": "flipped bit 32 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306312b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3395f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 65, + "comment": "flipped bit 48 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306312b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abc3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 66, + "comment": "flipped bit 64 in r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306312b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0330abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 67, + "comment": "length of r uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "306602813012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 68, + "comment": "length of r contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "30670282003012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 69, + "comment": "length of r uses 49 instead of 48", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 70, + "comment": "length of r uses 47 instead of 48", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065022f12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 71, + "comment": "uint32 overflow in length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a0285010000003012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 72, + "comment": "uint64 overflow in length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306e028901000000000000003012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 73, + "comment": "length of r = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306902847fffffff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 74, + "comment": "length of r = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306902848000000012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 75, + "comment": "length of r = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30690284ffffffff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 76, + "comment": "length of r = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a0285ffffffffff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 77, + "comment": "length of r = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d0288ffffffffffffffff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 78, + "comment": "incorrect length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306502ff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 79, + "comment": "replaced r by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065028012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 80, + "comment": "removing r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3033023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 81, + "comment": "lonely integer tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "303402023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 82, + "comment": "lonely integer tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3033023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702", + "result": "invalid" + }, + { + "tcId": 83, + "comment": "appending 0's to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023212b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70000023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 84, + "comment": "prepending 0's to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30670232000012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 85, + "comment": "appending unused 0's to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70000023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 86, + "comment": "appending null value to r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023212b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70500023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 87, + "comment": "prepending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a2235498177023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 88, + "comment": "prepending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306922342500023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 89, + "comment": "appending garbage to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d2232023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70004deadbeef023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 90, + "comment": "truncated length of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30350281023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 91, + "comment": "including undefined tags to r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306b2236aa02aabb023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 92, + "comment": "using composition with indefinite length for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30692280023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70000023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 93, + "comment": "using composition with wrong tag for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30692280033012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70000023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 94, + "comment": "Replacing r with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30350500023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 95, + "comment": "changing tag value of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065003012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 96, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065013012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 97, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065033012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 98, + "comment": "changing tag value of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065043012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 99, + "comment": "changing tag value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065ff3012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 100, + "comment": "dropping value of r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30350200023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 101, + "comment": "using composition for r", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "30692234020112022fb30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 102, + "comment": "modifying first byte of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023010b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 103, + "comment": "modifying last byte of r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c54857023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 104, + "comment": "truncated r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3064022f12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 105, + "comment": "truncated r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3064022fb30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 106, + "comment": "r of size 4145 to check for overflows", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "308210680282103112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 107, + "comment": "leading ff in r", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30660231ff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 108, + "comment": "replaced r by infinity", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3036090180023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 109, + "comment": "replacing r with zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 110, + "comment": "flipped bit 0 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3063023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d700e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f83", + "result": "invalid" + }, + { + "tcId": 111, + "comment": "flipped bit 32 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3063023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d700e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47aff426f82", + "result": "invalid" + }, + { + "tcId": 112, + "comment": "flipped bit 48 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3063023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d700e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fedc47bff426f82", + "result": "invalid" + }, + { + "tcId": 113, + "comment": "flipped bit 64 in s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3063023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d700e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd14fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 114, + "comment": "length of s uses long form encoding", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "3066023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702813100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 115, + "comment": "length of s contains a leading 0", + "flags": [ + "BerEncodedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70282003100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 116, + "comment": "length of s uses 50 instead of 49", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023200e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 117, + "comment": "length of s uses 48 instead of 49", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 118, + "comment": "uint32 overflow in length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70285010000003100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 119, + "comment": "uint64 overflow in length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306e023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7028901000000000000003100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 120, + "comment": "length of s = 2**31 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702847fffffff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 121, + "comment": "length of s = 2**31", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702848000000000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 122, + "comment": "length of s = 2**32 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70284ffffffff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 123, + "comment": "length of s = 2**40 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70285ffffffffff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 124, + "comment": "length of s = 2**64 - 1", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70288ffffffffffffffff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 125, + "comment": "incorrect length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d702ff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 126, + "comment": "replaced s by an indefinite length tag without termination", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7028000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 127, + "comment": "appending 0's to s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023300e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 128, + "comment": "prepending 0's to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70233000000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 129, + "comment": "appending null value to s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3067023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023300e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820500", + "result": "invalid" + }, + { + "tcId": 130, + "comment": "prepending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306a023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72236498177023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 131, + "comment": "prepending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d722352500023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 132, + "comment": "appending garbage to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306d023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72233023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820004deadbeef", + "result": "invalid" + }, + { + "tcId": 133, + "comment": "truncated length of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3034023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70281", + "result": "invalid" + }, + { + "tcId": 134, + "comment": "including undefined tags to s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "306b023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72237aa02aabb023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 135, + "comment": "using composition with indefinite length for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72280023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 136, + "comment": "using composition with wrong tag for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d72280033100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000", + "result": "invalid" + }, + { + "tcId": 137, + "comment": "Replacing s with NULL", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3034023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70500", + "result": "invalid" + }, + { + "tcId": 138, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7003100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 139, + "comment": "changing tag value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7013100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 140, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7033100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 141, + "comment": "changing tag value of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7043100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 142, + "comment": "changing tag value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7ff3100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 143, + "comment": "dropping value of s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3034023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70200", + "result": "invalid" + }, + { + "tcId": 144, + "comment": "using composition for s", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "3069023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d722350201000230e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 145, + "comment": "modifying first byte of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023102e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 146, + "comment": "modifying last byte of s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3065023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f02", + "result": "invalid" + }, + { + "tcId": 147, + "comment": "truncated s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3064023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f", + "result": "invalid" + }, + { + "tcId": 148, + "comment": "s of size 4146 to check for overflows", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "30821068023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70282103200e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f820000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 149, + "comment": "leading ff in s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3066023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d70232ff00e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 150, + "comment": "replaced s by infinity", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3035023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7090180", + "result": "invalid" + }, + { + "tcId": 151, + "comment": "replacing s with zero", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3035023012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7020100", + "result": "invalid" + }, + { + "tcId": 152, + "comment": "replaced r by r + n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "306602310112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19a25617aad7485e6312a8589714f647acf7a94cffbe8a724a023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 153, + "comment": "replaced r by r - n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30660231ff12b30abef6b5476fe6b612ae557c0425661e26b44b1bfe1a138f7ca6eeda02a462743d328394f8b71dd11a2a25001f64023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 154, + "comment": "replaced r by r + 256 * n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30670232010012b30abef6b5476fe6b612ae557c0425661e26b44b1bfde13e404c1d1a3f0fdbd49bfd2d7ced1b1ef6d69e61b6eebbd7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 155, + "comment": "replaced r by -r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30650230ed4cf541094ab8901949ed51aa83fbda99e1d94bb4e401e6250d35d71ceecf7c4571b51b33ba5fcdf542cc6b0e3ab729023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 156, + "comment": "replaced r by n - r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "3066023100ed4cf541094ab8901949ed51aa83fbda99e1d94bb4e401e5ec7083591125fd5b9d8bc2cd7c6b0748e22ee5d5daffe09c023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 157, + "comment": "replaced r by -n - r", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30660231feed4cf541094ab8901949ed51aa83fbda99e1d94bb4e401e65da9e85528b7a19ced57a768eb09b8530856b30041758db6023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 158, + "comment": "replaced r by r + 2**384", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "306602310112b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 159, + "comment": "replaced r by r + 2**448", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "306e023901000000000000000012b30abef6b5476fe6b612ae557c0425661e26b44b1bfe19daf2ca28e3113083ba8e4ae4cc45a0320abd3394f1c548d7023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 160, + "comment": "replaced s by s + n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "3066023101e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc5f8fc6adfda650a86aa74b95adbd6874b3cd8dde6cc0798f5023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 161, + "comment": "replaced s by s - n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "30650230e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc66a35cfdbf1f6aec7fa409df64a7538556300ab11327d460f023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 162, + "comment": "replaced s by s + 256 * n", + "flags": [ + "RangeCheck" + ], + "msg": "313233343030", + "sig": "306702320100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35f8d94e69f521d5bbbff6c685df143cd5abd3c062f48c46be282023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 163, + "comment": "replaced s by -s", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30660231ff1840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca039ce66e2a219d22358ada554576cda202fb0133b8400bd907e023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 164, + "comment": "replaced s by -n - s", + "flags": [ + "ModifiedInteger" + ], + "msg": "313233343030", + "sig": "30660231fe1840da9fc1d2f8f8900cf485d5413b8c2574ee3a8d4ca03a07039520259af579558b46a5242978b4c327221933f8670b023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 165, + "comment": "replaced s by s + 2**384", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "3066023101e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 166, + "comment": "replaced s by s - 2**384", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "30650230e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 167, + "comment": "replaced s by s + 2**448", + "flags": [ + "IntegerOverflow" + ], + "msg": "313233343030", + "sig": "306e0239010000000000000000e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82023100e7bf25603e2d07076ff30b7a2abec473da8b11c572b35fc631991d5de62ddca7525aaba89325dfd04fecc47bff426f82", + "result": "invalid" + }, + { + "tcId": 168, + "comment": "Signature with special case values r=0 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020100020100", + "result": "invalid" + }, + { + "tcId": 169, + "comment": "Signature with special case values r=0 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020100020101", + "result": "invalid" + }, + { + "tcId": 170, + "comment": "Signature with special case values r=0 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201000201ff", + "result": "invalid" + }, + { + "tcId": 171, + "comment": "Signature with special case values r=0 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 172, + "comment": "Signature with special case values r=0 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 173, + "comment": "Signature with special case values r=0 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 174, + "comment": "Signature with special case values r=0 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 175, + "comment": "Signature with special case values r=0 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020100023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 176, + "comment": "Signature with special case values r=1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020101020100", + "result": "invalid" + }, + { + "tcId": 177, + "comment": "Signature with special case values r=1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3006020101020101", + "result": "invalid" + }, + { + "tcId": 178, + "comment": "Signature with special case values r=1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201010201ff", + "result": "invalid" + }, + { + "tcId": 179, + "comment": "Signature with special case values r=1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020101023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 180, + "comment": "Signature with special case values r=1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020101023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 181, + "comment": "Signature with special case values r=1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020101023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 182, + "comment": "Signature with special case values r=1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020101023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 183, + "comment": "Signature with special case values r=1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036020101023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 184, + "comment": "Signature with special case values r=-1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff020100", + "result": "invalid" + }, + { + "tcId": 185, + "comment": "Signature with special case values r=-1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff020101", + "result": "invalid" + }, + { + "tcId": 186, + "comment": "Signature with special case values r=-1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30060201ff0201ff", + "result": "invalid" + }, + { + "tcId": 187, + "comment": "Signature with special case values r=-1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30360201ff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 188, + "comment": "Signature with special case values r=-1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30360201ff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 189, + "comment": "Signature with special case values r=-1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30360201ff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 190, + "comment": "Signature with special case values r=-1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30360201ff023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 191, + "comment": "Signature with special case values r=-1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "30360201ff023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 192, + "comment": "Signature with special case values r=n and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973020100", + "result": "invalid" + }, + { + "tcId": 193, + "comment": "Signature with special case values r=n and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973020101", + "result": "invalid" + }, + { + "tcId": 194, + "comment": "Signature with special case values r=n and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529730201ff", + "result": "invalid" + }, + { + "tcId": 195, + "comment": "Signature with special case values r=n and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 196, + "comment": "Signature with special case values r=n and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 197, + "comment": "Signature with special case values r=n and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 198, + "comment": "Signature with special case values r=n and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 199, + "comment": "Signature with special case values r=n and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 200, + "comment": "Signature with special case values r=n - 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972020100", + "result": "invalid" + }, + { + "tcId": 201, + "comment": "Signature with special case values r=n - 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972020101", + "result": "invalid" + }, + { + "tcId": 202, + "comment": "Signature with special case values r=n - 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529720201ff", + "result": "invalid" + }, + { + "tcId": 203, + "comment": "Signature with special case values r=n - 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 204, + "comment": "Signature with special case values r=n - 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 205, + "comment": "Signature with special case values r=n - 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 206, + "comment": "Signature with special case values r=n - 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 207, + "comment": "Signature with special case values r=n - 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 208, + "comment": "Signature with special case values r=n + 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974020100", + "result": "invalid" + }, + { + "tcId": 209, + "comment": "Signature with special case values r=n + 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974020101", + "result": "invalid" + }, + { + "tcId": 210, + "comment": "Signature with special case values r=n + 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529740201ff", + "result": "invalid" + }, + { + "tcId": 211, + "comment": "Signature with special case values r=n + 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 212, + "comment": "Signature with special case values r=n + 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 213, + "comment": "Signature with special case values r=n + 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 214, + "comment": "Signature with special case values r=n + 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 215, + "comment": "Signature with special case values r=n + 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 216, + "comment": "Signature with special case values r=p and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff020100", + "result": "invalid" + }, + { + "tcId": 217, + "comment": "Signature with special case values r=p and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff020101", + "result": "invalid" + }, + { + "tcId": 218, + "comment": "Signature with special case values r=p and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff0201ff", + "result": "invalid" + }, + { + "tcId": 219, + "comment": "Signature with special case values r=p and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 220, + "comment": "Signature with special case values r=p and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 221, + "comment": "Signature with special case values r=p and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 222, + "comment": "Signature with special case values r=p and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 223, + "comment": "Signature with special case values r=p and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 224, + "comment": "Signature with special case values r=p + 1 and s=0", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000020100", + "result": "invalid" + }, + { + "tcId": 225, + "comment": "Signature with special case values r=p + 1 and s=1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000020101", + "result": "invalid" + }, + { + "tcId": 226, + "comment": "Signature with special case values r=p + 1 and s=-1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000001000000000201ff", + "result": "invalid" + }, + { + "tcId": 227, + "comment": "Signature with special case values r=p + 1 and s=n", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973", + "result": "invalid" + }, + { + "tcId": 228, + "comment": "Signature with special case values r=p + 1 and s=n - 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972", + "result": "invalid" + }, + { + "tcId": 229, + "comment": "Signature with special case values r=p + 1 and s=n + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52974", + "result": "invalid" + }, + { + "tcId": 230, + "comment": "Signature with special case values r=p + 1 and s=p", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff", + "result": "invalid" + }, + { + "tcId": 231, + "comment": "Signature with special case values r=p + 1 and s=p + 1", + "flags": [ + "InvalidSignature" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff000000000000000100000000", + "result": "invalid" + }, + { + "tcId": 232, + "comment": "Signature encoding contains incorrect types: r=0, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008020100090380fe01", + "result": "invalid" + }, + { + "tcId": 233, + "comment": "Signature encoding contains incorrect types: r=0, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100090142", + "result": "invalid" + }, + { + "tcId": 234, + "comment": "Signature encoding contains incorrect types: r=0, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100010101", + "result": "invalid" + }, + { + "tcId": 235, + "comment": "Signature encoding contains incorrect types: r=0, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020100010100", + "result": "invalid" + }, + { + "tcId": 236, + "comment": "Signature encoding contains incorrect types: r=0, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201000500", + "result": "invalid" + }, + { + "tcId": 237, + "comment": "Signature encoding contains incorrect types: r=0, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201000c00", + "result": "invalid" + }, + { + "tcId": 238, + "comment": "Signature encoding contains incorrect types: r=0, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201000c0130", + "result": "invalid" + }, + { + "tcId": 239, + "comment": "Signature encoding contains incorrect types: r=0, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201003000", + "result": "invalid" + }, + { + "tcId": 240, + "comment": "Signature encoding contains incorrect types: r=0, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201003003020100", + "result": "invalid" + }, + { + "tcId": 241, + "comment": "Signature encoding contains incorrect types: r=1, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008020101090380fe01", + "result": "invalid" + }, + { + "tcId": 242, + "comment": "Signature encoding contains incorrect types: r=1, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101090142", + "result": "invalid" + }, + { + "tcId": 243, + "comment": "Signature encoding contains incorrect types: r=1, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101010101", + "result": "invalid" + }, + { + "tcId": 244, + "comment": "Signature encoding contains incorrect types: r=1, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006020101010100", + "result": "invalid" + }, + { + "tcId": 245, + "comment": "Signature encoding contains incorrect types: r=1, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201010500", + "result": "invalid" + }, + { + "tcId": 246, + "comment": "Signature encoding contains incorrect types: r=1, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201010c00", + "result": "invalid" + }, + { + "tcId": 247, + "comment": "Signature encoding contains incorrect types: r=1, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201010c0130", + "result": "invalid" + }, + { + "tcId": 248, + "comment": "Signature encoding contains incorrect types: r=1, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201013000", + "result": "invalid" + }, + { + "tcId": 249, + "comment": "Signature encoding contains incorrect types: r=1, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201013003020100", + "result": "invalid" + }, + { + "tcId": 250, + "comment": "Signature encoding contains incorrect types: r=-1, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201ff090380fe01", + "result": "invalid" + }, + { + "tcId": 251, + "comment": "Signature encoding contains incorrect types: r=-1, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff090142", + "result": "invalid" + }, + { + "tcId": 252, + "comment": "Signature encoding contains incorrect types: r=-1, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff010101", + "result": "invalid" + }, + { + "tcId": 253, + "comment": "Signature encoding contains incorrect types: r=-1, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff010100", + "result": "invalid" + }, + { + "tcId": 254, + "comment": "Signature encoding contains incorrect types: r=-1, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff0500", + "result": "invalid" + }, + { + "tcId": 255, + "comment": "Signature encoding contains incorrect types: r=-1, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff0c00", + "result": "invalid" + }, + { + "tcId": 256, + "comment": "Signature encoding contains incorrect types: r=-1, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060201ff0c0130", + "result": "invalid" + }, + { + "tcId": 257, + "comment": "Signature encoding contains incorrect types: r=-1, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050201ff3000", + "result": "invalid" + }, + { + "tcId": 258, + "comment": "Signature encoding contains incorrect types: r=-1, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30080201ff3003020100", + "result": "invalid" + }, + { + "tcId": 259, + "comment": "Signature encoding contains incorrect types: r=n, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3038023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973090380fe01", + "result": "invalid" + }, + { + "tcId": 260, + "comment": "Signature encoding contains incorrect types: r=n, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973090142", + "result": "invalid" + }, + { + "tcId": 261, + "comment": "Signature encoding contains incorrect types: r=n, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973010101", + "result": "invalid" + }, + { + "tcId": 262, + "comment": "Signature encoding contains incorrect types: r=n, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973010100", + "result": "invalid" + }, + { + "tcId": 263, + "comment": "Signature encoding contains incorrect types: r=n, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529730500", + "result": "invalid" + }, + { + "tcId": 264, + "comment": "Signature encoding contains incorrect types: r=n, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529730c00", + "result": "invalid" + }, + { + "tcId": 265, + "comment": "Signature encoding contains incorrect types: r=n, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529730c0130", + "result": "invalid" + }, + { + "tcId": 266, + "comment": "Signature encoding contains incorrect types: r=n, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529733000", + "result": "invalid" + }, + { + "tcId": 267, + "comment": "Signature encoding contains incorrect types: r=n, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3038023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc529733003020100", + "result": "invalid" + }, + { + "tcId": 268, + "comment": "Signature encoding contains incorrect types: r=p, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3038023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff090380fe01", + "result": "invalid" + }, + { + "tcId": 269, + "comment": "Signature encoding contains incorrect types: r=p, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff090142", + "result": "invalid" + }, + { + "tcId": 270, + "comment": "Signature encoding contains incorrect types: r=p, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff010101", + "result": "invalid" + }, + { + "tcId": 271, + "comment": "Signature encoding contains incorrect types: r=p, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff010100", + "result": "invalid" + }, + { + "tcId": 272, + "comment": "Signature encoding contains incorrect types: r=p, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff0500", + "result": "invalid" + }, + { + "tcId": 273, + "comment": "Signature encoding contains incorrect types: r=p, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff0c00", + "result": "invalid" + }, + { + "tcId": 274, + "comment": "Signature encoding contains incorrect types: r=p, s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3036023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff0c0130", + "result": "invalid" + }, + { + "tcId": 275, + "comment": "Signature encoding contains incorrect types: r=p, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3035023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff3000", + "result": "invalid" + }, + { + "tcId": 276, + "comment": "Signature encoding contains incorrect types: r=p, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3038023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff3003020100", + "result": "invalid" + }, + { + "tcId": 277, + "comment": "Signature encoding contains incorrect types: r=0.25, s=0.25", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300a090380fe01090380fe01", + "result": "invalid" + }, + { + "tcId": 278, + "comment": "Signature encoding contains incorrect types: r=nan, s=nan", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006090142090142", + "result": "invalid" + }, + { + "tcId": 279, + "comment": "Signature encoding contains incorrect types: r=True, s=True", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010101010101", + "result": "invalid" + }, + { + "tcId": 280, + "comment": "Signature encoding contains incorrect types: r=False, s=False", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010100010100", + "result": "invalid" + }, + { + "tcId": 281, + "comment": "Signature encoding contains incorrect types: r=Null, s=Null", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300405000500", + "result": "invalid" + }, + { + "tcId": 282, + "comment": "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=empyt UTF-8 string", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30040c000c00", + "result": "invalid" + }, + { + "tcId": 283, + "comment": "Signature encoding contains incorrect types: r=\"0\", s=\"0\"", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060c01300c0130", + "result": "invalid" + }, + { + "tcId": 284, + "comment": "Signature encoding contains incorrect types: r=empty list, s=empty list", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300430003000", + "result": "invalid" + }, + { + "tcId": 285, + "comment": "Signature encoding contains incorrect types: r=list containing 0, s=list containing 0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "300a30030201003003020100", + "result": "invalid" + }, + { + "tcId": 286, + "comment": "Signature encoding contains incorrect types: r=0.25, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3008090380fe01020100", + "result": "invalid" + }, + { + "tcId": 287, + "comment": "Signature encoding contains incorrect types: r=nan, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006090142020100", + "result": "invalid" + }, + { + "tcId": 288, + "comment": "Signature encoding contains incorrect types: r=True, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010101020100", + "result": "invalid" + }, + { + "tcId": 289, + "comment": "Signature encoding contains incorrect types: r=False, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "3006010100020100", + "result": "invalid" + }, + { + "tcId": 290, + "comment": "Signature encoding contains incorrect types: r=Null, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050500020100", + "result": "invalid" + }, + { + "tcId": 291, + "comment": "Signature encoding contains incorrect types: r=empyt UTF-8 string, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30050c00020100", + "result": "invalid" + }, + { + "tcId": 292, + "comment": "Signature encoding contains incorrect types: r=\"0\", s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30060c0130020100", + "result": "invalid" + }, + { + "tcId": 293, + "comment": "Signature encoding contains incorrect types: r=empty list, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30053000020100", + "result": "invalid" + }, + { + "tcId": 294, + "comment": "Signature encoding contains incorrect types: r=list containing 0, s=0", + "flags": [ + "InvalidTypesInSignature" + ], + "msg": "313233343030", + "sig": "30083003020100020100", + "result": "invalid" + }, + { + "tcId": 295, + "comment": "Edge case for Shamir multiplication", + "flags": [ + "EdgeCaseShamirMultiplication" + ], + "msg": "3133323237", + "sig": "3066023100ac042e13ab83394692019170707bc21dd3d7b8d233d11b651757085bdd5767eabbb85322984f14437335de0cdf565684023100bd770d3ee4beadbabe7ca46e8c4702783435228d46e2dd360e322fe61c86926fa49c8116ec940f72ac8c30d9beb3e12f", + "result": "valid" + }, + { + "tcId": 296, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31373530353531383135", + "sig": "3066023100d3298a0193c4316b34e3833ff764a82cff4ef57b5dd79ed6237b51ff76ceab13bf92131f41030515b7e012d2ba857830023100bfc7518d2ad20ed5f58f3be79720f1866f7a23b3bd1bf913d3916819d008497a071046311d3c2fd05fc284c964a39617", + "result": "valid" + }, + { + "tcId": 297, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130333633303731", + "sig": "3065023100e14f41a5fc83aa4725a9ea60ab5b0b9de27f519af4b557a601f1fee0243f8eee5180f8c531414f3473f4457430cb7a2602301047ed2bf1f98e3ce93e8fdbdc63cc79f238998fee74e1bb6cd708694950bbffe3945066064da043f04d7083d0a596ec", + "result": "valid" + }, + { + "tcId": 298, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32333632343231333231", + "sig": "3066023100b7c8b5cf631a96ad908d6a8c8d0e0a35fcc22a5a36050230b665932764ae45bd84cb87ebba8e444abd89e4483fc9c4a8023100a11636c095aa9bc69cf24b50a0a9e5377d0ffbba4fab5433159f006ab4563d55e918493020a19691574e4d1e66e3975e", + "result": "valid" + }, + { + "tcId": 299, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34353838303134363536", + "sig": "306402304a7df2df6a32d59b6bfed54f032c3d6f3acd3ac4063704099cd162ab3908e8eeba4e973ee75b5e285dd572062338fe58023035365be327e2463dc759951c5c0be5e3d094cb706912fdf7d26b15d4a5c42ffebeca5ae73a1823f5e65d571b4ccf1a82", + "result": "valid" + }, + { + "tcId": 300, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32313436363035363432", + "sig": "30660231009ad363a1bbc67c57c82a378e988cc083cc91f8b32739ec647c0cb348fb5c86472015131a7d9083bf4740af3351755195023100d310dc1509f8c00281efe571768d488027ea760fe32971f6cb7b57cdf90621b7d0086e26443d3761df7aa3a4eccc6c58", + "result": "valid" + }, + { + "tcId": 301, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333335333030383230", + "sig": "306502310095078af5c2ac230239557f5fcee2e712a7034e95437a9b34c1692a81270edcf8ddd5aba1138a42012663e5f81c9beae2023040ee510a0cceb8518ad4f618599164da0f3ba75eceeac216216ec62bcceae8dc98b5e35b2e7ed47c4b8ebacfe84a74e6", + "result": "valid" + }, + { + "tcId": 302, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36333936363033363331", + "sig": "3066023100a538076362043de54864464c14a6c1c3a478443726c1309a36b9e9ea1592b40c3f3f90d195bd298004a71e8f285e093a023100d74f97ef38468515a8c927a450275c14dc16ddbdd92b3a5cae804be20d29c682129247d2e01d37dabe38ffb74808a8b7", + "result": "valid" + }, + { + "tcId": 303, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33333931363630373935", + "sig": "3065023100bbe835113f8ea4dc469f0283af6603f3d7a3a222b3ab5a93db56007ef2dc07c97988fc7b8b833057fa3fbf97413b6c150230737c316320b61002c2acb184d82e60e46bd2129a9bbf563c80da423121c161decd363518b260aaacf3734c1ef9faa925", + "result": "valid" + }, + { + "tcId": 304, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31343436393735393634", + "sig": "30650230679c3640ad8ffe9577d9b59b18ff5598dbfe61122bbab8238d268907c989cd94dc7f601d17486af93f6d18624aa524a3023100e84dd195502bdcdd77b7f51d8c1ea789006905844a0e185474af1a583bab564ee23be0bc49500390dceb3d3948f06730", + "result": "valid" + }, + { + "tcId": 305, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35313539343738363431", + "sig": "3066023100f6f1afe6febce799cc9b754279f2499f3825c3e789accef46d3f068e2b6781fd50669e80c3c7293a5c0c0af48e068e35023100f59cc8c2222ed63b4553f8149ebecc43b866719b294ef0832a12b3e3dbc825eeab68b5779625b10ae5541412ec295354", + "result": "valid" + }, + { + "tcId": 306, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35323431373932333331", + "sig": "3065023100f46496f6d473f3c091a68aaa3749220c840061cd4f888613ccfeac0aa0411b451edbd4facbe38d2dd9d6d0d0d255ed34023000c3a74fa6666f58c4798f30c3779813e5c6d08ac31a792c2d0f9cb708733f26ad6bf3b1e46815ae536aa151680bdee2", + "result": "valid" + }, + { + "tcId": 307, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31313437323930323034", + "sig": "3066023100df8b8e4cb1bc4ec69cb1472fa5a81c36642ed47fc6ce560033c4f7cb0bc8459b5788e34caa7d96e6071188e449f0207a0231008b8ee0177962a489938f3feffae55729d9d446fe438c7cb91ea5f632c80aa72a43b9b04e6de7ff34f76f4425107fd697", + "result": "valid" + }, + { + "tcId": 308, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130383738373235363435", + "sig": "30660231008bb6a8ecdc8b483ad7b9c94bb39f63b5fc1378efe8c0204a74631dded7159643821419af33863b0414bd87ecf73ba3fb0231008928449f2d6db2b2c65d44d98beb77eeadcbda83ff33e57eb183e1fc29ad86f0ba29ee66e750e8170ccc434cf70ae199", + "result": "valid" + }, + { + "tcId": 309, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37333433333036353633", + "sig": "3065023100e3832877c80c4ed439d8eadcf615c0286ff54943e3ae2f66a3b9f886245fea470e6d5812cef80c23e4f568d0215a3bfc02303177a7dbf0ab8f8f5fc1d01b19d6a5e89642899f369dfe213b7cc55d8eaf21dd2885efce52b5959c1f06b7cac5773e5b", + "result": "valid" + }, + { + "tcId": 310, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393734343630393738", + "sig": "306502306275738f0880023286a9b6f28ea0a9779e8d644c3dec48293c64f1566b34e15c7119bd9d02fa2357774cabc9e53ef7e6023100d2f0a52b1016082bd5517609ee81c0764dc38a8f32d9a5074e717ee1d832f9ea0e4c6b100b1fd5e7f4bc7468c79d3933", + "result": "valid" + }, + { + "tcId": 311, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323237303836383339", + "sig": "3066023100d316fe5168cf13753c8c3bbef83869a6703dc0d5afa82af49c88ff3555660f57919a6f36e84451c3e8e5783e3b83fe3b023100995f08c8fec7cd82ce27e7509393f5a3803a48fe255fcb160321c6e1890eb36e37bcda158f0fa6899e7d107e52de8c3c", + "result": "valid" + }, + { + "tcId": 312, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "323332393736343130", + "sig": "306402300b13b8fd10fa7b42169137588ad3f557539a4e9206f3a1f1fe9202b0690defded2be18147f5b2da9285c0e7349735ea302300478ad317b22a247bf9334719b4c8ee84acf134515db77e6141c75d08961e1e51eaca29836744103de0f6a4c798d3eeb", + "result": "valid" + }, + { + "tcId": 313, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3934303437333831", + "sig": "3065023015804429bcb5277d4f0af73bd54c8a177499a7b64f18afc566c3ce7096bdc6c275e38548edcfa0b78dd7f57b6f393e49023100d5951f243e65b82ba5c0c7552d33b11f1e90fde0c3fd014aac1bb27db2aaf09b667c8b247c4cdd5b0723fba83b4f999e", + "result": "valid" + }, + { + "tcId": 314, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323230353639313233", + "sig": "30650230359247c95776bb17492b7bf827f5f330fa9f9de7cc10441a1479c81776ce36cdc6a13c5f5149c4e39147a196bb02ed34023100f6ed9252a73de48516f4eabab6368fbff6875128af4e1226d54db558bd76eec369cc9b285bc196d512e531f84864d33f", + "result": "valid" + }, + { + "tcId": 315, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343134303533393934", + "sig": "3065023100a557d1f63a2094f683429ecb35a6533bac897682775c0051e111eed6e076c48867cae005c5e0803800b050311e381cd602302a2f871efcf03cf1c8f509e076aaa2a76f1ea78d1c64804ea5b063b0324b8e98eb5825d04370106020ee15805dbedf81", + "result": "valid" + }, + { + "tcId": 316, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31393531353638363439", + "sig": "3065023100f22bf91169b4aec84ca84041cb826f7dfc6f33d973f3c72433b8a0ca203aac93f7eed62be9bea01706402d5b5d3b0e6502307841d3bc34aa47e813a55c25203c5ec2342d838d5b4638c2705dcf4bac9c24f765b5d4c28fa3c7fda7a38ed5048c7de3", + "result": "valid" + }, + { + "tcId": 317, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35393539303731363335", + "sig": "30660231009c196e39a2d61a3c2565f5932f357e242892737e9adfc86c6609f291e5e6fdbb23029ff915a032b0c5390ba9d15f203e023100d721e28e5269d7813e8a9aed53a37e652fec1560ca61f28f55ab4c262cc6214eee8d3c4c2ba9d1ba0ba19e5e3c7484a7", + "result": "valid" + }, + { + "tcId": 318, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "323135333436393533", + "sig": "30660231008ba1e9dec14d300b0e250ea0bcd4419c3d9559622cc7b8375bd73f7d70133242e3d5bf70bc782808734654bacd12daea023100d893d3970f72ccab35555ae91ebcfed3c5bfc5d39181071bc06ba382587a695e02ed482f1a74fe309a399eaee5f5bc52", + "result": "valid" + }, + { + "tcId": 319, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34383037313039383330", + "sig": "306402302f521d9d83e1bff8d25255a9bdca90e15d78a8c9ea7885b884024a40de9a315bed7f746b5da4ce96b070208e9ae0cfa502304185c6f4225b8c255a4d31abb5c9b6c686a6ee50a8eb7103aaef90245a4722fc8996f266f262109c3b5957ba73289a20", + "result": "valid" + }, + { + "tcId": 320, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343932393339363930", + "sig": "3065023100d4900f54c1bc841d38eb2f13e0bafbb12b5667393b07102db90639744f54d78960b344c8fbfbf3540b38d00278e177aa02303a16eff0399700009b6949f3f506c543495bf8e0f3a34feb8edd63648747b531adc4e75398e4da8083b88b34c2fb97a8", + "result": "valid" + }, + { + "tcId": 321, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32313132333535393630", + "sig": "3065023100c0169e2b8b97eeb0650e27653f2e473b97a06e1e888b07c1018c730cabfdeeec4a626c3edee0767d44e8ed07080c2ac4023013f46475f955f9701928067e3982d4ba5a58a379a66f91b74fad9ac8aee30086be6f41c9c2d8fb80e0924dedbe67e968", + "result": "valid" + }, + { + "tcId": 322, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31323339323735373034", + "sig": "306402302e868871ea8b27a8a746882152051f2b146af4ac9d8473b4b6852f80a1d0c7cab57489aa43f89024388aec0605b0263702306d8c89eed8a5a6252c5cead1c55391c6743d881609e3db24d70ead80a663570020798fbf41d4c624fcb1ce36c536fe38", + "result": "valid" + }, + { + "tcId": 323, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32303831313838373638", + "sig": "3065023100abe6a51179ee87c957805ecad5ccebca30c6e3a3e6dbe4eb4d130b71df2bf590b9d67c8f49e81bf90ce0909d3c2dab4c02307110582fab495b21bd9dda064fbd7acc09d0544dcf7699be35ad16207ffa10e8904f9241a709487ba2ba7e34430b81c3", + "result": "valid" + }, + { + "tcId": 324, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343534363038393633", + "sig": "3064023050252c19e60e4120b7c28b2c2e0a588e5d107518cd61e5c7999c6d465ea134f752322d8b83f5988fcdc62bd9adb36ccd0230193899352491dabfe4fc942e14ddacb200673729d61602cc0baf5732d262f36e5279865a810ce2f977f57686a0d0137a", + "result": "valid" + }, + { + "tcId": 325, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31333837363837313131", + "sig": "3066023100eb725fdd539d7de8ea02fac8db6ec464f40c272a63e6b2718c4e0266bf1235dae330f747a6052f4319ecbe7bdade9bd0023100ae84507648ba2d1944bb67722ccd2cb94b92b59e89a1ae698c668bb57f481c42b216c23da4b1d8c0e502ef97fda05ad0", + "result": "valid" + }, + { + "tcId": 326, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32303331333831383735", + "sig": "3064023025aa56fcbd92f2cf53bddbaa0db537de5843290731c1dd78036fcbded4a8f7187ddfed9f5ca9d98ea7b12d24b8d29d570230028f68372d66164810bf79c30a191116d496fe32314605dc1668289425fb3a15d7532dde1052a49a35866c147abde1d9", + "result": "valid" + }, + { + "tcId": 327, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "323535333538333333", + "sig": "3065023054bf7adc8548e7cae270e7b097f16b5e315158d21b0e652ce1cfe4b33126ba4a65bf227b4cddcaf22d33d82478937b20023100bfc1b8f1d02846a42f31e1bd10ba334065459f712a3bbc76005d6c6488889f88c0983f4834d0bf2249dbf0a6db760701", + "result": "valid" + }, + { + "tcId": 328, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34363138383431343732", + "sig": "3066023100d3bb29ac0bd1f6058a5197f766d6ea3216c572ded62af46318c8c7f9547bb246553654279d69989d9af5ef4ccacf64da023100e10281122c2112a2a5a9d87ac58f64fb07c996a2d09292119e8f24d5499b2e8524ebd0570097f6cc7f9c26094a35c857", + "result": "valid" + }, + { + "tcId": 329, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31303039323435383534", + "sig": "3066023100bc32e85e3112472408f9324586e525325128a38313c34b79700cb0a3f7262a90a1fcc40eef1f1a3884032a7a21810e0a023100c02f52541360358107a13dbea31f83d80397710901734b7adb78b1fc904454a28a378514ccef80ecc70c1d8e55f11311", + "result": "valid" + }, + { + "tcId": 330, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32373536343636353238", + "sig": "3066023100f04b9e17c71d2d2133ea380d71b6b82c8a8e3332703e9d535b2c2bca9b0ad586d176a6049afa35edd9722edb5c33daa3023100bd44d4a6263380ca6f22e76c26d5f70f41f4d7cae7d4b9c1b8dc2ba5298d9d12408b04614e2f3796cc19c950c8c88a10", + "result": "valid" + }, + { + "tcId": 331, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "313139363937313032", + "sig": "3065023100c8807351d8e261338e750cb9a52f4be4470b63f6f181cbe0e81d43b60824ba4be1bba42b1783897a0d72b0614018b02f023052e3a598c8be982127e961eed2b04f21c86df4ebcab0d955a7c66ec7f818898798ee75367a85022276b912c0a072bff7", + "result": "valid" + }, + { + "tcId": 332, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "323333313432313732", + "sig": "306402306152841b6fb460546eeb4158a3e5ffa54f51aa6a208987be899b706055cd59d8ec7c01f4634254fe050e1d4ec525a173023073f0c5f13640d892c28f701428e8fbfb736b6478bbd972c8c684977556ed599a70d313e06b126080e13068d56e1c10be", + "result": "valid" + }, + { + "tcId": 333, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363733343831383938", + "sig": "3066023100842f8d2814f5b7163f4b21bd9727246e078ad1e7435dfe1bc5f9e0e7374232e686b9b98b73deab9e43b3b7f25416c2be023100852c106c412300bac3ba265990b428a26076ab3f00fd7657bbd9315fa1cd2a1230a9a60d06b7af87aa0a6cf3f48b344c", + "result": "valid" + }, + { + "tcId": 334, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31343630313539383237", + "sig": "3066023100e13f6d638b9d4fba54aa436a945cfea66dec058fab6f026293265884457b5a86e8e927d699bc64431b71e3d41df200440231009832cd1b4177118ed247b4f31277da15f420179f45c71a237d77f599a45df68247bac3dcef0868ecd1665005c25b7c6c", + "result": "valid" + }, + { + "tcId": 335, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "38393930383539393239", + "sig": "3064023009fff1c2e4ff8643cbfad588620c2bf7aaca5cf4242969142c7145b927bd82ed14f3ae8c6e2ce2da63b990b9f1be6d640230780c816f6c86343b008235ee986abf2136123ed247e4751e4d5467334f08e5e2ca1161254f68c3e6678e2d0b87d1cc7c", + "result": "valid" + }, + { + "tcId": 336, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34333236343430393831", + "sig": "3066023100ffae6e7d2cea71b5a9c73cbc1285a8d252949772afe1aa27fb137740fc429c2a8c8648c9a5ba678a32f7ae7689b395ca02310089d54cd13a162c34189ff524813690e79768af8ebe794cc941dfe7fdf2cb8dd0b42519f034ea4d4f1c870046d13210e1", + "result": "valid" + }, + { + "tcId": 337, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32333736343337353537", + "sig": "3066023100efa3c5fc3c8be1007475a2dbd46e3578bb30579445909c2445f850fb8aa60aa5b1749cc3400d8ffd81cb8832b50d27b4023100b36a08db3845b3d2ebd2c335480f12fb83f2a7351841ea3842ec62ad904b098efbf9faa7828b9c185746d9c8bd047d76", + "result": "valid" + }, + { + "tcId": 338, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "383630333937373230", + "sig": "3066023100f577095f7c74594aa1c69aca9bb26e0c7475ae5163058ecc074b03af89e56b12b6a72450589dacf0d7e6b172d0017a0e023100bee756a0b5d0a677bf95f98da512854f3ecb712f94570e1ad230eab17c527b6a8bcc9ae202b657a3611ecffa94ba0d54", + "result": "valid" + }, + { + "tcId": 339, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35383037373733393837", + "sig": "306502300ae7688c7de5882eb9c3172f5500015552f998fb53702c6cd4b03404d5a0510a8073db95db544808dbd76659fd20cf12023100bc610fe5f04d8909cc439615fb7e302d3d82992817647c50c1f467090a52b328cbbc0262f18ffb6fd9f3bd60013cea08", + "result": "valid" + }, + { + "tcId": 340, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "353731383636383537", + "sig": "306502305dc8a6d84afaaf900d78c6a91dc5e12e7d17891a52c1468253061d704b8940bef85b9fe807a0e02b56e8dd37c22fbb82023100914258de52932c4604dceb5ce7cc0a92e021edca9b819b84a9f25652f9af13f956a1139ee95c7aa7a079e3ad8317fbdb", + "result": "valid" + }, + { + "tcId": 341, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "38363737333039333632", + "sig": "3066023100da55a6dbb845205c87c995b0bbc8444ffcba6eb1f4eb9d30f721d2dacc198fb1a8296075e68eb3d25ef596a952b8ea19023100829f671dccad6d7b0b8c4b39ff3f42597965d55c645fb880a66fe198d9344c9311f1598930392470379fa5ff43c75d04", + "result": "valid" + }, + { + "tcId": 342, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32343735353135303630", + "sig": "306402303730dfd0985de77decdd358a544b47f418d3fab42481530d5d514859894c6f23b729af72b44686058de29687b34b3b0c023065bdfaf0ac217a80b82eb09c9f59c5c8cfbf50a6eb979a8f5f63eab9bd38ee0938e4b23102112033b230a14ad2790e3f", + "result": "valid" + }, + { + "tcId": 343, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393733313736383734", + "sig": "3065023055210df2124c170e259af1dafa73e66613aa18ced8eb40a7f66155d50d5f3124edfa55276de4797013177291e8afeff6023100c314d3a310a60647dad3318ed7f0405a64c3f94b5ac98e6be12208c8ad9835fa6b81a0ea59f476608634657b66e00ffd", + "result": "valid" + }, + { + "tcId": 344, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33363938303935313438", + "sig": "3065023100f6c9897144b5d84964515eb0c8c3d0d9c6687c957887e93c29b2a21804b40307fb88bfd5cca11c95885d28867cb33a740230656bafca242290f7d7e9801b6cfd4bd1b07e8d7c6c1c59fd3d8e82e9846a1b2855c85420e4ee6ec2d97fec2161eeb243", + "result": "valid" + }, + { + "tcId": 345, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130373530323638353736", + "sig": "3065023100bfbcc5f343e2ab392ce6c1c02d91c00650c47136836a5d0622d476ac2b3274395721b1ab21882ed5cabed093b43b133f0230043e9fc64c6108df73f9eced90f91185f83d89662f5a9d810c1824fbfd97b842f784305fd6b9c28c80d32d52b1538d12", + "result": "valid" + }, + { + "tcId": 346, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "383639313439353538", + "sig": "3066023100b8f793ddd47e657a9081cbed1600fb22b38ad6a155f9c006ba98de1f383b4c0918ceea72253e0f869524b2369cd9bd8c02310096c452ff58f42e0853040a6d5c7e750b57dd4af06e2df8194e8d524e81ac000ee3315bbeabbf6a21f61b8904c55378d9", + "result": "valid" + }, + { + "tcId": 347, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32313734363535343335", + "sig": "30640230263ab1c93567e93b5ec4e380b0d3bb5ea1ce693c14a47afccc539aaf197f099d331ea9e26f1a0057148d46727acb61880230621db07ce94110e2be74fa953a00a8a554225b3f2c0f6c56b4ebd4db2f57ca2565ed3323fd708bb56ac6e28bfb40f2e7", + "result": "valid" + }, + { + "tcId": 348, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "363434353530373932", + "sig": "306502310096f4a2b3529c65e45a0b4c19c582dc8db635d4e74f0b81309696b23be920ba8ec553d4b370df4c59d74dd654bac6df5802301573ba1b280c735a3401d957ecd3b8908e4e0b7d80239ce042594d182faf2ddf811c9056aac4c87f4f85043766a26614", + "result": "valid" + }, + { + "tcId": 349, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "353332383138333338", + "sig": "306602310096a691b19a6294b311a438f8da345e480b1deaa1e940cfbf02177d5f08479976ea58aee31011d50b5542be188c9d63df0231008f67dc9e1588aeb8be180013d41a036f9badfad9fe9340910cbf87243776f54bef7da2ebf3a7643866eb9a3b23fe59b9", + "result": "valid" + }, + { + "tcId": 350, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31313932303736333832", + "sig": "3066023100cff27948c6d902c73d103d0802eb144dd89c1b0e3b9f9a5e498b0361dc122a0d555160d8c64d61539c1dbbd4bc18971f023100b60827488c9f16ba28378fd59b1a29c65073335a7f236131134674c62c8396f193c76f2395ddaaa4f24b69161eb69b4d", + "result": "valid" + }, + { + "tcId": 351, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31353332383432323230", + "sig": "3066023100e90e22d9e535dfdfd86e098d5d6a0ae08f69d4a3ffaa39f6930bcf5f5ad02ee0d0472ae984edd9f0bbe5e7d63fd4f6ac023100e3f57b0a4629ecaa21f2d34a7a0834d57ba20f99c6e31b43c37811cc23b9957c8f3356f4462214d3c8e58745e50f23f6", + "result": "valid" + }, + { + "tcId": 352, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "313536373137373339", + "sig": "3064023018b70e272a98cc48e1e0af73146f0f972bbfbeb6b985feb2c4acd695a7a41b99c415be9c46aedaf3ddff67a65a89e387023047d6bcea088f622ad35d88bcf46d71827bcba2f57c36d6fb8a4bf2befdc0d4e3ef366d5966c4d076d3cfa43d6626717b", + "result": "valid" + }, + { + "tcId": 353, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34333033303931313230", + "sig": "3066023100acfd981c55fd5286cfce173726d51c3d25f65b11b7673729a62167256774f7c894b74662a212c706e00cef096074162f023100f4d471c97797c24d96aec1de85a249ef468d6036cd712563aeb65cea4995f3ee85e769b874f09a08637a44a96084be7a", + "result": "valid" + }, + { + "tcId": 354, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37373335393135353831", + "sig": "3065023100f15fcbeea8b64dad5e8566a2c37913c82d6be9d9668df469bd0b591c3923a6e12644eaf697d466fa7cd513983d946a40023070063966801079351526999e5c5c2c5f627e4c8bc96784bcbe715fe7c7afcf69785d1c8c7ccd3725e364101638396597", + "result": "valid" + }, + { + "tcId": 355, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "323433393636373430", + "sig": "3066023100d995147939ae6d8f62bb57372227395839e25a0d4308b899d5f506cf9e0a01e8115b7e4b822f037ec95752bd9e892f5e0231009bb4d07333e468f8482a790a2a2e650e2c42da8240ec5e402506b368122f046680cd71e0117897cce3df4a1555fc8876", + "result": "valid" + }, + { + "tcId": 356, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34333237363032383233", + "sig": "3064023043c6ce5184476f3f496afeae3cb96a3f9f038957686c93437b8266a233022371d266e904aa096c3566cb33824b88075e0230680c13245a8bc560b638d26f0c5f261964130256939552d3fffb07b658355611612c268a89541055d3c2bf9e82cf4da3", + "result": "valid" + }, + { + "tcId": 357, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32393332303032353932", + "sig": "30630230447539941dc350767fc841083d25d9247a0807e1e22e0bb9d94f504f721981b413d521efbd75e4fe831ee26338cf3de3022f395ab27ea782cee4be53e06c7616bbd41d6926b18d219d75d5979f13cba2f52101019b0ec0a41ffdbf29ef73ddba70", + "result": "valid" + }, + { + "tcId": 358, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36343039383737323834", + "sig": "3066023100a0ba8e8b979c20345e34fca98531900164a859923bd6986a9c39236a2f5de053a252997f35e5b84b0d48ba0f8d09aedd023100facd6df04358fcd95fa9018a6fc0828dfe319812ff65929c060b18ad4b9f06e7fc0addd1b695315d71c15e51dc51d719", + "result": "valid" + }, + { + "tcId": 359, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36303735363930343132", + "sig": "3065023100b8378390f71f0bb6663f1846daf6908f8c84f770ae740cc8054122494cf0ffa9437ab26040ca22808fb29a810b70126e0230427636b929a500abc34d9f22977b81e734919afaf3ed2c91eeada7074e0c16bdc52f960eaec9db5a879c1e6414035101", + "result": "valid" + }, + { + "tcId": 360, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32333231363233313335", + "sig": "3066023100f36a9048fd94803d3d6d1b11430b90b94ef8d5d2ad89018c69473ce9cfe0d6105b3c2fb2e7555ccd25f65af8c872bdc602310081254841e7ecbfd0d810afaaf5afd6d6c5d0542bb00cc183b1db01767120afbcc0006ddcba8db7baf65f302723dabc4d", + "result": "valid" + }, + { + "tcId": 361, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36343130313532313731", + "sig": "3066023100d8a4d96409c191baa9540bf35f1d5192f9352d7f0e14f92c0e8e1f19f559b42ed3c6b7bdb6becc56584fb5c09421e2e4023100d966ba13d4245e248eafb46f2a3df92c2037d5969c7db6dbcb0ff4b21850e16a18a29785267239886365cf721a212536", + "result": "valid" + }, + { + "tcId": 362, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "383337323835373438", + "sig": "306402301d5d86fd48e65b0cf0b0b46062241f89cf65785dd818f93f1162771a38a15f20febc261812ecaaf6f4f2b86b3362d7eb02300c76e363de1432513cb9dad6493931381ecd25f142e61968b6f20d7b1270cb9e38a7ae54e4778aff4025eb00c6a67aef", + "result": "valid" + }, + { + "tcId": 363, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33333234373034353235", + "sig": "306402300508eed148f061114be18e8a86188feabf76b873b36eadcca9c2c60e24a2002fe456231decf7a8f6f032c08dbe0ab5a90230694c0ad781b2341e30e1d0739ac99672064f48821a69852c7940cf1d621738199c980d56d2a0b71b3fc6011c6b2444ba", + "result": "valid" + }, + { + "tcId": 364, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31343033393636383732", + "sig": "30650230726ef88bb7947a043116c111cb519ddeda3e6ffbf724884a1b22c24409cdf2779d93ce610c8c07411c2b001399103d6d02310095dc1d65046caf0e8dad07b224798d6f7807278e737883e7c7bf0b446791d4ee144c26f710134861af4e6771d4082896", + "result": "valid" + }, + { + "tcId": 365, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31323237363035313238", + "sig": "3066023100eb0e8e3c639f5eba8eccd9020d0ec62d8ac73f3fddbdfa08fdb2155deb0a536923ebd55e20020cab9f8e39a43a88be11023100c796df399fc35883dd5dae6817d02d3d67a8eec6601585e5e36fd2c134eddb1447ec12b144dddc9aae28a84f22602641", + "result": "valid" + }, + { + "tcId": 366, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34393531343838333632", + "sig": "3065023100e8f8c69d0396ea900f9757736d2b19dbc2d2a8c01dccf490c8b9455bd63b34c095867e7cf3b84dc7c3c3d6b51bebf405023058152a7564eeb22a3e26597026d0cd7835725bd512245448cb5016eb48ea759809fd6949d0ee5d579643f72f908c16bb", + "result": "valid" + }, + { + "tcId": 367, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32343532313237303139", + "sig": "30650230380b4e48b3ff012af7c08bf871d9f4da0c708b5494a986d3d80b1979e579d0dbee61db9bc3c04c396176410788e15a0f023100e6971c013c965a7e4df10f95620a5092fab096bd5b50828f4bc91c5e479bccf6e0daf287e7ef580fa9ea153fa1a507a2", + "result": "valid" + }, + { + "tcId": 368, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31373331353530373036", + "sig": "30650231008061de12029e2b000d157a455ecf2301222f092df95b9551b78cf0ef3a64f12212b57ec7b16d2c0f258946f51cb1633a02300ac2ca6ad99b29ca29a0dc38b34443ee41020f81ed9087cef7681a00c4fe60653a572944ba37f1fe51d112bfffbdd701", + "result": "valid" + }, + { + "tcId": 369, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363637303639383738", + "sig": "3066023100e74f2a791eeb7341cff6cc1c24f459e6c0109924f7984639ae387e3ceb58758a1bc3839dea1fc3a3799562225e70a733023100d90e4d0f47343268e56bbcb011bd4734390abc9aa1304b6253e78f5a78b6905aa6bf6a3892a4ae1a875c823ae5a83e87", + "result": "valid" + }, + { + "tcId": 370, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343431353437363137", + "sig": "306402306a1cd0ff7906be207b56862edcbc0d0bbfb26d43255c99f6ab77639f5e6103a07aa322b22ed43870d1ce6df68aa0a8c10230655558b129aa23184500bd4aab4f0355d3192e9b8860f60b05a1c29261f4486a6ae235a526339b86c05f5fac477b6723", + "result": "valid" + }, + { + "tcId": 371, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343233393434393938", + "sig": "306602310081111fdc5f0de65583c7a5668d26c04ee52e08dac227753132cff1741cb721e112aa793c0d5fa047faf14cb45dd13e1f0231009a25cf1e6c152bc3e216e021561d194979f1c11fe17019ed7bac2c13c4010f209665e3b6f33b86641704d922b407818f", + "result": "valid" + }, + { + "tcId": 372, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34383037363230373132", + "sig": "30660231009b66d122a315095b2b66ccb97272c476a2d760e827fdea05732d634df3d066569c984dd941aad5f5dec4c2e1b7b94a0002310096c32403c85bc3d0ee87f96a600182796dce53d54d7467ae660a42b87bb70792f14650ac28a5fa47ce9ca4d3b2c25878", + "result": "valid" + }, + { + "tcId": 373, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32313634363636323839", + "sig": "306402302bb062a002088d62a0b7338d0484fedfe2af7e20cebf6a4788264eb27cb4ebc3cc81c816e6a35722cf9b464783094cb8023046cc21b70f2133f85ab0443bebe9c6fc62c6e2ec1fd9c4ddf4a6d5f3f48eb7abf1ee7bdf6725879fd1b7daafb44f6e04", + "result": "valid" + }, + { + "tcId": 374, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31393432383533383635", + "sig": "3065023033e87061ee9a82eb74d8bb4ae91606563c2e4db8b09183cc00d1119ab4f5033d287a1fc90a2348163fdf68d35006fd7f02310096db97c947ee2e96e6139d3bcbf5a43606bae1ad3ca28290fbad43b281ef115ec1b98bc581ef48094f8c1aa8e36c282a", + "result": "valid" + }, + { + "tcId": 375, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32323139333833353231", + "sig": "3064023070f80b438424ba228a7d80f26e22ff6a896243c9d49c75573489ee0de58ec60efd103838143465bd8fe34672ba9496170230115492bd9365b96f38747536318bffb819e7c146df3a5a7a46d6288c7fdf31cff570b22176aa398daba9073ab1e7b9bf", + "result": "valid" + }, + { + "tcId": 376, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393236393333343139", + "sig": "3066023100ff16ca0389ea6948f4305b434fe0aa589f880f5aa937767c31170ee8da6c1ad620c993d40ddf141b7fda37424d51b5cd023100ba0f86985dffc61d6e35a37de06918b11e431b72403161acfb8f05c469f1fcfa6e215c6f7eb5a0a5e0cc9e7be79ce18b", + "result": "valid" + }, + { + "tcId": 377, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "373639333836333634", + "sig": "3065023100d60c24bee05f5198cd155ad095ffb956bbcfb66b82fc0d3755119915a62f2f923557b85ddc1d12e6a757f23042cb601b02302c4d968b5eac930b51d283b418fcff6df3a9d6d66e3812cd1bf5fde797fd203a7c439b1b381e4fe8b44e6f108764a7dd", + "result": "valid" + }, + { + "tcId": 378, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32373335393330353733", + "sig": "3066023100bdf634d915a4fae7a155532ca2847c33a6babe7ef8db0af50f485db3dd2c8bffe722394583932f6eb5cd97f6db7561d9023100bb425cae2e5483174b5ed873af4329da4618c14458141850bee3c7bf1ffb3f2030159043277dacc708e9d32f63400083", + "result": "valid" + }, + { + "tcId": 379, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "38333030353634303635", + "sig": "30650230061320a3bcebac33cf399d45d1e1e1b34f37288fe4753f4fddfd496eff427e1d26b1b91d749cc34c12f4ecef837c0e8f023100fd5cf468cda319fe06e773a190c38de6e150a321ac1c416ad875432cdb7a07134c446f13068e71a1a96e35da923974ad", + "result": "valid" + }, + { + "tcId": 380, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34333037363535373338", + "sig": "3065023100d620f063d33efa859b623f6c9a92340e4cdd854ffbe3e5e01379177aee31715ce587b00bd0aea98fddf236d2fc8a7a740230671f4b7c187297dc236c61888b6d9397e97783077cc4101807d79ee62e4a53a78c4b6a3a31b03178668af894a3d8902e", + "result": "valid" + }, + { + "tcId": 381, + "comment": "special case hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "39363537303138313735", + "sig": "306502310091c556c5bddd529fe903b86afc0eb8fa1f49425b779a39114ae563bebc947e633ba4ee98948faa8940dfe2562c63e1c50230198b00079d8db072d25b0a49bc8bc36457926f3c101527528df6679f92c76f1b487e6695d4b92fe33b4ee7046a6a5df9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044bf4e52f958427ebb5915fb8c9595551b4d3a3fdab67badd9d6c3093f425ba43630df71f42f0eb7ceaa94d9f6448a85dd30331588249fd2fdc0b309ec7ed8481bc16f27800c13d7db700fc82e1b1c8545aa0c0d3b56e3bfe789fc18a916887c2", + "wx": "4bf4e52f958427ebb5915fb8c9595551b4d3a3fdab67badd9d6c3093f425ba43630df71f42f0eb7ceaa94d9f6448a85d", + "wy": "00d30331588249fd2fdc0b309ec7ed8481bc16f27800c13d7db700fc82e1b1c8545aa0c0d3b56e3bfe789fc18a916887c2" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044bf4e52f958427ebb5915fb8c9595551b4d3a3fdab67badd9d6c3093f425ba43630df71f42f0eb7ceaa94d9f6448a85dd30331588249fd2fdc0b309ec7ed8481bc16f27800c13d7db700fc82e1b1c8545aa0c0d3b56e3bfe789fc18a916887c2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAES/TlL5WEJ+u1kV+4yVlVUbTTo/2rZ7rd\nnWwwk/QlukNjDfcfQvDrfOqpTZ9kSKhd0wMxWIJJ/S/cCzCex+2EgbwW8ngAwT19\ntwD8guGxyFRaoMDTtW47/nifwYqRaIfC\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 382, + "comment": "k*G has a large x-coordinate", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "304d0218389cb27e0bc8d21fa7e5f24cb74f58851313e696333ad68b023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "valid" + }, + { + "tcId": 383, + "comment": "r too large", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3066023100fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffe023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043623bb296b88f626d0f92656bf016f115b721277ccb4930739bfbd81f9c1e734630e0685d32e154e0b4a5c62e43851f6768356b4a5764c128c7b1105e3d778a89d1e01da297ede1bc4312c2583e0bbddd21613583dd09ab895c63be479f94576", + "wx": "3623bb296b88f626d0f92656bf016f115b721277ccb4930739bfbd81f9c1e734630e0685d32e154e0b4a5c62e43851f6", + "wy": "768356b4a5764c128c7b1105e3d778a89d1e01da297ede1bc4312c2583e0bbddd21613583dd09ab895c63be479f94576" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043623bb296b88f626d0f92656bf016f115b721277ccb4930739bfbd81f9c1e734630e0685d32e154e0b4a5c62e43851f6768356b4a5764c128c7b1105e3d778a89d1e01da297ede1bc4312c2583e0bbddd21613583dd09ab895c63be479f94576", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENiO7KWuI9ibQ+SZWvwFvEVtyEnfMtJMH\nOb+9gfnB5zRjDgaF0y4VTgtKXGLkOFH2doNWtKV2TBKMexEF49d4qJ0eAdopft4b\nxDEsJYPgu93SFhNYPdCauJXGO+R5+UV2\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 384, + "comment": "r,s are large", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52972023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52971", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04d516cb8ac8e4457b693d5192beeb6ce7d9a46bef48eecf3ea823286f101f98d130f5a26dc6fec23662eff07f14486fd58456932e74894b7f0e3bb0dfd362502b3765dd80a3177209fb221dc9b51aaf4470b245391405bef514176b13a267a720", + "wx": "00d516cb8ac8e4457b693d5192beeb6ce7d9a46bef48eecf3ea823286f101f98d130f5a26dc6fec23662eff07f14486fd5", + "wy": "008456932e74894b7f0e3bb0dfd362502b3765dd80a3177209fb221dc9b51aaf4470b245391405bef514176b13a267a720" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004d516cb8ac8e4457b693d5192beeb6ce7d9a46bef48eecf3ea823286f101f98d130f5a26dc6fec23662eff07f14486fd58456932e74894b7f0e3bb0dfd362502b3765dd80a3177209fb221dc9b51aaf4470b245391405bef514176b13a267a720", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE1RbLisjkRXtpPVGSvuts59mka+9I7s8+\nqCMobxAfmNEw9aJtxv7CNmLv8H8USG/VhFaTLnSJS38OO7Df02JQKzdl3YCjF3IJ\n+yIdybUar0RwskU5FAW+9RQXaxOiZ6cg\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 385, + "comment": "r and s^-1 have a large Hamming weight", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100d1aee55fdc2a716ba2fabcb57020b72e539bf05c7902f98e105bf83d4cc10c2a159a3cf7e01d749d2205f4da6bd8fcf1", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04a8380cd35026e13bf87be693cdb6e75a82d765b4019b529e8d277c4af6c9db27ebb5d3f86e88add9d5b61186f04c83a992a187507c737325d2cc624acef3cd036bfa99e0c1518be65c88bb51f900f94123acabad81d15130d3ade7ff7e4364e1", + "wx": "00a8380cd35026e13bf87be693cdb6e75a82d765b4019b529e8d277c4af6c9db27ebb5d3f86e88add9d5b61186f04c83a9", + "wy": "0092a187507c737325d2cc624acef3cd036bfa99e0c1518be65c88bb51f900f94123acabad81d15130d3ade7ff7e4364e1" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004a8380cd35026e13bf87be693cdb6e75a82d765b4019b529e8d277c4af6c9db27ebb5d3f86e88add9d5b61186f04c83a992a187507c737325d2cc624acef3cd036bfa99e0c1518be65c88bb51f900f94123acabad81d15130d3ade7ff7e4364e1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEqDgM01Am4Tv4e+aTzbbnWoLXZbQBm1Ke\njSd8SvbJ2yfrtdP4boit2dW2EYbwTIOpkqGHUHxzcyXSzGJKzvPNA2v6meDBUYvm\nXIi7UfkA+UEjrKutgdFRMNOt5/9+Q2Th\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 386, + "comment": "r and s^-1 have a large Hamming weight", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100b6b681dc484f4f020fd3f7e626d88edc6ded1b382ef3e143d60887b51394260832d4d8f2ef70458f9fa90e38c2e19e4f", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04554f2fd0b700a9f4568752b673d9c0d29dc96c10fe67e38c6d6d339bfafe05f970da8c3d2164e82031307a44bd32251171312b61b59113ff0bd3b8a9a4934df262aa8096f840e9d8bffa5d7491ded87b38c496f9b9e4f0ba1089f8d3ffc88a9f", + "wx": "554f2fd0b700a9f4568752b673d9c0d29dc96c10fe67e38c6d6d339bfafe05f970da8c3d2164e82031307a44bd322511", + "wy": "71312b61b59113ff0bd3b8a9a4934df262aa8096f840e9d8bffa5d7491ded87b38c496f9b9e4f0ba1089f8d3ffc88a9f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004554f2fd0b700a9f4568752b673d9c0d29dc96c10fe67e38c6d6d339bfafe05f970da8c3d2164e82031307a44bd32251171312b61b59113ff0bd3b8a9a4934df262aa8096f840e9d8bffa5d7491ded87b38c496f9b9e4f0ba1089f8d3ffc88a9f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEVU8v0LcAqfRWh1K2c9nA0p3JbBD+Z+OM\nbW0zm/r+Bflw2ow9IWToIDEwekS9MiURcTErYbWRE/8L07ippJNN8mKqgJb4QOnY\nv/pddJHe2Hs4xJb5ueTwuhCJ+NP/yIqf\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 387, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020102020101", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0444ee3335fa77d2fb02e4bd7074f45e598a879c0fa822ec718c21dc13b83440edc4e3c10a1858423e03044c9eff22591cd027c49933e5510557d6b4b2c6f66fe5dcb9302a3b13fdc68048c3fcac88ba152b6a9833c87fdc6280afc5d11ab7c107", + "wx": "44ee3335fa77d2fb02e4bd7074f45e598a879c0fa822ec718c21dc13b83440edc4e3c10a1858423e03044c9eff22591c", + "wy": "00d027c49933e5510557d6b4b2c6f66fe5dcb9302a3b13fdc68048c3fcac88ba152b6a9833c87fdc6280afc5d11ab7c107" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000444ee3335fa77d2fb02e4bd7074f45e598a879c0fa822ec718c21dc13b83440edc4e3c10a1858423e03044c9eff22591cd027c49933e5510557d6b4b2c6f66fe5dcb9302a3b13fdc68048c3fcac88ba152b6a9833c87fdc6280afc5d11ab7c107", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAERO4zNfp30vsC5L1wdPReWYqHnA+oIuxx\njCHcE7g0QO3E48EKGFhCPgMETJ7/Ilkc0CfEmTPlUQVX1rSyxvZv5dy5MCo7E/3G\ngEjD/KyIuhUrapgzyH/cYoCvxdEat8EH\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 388, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020102020102", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04e2f87f72e3c66c73037fe77607d42ad2d9c4cc159893b4b9b8b0365d3a7766dbe8678b02e2b68f58e5a4f7681061a390e38f2142818542bef6b2bc3a2c4f43c95e5259d6bd5401531378c7ca125a1f6cc609d4fadfc5c9a99358ee77ff780c8d", + "wx": "00e2f87f72e3c66c73037fe77607d42ad2d9c4cc159893b4b9b8b0365d3a7766dbe8678b02e2b68f58e5a4f7681061a390", + "wy": "00e38f2142818542bef6b2bc3a2c4f43c95e5259d6bd5401531378c7ca125a1f6cc609d4fadfc5c9a99358ee77ff780c8d" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004e2f87f72e3c66c73037fe77607d42ad2d9c4cc159893b4b9b8b0365d3a7766dbe8678b02e2b68f58e5a4f7681061a390e38f2142818542bef6b2bc3a2c4f43c95e5259d6bd5401531378c7ca125a1f6cc609d4fadfc5c9a99358ee77ff780c8d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE4vh/cuPGbHMDf+d2B9Qq0tnEzBWYk7S5\nuLA2XTp3ZtvoZ4sC4raPWOWk92gQYaOQ448hQoGFQr72srw6LE9DyV5SWda9VAFT\nE3jHyhJaH2zGCdT638XJqZNY7nf/eAyN\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 389, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020102020103", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0460e89510c308089a747f06374c5388416535753b33514480bf8251ff4014754ebaf48aa655dc41ca89f373257a7e50b14dc4c2bed99597c146d577f4333843855da27e395fc81aa90205795bd555b3451dc4b9536e234799185123c4792cfb1d", + "wx": "60e89510c308089a747f06374c5388416535753b33514480bf8251ff4014754ebaf48aa655dc41ca89f373257a7e50b1", + "wy": "4dc4c2bed99597c146d577f4333843855da27e395fc81aa90205795bd555b3451dc4b9536e234799185123c4792cfb1d" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000460e89510c308089a747f06374c5388416535753b33514480bf8251ff4014754ebaf48aa655dc41ca89f373257a7e50b14dc4c2bed99597c146d577f4333843855da27e395fc81aa90205795bd555b3451dc4b9536e234799185123c4792cfb1d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEYOiVEMMICJp0fwY3TFOIQWU1dTszUUSA\nv4JR/0AUdU669IqmVdxByonzcyV6flCxTcTCvtmVl8FG1Xf0MzhDhV2ifjlfyBqp\nAgV5W9VVs0UdxLlTbiNHmRhRI8R5LPsd\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 390, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020103020101", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "040a82d7df701a1f0c02a8265fc471d4851a3f08b5c82897766c18400a270c11d4fedd7b5b085e532674b395b3653f6385ae089577be259cdbe030a661868d7b3b5413218a48439a6753f92316dccf692f2520058048958a6ed4085583ce78f45f", + "wx": "0a82d7df701a1f0c02a8265fc471d4851a3f08b5c82897766c18400a270c11d4fedd7b5b085e532674b395b3653f6385", + "wy": "00ae089577be259cdbe030a661868d7b3b5413218a48439a6753f92316dccf692f2520058048958a6ed4085583ce78f45f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200040a82d7df701a1f0c02a8265fc471d4851a3f08b5c82897766c18400a270c11d4fedd7b5b085e532674b395b3653f6385ae089577be259cdbe030a661868d7b3b5413218a48439a6753f92316dccf692f2520058048958a6ed4085583ce78f45f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAECoLX33AaHwwCqCZfxHHUhRo/CLXIKJd2\nbBhACicMEdT+3XtbCF5TJnSzlbNlP2OFrgiVd74lnNvgMKZhho17O1QTIYpIQ5pn\nU/kjFtzPaS8lIAWASJWKbtQIVYPOePRf\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 391, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020103020103", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041301dee63fca91b6de8835480c3d86297b1e6a0a7339fc5011a50c33f350e9938743df496aeaa1e3170ba1e2f0c449187b6812948761816232e414e23b0f9904d171da5cc0492a341e2b4f9477da0a311cdac7c7d01037ed7dddb3376892fd44", + "wx": "1301dee63fca91b6de8835480c3d86297b1e6a0a7339fc5011a50c33f350e9938743df496aeaa1e3170ba1e2f0c44918", + "wy": "7b6812948761816232e414e23b0f9904d171da5cc0492a341e2b4f9477da0a311cdac7c7d01037ed7dddb3376892fd44" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041301dee63fca91b6de8835480c3d86297b1e6a0a7339fc5011a50c33f350e9938743df496aeaa1e3170ba1e2f0c449187b6812948761816232e414e23b0f9904d171da5cc0492a341e2b4f9477da0a311cdac7c7d01037ed7dddb3376892fd44", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEwHe5j/KkbbeiDVIDD2GKXseagpzOfxQ\nEaUMM/NQ6ZOHQ99Jauqh4xcLoeLwxEkYe2gSlIdhgWIy5BTiOw+ZBNFx2lzASSo0\nHitPlHfaCjEc2sfH0BA37X3dszdokv1E\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 392, + "comment": "small r and s", + "flags": [ + "SmallRandS", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3006020103020104", + "result": "valid" + }, + { + "tcId": 393, + "comment": "r is larger than n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3036023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52976020104", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04cce27e78386d68492fc58dd5f191a690c2ebc0a452442fe0dd331f458f18c8fcd922e148f8f251bf1b85e149ccb3f19295395c884ff97f670631e84b7e0b0dab503ba9c7080eda0e1c66b04e160728067cfe88fbcbbb0f52cfb733cd951fcf26", + "wx": "00cce27e78386d68492fc58dd5f191a690c2ebc0a452442fe0dd331f458f18c8fcd922e148f8f251bf1b85e149ccb3f192", + "wy": "0095395c884ff97f670631e84b7e0b0dab503ba9c7080eda0e1c66b04e160728067cfe88fbcbbb0f52cfb733cd951fcf26" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004cce27e78386d68492fc58dd5f191a690c2ebc0a452442fe0dd331f458f18c8fcd922e148f8f251bf1b85e149ccb3f19295395c884ff97f670631e84b7e0b0dab503ba9c7080eda0e1c66b04e160728067cfe88fbcbbb0f52cfb733cd951fcf26", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEzOJ+eDhtaEkvxY3V8ZGmkMLrwKRSRC/g\n3TMfRY8YyPzZIuFI+PJRvxuF4UnMs/GSlTlciE/5f2cGMehLfgsNq1A7qccIDtoO\nHGawThYHKAZ8/oj7y7sPUs+3M82VH88m\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 394, + "comment": "s is larger than n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3036020103023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accd7fffa", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "040bb03fce3c01ebcf0873abd134a8682f5fb8dbffa22da674047e5c3e71e43de582ed6abb908c2e4faa5d96186278b6c1ba3b22123e68ccc56f17dd79ff15565706f71a0b6123c77af3cd88f0af024cc5259781516edcaf5fe990646e7b66999d", + "wx": "0bb03fce3c01ebcf0873abd134a8682f5fb8dbffa22da674047e5c3e71e43de582ed6abb908c2e4faa5d96186278b6c1", + "wy": "00ba3b22123e68ccc56f17dd79ff15565706f71a0b6123c77af3cd88f0af024cc5259781516edcaf5fe990646e7b66999d" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200040bb03fce3c01ebcf0873abd134a8682f5fb8dbffa22da674047e5c3e71e43de582ed6abb908c2e4faa5d96186278b6c1ba3b22123e68ccc56f17dd79ff15565706f71a0b6123c77af3cd88f0af024cc5259781516edcaf5fe990646e7b66999d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEC7A/zjwB688Ic6vRNKhoL1+42/+iLaZ0\nBH5cPnHkPeWC7Wq7kIwuT6pdlhhieLbBujsiEj5ozMVvF915/xVWVwb3GgthI8d6\n882I8K8CTMUll4FRbtyvX+mQZG57Zpmd\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 395, + "comment": "small r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3036020201000230489122448912244891224489122448912244891224489122347ce79bc437f4d071aaa92c7d6c882ae8734dc18cb0d553", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0458f246090d5e49863bc0bf2d501ff72f551c5f1c5e679eb49064fd02e221a2707326ec2d140bcc817afaad5065761566497c823fd736882cbf78fb92b1a5589b67e8067497c710a4cbb39dee2c5431bc45cfb96c9f8454385c9f2b3ef2d3d31a", + "wx": "58f246090d5e49863bc0bf2d501ff72f551c5f1c5e679eb49064fd02e221a2707326ec2d140bcc817afaad5065761566", + "wy": "497c823fd736882cbf78fb92b1a5589b67e8067497c710a4cbb39dee2c5431bc45cfb96c9f8454385c9f2b3ef2d3d31a" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000458f246090d5e49863bc0bf2d501ff72f551c5f1c5e679eb49064fd02e221a2707326ec2d140bcc817afaad5065761566497c823fd736882cbf78fb92b1a5589b67e8067497c710a4cbb39dee2c5431bc45cfb96c9f8454385c9f2b3ef2d3d31a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEWPJGCQ1eSYY7wL8tUB/3L1UcXxxeZ560\nkGT9AuIhonBzJuwtFAvMgXr6rVBldhVmSXyCP9c2iCy/ePuSsaVYm2foBnSXxxCk\ny7Od7ixUMbxFz7lsn4RUOFyfKz7y09Ma\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 396, + "comment": "smallish r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "303c02072d9b4d347952cd023100ce751512561b6f57c75342848a3ff98ccf9c3f0219b6b68d00449e6c971a85d2e2ce73554b59219d54d2083b46327351", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04fc6984dd6830d1485fb2581a45a791d8dca2c727c73d3d44c89f0082c1868af5ca74b4ca4ae22802640a9ebfe8c7ae12998d63a5b5ad1b72b899f0b132e4952aaa19d41fdeea48b1ed6b8358dd1db207fd66e01453ad40f67b836adc802d5fe8", + "wx": "00fc6984dd6830d1485fb2581a45a791d8dca2c727c73d3d44c89f0082c1868af5ca74b4ca4ae22802640a9ebfe8c7ae12", + "wy": "00998d63a5b5ad1b72b899f0b132e4952aaa19d41fdeea48b1ed6b8358dd1db207fd66e01453ad40f67b836adc802d5fe8" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004fc6984dd6830d1485fb2581a45a791d8dca2c727c73d3d44c89f0082c1868af5ca74b4ca4ae22802640a9ebfe8c7ae12998d63a5b5ad1b72b899f0b132e4952aaa19d41fdeea48b1ed6b8358dd1db207fd66e01453ad40f67b836adc802d5fe8", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE/GmE3Wgw0UhfslgaRaeR2NyixyfHPT1E\nyJ8AgsGGivXKdLTKSuIoAmQKnr/ox64SmY1jpbWtG3K4mfCxMuSVKqoZ1B/e6kix\n7WuDWN0dsgf9ZuAUU61A9nuDatyALV/o\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 397, + "comment": "100-bit r and small s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3041020d1033e67e37b32b445580bf4efb02302ad52ad52ad52ad52ad52ad52ad52ad52ad52ad52ad52ad5215c51b320e460542f9cc38968ccdf4263684004eb79a452", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041b8def5922303d647e8eb07e3bad92f924b79b769eef168e7541de1f4e0d28ae9733eb98cf8a1fb6dd52ca02c8c75b51c7aa4bf679d49d8114122074da8f6044a427371796a5654a6106162d5f686abb73ebd896ab08c7062687f12171fbe4a3", + "wx": "1b8def5922303d647e8eb07e3bad92f924b79b769eef168e7541de1f4e0d28ae9733eb98cf8a1fb6dd52ca02c8c75b51", + "wy": "00c7aa4bf679d49d8114122074da8f6044a427371796a5654a6106162d5f686abb73ebd896ab08c7062687f12171fbe4a3" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041b8def5922303d647e8eb07e3bad92f924b79b769eef168e7541de1f4e0d28ae9733eb98cf8a1fb6dd52ca02c8c75b51c7aa4bf679d49d8114122074da8f6044a427371796a5654a6106162d5f686abb73ebd896ab08c7062687f12171fbe4a3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEG43vWSIwPWR+jrB+O62S+SS3m3ae7xaO\ndUHeH04NKK6XM+uYz4oftt1SygLIx1tRx6pL9nnUnYEUEiB02o9gRKQnNxeWpWVK\nYQYWLV9oartz69iWqwjHBiaH8SFx++Sj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 398, + "comment": "small r and 100 bit s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "303602020100023077a172dfe37a2c53f0b92ab60f0a8f085f49dbfd930719d6f9e587ea68ae57cb49cd35a88cf8c6acec02f057a3807a5b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041734a039a88a16c2ff4aa97d2399121f56f52ef01ed5e50887f736f65b6e51d6e8786abb4e063da5d1ba812dff998403ccd698e6c296d5cd69178f8a82481a865da331627f1c4b324fbc02b36e8b5ed58a31f728e904d203a388755302195765", + "wx": "1734a039a88a16c2ff4aa97d2399121f56f52ef01ed5e50887f736f65b6e51d6e8786abb4e063da5d1ba812dff998403", + "wy": "00ccd698e6c296d5cd69178f8a82481a865da331627f1c4b324fbc02b36e8b5ed58a31f728e904d203a388755302195765" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041734a039a88a16c2ff4aa97d2399121f56f52ef01ed5e50887f736f65b6e51d6e8786abb4e063da5d1ba812dff998403ccd698e6c296d5cd69178f8a82481a865da331627f1c4b324fbc02b36e8b5ed58a31f728e904d203a388755302195765", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEFzSgOaiKFsL/Sql9I5kSH1b1LvAe1eUI\nh/c29ltuUdboeGq7TgY9pdG6gS3/mYQDzNaY5sKW1c1pF4+Kgkgahl2jMWJ/HEsy\nT7wCs26LXtWKMfco6QTSA6OIdVMCGVdl\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 399, + "comment": "100-bit r and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3041020d062522bbd3ecbe7c39e93e7c24023077a172dfe37a2c53f0b92ab60f0a8f085f49dbfd930719d6f9e587ea68ae57cb49cd35a88cf8c6acec02f057a3807a5b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0452ca47dda99172cb8321495acf988548295988ec973c1b4ea9462c53e5768a704a936410ee847b5dbf1e9d0c131da6c787a47027e6655792eb002d4228ee72f7c814c9a0cecbff267948f81c9903ac10eb35f6cb86369224ed609811cdf390f4", + "wx": "52ca47dda99172cb8321495acf988548295988ec973c1b4ea9462c53e5768a704a936410ee847b5dbf1e9d0c131da6c7", + "wy": "0087a47027e6655792eb002d4228ee72f7c814c9a0cecbff267948f81c9903ac10eb35f6cb86369224ed609811cdf390f4" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000452ca47dda99172cb8321495acf988548295988ec973c1b4ea9462c53e5768a704a936410ee847b5dbf1e9d0c131da6c787a47027e6655792eb002d4228ee72f7c814c9a0cecbff267948f81c9903ac10eb35f6cb86369224ed609811cdf390f4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEUspH3amRcsuDIUlaz5iFSClZiOyXPBtO\nqUYsU+V2inBKk2QQ7oR7Xb8enQwTHabHh6RwJ+ZlV5LrAC1CKO5y98gUyaDOy/8m\neUj4HJkDrBDrNfbLhjaSJO1gmBHN85D0\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 400, + "comment": "r and s^-1 are close to n", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc528f3023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0491aa326dabe04a6ad266de30873518f978f634c740705152539787b5b42dd9683c4185ace936684683b4c136b5f2ff20cacda42b735cbee78e7b6a43f50b851b85e998c365909f763d3e64210eded159ebf21818dec0e207b877b99ff595beaf", + "wx": "0091aa326dabe04a6ad266de30873518f978f634c740705152539787b5b42dd9683c4185ace936684683b4c136b5f2ff20", + "wy": "00cacda42b735cbee78e7b6a43f50b851b85e998c365909f763d3e64210eded159ebf21818dec0e207b877b99ff595beaf" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000491aa326dabe04a6ad266de30873518f978f634c740705152539787b5b42dd9683c4185ace936684683b4c136b5f2ff20cacda42b735cbee78e7b6a43f50b851b85e998c365909f763d3e64210eded159ebf21818dec0e207b877b99ff595beaf", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEkaoybavgSmrSZt4whzUY+Xj2NMdAcFFS\nU5eHtbQt2Wg8QYWs6TZoRoO0wTa18v8gys2kK3NcvueOe2pD9QuFG4XpmMNlkJ92\nPT5kIQ7e0Vnr8hgY3sDiB7h3uZ/1lb6v\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 401, + "comment": "r and s are 64-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30160209009c44febf31c3594d020900839ed28247c2b06b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04b1f52ae15400a0e0a4b39aae9a11e675cfc918d0c672189a86f68c0f306b115b6b470b931d19b2bbfcddada74f30a72c43cdc9522c0f73082251b4293982bc3e90960384f957f594d0ebe6eefe72af1ce7387f46ca5824ba0515559c05444f59", + "wx": "00b1f52ae15400a0e0a4b39aae9a11e675cfc918d0c672189a86f68c0f306b115b6b470b931d19b2bbfcddada74f30a72c", + "wy": "43cdc9522c0f73082251b4293982bc3e90960384f957f594d0ebe6eefe72af1ce7387f46ca5824ba0515559c05444f59" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004b1f52ae15400a0e0a4b39aae9a11e675cfc918d0c672189a86f68c0f306b115b6b470b931d19b2bbfcddada74f30a72c43cdc9522c0f73082251b4293982bc3e90960384f957f594d0ebe6eefe72af1ce7387f46ca5824ba0515559c05444f59", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEsfUq4VQAoOCks5qumhHmdc/JGNDGchia\nhvaMDzBrEVtrRwuTHRmyu/zdradPMKcsQ83JUiwPcwgiUbQpOYK8PpCWA4T5V/WU\n0Ovm7v5yrxznOH9GylgkugUVVZwFRE9Z\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 402, + "comment": "r and s are 100-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "301e020d09df8b682430beef6f5fd7c7d0020d0fd0a62e13778f4222a0d61c8a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044314072bfccfe420f64cf79393bf38c773c4390f7df826c6a59043b3e0d55e8e69d37678c72a5e68a114e04ae5a2de765a4b87638874c3b3ff687ba7fcd08238d46385e2aa6d65e2e53a6d5e205fcfd9b744f4087c6292b665dcb691ca5e86d4", + "wx": "4314072bfccfe420f64cf79393bf38c773c4390f7df826c6a59043b3e0d55e8e69d37678c72a5e68a114e04ae5a2de76", + "wy": "5a4b87638874c3b3ff687ba7fcd08238d46385e2aa6d65e2e53a6d5e205fcfd9b744f4087c6292b665dcb691ca5e86d4" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044314072bfccfe420f64cf79393bf38c773c4390f7df826c6a59043b3e0d55e8e69d37678c72a5e68a114e04ae5a2de765a4b87638874c3b3ff687ba7fcd08238d46385e2aa6d65e2e53a6d5e205fcfd9b744f4087c6292b665dcb691ca5e86d4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEQxQHK/zP5CD2TPeTk784x3PEOQ99+CbG\npZBDs+DVXo5p03Z4xypeaKEU4Erlot52WkuHY4h0w7P/aHun/NCCONRjheKqbWXi\n5TptXiBfz9m3RPQIfGKStmXctpHKXobU\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 403, + "comment": "r and s are 128-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "30260211008a598e563a89f526c32ebec8de26367a02110084f633e2042630e99dd0f1e16f7a04bf", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04eb99d6bf52d08c1118ce27b0e4c09ce0d6893d5a9da2757b7f03057fcc17bd8afb4c48a60e757ff61d5e54e31d6536a9059ec79354b3949d53461e6adf7671ddf20402e1c9337464775ee56d507832728124c514e1dca506fe5fa72f7e1778ff", + "wx": "00eb99d6bf52d08c1118ce27b0e4c09ce0d6893d5a9da2757b7f03057fcc17bd8afb4c48a60e757ff61d5e54e31d6536a9", + "wy": "059ec79354b3949d53461e6adf7671ddf20402e1c9337464775ee56d507832728124c514e1dca506fe5fa72f7e1778ff" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004eb99d6bf52d08c1118ce27b0e4c09ce0d6893d5a9da2757b7f03057fcc17bd8afb4c48a60e757ff61d5e54e31d6536a9059ec79354b3949d53461e6adf7671ddf20402e1c9337464775ee56d507832728124c514e1dca506fe5fa72f7e1778ff", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE65nWv1LQjBEYziew5MCc4NaJPVqdonV7\nfwMFf8wXvYr7TEimDnV/9h1eVOMdZTapBZ7Hk1SzlJ1TRh5q33Zx3fIEAuHJM3Rk\nd17lbVB4MnKBJMUU4dylBv5fpy9+F3j/\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 404, + "comment": "r and s are 160-bit integer", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "302e021500aa6eeb5823f7fa31b466bb473797f0d0314c0be0021500e2977c479e6d25703cebbc6bd561938cc9d1bfb9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04bd3d91f003e18adbea73079d4eba23b91fc17fcec14c9eb15a193fbc9ca39c8c747cd7a2c9623e05dd587ccbb8ab4c443adb0a0706aa5ea7a68042082fccefc979612a7a1a3d694b00793b03f89bff866a8b97c8e77990c29360ce795036c764", + "wx": "00bd3d91f003e18adbea73079d4eba23b91fc17fcec14c9eb15a193fbc9ca39c8c747cd7a2c9623e05dd587ccbb8ab4c44", + "wy": "3adb0a0706aa5ea7a68042082fccefc979612a7a1a3d694b00793b03f89bff866a8b97c8e77990c29360ce795036c764" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004bd3d91f003e18adbea73079d4eba23b91fc17fcec14c9eb15a193fbc9ca39c8c747cd7a2c9623e05dd587ccbb8ab4c443adb0a0706aa5ea7a68042082fccefc979612a7a1a3d694b00793b03f89bff866a8b97c8e77990c29360ce795036c764", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEvT2R8APhitvqcwedTrojuR/Bf87BTJ6x\nWhk/vJyjnIx0fNeiyWI+Bd1YfMu4q0xEOtsKBwaqXqemgEIIL8zvyXlhKnoaPWlL\nAHk7A/ib/4Zqi5fI53mQwpNgznlQNsdk\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 405, + "comment": "s == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3035023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326020101", + "result": "valid" + }, + { + "tcId": 406, + "comment": "s == 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3035023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326020100", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "045abbf618a084f67138c418a896d61af3af1826040835b73e7619846b495eba6f7eeaa2e9cc61c85f6100fedc25c16743b065a427bc503139529e4faa63dda553aed2696fd02c2b6ceb2d941d2c4363cf9ac7a6759d50e8b9d07fe286f17cef5c", + "wx": "5abbf618a084f67138c418a896d61af3af1826040835b73e7619846b495eba6f7eeaa2e9cc61c85f6100fedc25c16743", + "wy": "00b065a427bc503139529e4faa63dda553aed2696fd02c2b6ceb2d941d2c4363cf9ac7a6759d50e8b9d07fe286f17cef5c" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200045abbf618a084f67138c418a896d61af3af1826040835b73e7619846b495eba6f7eeaa2e9cc61c85f6100fedc25c16743b065a427bc503139529e4faa63dda553aed2696fd02c2b6ceb2d941d2c4363cf9ac7a6759d50e8b9d07fe286f17cef5c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEWrv2GKCE9nE4xBioltYa868YJgQINbc+\ndhmEa0leum9+6qLpzGHIX2EA/twlwWdDsGWkJ7xQMTlSnk+qY92lU67SaW/QLCts\n6y2UHSxDY8+ax6Z1nVDoudB/4obxfO9c\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 407, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec63260230427f8227a67d9422557647d27945a90ae1d2ec2931f90113cd5b407099e3d8f5a889d62069e64c0e1c4efe29690b0992", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043942027bc7f33c10b159293f2abd0af935642a546ea20de9d85c36a0f4ed40cfada782a297bb2046d633fa53e26adc5230656a4f1804feca511d41372483af36387f658c44fdc5e7f02487ab70e1bf9d185918d7820fee0ea57a4fe006abbe70", + "wx": "3942027bc7f33c10b159293f2abd0af935642a546ea20de9d85c36a0f4ed40cfada782a297bb2046d633fa53e26adc52", + "wy": "30656a4f1804feca511d41372483af36387f658c44fdc5e7f02487ab70e1bf9d185918d7820fee0ea57a4fe006abbe70" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043942027bc7f33c10b159293f2abd0af935642a546ea20de9d85c36a0f4ed40cfada782a297bb2046d633fa53e26adc5230656a4f1804feca511d41372483af36387f658c44fdc5e7f02487ab70e1bf9d185918d7820fee0ea57a4fe006abbe70", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEOUICe8fzPBCxWSk/Kr0K+TVkKlRuog3p\n2Fw2oPTtQM+tp4Kil7sgRtYz+lPiatxSMGVqTxgE/spRHUE3JIOvNjh/ZYxE/cXn\n8CSHq3Dhv50YWRjXgg/uDqV6T+AGq75w\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 408, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec63260230369cf68bb2919c11d0f82315e1ee68a7ee8c17858bd334bf84536b2b74756a77e4eee10ecc5a6416a8263b5429afcba4", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04d5db4d230cadf5bc6350f74d0bc5015b14d377934c879f74caf483dac49ef9fcf7a6676aaac5b405896d5be6ae0653e5e3509606e26f71415a7f8ce37698e1c82286cdcdf3a7def73c347e32b45b32b6deeb34c4038373a30a7f8275f6daf541", + "wx": "00d5db4d230cadf5bc6350f74d0bc5015b14d377934c879f74caf483dac49ef9fcf7a6676aaac5b405896d5be6ae0653e5", + "wy": "00e3509606e26f71415a7f8ce37698e1c82286cdcdf3a7def73c347e32b45b32b6deeb34c4038373a30a7f8275f6daf541" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004d5db4d230cadf5bc6350f74d0bc5015b14d377934c879f74caf483dac49ef9fcf7a6676aaac5b405896d5be6ae0653e5e3509606e26f71415a7f8ce37698e1c82286cdcdf3a7def73c347e32b45b32b6deeb34c4038373a30a7f8275f6daf541", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE1dtNIwyt9bxjUPdNC8UBWxTTd5NMh590\nyvSD2sSe+fz3pmdqqsW0BYltW+auBlPl41CWBuJvcUFaf4zjdpjhyCKGzc3zp973\nPDR+MrRbMrbe6zTEA4Nzowp/gnX22vVB\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 409, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602302111832a45fc5967f7bf78ccdfe98d4e707484aad43f67cf5ac8aa2afbde0d1d8b7fe5cfc5012feb033dffdec623dfbf", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04629e253d5ef8c23319bbe9a56af387d92f867ef9f81c6d9f0ee7f5ac28412b0227eac75d982814e8e24d82b8308cc9c14ef3b9286c9882d7e853f7032f01dbe88206a7f92ec7c776cdfd2117ccb2ad2165fb8650de299107037edb69109001db", + "wx": "629e253d5ef8c23319bbe9a56af387d92f867ef9f81c6d9f0ee7f5ac28412b0227eac75d982814e8e24d82b8308cc9c1", + "wy": "4ef3b9286c9882d7e853f7032f01dbe88206a7f92ec7c776cdfd2117ccb2ad2165fb8650de299107037edb69109001db" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004629e253d5ef8c23319bbe9a56af387d92f867ef9f81c6d9f0ee7f5ac28412b0227eac75d982814e8e24d82b8308cc9c14ef3b9286c9882d7e853f7032f01dbe88206a7f92ec7c776cdfd2117ccb2ad2165fb8650de299107037edb69109001db", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEYp4lPV74wjMZu+mlavOH2S+Gfvn4HG2f\nDuf1rChBKwIn6sddmCgU6OJNgrgwjMnBTvO5KGyYgtfoU/cDLwHb6IIGp/kux8d2\nzf0hF8yyrSFl+4ZQ3imRBwN+22kQkAHb\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 410, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023020cd002ab7dca06b798fecef3f06a222c2d2a65e9ec92f74659a8d82fe7d75e9af739f0b532e17d6c5f622c4b591442b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043eb89e36a222831fba4be0b7ca40b7df6e4d795f921089b48989af0add1fa6c6e846946c25e4d195f9ac5dbb34147e412b3081be4324036a3bc79e9b6cd78d0d48500f0fce1e5a0fa31d833f86d1afe2f7adfeb5cb9662c74763c85f0f9d339a", + "wx": "3eb89e36a222831fba4be0b7ca40b7df6e4d795f921089b48989af0add1fa6c6e846946c25e4d195f9ac5dbb34147e41", + "wy": "2b3081be4324036a3bc79e9b6cd78d0d48500f0fce1e5a0fa31d833f86d1afe2f7adfeb5cb9662c74763c85f0f9d339a" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043eb89e36a222831fba4be0b7ca40b7df6e4d795f921089b48989af0add1fa6c6e846946c25e4d195f9ac5dbb34147e412b3081be4324036a3bc79e9b6cd78d0d48500f0fce1e5a0fa31d833f86d1afe2f7adfeb5cb9662c74763c85f0f9d339a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEPrieNqIigx+6S+C3ykC3325NeV+SEIm0\niYmvCt0fpsboRpRsJeTRlfmsXbs0FH5BKzCBvkMkA2o7x56bbNeNDUhQDw/OHloP\nox2DP4bRr+L3rf61y5Zix0djyF8PnTOa\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 411, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602303276fe55314e426a8ed83c4c38dc27c8fe8cbba0b39bad7cfc35e963adf10ab37251ea6829b8d255a77dd0b655cf9ff8", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0466d0d1cec3fe7f8a46e766d1f7f44b2436f48164e12139313887c5992cfe5944059ba97eb10df411182f4242cb0d0bd4a3e39ee77a4c472aeb3f110b088b5eb92b7d2885bce326eb8f002e2ce3c858910717841499eeb7f739441ba0ffb3c02f", + "wx": "66d0d1cec3fe7f8a46e766d1f7f44b2436f48164e12139313887c5992cfe5944059ba97eb10df411182f4242cb0d0bd4", + "wy": "00a3e39ee77a4c472aeb3f110b088b5eb92b7d2885bce326eb8f002e2ce3c858910717841499eeb7f739441ba0ffb3c02f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000466d0d1cec3fe7f8a46e766d1f7f44b2436f48164e12139313887c5992cfe5944059ba97eb10df411182f4242cb0d0bd4a3e39ee77a4c472aeb3f110b088b5eb92b7d2885bce326eb8f002e2ce3c858910717841499eeb7f739441ba0ffb3c02f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEZtDRzsP+f4pG52bR9/RLJDb0gWThITkx\nOIfFmSz+WUQFm6l+sQ30ERgvQkLLDQvUo+Oe53pMRyrrPxELCIteuSt9KIW84ybr\njwAuLOPIWJEHF4QUme639zlEG6D/s8Av\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 412, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602301a80b4a3d6c88775821e26784463080eb7de510762ab0d98223e532364c7089b07af73746ae4cf076c5277dcc80cf8c2", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "045ea90d3b95fe4c25b3623cba85867df605039be9c78b0489dcafb2c613ce6887c53fccc95fd342156466d0f8c05ba628c81f3c6e5b5a400feffb76814c47f2ae486ac575359ee6dbea6e3a0fbad3747558934a5a1079883d02aa06bb071001b9", + "wx": "5ea90d3b95fe4c25b3623cba85867df605039be9c78b0489dcafb2c613ce6887c53fccc95fd342156466d0f8c05ba628", + "wy": "00c81f3c6e5b5a400feffb76814c47f2ae486ac575359ee6dbea6e3a0fbad3747558934a5a1079883d02aa06bb071001b9" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200045ea90d3b95fe4c25b3623cba85867df605039be9c78b0489dcafb2c613ce6887c53fccc95fd342156466d0f8c05ba628c81f3c6e5b5a400feffb76814c47f2ae486ac575359ee6dbea6e3a0fbad3747558934a5a1079883d02aa06bb071001b9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEXqkNO5X+TCWzYjy6hYZ99gUDm+nHiwSJ\n3K+yxhPOaIfFP8zJX9NCFWRm0PjAW6YoyB88bltaQA/v+3aBTEfyrkhqxXU1nubb\n6m46D7rTdHVYk0paEHmIPQKqBrsHEAG5\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 413, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023074e780e38b3a7cd6cfe17d5c9ac615895bd97dd4076b5f8218ae758b83d195fba64eb9aead39a790ca0f8b8387376265", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04c8793c0b7d239c26195cbea62a97b350d74e64609e3946eca0061b19fe480332be3ba3e4b62de5c5032d7437015adf15af8878a280a6469441d0ab04d0d331ffbc1389b9bf81991660b7b8c2ee20b2a0ed31b94742b5a7413fbb758be5927f7e", + "wx": "00c8793c0b7d239c26195cbea62a97b350d74e64609e3946eca0061b19fe480332be3ba3e4b62de5c5032d7437015adf15", + "wy": "00af8878a280a6469441d0ab04d0d331ffbc1389b9bf81991660b7b8c2ee20b2a0ed31b94742b5a7413fbb758be5927f7e" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004c8793c0b7d239c26195cbea62a97b350d74e64609e3946eca0061b19fe480332be3ba3e4b62de5c5032d7437015adf15af8878a280a6469441d0ab04d0d331ffbc1389b9bf81991660b7b8c2ee20b2a0ed31b94742b5a7413fbb758be5927f7e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEyHk8C30jnCYZXL6mKpezUNdOZGCeOUbs\noAYbGf5IAzK+O6Pkti3lxQMtdDcBWt8Vr4h4ooCmRpRB0KsE0NMx/7wTibm/gZkW\nYLe4wu4gsqDtMblHQrWnQT+7dYvlkn9+\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 414, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602306ee5f8daae12c862e1f7f8b59294ac90448c4461e29b36ed623a719dd69bb17b3a4b7c29b9eb5c39ca6168bf6b597c6a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0457d1385205e0cb872d619c2aec0b3442cf449959d33c1c4e76b55f9378e914fb07c4f26929832c3862de9be4b3d5fe18f10779e7e09e2f0ea1ca2df8f801167bf384f061a2c272720e0a6f4b313341f29da004e91b83a738b14e7c3b3235a549", + "wx": "57d1385205e0cb872d619c2aec0b3442cf449959d33c1c4e76b55f9378e914fb07c4f26929832c3862de9be4b3d5fe18", + "wy": "00f10779e7e09e2f0ea1ca2df8f801167bf384f061a2c272720e0a6f4b313341f29da004e91b83a738b14e7c3b3235a549" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000457d1385205e0cb872d619c2aec0b3442cf449959d33c1c4e76b55f9378e914fb07c4f26929832c3862de9be4b3d5fe18f10779e7e09e2f0ea1ca2df8f801167bf384f061a2c272720e0a6f4b313341f29da004e91b83a738b14e7c3b3235a549", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEV9E4UgXgy4ctYZwq7As0Qs9EmVnTPBxO\ndrVfk3jpFPsHxPJpKYMsOGLem+Sz1f4Y8Qd55+CeLw6hyi34+AEWe/OE8GGiwnJy\nDgpvSzEzQfKdoATpG4OnOLFOfDsyNaVJ\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 415, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602305426ca20a25b0cfb1ef230c62f91e98005f346e229233f1803e8944bf421fef150a4a109e48cefaa4ea23eea627fca41", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04a982d9378c598e40330f1f1254494315e65a50754c701c46fbd2253b50673c6a794b72743e412aa92201df95e81af63cd05e4c775885dfa050743dbf3b5d020be409bababce230b80d7aea32f38973a0b659aba3808fe7f9d2ae67ef9639d971", + "wx": "00a982d9378c598e40330f1f1254494315e65a50754c701c46fbd2253b50673c6a794b72743e412aa92201df95e81af63c", + "wy": "00d05e4c775885dfa050743dbf3b5d020be409bababce230b80d7aea32f38973a0b659aba3808fe7f9d2ae67ef9639d971" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004a982d9378c598e40330f1f1254494315e65a50754c701c46fbd2253b50673c6a794b72743e412aa92201df95e81af63cd05e4c775885dfa050743dbf3b5d020be409bababce230b80d7aea32f38973a0b659aba3808fe7f9d2ae67ef9639d971", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEqYLZN4xZjkAzDx8SVElDFeZaUHVMcBxG\n+9IlO1BnPGp5S3J0PkEqqSIB35XoGvY80F5Md1iF36BQdD2/O10CC+QJurq84jC4\nDXrqMvOJc6C2WaujgI/n+dKuZ++WOdlx\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 416, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023039fd1a0ae3964735554c61daf085c66bcc2e9e5350131086023aa99549fc5f9057c848e75a1b8e58069fe0b9b23fa3c9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04daf193bd2f16d613aff2254bdc2dcd1eeb036d6506a50e07a26f83d3830629fad4433d3232628f5f24ede60bb6eb3e1ee299714cc03e73b5e1a7fa0e1adfb2709a55883d9e97036007b31b7661f6fef6a1dbe418b633a5f3639f7d529da97285", + "wx": "00daf193bd2f16d613aff2254bdc2dcd1eeb036d6506a50e07a26f83d3830629fad4433d3232628f5f24ede60bb6eb3e1e", + "wy": "00e299714cc03e73b5e1a7fa0e1adfb2709a55883d9e97036007b31b7661f6fef6a1dbe418b633a5f3639f7d529da97285" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004daf193bd2f16d613aff2254bdc2dcd1eeb036d6506a50e07a26f83d3830629fad4433d3232628f5f24ede60bb6eb3e1ee299714cc03e73b5e1a7fa0e1adfb2709a55883d9e97036007b31b7661f6fef6a1dbe418b633a5f3639f7d529da97285", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE2vGTvS8W1hOv8iVL3C3NHusDbWUGpQ4H\nom+D04MGKfrUQz0yMmKPXyTt5gu26z4e4plxTMA+c7Xhp/oOGt+ycJpViD2elwNg\nB7MbdmH2/vah2+QYtjOl82OffVKdqXKF\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 417, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec63260230707a37cfb7367c2e551ea1f0caeac6c0fdd2b562e1bd8f1c7c51a5dd78f21da8cb179bd832cac3d3aee21fda54729e66", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0409d4064490c7736106946b7fc6d88957c69d6f2f62e4388262603a43c129ceabe8d601ab2a700394b3b950840364bb6c7907bc45387fa1200b7cfae3171488d104738c60d22cacb71ed34a72bf1d315f7370aa181b265810c083996fe3a6b0fc", + "wx": "09d4064490c7736106946b7fc6d88957c69d6f2f62e4388262603a43c129ceabe8d601ab2a700394b3b950840364bb6c", + "wy": "7907bc45387fa1200b7cfae3171488d104738c60d22cacb71ed34a72bf1d315f7370aa181b265810c083996fe3a6b0fc" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000409d4064490c7736106946b7fc6d88957c69d6f2f62e4388262603a43c129ceabe8d601ab2a700394b3b950840364bb6c7907bc45387fa1200b7cfae3171488d104738c60d22cacb71ed34a72bf1d315f7370aa181b265810c083996fe3a6b0fc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAECdQGRJDHc2EGlGt/xtiJV8adby9i5DiC\nYmA6Q8Epzqvo1gGrKnADlLO5UIQDZLtseQe8RTh/oSALfPrjFxSI0QRzjGDSLKy3\nHtNKcr8dMV9zcKoYGyZYEMCDmW/jprD8\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 418, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023015c99e2ae11f429e74fe2e758bc53ffea26eb6368dd60d10daf860f9c79fa8cc6cb98fee9b87dd38353e970539a50a9e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04650323415ec7cb87c02b670ba5dff00e6741d50c78f044ba179891e1e1e00cecc56803566872a288dcecfea93ae74955084ff6f9ad4f7ae7ec9c808259a5b640984000f7d86b412b4d04506fdce4d06cfd9b176d07cd869be6741de771438020", + "wx": "650323415ec7cb87c02b670ba5dff00e6741d50c78f044ba179891e1e1e00cecc56803566872a288dcecfea93ae74955", + "wy": "084ff6f9ad4f7ae7ec9c808259a5b640984000f7d86b412b4d04506fdce4d06cfd9b176d07cd869be6741de771438020" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004650323415ec7cb87c02b670ba5dff00e6741d50c78f044ba179891e1e1e00cecc56803566872a288dcecfea93ae74955084ff6f9ad4f7ae7ec9c808259a5b640984000f7d86b412b4d04506fdce4d06cfd9b176d07cd869be6741de771438020", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEZQMjQV7Hy4fAK2cLpd/wDmdB1Qx48ES6\nF5iR4eHgDOzFaANWaHKiiNzs/qk650lVCE/2+a1PeufsnICCWaW2QJhAAPfYa0Er\nTQRQb9zk0Gz9mxdtB82Gm+Z0HedxQ4Ag\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 419, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec63260230148c732596feaabb01be1be3a220740e84bbfabe6d82ad0db1c396fa047603beeb95a1cd37fc708a9451d3cc29a45b32", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04dcbe590865766687b59e391cd0e7774c8c71b48a150fd71aa85f12ae56a574a7d6c815eba1c1ac2ba98c0246e7a77ffc8adc0f6009441969497b33ec3ba5ca9056265ca6af4a732540ea71f4a0cb64c4a8296585be4cffa7f70bb779997300ff", + "wx": "00dcbe590865766687b59e391cd0e7774c8c71b48a150fd71aa85f12ae56a574a7d6c815eba1c1ac2ba98c0246e7a77ffc", + "wy": "008adc0f6009441969497b33ec3ba5ca9056265ca6af4a732540ea71f4a0cb64c4a8296585be4cffa7f70bb779997300ff" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004dcbe590865766687b59e391cd0e7774c8c71b48a150fd71aa85f12ae56a574a7d6c815eba1c1ac2ba98c0246e7a77ffc8adc0f6009441969497b33ec3ba5ca9056265ca6af4a732540ea71f4a0cb64c4a8296585be4cffa7f70bb779997300ff", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE3L5ZCGV2Zoe1njkc0Od3TIxxtIoVD9ca\nqF8SrlaldKfWyBXrocGsK6mMAkbnp3/8itwPYAlEGWlJezPsO6XKkFYmXKavSnMl\nQOpx9KDLZMSoKWWFvkz/p/cLt3mZcwD/\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 420, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602306b3cc62a449ae5ef68bec8672f186d5418cc18d039af91b45f8a8fae4210ef06d3f0d226f89945b314d9df72e01a02bb", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04334ab85078a211761e6fe39b56b715047f6aa5f187f2eef32c66b10dc7aae5af2d43e3feb356332354f6e3231e723dcef5dd6d0a40fe6c13e5008e310c848139ad58eaa1e9ba242ab383d433111ff11a494a57ab9f0924a257e751418aaaa66f", + "wx": "334ab85078a211761e6fe39b56b715047f6aa5f187f2eef32c66b10dc7aae5af2d43e3feb356332354f6e3231e723dce", + "wy": "00f5dd6d0a40fe6c13e5008e310c848139ad58eaa1e9ba242ab383d433111ff11a494a57ab9f0924a257e751418aaaa66f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004334ab85078a211761e6fe39b56b715047f6aa5f187f2eef32c66b10dc7aae5af2d43e3feb356332354f6e3231e723dcef5dd6d0a40fe6c13e5008e310c848139ad58eaa1e9ba242ab383d433111ff11a494a57ab9f0924a257e751418aaaa66f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEM0q4UHiiEXYeb+ObVrcVBH9qpfGH8u7z\nLGaxDceq5a8tQ+P+s1YzI1T24yMecj3O9d1tCkD+bBPlAI4xDISBOa1Y6qHpuiQq\ns4PUMxEf8RpJSlernwkkolfnUUGKqqZv\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 421, + "comment": "edge case modular inverse", + "flags": [ + "ModularInverse", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec632602307db7901f053b9cefacfda88dd7791c01fd569ed9a5243385eccae12ba992af55832a2e5dc8065e018399a70730035bd8", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04f896353cc3a8afdd543ec3aef062ca97bc32ed1724ea38b940b8c0ea0e23b34187afbe70daf8dbaa5b511557e5d2bddac4bd265da67ceeafca636f6f4c0472f22a9d02e2289184f73bbb700ae8fc921eff4920f290bfcb49fbb232cc13a21028", + "wx": "00f896353cc3a8afdd543ec3aef062ca97bc32ed1724ea38b940b8c0ea0e23b34187afbe70daf8dbaa5b511557e5d2bdda", + "wy": "00c4bd265da67ceeafca636f6f4c0472f22a9d02e2289184f73bbb700ae8fc921eff4920f290bfcb49fbb232cc13a21028" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004f896353cc3a8afdd543ec3aef062ca97bc32ed1724ea38b940b8c0ea0e23b34187afbe70daf8dbaa5b511557e5d2bddac4bd265da67ceeafca636f6f4c0472f22a9d02e2289184f73bbb700ae8fc921eff4920f290bfcb49fbb232cc13a21028", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+JY1PMOor91UPsOu8GLKl7wy7Rck6ji5\nQLjA6g4js0GHr75w2vjbqltRFVfl0r3axL0mXaZ87q/KY29vTARy8iqdAuIokYT3\nO7twCuj8kh7/SSDykL/LSfuyMswTohAo\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 422, + "comment": "point at infinity during verify", + "flags": [ + "PointDuplication", + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294b9023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04370d9e2e31c712c8028092f802319d7fdf5b3319a8518d08bed3891508c7060cfe2236e18fa14fe077093ceae633e5430fd79aacf9d16ecc19b12d60fba4998dfc682702ec7c8bdd4a590035773b8c9c570ac7dcd414e03252f7a0e6f53b5863", + "wx": "370d9e2e31c712c8028092f802319d7fdf5b3319a8518d08bed3891508c7060cfe2236e18fa14fe077093ceae633e543", + "wy": "0fd79aacf9d16ecc19b12d60fba4998dfc682702ec7c8bdd4a590035773b8c9c570ac7dcd414e03252f7a0e6f53b5863" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004370d9e2e31c712c8028092f802319d7fdf5b3319a8518d08bed3891508c7060cfe2236e18fa14fe077093ceae633e5430fd79aacf9d16ecc19b12d60fba4998dfc682702ec7c8bdd4a590035773b8c9c570ac7dcd414e03252f7a0e6f53b5863", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENw2eLjHHEsgCgJL4AjGdf99bMxmoUY0I\nvtOJFQjHBgz+Ijbhj6FP4HcJPOrmM+VDD9earPnRbswZsS1g+6SZjfxoJwLsfIvd\nSlkANXc7jJxXCsfc1BTgMlL3oOb1O1hj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 423, + "comment": "edge case for signature malleability", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294b902307fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294b9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04941e6cfa356e572dcccaeb594b06955d99dc4bf07958fc98ffa17de11c7521bf2c7aa8ff260952fcb7aac078ede67b4790a78a0296b041a10f003df1998da4cc4a1614ebcbf5d239431f33d90d3023edc1802e8db6dabcbae67cc314da2aabab", + "wx": "00941e6cfa356e572dcccaeb594b06955d99dc4bf07958fc98ffa17de11c7521bf2c7aa8ff260952fcb7aac078ede67b47", + "wy": "0090a78a0296b041a10f003df1998da4cc4a1614ebcbf5d239431f33d90d3023edc1802e8db6dabcbae67cc314da2aabab" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004941e6cfa356e572dcccaeb594b06955d99dc4bf07958fc98ffa17de11c7521bf2c7aa8ff260952fcb7aac078ede67b4790a78a0296b041a10f003df1998da4cc4a1614ebcbf5d239431f33d90d3023edc1802e8db6dabcbae67cc314da2aabab", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAElB5s+jVuVy3MyutZSwaVXZncS/B5WPyY\n/6F94Rx1Ib8seqj/JglS/LeqwHjt5ntHkKeKApawQaEPAD3xmY2kzEoWFOvL9dI5\nQx8z2Q0wI+3BgC6Nttq8uuZ8wxTaKqur\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 424, + "comment": "edge case for signature malleability", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294b902307fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294ba", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043ecfd58a3ce583866e0471d16eb3c10a411ec3b8671f3a04769b1ed8464a71cf1c76d8d9b7e3670bbe712d6f554a9383d980d8bedf57470d6b45cc1ad0c6426dc70a0e4be901106a36663bfcab04fcb86008777b92445120d5e3641d97396362", + "wx": "3ecfd58a3ce583866e0471d16eb3c10a411ec3b8671f3a04769b1ed8464a71cf1c76d8d9b7e3670bbe712d6f554a9383", + "wy": "00d980d8bedf57470d6b45cc1ad0c6426dc70a0e4be901106a36663bfcab04fcb86008777b92445120d5e3641d97396362" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043ecfd58a3ce583866e0471d16eb3c10a411ec3b8671f3a04769b1ed8464a71cf1c76d8d9b7e3670bbe712d6f554a9383d980d8bedf57470d6b45cc1ad0c6426dc70a0e4be901106a36663bfcab04fcb86008777b92445120d5e3641d97396362", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEPs/Vijzlg4ZuBHHRbrPBCkEew7hnHzoE\ndpse2EZKcc8cdtjZt+NnC75xLW9VSpOD2YDYvt9XRw1rRcwa0MZCbccKDkvpARBq\nNmY7/KsE/LhgCHd7kkRRINXjZB2XOWNi\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 425, + "comment": "u1 == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023100f9b127f0d81ebcd17b7ba0ea131c660d340b05ce557c82160e0f793de07d38179023942871acb7002dfafdfffc8deace", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044150ccd0fa45aa2ef6b5042ddbb1b87c5ffd1115a8fe5995641948acda82a7b190762d84352cd74d1ca01e79f68f9cb4eb11be9d494c181c156e23e77e532bdf0a20c3cc74ba8c29b1f3eb2bd99129ee0d70ff0d593f0d7a6d6887e7c55930d2", + "wx": "4150ccd0fa45aa2ef6b5042ddbb1b87c5ffd1115a8fe5995641948acda82a7b190762d84352cd74d1ca01e79f68f9cb4", + "wy": "00eb11be9d494c181c156e23e77e532bdf0a20c3cc74ba8c29b1f3eb2bd99129ee0d70ff0d593f0d7a6d6887e7c55930d2" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044150ccd0fa45aa2ef6b5042ddbb1b87c5ffd1115a8fe5995641948acda82a7b190762d84352cd74d1ca01e79f68f9cb4eb11be9d494c181c156e23e77e532bdf0a20c3cc74ba8c29b1f3eb2bd99129ee0d70ff0d593f0d7a6d6887e7c55930d2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEQVDM0PpFqi72tQQt27G4fF/9ERWo/lmV\nZBlIrNqCp7GQdi2ENSzXTRygHnn2j5y06xG+nUlMGBwVbiPnflMr3wogw8x0uowp\nsfPrK9mRKe4NcP8NWT8Nem1oh+fFWTDS\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 426, + "comment": "u1 == n - 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec63260230064ed80f27e1432e84845f15ece399f2cbf4fa31aa837de9b953d44413b9f5c7c7f67989d703f07abef11b6ad0373ea5", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04e78fe2c11beac7090ee0af7fed469a8ccebd3cccc4ee9fccc8ef3fc0455b69aaa082dc13e1d84f34026cb6f0af9e992ff34ebba71bf3a4050bf28e4084b5c5f5d4098ec46f10a31b02fb4bf20cc9362f6f02a66e802f817507535fac3ec0b099", + "wx": "00e78fe2c11beac7090ee0af7fed469a8ccebd3cccc4ee9fccc8ef3fc0455b69aaa082dc13e1d84f34026cb6f0af9e992f", + "wy": "00f34ebba71bf3a4050bf28e4084b5c5f5d4098ec46f10a31b02fb4bf20cc9362f6f02a66e802f817507535fac3ec0b099" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004e78fe2c11beac7090ee0af7fed469a8ccebd3cccc4ee9fccc8ef3fc0455b69aaa082dc13e1d84f34026cb6f0af9e992ff34ebba71bf3a4050bf28e4084b5c5f5d4098ec46f10a31b02fb4bf20cc9362f6f02a66e802f817507535fac3ec0b099", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE54/iwRvqxwkO4K9/7UaajM69PMzE7p/M\nyO8/wEVbaaqggtwT4dhPNAJstvCvnpkv8067pxvzpAUL8o5AhLXF9dQJjsRvEKMb\nAvtL8gzJNi9vAqZugC+BdQdTX6w+wLCZ\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 427, + "comment": "u2 == 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04ee24ab8a34d05af684939357f32759cc5a14f3c717529a20aea8e0c5965d8a41e68925f688471994b72021ba51b28c090a55693c92ad0cbae9edcf515e2b4c060b888d82c81e4a3b6a173b62ed04a46fa95db1a2f3949980fba2e371263c4fa9", + "wx": "00ee24ab8a34d05af684939357f32759cc5a14f3c717529a20aea8e0c5965d8a41e68925f688471994b72021ba51b28c09", + "wy": "0a55693c92ad0cbae9edcf515e2b4c060b888d82c81e4a3b6a173b62ed04a46fa95db1a2f3949980fba2e371263c4fa9" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004ee24ab8a34d05af684939357f32759cc5a14f3c717529a20aea8e0c5965d8a41e68925f688471994b72021ba51b28c090a55693c92ad0cbae9edcf515e2b4c060b888d82c81e4a3b6a173b62ed04a46fa95db1a2f3949980fba2e371263c4fa9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE7iSrijTQWvaEk5NX8ydZzFoU88cXUpog\nrqjgxZZdikHmiSX2iEcZlLcgIbpRsowJClVpPJKtDLrp7c9RXitMBguIjYLIHko7\nahc7Yu0EpG+pXbGi85SZgPui43EmPE+p\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 428, + "comment": "u2 == n - 1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023100aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa84ecde56a2cf73ea3abc092185cb1a51f34810f1ddd8c64d", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043d2e916055c92e1b36133f5937b37c1b0102834eb77008a3ba9c3da446e9065971d68ba913091851e10cff5b4cd875c139aa7aadfc2caf7107b17ae1aea8b299d61bf15aca0cb3fd6f1ffde8192bfe58f0822bbbc1f55bddf6b4fe9c8f2b0eac", + "wx": "3d2e916055c92e1b36133f5937b37c1b0102834eb77008a3ba9c3da446e9065971d68ba913091851e10cff5b4cd875c1", + "wy": "39aa7aadfc2caf7107b17ae1aea8b299d61bf15aca0cb3fd6f1ffde8192bfe58f0822bbbc1f55bddf6b4fe9c8f2b0eac" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043d2e916055c92e1b36133f5937b37c1b0102834eb77008a3ba9c3da446e9065971d68ba913091851e10cff5b4cd875c139aa7aadfc2caf7107b17ae1aea8b299d61bf15aca0cb3fd6f1ffde8192bfe58f0822bbbc1f55bddf6b4fe9c8f2b0eac", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEPS6RYFXJLhs2Ez9ZN7N8GwECg063cAij\nupw9pEbpBllx1oupEwkYUeEM/1tM2HXBOap6rfwsr3EHsXrhrqiymdYb8VrKDLP9\nbx/96Bkr/ljwgiu7wfVb3fa0/pyPKw6s\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 429, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0230533b0d50480a3ef07e7e8af8b1097759bc03ac9a1c7ed6075a052869f57f12b285613162d08ee7aab9fe54aaa984a39a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04ae596697427aa250156c05ac4338e48980a7f093ea1f1fe67098b43f6539c1b20ae74338f9bf270d33663c50abe8fd001ca6a52732db74ab15d2f249a3d839080f898367dfd64992cdce2708deaad523a2a236b43400424241c91a35b530fa50", + "wx": "00ae596697427aa250156c05ac4338e48980a7f093ea1f1fe67098b43f6539c1b20ae74338f9bf270d33663c50abe8fd00", + "wy": "1ca6a52732db74ab15d2f249a3d839080f898367dfd64992cdce2708deaad523a2a236b43400424241c91a35b530fa50" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004ae596697427aa250156c05ac4338e48980a7f093ea1f1fe67098b43f6539c1b20ae74338f9bf270d33663c50abe8fd001ca6a52732db74ab15d2f249a3d839080f898367dfd64992cdce2708deaad523a2a236b43400424241c91a35b530fa50", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAErllml0J6olAVbAWsQzjkiYCn8JPqHx/m\ncJi0P2U5wbIK50M4+b8nDTNmPFCr6P0AHKalJzLbdKsV0vJJo9g5CA+Jg2ff1kmS\nzc4nCN6q1SOioja0NABCQkHJGjW1MPpQ\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 430, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100d49a253986bbaa8ce9c3d3808313d39c3b950a478372edc009bc0566b73be7b05dad0737e16960257cc16db6ec6c620f", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0488738f9981dd4d1fabb60ad83c2dd6dfc9da302209ae3e53498a883b6e39a38bead9b02709f352d3e6b6578154eab2529388a05c6b9f3a4028abb9950a51f5264ecd7580a423fdec9472faeeb57f92e31c46bef2a781fe5edad026009f198262", + "wx": "0088738f9981dd4d1fabb60ad83c2dd6dfc9da302209ae3e53498a883b6e39a38bead9b02709f352d3e6b6578154eab252", + "wy": "009388a05c6b9f3a4028abb9950a51f5264ecd7580a423fdec9472faeeb57f92e31c46bef2a781fe5edad026009f198262" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000488738f9981dd4d1fabb60ad83c2dd6dfc9da302209ae3e53498a883b6e39a38bead9b02709f352d3e6b6578154eab2529388a05c6b9f3a4028abb9950a51f5264ecd7580a423fdec9472faeeb57f92e31c46bef2a781fe5edad026009f198262", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEiHOPmYHdTR+rtgrYPC3W38naMCIJrj5T\nSYqIO245o4vq2bAnCfNS0+a2V4FU6rJSk4igXGufOkAoq7mVClH1Jk7NdYCkI/3s\nlHL67rV/kuMcRr7yp4H+XtrQJgCfGYJi\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 431, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd0230285090b0d6a6820bbba394efbee5c24a2281e825d2f6c55fb7a85b8251db00f75ab07cc993ceaf664f3c116baf34b021", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04f421541311c94fdd79fc298f8ab1a3adfd08029fdad439a94d4cea11f7e799bc439609f2fb7be3f349d55e484d0a0d36b35330bbdbec1e75f2984483d96bf210d722c1830292ffc35a2f6a21a4b50519f565f024bbccc97228a2f8ad8fadc0d5", + "wx": "00f421541311c94fdd79fc298f8ab1a3adfd08029fdad439a94d4cea11f7e799bc439609f2fb7be3f349d55e484d0a0d36", + "wy": "00b35330bbdbec1e75f2984483d96bf210d722c1830292ffc35a2f6a21a4b50519f565f024bbccc97228a2f8ad8fadc0d5" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004f421541311c94fdd79fc298f8ab1a3adfd08029fdad439a94d4cea11f7e799bc439609f2fb7be3f349d55e484d0a0d36b35330bbdbec1e75f2984483d96bf210d722c1830292ffc35a2f6a21a4b50519f565f024bbccc97228a2f8ad8fadc0d5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE9CFUExHJT915/CmPirGjrf0IAp/a1Dmp\nTUzqEffnmbxDlgny+3vj80nVXkhNCg02s1Mwu9vsHnXymESD2WvyENciwYMCkv/D\nWi9qIaS1BRn1ZfAku8zJciii+K2PrcDV\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 432, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100b39af4a81ee4ae79064ed80f27e1432e84845f15ece399f2a43d2505a0a8c72c5731f4fd967420b1000e3f75502ed7b7", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04399be4cfc439f94f2421cbd34c2cd90bae53eb60ddfafca52f7275d165d14fa659b636713b5d4b39e62fd48bae141d0e1b23e3b4f0c202ed7b59db78a35c12ac698c603eab144fd09ac2ed8f4495f607e4d2c87a23ce2ec33e410ca47ecc2555", + "wx": "399be4cfc439f94f2421cbd34c2cd90bae53eb60ddfafca52f7275d165d14fa659b636713b5d4b39e62fd48bae141d0e", + "wy": "1b23e3b4f0c202ed7b59db78a35c12ac698c603eab144fd09ac2ed8f4495f607e4d2c87a23ce2ec33e410ca47ecc2555" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004399be4cfc439f94f2421cbd34c2cd90bae53eb60ddfafca52f7275d165d14fa659b636713b5d4b39e62fd48bae141d0e1b23e3b4f0c202ed7b59db78a35c12ac698c603eab144fd09ac2ed8f4495f607e4d2c87a23ce2ec33e410ca47ecc2555", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEOZvkz8Q5+U8kIcvTTCzZC65T62Dd+vyl\nL3J10WXRT6ZZtjZxO11LOeYv1IuuFB0OGyPjtPDCAu17Wdt4o1wSrGmMYD6rFE/Q\nmsLtj0SV9gfk0sh6I84uwz5BDKR+zCVV\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 433, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100af4a81ee4ae79064ed80f27e1432e84845f15ece399f2cbf28df829ccd30f5ef62ec23957b837d73fe4e156edccd4465", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041578bbff72137c4bca33d7385a892be94cb059f9091ddfe890345f712a9fba5fc77084cec11084ed048491604a07f66c76bbaa872f0710d82a08d9dddd833c7be7c7e8e265f49145157eb4e8e8280076a37ee5873271db510034da19da24415b", + "wx": "1578bbff72137c4bca33d7385a892be94cb059f9091ddfe890345f712a9fba5fc77084cec11084ed048491604a07f66c", + "wy": "76bbaa872f0710d82a08d9dddd833c7be7c7e8e265f49145157eb4e8e8280076a37ee5873271db510034da19da24415b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041578bbff72137c4bca33d7385a892be94cb059f9091ddfe890345f712a9fba5fc77084cec11084ed048491604a07f66c76bbaa872f0710d82a08d9dddd833c7be7c7e8e265f49145157eb4e8e8280076a37ee5873271db510034da19da24415b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEFXi7/3ITfEvKM9c4Wokr6UywWfkJHd/o\nkDRfcSqful/HcITOwRCE7QSEkWBKB/Zsdruqhy8HENgqCNnd3YM8e+fH6OJl9JFF\nFX606OgoAHajfuWHMnHbUQA02hnaJEFb\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 434, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02305e9503dc95cf20c9db01e4fc2865d0908be2bd9c733e597e8a5bb7b7a62abdff6dbe3978ae56536d0fb01172ecd55f57", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0433ba451c85e729058f83041077a4695eb47df93e718b09a4618c753ac803cd75c1a91290c2ff5a635389d07149571dab1fc7d8a71776851ff244ff632fe6f92e1652e5284893c4244fe775d8efc589d823dd03f3919027f004537bd8ee09f3a3", + "wx": "33ba451c85e729058f83041077a4695eb47df93e718b09a4618c753ac803cd75c1a91290c2ff5a635389d07149571dab", + "wy": "1fc7d8a71776851ff244ff632fe6f92e1652e5284893c4244fe775d8efc589d823dd03f3919027f004537bd8ee09f3a3" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000433ba451c85e729058f83041077a4695eb47df93e718b09a4618c753ac803cd75c1a91290c2ff5a635389d07149571dab1fc7d8a71776851ff244ff632fe6f92e1652e5284893c4244fe775d8efc589d823dd03f3919027f004537bd8ee09f3a3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEM7pFHIXnKQWPgwQQd6RpXrR9+T5xiwmk\nYYx1OsgDzXXBqRKQwv9aY1OJ0HFJVx2rH8fYpxd2hR/yRP9jL+b5LhZS5ShIk8Qk\nT+d12O/Fidgj3QPzkZAn8ARTe9juCfOj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 435, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02301ee4ae79064ed80f27e1432e84845f15ece399f2cbf4fa31a3ae8edab84dc3330a39f70938e3912bd59753de5aed3088", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04040771e3390216fed2c6208bdf5bfea83ab1915b166e626569f12efd410a39b7e7c76f70f0012843a26debf4ccc33ddae5bc5f7e62d054eac31cd022afdb71b7c638f24c30cbad0ef35ed2fc9917f356e9c3f04391b21d1035274b81537fcbf3", + "wx": "040771e3390216fed2c6208bdf5bfea83ab1915b166e626569f12efd410a39b7e7c76f70f0012843a26debf4ccc33dda", + "wy": "00e5bc5f7e62d054eac31cd022afdb71b7c638f24c30cbad0ef35ed2fc9917f356e9c3f04391b21d1035274b81537fcbf3" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004040771e3390216fed2c6208bdf5bfea83ab1915b166e626569f12efd410a39b7e7c76f70f0012843a26debf4ccc33ddae5bc5f7e62d054eac31cd022afdb71b7c638f24c30cbad0ef35ed2fc9917f356e9c3f04391b21d1035274b81537fcbf3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEBAdx4zkCFv7SxiCL31v+qDqxkVsWbmJl\nafEu/UEKObfnx29w8AEoQ6Jt6/TMwz3a5bxffmLQVOrDHNAir9txt8Y48kwwy60O\n817S/JkX81bpw/BDkbIdEDUnS4FTf8vz\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 436, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100bb51cd3ba8eb201f53ddb4e34e08c0ff7dff9378106784d798d5a3440bd6dc34be3a0eaef8776619a0c97fefb15720b3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0498d3f16e1c510a933e648e78d01588319f002e9475df8942a2a89db0666bb7c88b32bb248140e44ac4ab28111b2b792399a926f4a66fbe28ff65c09f8306893aec094b89d0fe529e3577c5ecf30a7944caaf530f4575eb113fcf4c200d2dd4bd", + "wx": "0098d3f16e1c510a933e648e78d01588319f002e9475df8942a2a89db0666bb7c88b32bb248140e44ac4ab28111b2b7923", + "wy": "0099a926f4a66fbe28ff65c09f8306893aec094b89d0fe529e3577c5ecf30a7944caaf530f4575eb113fcf4c200d2dd4bd" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000498d3f16e1c510a933e648e78d01588319f002e9475df8942a2a89db0666bb7c88b32bb248140e44ac4ab28111b2b792399a926f4a66fbe28ff65c09f8306893aec094b89d0fe529e3577c5ecf30a7944caaf530f4575eb113fcf4c200d2dd4bd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEmNPxbhxRCpM+ZI540BWIMZ8ALpR134lC\noqidsGZrt8iLMrskgUDkSsSrKBEbK3kjmakm9KZvvij/ZcCfgwaJOuwJS4nQ/lKe\nNXfF7PMKeUTKr1MPRXXrET/PTCANLdS9\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 437, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100e707e267ea635384a6da09823149f5cb7acbb29e910d2630c5fb5afbc42aa8436349b214a3b8fb9481ec999e005091f8", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04d1fd602feef80be9e55a19d1a9799c72a899110c6ac21fb3c21357069809d591a8775b64d1867a8cfff124f6a5e3a4f5f9548064f01b9af8868705493a37a037193b48f53b7c7973023f53e6ceff6830ca2f7a14ef51536d453af43b3058d8a9", + "wx": "00d1fd602feef80be9e55a19d1a9799c72a899110c6ac21fb3c21357069809d591a8775b64d1867a8cfff124f6a5e3a4f5", + "wy": "00f9548064f01b9af8868705493a37a037193b48f53b7c7973023f53e6ceff6830ca2f7a14ef51536d453af43b3058d8a9" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004d1fd602feef80be9e55a19d1a9799c72a899110c6ac21fb3c21357069809d591a8775b64d1867a8cfff124f6a5e3a4f5f9548064f01b9af8868705493a37a037193b48f53b7c7973023f53e6ceff6830ca2f7a14ef51536d453af43b3058d8a9", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE0f1gL+74C+nlWhnRqXmccqiZEQxqwh+z\nwhNXBpgJ1ZGod1tk0YZ6jP/xJPal46T1+VSAZPAbmviGhwVJOjegNxk7SPU7fHlz\nAj9T5s7/aDDKL3oU71FTbUU69DswWNip\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 438, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100acc4f2afb7f5c10f818175074ef688a643fc5365e38129f86d5e2517feb81b2cd2b8dc4f7821bfd032edc4c0234085d9", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0482f37604f66664c2883dba6d98397c281045cbf59f1d16dddb1381126a246553a8b4d2aaea48ad9185a1645f65567d318a4d7b19f1d2e4434c9a8ecad396304abc82221bbab0679935071c72fd975e7b021c04b1d16ea36fc2d051ef5a8e117c", + "wx": "0082f37604f66664c2883dba6d98397c281045cbf59f1d16dddb1381126a246553a8b4d2aaea48ad9185a1645f65567d31", + "wy": "008a4d7b19f1d2e4434c9a8ecad396304abc82221bbab0679935071c72fd975e7b021c04b1d16ea36fc2d051ef5a8e117c" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000482f37604f66664c2883dba6d98397c281045cbf59f1d16dddb1381126a246553a8b4d2aaea48ad9185a1645f65567d318a4d7b19f1d2e4434c9a8ecad396304abc82221bbab0679935071c72fd975e7b021c04b1d16ea36fc2d051ef5a8e117c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEgvN2BPZmZMKIPbptmDl8KBBFy/WfHRbd\n2xOBEmokZVOotNKq6kitkYWhZF9lVn0xik17GfHS5ENMmo7K05YwSryCIhu6sGeZ\nNQcccv2XXnsCHASx0W6jb8LQUe9ajhF8\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 439, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02310083276c0793f0a19742422f8af671ccf965fa7d18d541bef4c05b90e303f891d39008439e0fda4bfad5ee9a6ace7e340c", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04f052dfc27bf8a6d36f3739f239b981f5b53fe08d999ec683b01e43e7596156206ba08b8b9f59229e2fbdce05f1e40f9990f0fdfb7029f9b3e8c6144dad0339208b7cdcb3820a554259db9d27afdd18f4a750296c59bad6b62df076f90d53be0d", + "wx": "00f052dfc27bf8a6d36f3739f239b981f5b53fe08d999ec683b01e43e7596156206ba08b8b9f59229e2fbdce05f1e40f99", + "wy": "0090f0fdfb7029f9b3e8c6144dad0339208b7cdcb3820a554259db9d27afdd18f4a750296c59bad6b62df076f90d53be0d" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004f052dfc27bf8a6d36f3739f239b981f5b53fe08d999ec683b01e43e7596156206ba08b8b9f59229e2fbdce05f1e40f9990f0fdfb7029f9b3e8c6144dad0339208b7cdcb3820a554259db9d27afdd18f4a750296c59bad6b62df076f90d53be0d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE8FLfwnv4ptNvNznyObmB9bU/4I2ZnsaD\nsB5D51lhViBroIuLn1kini+9zgXx5A+ZkPD9+3Ap+bPoxhRNrQM5IIt83LOCClVC\nWdudJ6/dGPSnUClsWbrWti3wdvkNU74N\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 440, + "comment": "edge case for u1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100942848586b534105ddd1ca77df72e1251140f412e97b62afbf85d4822309176b5965453dee3fab709e14156b3dfcecca", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04f877bd6e2a9273e322a3298ea3add13d1104b32172283669ca6688f0cb591524a7f15dd41496681eda98939aae729fede85ca37c81ef19e3dc9ab16908a3720d86875a51a6a6d932e37492a6ec7a344eabc482377f14891fbd1da7faeffa1178", + "wx": "00f877bd6e2a9273e322a3298ea3add13d1104b32172283669ca6688f0cb591524a7f15dd41496681eda98939aae729fed", + "wy": "00e85ca37c81ef19e3dc9ab16908a3720d86875a51a6a6d932e37492a6ec7a344eabc482377f14891fbd1da7faeffa1178" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004f877bd6e2a9273e322a3298ea3add13d1104b32172283669ca6688f0cb591524a7f15dd41496681eda98939aae729fede85ca37c81ef19e3dc9ab16908a3720d86875a51a6a6d932e37492a6ec7a344eabc482377f14891fbd1da7faeffa1178", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+He9biqSc+MioymOo63RPREEsyFyKDZp\nymaI8MtZFSSn8V3UFJZoHtqYk5qucp/t6FyjfIHvGePcmrFpCKNyDYaHWlGmptky\n43SSpux6NE6rxII3fxSJH70dp/rv+hF4\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 441, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02307fffffffffffffffffffffffffffffffffffffffffffffffed2119d5fc12649fc808af3b6d9037d3a44eb32399970dd0", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0414249bbcfeeceab06c75654d361c0df8d56b320ea3bc1d4627ec0a2f4b8fa3577445694664f569a91f480741381e494a28479f2186d715a56788f67073056aa0cb0b6a7f7893e77b9a6976ef6663d80226896d7f43bb502e1b4d49558a27dd8b", + "wx": "14249bbcfeeceab06c75654d361c0df8d56b320ea3bc1d4627ec0a2f4b8fa3577445694664f569a91f480741381e494a", + "wy": "28479f2186d715a56788f67073056aa0cb0b6a7f7893e77b9a6976ef6663d80226896d7f43bb502e1b4d49558a27dd8b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000414249bbcfeeceab06c75654d361c0df8d56b320ea3bc1d4627ec0a2f4b8fa3577445694664f569a91f480741381e494a28479f2186d715a56788f67073056aa0cb0b6a7f7893e77b9a6976ef6663d80226896d7f43bb502e1b4d49558a27dd8b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEFCSbvP7s6rBsdWVNNhwN+NVrMg6jvB1G\nJ+wKL0uPo1d0RWlGZPVpqR9IB0E4HklKKEefIYbXFaVniPZwcwVqoMsLan94k+d7\nmml272Zj2AImiW1/Q7tQLhtNSVWKJ92L\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 442, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023079b95c013b0472de04d8faeec3b779c39fe729ea84fb554cd091c7178c2f054eabbc62c3e1cfbac2c2e69d7aa45d9072", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0450a438c98ee94025ce13e27d36b8280d4843585836eb47011a070cd77729245684a0db31fde980620349c796832b2c6cbdb72dba9f3f9cc878559f50b6bd1290f10a6bccbc1eeef7708b1b72059022987979e35221c51259f337c7288a2f86bc", + "wx": "50a438c98ee94025ce13e27d36b8280d4843585836eb47011a070cd77729245684a0db31fde980620349c796832b2c6c", + "wy": "00bdb72dba9f3f9cc878559f50b6bd1290f10a6bccbc1eeef7708b1b72059022987979e35221c51259f337c7288a2f86bc" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000450a438c98ee94025ce13e27d36b8280d4843585836eb47011a070cd77729245684a0db31fde980620349c796832b2c6cbdb72dba9f3f9cc878559f50b6bd1290f10a6bccbc1eeef7708b1b72059022987979e35221c51259f337c7288a2f86bc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEUKQ4yY7pQCXOE+J9NrgoDUhDWFg260cB\nGgcM13cpJFaEoNsx/emAYgNJx5aDKyxsvbctup8/nMh4VZ9Qtr0SkPEKa8y8Hu73\ncIsbcgWQIph5eeNSIcUSWfM3xyiKL4a8\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 443, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100bfd40d0caa4d9d42381f3d72a25683f52b03a1ed96fb72d03f08dcb9a8bc8f23c1a459deab03bcd39396c0d1e9053c81", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044d3fc5dcfaf741113cda3ce2f8dff4c912143e4d36314c361d7ed5656b68448bcca114ba9e8124281234660b7726ddcd680ddfef7ea07bfbcede10803d38d7211631ca11466078819eb66e11921ab7ffa3c4560c732e77595fd408e917dd9afc", + "wx": "4d3fc5dcfaf741113cda3ce2f8dff4c912143e4d36314c361d7ed5656b68448bcca114ba9e8124281234660b7726ddcd", + "wy": "680ddfef7ea07bfbcede10803d38d7211631ca11466078819eb66e11921ab7ffa3c4560c732e77595fd408e917dd9afc" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044d3fc5dcfaf741113cda3ce2f8dff4c912143e4d36314c361d7ed5656b68448bcca114ba9e8124281234660b7726ddcd680ddfef7ea07bfbcede10803d38d7211631ca11466078819eb66e11921ab7ffa3c4560c732e77595fd408e917dd9afc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETT/F3Pr3QRE82jzi+N/0yRIUPk02MUw2\nHX7VZWtoRIvMoRS6noEkKBI0Zgt3Jt3NaA3f736ge/vO3hCAPTjXIRYxyhFGYHiB\nnrZuEZIat/+jxFYMcy53WV/UCOkX3Zr8\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 444, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02304c7d219db9af94ce7fffffffffffffffffffffffffffffffef15cf1058c8d8ba1e634c4122db95ec1facd4bb13ebf09a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0463d65cdfeb1f1a42000f43bd1ddd130537a7b6f635e8d2bd81a97da168221183da433ca78429fd2b33c5f94895a9c13aa9d1d5ea328725653a5a9d00f85a5516236f3b1428a8629287d3b0487a2e82dd57f93bb2aa3d9783dc74131e13756034", + "wx": "63d65cdfeb1f1a42000f43bd1ddd130537a7b6f635e8d2bd81a97da168221183da433ca78429fd2b33c5f94895a9c13a", + "wy": "00a9d1d5ea328725653a5a9d00f85a5516236f3b1428a8629287d3b0487a2e82dd57f93bb2aa3d9783dc74131e13756034" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000463d65cdfeb1f1a42000f43bd1ddd130537a7b6f635e8d2bd81a97da168221183da433ca78429fd2b33c5f94895a9c13aa9d1d5ea328725653a5a9d00f85a5516236f3b1428a8629287d3b0487a2e82dd57f93bb2aa3d9783dc74131e13756034", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEY9Zc3+sfGkIAD0O9Hd0TBTentvY16NK9\ngal9oWgiEYPaQzynhCn9KzPF+UiVqcE6qdHV6jKHJWU6Wp0A+FpVFiNvOxQoqGKS\nh9OwSHougt1X+Tuyqj2Xg9x0Ex4TdWA0\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 445, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100d219db9af94ce7ffffffffffffffffffffffffffffffffffd189bdb6d9ef7be8504ca374756ea5b8f15e44067d209b9b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04d22c9c348b9745711f57debac3a07df90a527c06bd02a8454f41437d54224e071698f03fdc64b1d652414edc3f2239c49ae9812a4b92f099d6659a659691768d57e530ed3c91d5455781605850997a58221f22a2451c3932470606c23f3ab1b8", + "wx": "00d22c9c348b9745711f57debac3a07df90a527c06bd02a8454f41437d54224e071698f03fdc64b1d652414edc3f2239c4", + "wy": "009ae9812a4b92f099d6659a659691768d57e530ed3c91d5455781605850997a58221f22a2451c3932470606c23f3ab1b8" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004d22c9c348b9745711f57debac3a07df90a527c06bd02a8454f41437d54224e071698f03fdc64b1d652414edc3f2239c49ae9812a4b92f099d6659a659691768d57e530ed3c91d5455781605850997a58221f22a2451c3932470606c23f3ab1b8", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE0iycNIuXRXEfV966w6B9+QpSfAa9AqhF\nT0FDfVQiTgcWmPA/3GSx1lJBTtw/IjnEmumBKkuS8JnWZZpllpF2jVflMO08kdVF\nV4FgWFCZelgiHyKiRRw5MkcGBsI/OrG4\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 446, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100a433b735f299cfffffffffffffffffffffffffffffffffffdbb02debbfa7c9f1487f3936a22ca3f6f5d06ea22d7c0dc3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0431f05c0c29e9da49aa2fbbedee770c68d10f85e7f77e72ac3cfa9c8623a2bb42eeb2f24ac8f2aef7ab0c4b47823140035bb32fc1ec04bbff5eab96e070c938ba1b53fe63970f649ae02e2a4ada420a249b6f7c525e2c4b9b0d5562ae26f2278c", + "wx": "31f05c0c29e9da49aa2fbbedee770c68d10f85e7f77e72ac3cfa9c8623a2bb42eeb2f24ac8f2aef7ab0c4b4782314003", + "wy": "5bb32fc1ec04bbff5eab96e070c938ba1b53fe63970f649ae02e2a4ada420a249b6f7c525e2c4b9b0d5562ae26f2278c" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000431f05c0c29e9da49aa2fbbedee770c68d10f85e7f77e72ac3cfa9c8623a2bb42eeb2f24ac8f2aef7ab0c4b47823140035bb32fc1ec04bbff5eab96e070c938ba1b53fe63970f649ae02e2a4ada420a249b6f7c525e2c4b9b0d5562ae26f2278c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEMfBcDCnp2kmqL7vt7ncMaNEPhef3fnKs\nPPqchiOiu0LusvJKyPKu96sMS0eCMUADW7MvwewEu/9eq5bgcMk4uhtT/mOXD2Sa\n4C4qStpCCiSbb3xSXixLmw1VYq4m8ieM\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 447, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100b9af94ce7fffffffffffffffffffffffffffffffffffffffd6efeefc876c9f23217b443c80637ef939e911219f96c179", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04bc26eec95e26c980bc0334264cbcfc26b897c3571c96ce9ab2a67b49bb0f26a6272fdc27806d7a4c572ae0f78149f1f3c8af5f41b99d2066018165513fb3b55e4255dcd0659647ed55e1e2602cae4efbd6eae1dfe2ff63e2c748d4acc7430139", + "wx": "00bc26eec95e26c980bc0334264cbcfc26b897c3571c96ce9ab2a67b49bb0f26a6272fdc27806d7a4c572ae0f78149f1f3", + "wy": "00c8af5f41b99d2066018165513fb3b55e4255dcd0659647ed55e1e2602cae4efbd6eae1dfe2ff63e2c748d4acc7430139" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004bc26eec95e26c980bc0334264cbcfc26b897c3571c96ce9ab2a67b49bb0f26a6272fdc27806d7a4c572ae0f78149f1f3c8af5f41b99d2066018165513fb3b55e4255dcd0659647ed55e1e2602cae4efbd6eae1dfe2ff63e2c748d4acc7430139", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEvCbuyV4myYC8AzQmTLz8JriXw1ccls6a\nsqZ7SbsPJqYnL9wngG16TFcq4PeBSfHzyK9fQbmdIGYBgWVRP7O1XkJV3NBllkft\nVeHiYCyuTvvW6uHf4v9j4sdI1KzHQwE5\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 448, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100a276276276276276276276276276276276276276276276273d7228d4f84b769be0fd57b97e4c1ebcae9a5f635e80e9df", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "046fa0964dd054250af176891c0c822b013b70f059c347172cafc6b36cd16cf3b0f9d19f2598bd0d580ac16c46acb167d4375bef701c002dcc040fd54824b14cc2df0154eb20e74464e1fe7b833426dd7d636bf2d79603fdde5ddaab23ab0cf426", + "wx": "6fa0964dd054250af176891c0c822b013b70f059c347172cafc6b36cd16cf3b0f9d19f2598bd0d580ac16c46acb167d4", + "wy": "375bef701c002dcc040fd54824b14cc2df0154eb20e74464e1fe7b833426dd7d636bf2d79603fdde5ddaab23ab0cf426" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200046fa0964dd054250af176891c0c822b013b70f059c347172cafc6b36cd16cf3b0f9d19f2598bd0d580ac16c46acb167d4375bef701c002dcc040fd54824b14cc2df0154eb20e74464e1fe7b833426dd7d636bf2d79603fdde5ddaab23ab0cf426", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEb6CWTdBUJQrxdokcDIIrATtw8FnDRxcs\nr8azbNFs87D50Z8lmL0NWArBbEassWfUN1vvcBwALcwED9VIJLFMwt8BVOsg50Rk\n4f57gzQm3X1ja/LXlgP93l3aqyOrDPQm\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 449, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023073333333333333333333333333333333333333333333333316e4d9f42d4eca22df403a0c578b86f0a9a93fe89995c7ed", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04baa4e712ee0786a5ab0e5a5dafdcdcf87b38830ab2ec86faedda9fdf65332f6a9688269412f050356530d4664a7fb8cdecc46a901b016e6bb8a336ad9aa6f19abf9ada69705d1c905beafb95a44f52af43de4bf80c050cf996b7796dfcee8e1b", + "wx": "00baa4e712ee0786a5ab0e5a5dafdcdcf87b38830ab2ec86faedda9fdf65332f6a9688269412f050356530d4664a7fb8cd", + "wy": "00ecc46a901b016e6bb8a336ad9aa6f19abf9ada69705d1c905beafb95a44f52af43de4bf80c050cf996b7796dfcee8e1b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004baa4e712ee0786a5ab0e5a5dafdcdcf87b38830ab2ec86faedda9fdf65332f6a9688269412f050356530d4664a7fb8cdecc46a901b016e6bb8a336ad9aa6f19abf9ada69705d1c905beafb95a44f52af43de4bf80c050cf996b7796dfcee8e1b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEuqTnEu4HhqWrDlpdr9zc+Hs4gwqy7Ib6\n7dqf32UzL2qWiCaUEvBQNWUw1GZKf7jN7MRqkBsBbmu4ozatmqbxmr+a2mlwXRyQ\nW+r7laRPUq9D3kv4DAUM+Za3eW387o4b\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 450, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02307fffffffffffffffffffffffffffffffffffffffffffffffda4233abf824c93f90115e76db206fa7489d6647332e1ba3", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0481e78a52ae0695583f7a601ab9b6fbfaf434f2befa1f8c833d59deb627a927c2f42d48eb617fe042f584e105c23c2317cf22d565f5f3b425ef7937df629b6864dac71264b288c1a987210f523071319ce3f64411910ac23765c4266e615112bc", + "wx": "0081e78a52ae0695583f7a601ab9b6fbfaf434f2befa1f8c833d59deb627a927c2f42d48eb617fe042f584e105c23c2317", + "wy": "00cf22d565f5f3b425ef7937df629b6864dac71264b288c1a987210f523071319ce3f64411910ac23765c4266e615112bc" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000481e78a52ae0695583f7a601ab9b6fbfaf434f2befa1f8c833d59deb627a927c2f42d48eb617fe042f584e105c23c2317cf22d565f5f3b425ef7937df629b6864dac71264b288c1a987210f523071319ce3f64411910ac23765c4266e615112bc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEgeeKUq4GlVg/emAaubb7+vQ08r76H4yD\nPVnetiepJ8L0LUjrYX/gQvWE4QXCPCMXzyLVZfXztCXveTffYptoZNrHEmSyiMGp\nhyEPUjBxMZzj9kQRkQrCN2XEJm5hURK8\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 451, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306402307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd02303fffffffffffffffffffffffffffffffffffffffffffffffe3b1a6c0fa1b96efac0d06d9245853bd76760cb5666294bb", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0441fa8765b19d3108031e28c9a781a385c9c10b2bfd42e6437e5c4bd711cf2a031750847d17a82f9376a30ae182a6d6e71c20af96324147d4155a4d0c867ca8e36eba204fbed2087e0fcbdc8baabe07bb3123f9f7259e771cd9f1ad17d1a23787", + "wx": "41fa8765b19d3108031e28c9a781a385c9c10b2bfd42e6437e5c4bd711cf2a031750847d17a82f9376a30ae182a6d6e7", + "wy": "1c20af96324147d4155a4d0c867ca8e36eba204fbed2087e0fcbdc8baabe07bb3123f9f7259e771cd9f1ad17d1a23787" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000441fa8765b19d3108031e28c9a781a385c9c10b2bfd42e6437e5c4bd711cf2a031750847d17a82f9376a30ae182a6d6e71c20af96324147d4155a4d0c867ca8e36eba204fbed2087e0fcbdc8baabe07bb3123f9f7259e771cd9f1ad17d1a23787", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEQfqHZbGdMQgDHijJp4GjhcnBCyv9QuZD\nflxL1xHPKgMXUIR9F6gvk3ajCuGCptbnHCCvljJBR9QVWk0Mhnyo4266IE++0gh+\nD8vci6q+B7sxI/n3JZ53HNnxrRfRojeH\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 452, + "comment": "edge case for u2", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "306502307ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffd023100dfea06865526cea11c0f9eb9512b41fa9581d0f6cb7db9680336151dce79de818cdf33c879da322740416d1e5ae532fa", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86b572c1e06dd2c7b94b873f0578fcb2b99d60e246e51245d0804edd44b32f0f000c8f8f88f1d4a65fea51dbbb4ab1e2823", + "wx": "00e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86b", + "wy": "572c1e06dd2c7b94b873f0578fcb2b99d60e246e51245d0804edd44b32f0f000c8f8f88f1d4a65fea51dbbb4ab1e2823" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86b572c1e06dd2c7b94b873f0578fcb2b99d60e246e51245d0804edd44b32f0f000c8f8f88f1d4a65fea51dbbb4ab1e2823", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE5YWgZ9bf83rn8X+BWDEZthKRWXNF8Qes\n/+I3oI9IhtT9+U/mMYLmFDyZviWnt9hrVyweBt0se5S4c/BXj8srmdYOJG5RJF0I\nBO3USzLw8ADI+PiPHUpl/qUdu7SrHigj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 453, + "comment": "point duplication during verification", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3065023100b37699e0d518a4d370dbdaaaea3788850fa03f8186d1f78fdfbae6540aa670b31c8ada0fff3e737bd69520560fe0ce60023064adb4d51a93f96bed4665de2d4e1169cc95819ec6e9333edfd5c07ca134ceef7c95957b719ae349fc439eaa49fbbe34", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86ba8d3e1f922d3846b478c0fa87034d46629f1db91aedba2f7fb122bb4cd0f0ffe3707076fe2b59a015ae2444c54e1d7dc", + "wx": "00e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86b", + "wy": "00a8d3e1f922d3846b478c0fa87034d46629f1db91aedba2f7fb122bb4cd0f0ffe3707076fe2b59a015ae2444c54e1d7dc" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004e585a067d6dff37ae7f17f81583119b61291597345f107acffe237a08f4886d4fdf94fe63182e6143c99be25a7b7d86ba8d3e1f922d3846b478c0fa87034d46629f1db91aedba2f7fb122bb4cd0f0ffe3707076fe2b59a015ae2444c54e1d7dc", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE5YWgZ9bf83rn8X+BWDEZthKRWXNF8Qes\n/+I3oI9IhtT9+U/mMYLmFDyZviWnt9hrqNPh+SLThGtHjA+ocDTUZinx25Gu26L3\n+xIrtM0PD/43Bwdv4rWaAVriRExU4dfc\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 454, + "comment": "duplication bug", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3065023100b37699e0d518a4d370dbdaaaea3788850fa03f8186d1f78fdfbae6540aa670b31c8ada0fff3e737bd69520560fe0ce60023064adb4d51a93f96bed4665de2d4e1169cc95819ec6e9333edfd5c07ca134ceef7c95957b719ae349fc439eaa49fbbe34", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04b4d78cccbced8065c0ebdc330b4670ec99309273e442b9be341196c1043e4441fc57b914085595bfc755c64fc409f0ba01fee31cbbbaed5c1323f09c87df9b0712c12e99733fa23ef91b4e6ca666b09dd7540ebf1068a15155bc069e3d595c8c", + "wx": "00b4d78cccbced8065c0ebdc330b4670ec99309273e442b9be341196c1043e4441fc57b914085595bfc755c64fc409f0ba", + "wy": "01fee31cbbbaed5c1323f09c87df9b0712c12e99733fa23ef91b4e6ca666b09dd7540ebf1068a15155bc069e3d595c8c" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004b4d78cccbced8065c0ebdc330b4670ec99309273e442b9be341196c1043e4441fc57b914085595bfc755c64fc409f0ba01fee31cbbbaed5c1323f09c87df9b0712c12e99733fa23ef91b4e6ca666b09dd7540ebf1068a15155bc069e3d595c8c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEtNeMzLztgGXA69wzC0Zw7JkwknPkQrm+\nNBGWwQQ+REH8V7kUCFWVv8dVxk/ECfC6Af7jHLu67VwTI/Cch9+bBxLBLplzP6I+\n+RtObKZmsJ3XVA6/EGihUVW8Bp49WVyM\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 455, + "comment": "point with x-coordinate 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3035020101023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "046e3c68be53aade81ef89e096d841e2845a23331e7ec8a6a839d58d07fa016c0973ed75de4f99177bfdc74db566e9d15a4972ea08e577ce1f61c13a6ca1bad1deef2982ee01a2826f002b769f2c46098d3baff068a405d09ca3840d2fafe4e46e", + "wx": "6e3c68be53aade81ef89e096d841e2845a23331e7ec8a6a839d58d07fa016c0973ed75de4f99177bfdc74db566e9d15a", + "wy": "4972ea08e577ce1f61c13a6ca1bad1deef2982ee01a2826f002b769f2c46098d3baff068a405d09ca3840d2fafe4e46e" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200046e3c68be53aade81ef89e096d841e2845a23331e7ec8a6a839d58d07fa016c0973ed75de4f99177bfdc74db566e9d15a4972ea08e577ce1f61c13a6ca1bad1deef2982ee01a2826f002b769f2c46098d3baff068a405d09ca3840d2fafe4e46e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEbjxovlOq3oHvieCW2EHihFojMx5+yKao\nOdWNB/oBbAlz7XXeT5kXe/3HTbVm6dFaSXLqCOV3zh9hwTpsobrR3u8pgu4BooJv\nACt2nyxGCY07r/BopAXQnKOEDS+v5ORu\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 456, + "comment": "point with x-coordinate 0", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000023033333333333333333333333333333333333333333333333327e0a919fda4a2c644d202bd41bcee4bc8fc05155c276eb0", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04b101cdb3eba20e112adbb4bbd2cb479a69e590a44ea902631832abfab8af2c3041b3df7f1665b2c6eb533f546217100a1a61aa9951578ad4f00ae17339a8a6f1359bbd0ac355678ed4df21338f08763c1d3702ec132b634c7bcc0118efb1d0dd", + "wx": "00b101cdb3eba20e112adbb4bbd2cb479a69e590a44ea902631832abfab8af2c3041b3df7f1665b2c6eb533f546217100a", + "wy": "1a61aa9951578ad4f00ae17339a8a6f1359bbd0ac355678ed4df21338f08763c1d3702ec132b634c7bcc0118efb1d0dd" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004b101cdb3eba20e112adbb4bbd2cb479a69e590a44ea902631832abfab8af2c3041b3df7f1665b2c6eb533f546217100a1a61aa9951578ad4f00ae17339a8a6f1359bbd0ac355678ed4df21338f08763c1d3702ec132b634c7bcc0118efb1d0dd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEsQHNs+uiDhEq27S70stHmmnlkKROqQJj\nGDKr+rivLDBBs99/FmWyxutTP1RiFxAKGmGqmVFXitTwCuFzOaim8TWbvQrDVWeO\n1N8hM48IdjwdNwLsEytjTHvMARjvsdDd\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 457, + "comment": "comparison with point at infinity ", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326023033333333333333333333333333333333333333333333333327e0a919fda4a2c644d202bd41bcee4bc8fc05155c276eb0", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "046761044a040a4979db269b4a377e42f11b4be0ce24611f677674dcf770f5887ca4db565303283809e6d65f7fc6bc273605c7daa403fca53549f75ff3372909642d02b7fdcac1e68242814d6e925ab01a80836cfbb35581960079e2fb44c0d186", + "wx": "6761044a040a4979db269b4a377e42f11b4be0ce24611f677674dcf770f5887ca4db565303283809e6d65f7fc6bc2736", + "wy": "05c7daa403fca53549f75ff3372909642d02b7fdcac1e68242814d6e925ab01a80836cfbb35581960079e2fb44c0d186" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200046761044a040a4979db269b4a377e42f11b4be0ce24611f677674dcf770f5887ca4db565303283809e6d65f7fc6bc273605c7daa403fca53549f75ff3372909642d02b7fdcac1e68242814d6e925ab01a80836cfbb35581960079e2fb44c0d186", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEZ2EESgQKSXnbJptKN35C8RtL4M4kYR9n\ndnTc93D1iHyk21ZTAyg4CebWX3/GvCc2BcfapAP8pTVJ91/zNykJZC0Ct/3KweaC\nQoFNbpJasBqAg2z7s1WBlgB54vtEwNGG\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 458, + "comment": "extreme value for k and edgecase s", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df61023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "046922c591502f01046fee5617bf16496f58398822e69afa8335308f36c09a8ed437209fefcffbbdf0a4876b35a3c7ab2655854db825b94b3f27e5f892d3bbb6c7240ec922894dd3598e91fcc6134a2b8fd154e1790466906206f0f623416e63a1", + "wx": "6922c591502f01046fee5617bf16496f58398822e69afa8335308f36c09a8ed437209fefcffbbdf0a4876b35a3c7ab26", + "wy": "55854db825b94b3f27e5f892d3bbb6c7240ec922894dd3598e91fcc6134a2b8fd154e1790466906206f0f623416e63a1" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200046922c591502f01046fee5617bf16496f58398822e69afa8335308f36c09a8ed437209fefcffbbdf0a4876b35a3c7ab2655854db825b94b3f27e5f892d3bbb6c7240ec922894dd3598e91fcc6134a2b8fd154e1790466906206f0f623416e63a1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEaSLFkVAvAQRv7lYXvxZJb1g5iCLmmvqD\nNTCPNsCajtQ3IJ/vz/u98KSHazWjx6smVYVNuCW5Sz8n5fiS07u2xyQOySKJTdNZ\njpH8xhNKK4/RVOF5BGaQYgbw9iNBbmOh\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 459, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df6102302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04892dac0e700fc29d1802d9a449a6f56b2172cb1b7d881013cd3b31c0edb052f2d340c8995a4477bcb9225fec15667233cc6c34ae17445444516fd8fd22ee83f79eb0771ebff6677ac5d4e089f87a1c72df957acb24492adcd7c3816b8e0c75b1", + "wx": "00892dac0e700fc29d1802d9a449a6f56b2172cb1b7d881013cd3b31c0edb052f2d340c8995a4477bcb9225fec15667233", + "wy": "00cc6c34ae17445444516fd8fd22ee83f79eb0771ebff6677ac5d4e089f87a1c72df957acb24492adcd7c3816b8e0c75b1" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004892dac0e700fc29d1802d9a449a6f56b2172cb1b7d881013cd3b31c0edb052f2d340c8995a4477bcb9225fec15667233cc6c34ae17445444516fd8fd22ee83f79eb0771ebff6677ac5d4e089f87a1c72df957acb24492adcd7c3816b8e0c75b1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEiS2sDnAPwp0YAtmkSab1ayFyyxt9iBAT\nzTsxwO2wUvLTQMiZWkR3vLkiX+wVZnIzzGw0rhdEVERRb9j9Iu6D956wdx6/9md6\nxdTgifh6HHLflXrLJEkq3NfDgWuODHWx\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 460, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df6102306666666666666666666666666666666666666666666666664fc15233fb49458c89a4057a8379dc9791f80a2ab84edd61", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0401634117e6478ce0568b0a2469237bbac6ff096acb7e514072bf77123cb51ba0cc3e8d69284d534d8e6d1e876cecf22231e5ef04dc96762ce7d5ef3348ad1e241ac797ae3b630ea249afc5139af49b8ef68b32f812d6b514210363d498efc28c", + "wx": "01634117e6478ce0568b0a2469237bbac6ff096acb7e514072bf77123cb51ba0cc3e8d69284d534d8e6d1e876cecf222", + "wy": "31e5ef04dc96762ce7d5ef3348ad1e241ac797ae3b630ea249afc5139af49b8ef68b32f812d6b514210363d498efc28c" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000401634117e6478ce0568b0a2469237bbac6ff096acb7e514072bf77123cb51ba0cc3e8d69284d534d8e6d1e876cecf22231e5ef04dc96762ce7d5ef3348ad1e241ac797ae3b630ea249afc5139af49b8ef68b32f812d6b514210363d498efc28c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEAWNBF+ZHjOBWiwokaSN7usb/CWrLflFA\ncr93Ejy1G6DMPo1pKE1TTY5tHods7PIiMeXvBNyWdizn1e8zSK0eJBrHl647Yw6i\nSa/FE5r0m472izL4Eta1FCEDY9SY78KM\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 461, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df6102310099999999999999999999999999999999999999999999999977a1fb4df8ede852ce760837c536cae35af40f4014764c12", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04675bdc79d8243887fe1b305d12ac10d2e9c0bde070a6e3394cd5f6adfbceda75498b0e7a794c7212f42be93f616744563e96d1bf6f95cdbefa774911ba06463d8a90a0c9d73c9699b061d779dc52496e8ee9b9ae9c5d4d90e89cd1157d811895", + "wx": "675bdc79d8243887fe1b305d12ac10d2e9c0bde070a6e3394cd5f6adfbceda75498b0e7a794c7212f42be93f61674456", + "wy": "3e96d1bf6f95cdbefa774911ba06463d8a90a0c9d73c9699b061d779dc52496e8ee9b9ae9c5d4d90e89cd1157d811895" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004675bdc79d8243887fe1b305d12ac10d2e9c0bde070a6e3394cd5f6adfbceda75498b0e7a794c7212f42be93f616744563e96d1bf6f95cdbefa774911ba06463d8a90a0c9d73c9699b061d779dc52496e8ee9b9ae9c5d4d90e89cd1157d811895", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEZ1vcedgkOIf+GzBdEqwQ0unAveBwpuM5\nTNX2rfvO2nVJiw56eUxyEvQr6T9hZ0RWPpbRv2+Vzb76d0kRugZGPYqQoMnXPJaZ\nsGHXedxSSW6O6bmunF1NkOic0RV9gRiV\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 462, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df61023100db6db6db6db6db6db6db6db6db6db6db6db6db6db6db6db6aae76701acc1950894a89e068772d8b281eef136f8a8fef5", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "040fd1aab89f47b565b8160dfcc433b6408adeb1473c036b26b7ddec714fb4d0e7dd756c88469e86e218813ead8e8e7676f1cc955c4139e0071c0079ec1d77164e0569bdf453837e8b33c98535a0e7c9c61ef24762067bb46b6116ea7909a69b23", + "wx": "0fd1aab89f47b565b8160dfcc433b6408adeb1473c036b26b7ddec714fb4d0e7dd756c88469e86e218813ead8e8e7676", + "wy": "00f1cc955c4139e0071c0079ec1d77164e0569bdf453837e8b33c98535a0e7c9c61ef24762067bb46b6116ea7909a69b23" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200040fd1aab89f47b565b8160dfcc433b6408adeb1473c036b26b7ddec714fb4d0e7dd756c88469e86e218813ead8e8e7676f1cc955c4139e0071c0079ec1d77164e0569bdf453837e8b33c98535a0e7c9c61ef24762067bb46b6116ea7909a69b23", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAED9GquJ9HtWW4Fg38xDO2QIresUc8A2sm\nt93scU+00OfddWyIRp6G4hiBPq2OjnZ28cyVXEE54AccAHnsHXcWTgVpvfRTg36L\nM8mFNaDnycYe8kdiBnu0a2EW6nkJppsj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 463, + "comment": "extreme value for k", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3064023008d999057ba3d2d969260045c55b97f089025959a6f434d651d207d19fb96e9e4fe0e86ebe0e64f85b96a9c75295df6102300eb10e5ab95f2f26a40700b1300fb8c3e754d5c453d9384ecce1daa38135a48a0a96c24efc2a76d00bde1d7aeedf7f6a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0434d74ec088bab6c6323968d1f468993812f690d6edca5b97604d718e12b8cdfdd96d42e57d33afe312f0ee3c3d0a13f786f4922bb2c13bdf7752a3ecb69393e997bd65461c46867ebeef6296b23f2c56df63acfde648f3f5002dbc239ffd1582", + "wx": "34d74ec088bab6c6323968d1f468993812f690d6edca5b97604d718e12b8cdfdd96d42e57d33afe312f0ee3c3d0a13f7", + "wy": "0086f4922bb2c13bdf7752a3ecb69393e997bd65461c46867ebeef6296b23f2c56df63acfde648f3f5002dbc239ffd1582" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000434d74ec088bab6c6323968d1f468993812f690d6edca5b97604d718e12b8cdfdd96d42e57d33afe312f0ee3c3d0a13f786f4922bb2c13bdf7752a3ecb69393e997bd65461c46867ebeef6296b23f2c56df63acfde648f3f5002dbc239ffd1582", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENNdOwIi6tsYyOWjR9GiZOBL2kNbtyluX\nYE1xjhK4zf3ZbULlfTOv4xLw7jw9ChP3hvSSK7LBO993UqPstpOT6Ze9ZUYcRoZ+\nvu9ilrI/LFbfY6z95kjz9QAtvCOf/RWC\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 464, + "comment": "extreme value for k and edgecase s", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7023055555555555555555555555555555555555555555555555542766f2b5167b9f51d5e0490c2e58d28f9a40878eeec6326", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044376c9893e9277296c766a83abbe36b34da7a631f8cbfd32a1888de0dd1455a21a153ea2d61cfa5071fc6be12a658f6b290ba1a8ee8c78b5dd58f9ffcacb22955682eea02429c3fa8cdcb649fa4d007c8693e3f8f3c0a5f3c4de7a51beaa9809", + "wx": "4376c9893e9277296c766a83abbe36b34da7a631f8cbfd32a1888de0dd1455a21a153ea2d61cfa5071fc6be12a658f6b", + "wy": "290ba1a8ee8c78b5dd58f9ffcacb22955682eea02429c3fa8cdcb649fa4d007c8693e3f8f3c0a5f3c4de7a51beaa9809" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044376c9893e9277296c766a83abbe36b34da7a631f8cbfd32a1888de0dd1455a21a153ea2d61cfa5071fc6be12a658f6b290ba1a8ee8c78b5dd58f9ffcacb22955682eea02429c3fa8cdcb649fa4d007c8693e3f8f3c0a5f3c4de7a51beaa9809", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEQ3bJiT6SdylsdmqDq742s02npjH4y/0y\noYiN4N0UVaIaFT6i1hz6UHH8a+EqZY9rKQuhqO6MeLXdWPn/yssilVaC7qAkKcP6\njNy2SfpNAHyGk+P488Cl88TeelG+qpgJ\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 465, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab702302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0410878fc4807f6732a23c883e838e38c787f7088f94c1824b84673e8b9eab16de1544ae4bf2c6fe3fe4fb343b7487e2b43036ff439533d22f951dae966584bafb23b217dcad2f8f4e0e6999c0c4d0f076634be805f676fd2a59c27f9fe7c5d95b", + "wx": "10878fc4807f6732a23c883e838e38c787f7088f94c1824b84673e8b9eab16de1544ae4bf2c6fe3fe4fb343b7487e2b4", + "wy": "3036ff439533d22f951dae966584bafb23b217dcad2f8f4e0e6999c0c4d0f076634be805f676fd2a59c27f9fe7c5d95b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000410878fc4807f6732a23c883e838e38c787f7088f94c1824b84673e8b9eab16de1544ae4bf2c6fe3fe4fb343b7487e2b43036ff439533d22f951dae966584bafb23b217dcad2f8f4e0e6999c0c4d0f076634be805f676fd2a59c27f9fe7c5d95b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEIePxIB/ZzKiPIg+g444x4f3CI+UwYJL\nhGc+i56rFt4VRK5L8sb+P+T7NDt0h+K0MDb/Q5Uz0i+VHa6WZYS6+yOyF9ytL49O\nDmmZwMTQ8HZjS+gF9nb9KlnCf5/nxdlb\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 466, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab702306666666666666666666666666666666666666666666666664fc15233fb49458c89a4057a8379dc9791f80a2ab84edd61", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04036b253e3b4ac88bb8585a2b32b978766a931e5ad0d0e653a2e34b44d6ddcc0d386e20c4def2d8bb3f8da128c1eac69f9c8e3b5ff5dde2205af359b3974d52758d7abae812b8b275e1452c4e59cb62e9b6771d347dbd1dea761c70291cc5e0a6", + "wx": "036b253e3b4ac88bb8585a2b32b978766a931e5ad0d0e653a2e34b44d6ddcc0d386e20c4def2d8bb3f8da128c1eac69f", + "wy": "009c8e3b5ff5dde2205af359b3974d52758d7abae812b8b275e1452c4e59cb62e9b6771d347dbd1dea761c70291cc5e0a6" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004036b253e3b4ac88bb8585a2b32b978766a931e5ad0d0e653a2e34b44d6ddcc0d386e20c4def2d8bb3f8da128c1eac69f9c8e3b5ff5dde2205af359b3974d52758d7abae812b8b275e1452c4e59cb62e9b6771d347dbd1dea761c70291cc5e0a6", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEA2slPjtKyIu4WForMrl4dmqTHlrQ0OZT\nouNLRNbdzA04biDE3vLYuz+NoSjB6safnI47X/Xd4iBa81mzl01SdY16uugSuLJ1\n4UUsTlnLYum2dx00fb0d6nYccCkcxeCm\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 467, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3066023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab702310099999999999999999999999999999999999999999999999977a1fb4df8ede852ce760837c536cae35af40f4014764c12", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "042783c1be922fce155864ecb41d0a316e193a55843e80192f1fe556772f3debd04b9fc93c27bc6f353938886a404419941a352cec336946424fa3c208ea7105f5549edde8688abd305344bf4f66dda7eabcda6f8557c9af88109804d702e9670b", + "wx": "2783c1be922fce155864ecb41d0a316e193a55843e80192f1fe556772f3debd04b9fc93c27bc6f353938886a40441994", + "wy": "1a352cec336946424fa3c208ea7105f5549edde8688abd305344bf4f66dda7eabcda6f8557c9af88109804d702e9670b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200042783c1be922fce155864ecb41d0a316e193a55843e80192f1fe556772f3debd04b9fc93c27bc6f353938886a404419941a352cec336946424fa3c208ea7105f5549edde8688abd305344bf4f66dda7eabcda6f8557c9af88109804d702e9670b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEJ4PBvpIvzhVYZOy0HQoxbhk6VYQ+gBkv\nH+VWdy8969BLn8k8J7xvNTk4iGpARBmUGjUs7DNpRkJPo8II6nEF9VSe3ehoir0w\nU0S/T2bdp+q82m+FV8mviBCYBNcC6WcL\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 468, + "comment": "extreme value for k and s^-1", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3066023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7023100db6db6db6db6db6db6db6db6db6db6db6db6db6db6db6db6aae76701acc1950894a89e068772d8b281eef136f8a8fef5", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04fa92538cdc740368caf16480ff1304cebbbe59a46a7a84603726b9592d105be069df1c61b5974f27e7552f797de97cdb620e03a46da862e4b089bafbb80df8f055c8f47991b3a3ddb2b089aedb2f15841a6a5b5e14c1dc36b3c155c4f74d3409", + "wx": "00fa92538cdc740368caf16480ff1304cebbbe59a46a7a84603726b9592d105be069df1c61b5974f27e7552f797de97cdb", + "wy": "620e03a46da862e4b089bafbb80df8f055c8f47991b3a3ddb2b089aedb2f15841a6a5b5e14c1dc36b3c155c4f74d3409" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004fa92538cdc740368caf16480ff1304cebbbe59a46a7a84603726b9592d105be069df1c61b5974f27e7552f797de97cdb620e03a46da862e4b089bafbb80df8f055c8f47991b3a3ddb2b089aedb2f15841a6a5b5e14c1dc36b3c155c4f74d3409", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+pJTjNx0A2jK8WSA/xMEzru+WaRqeoRg\nNya5WS0QW+Bp3xxhtZdPJ+dVL3l96XzbYg4DpG2oYuSwibr7uA348FXI9HmRs6Pd\nsrCJrtsvFYQaalteFMHcNrPBVcT3TTQJ\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 469, + "comment": "extreme value for k", + "flags": [ + "ArithmeticError" + ], + "msg": "313233343030", + "sig": "3065023100aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab702300eb10e5ab95f2f26a40700b1300fb8c3e754d5c453d9384ecce1daa38135a48a0a96c24efc2a76d00bde1d7aeedf7f6a", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab73617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", + "wx": "00aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", + "wy": "3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab73617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEqofKIr6LBTeOscce8yCtdG4dO2KLp5uY\nWfdB4IJUKjhVAvJdv1UpbDpUXjhydgq3NhfeSpYmLG9dnpi/kpLcKfj0Hb0omhR8\n6doxE7XwuMAKYLHOHX6BnXpDHXyQ6g5f\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 470, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3065023100f9b127f0d81ebcd17b7ba0ea131c660d340b05ce557c82160e0f793de07d38179023942871acb7002dfafdfffc8deace02302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "invalid" + }, + { + "tcId": 471, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "30640230064ed80f27e1432e84845f15ece399f2cbf4fa31aa837de9b953d44413b9f5c7c7f67989d703f07abef11b6ad0373ea502302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7c9e821b569d9d390a26167406d6d23d6070be242d765eb831625ceec4a0f473ef59f4e30e2817e6285bce2846f15f1a0", + "wx": "00aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7", + "wy": "00c9e821b569d9d390a26167406d6d23d6070be242d765eb831625ceec4a0f473ef59f4e30e2817e6285bce2846f15f1a0" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7c9e821b569d9d390a26167406d6d23d6070be242d765eb831625ceec4a0f473ef59f4e30e2817e6285bce2846f15f1a0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEqofKIr6LBTeOscce8yCtdG4dO2KLp5uY\nWfdB4IJUKjhVAvJdv1UpbDpUXjhydgq3yeghtWnZ05CiYWdAbW0j1gcL4kLXZeuD\nFiXO7EoPRz71n04w4oF+YoW84oRvFfGg\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 472, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "3065023100f9b127f0d81ebcd17b7ba0ea131c660d340b05ce557c82160e0f793de07d38179023942871acb7002dfafdfffc8deace02302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "invalid" + }, + { + "tcId": 473, + "comment": "public key shares x-coordinate with generator", + "flags": [ + "PointDuplication" + ], + "msg": "313233343030", + "sig": "30640230064ed80f27e1432e84845f15ece399f2cbf4fa31aa837de9b953d44413b9f5c7c7f67989d703f07abef11b6ad0373ea502302492492492492492492492492492492492492492492492491c7be680477598d6c3716fabc13dcec86afd2833d41c2a7e", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04ffffffffaa63f1a239ac70197c6ebfcea5756dc012123f82c51fa874d66028be00e976a1080606737cc75c40bdfe4aacacbd85389088a62a6398384c22b52d492f23f46e4a27a4724ad55551da5c483438095a247cb0c3378f1f52c3425ff9f1", + "wx": "00ffffffffaa63f1a239ac70197c6ebfcea5756dc012123f82c51fa874d66028be00e976a1080606737cc75c40bdfe4aac", + "wy": "00acbd85389088a62a6398384c22b52d492f23f46e4a27a4724ad55551da5c483438095a247cb0c3378f1f52c3425ff9f1" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004ffffffffaa63f1a239ac70197c6ebfcea5756dc012123f82c51fa874d66028be00e976a1080606737cc75c40bdfe4aacacbd85389088a62a6398384c22b52d492f23f46e4a27a4724ad55551da5c483438095a247cb0c3378f1f52c3425ff9f1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE/////6pj8aI5rHAZfG6/zqV1bcASEj+C\nxR+odNZgKL4A6XahCAYGc3zHXEC9/kqsrL2FOJCIpipjmDhMIrUtSS8j9G5KJ6Ry\nStVVUdpcSDQ4CVokfLDDN48fUsNCX/nx\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 474, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023007648b6660d01ba2520a09d298adf3b1a02c32744bd2877208f5a4162f6c984373139d800a4cdc1ffea15bce4871a0ed02310099fd367012cb9e02cde2749455e0d495c52818f3c14f6e6aad105b0925e2a7290ac4a06d9fadf4b15b578556fe332a5f", + "result": "valid" + }, + { + "tcId": 475, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100a049dcd96c72e4f36144a51bba30417b451a305dd01c9e30a5e04df94342617dc383f17727708e3277cd7246ca44074102303970e264d85b228bf9e9b9c4947c5dd041ea8b5bde30b93aa59fedf2c428d3e2540a54e0530688acccb83ac7b29b79a2", + "result": "valid" + }, + { + "tcId": 476, + "comment": "x-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "30650230441800ea9377c27865be000ad008eb3d7502bdd105824b26d15cf3d06452969a9d0607a915a8fe989215fc4d61af6e05023100dce29faa5137f75ad77e03918c8ee6747cc7a39b0a69f8b915654cac4cf4bfd9c87cc46ae1631b5c6baebd4fc08ff8fd", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04d1827fc6f6f12f21992c5a409a0653b121d2ef02b2b0ab01a9161ce956280740b1e356b255701b0a6ddc9ec2ca8a9422c6ed5d2ced8d8ab7560fa5bb88c738e74541883d8a2b1c0e2ba7e36d030fc4d9bfb8b22f24db897ebac49dd400000000", + "wx": "00d1827fc6f6f12f21992c5a409a0653b121d2ef02b2b0ab01a9161ce956280740b1e356b255701b0a6ddc9ec2ca8a9422", + "wy": "00c6ed5d2ced8d8ab7560fa5bb88c738e74541883d8a2b1c0e2ba7e36d030fc4d9bfb8b22f24db897ebac49dd400000000" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004d1827fc6f6f12f21992c5a409a0653b121d2ef02b2b0ab01a9161ce956280740b1e356b255701b0a6ddc9ec2ca8a9422c6ed5d2ced8d8ab7560fa5bb88c738e74541883d8a2b1c0e2ba7e36d030fc4d9bfb8b22f24db897ebac49dd400000000", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE0YJ/xvbxLyGZLFpAmgZTsSHS7wKysKsB\nqRYc6VYoB0Cx41ayVXAbCm3cnsLKipQixu1dLO2NirdWD6W7iMc450VBiD2KKxwO\nK6fjbQMPxNm/uLIvJNuJfrrEndQAAAAA\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 477, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "306402303244768016457c463b74f2097f216d9670b191f76281c74bc6a1a1971d19f209bf4696468f5eb75d6326a0a43c0a65290230501e0ad985ed9f95697bd17fdbe3f9ca92e0f76426d3664e6896648d9c750bf588d0ce7d011c1a1e8d6c2e082422dc93", + "result": "valid" + }, + { + "tcId": 478, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "306402305e1af40f2480e3d97c4ae4bfd34a9f45269241356f3a46becd86a4a7c9716d73ca5aebdb3db1a7765650666683bc856b02307e7c4b473a2baaa4953785be8aa2a10006f6d36b400ab981864d69cecec046718d0404b9647454b159aa5a92d76d7955", + "result": "valid" + }, + { + "tcId": 479, + "comment": "y-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "306502306688e36a26f15bdc1c3f91367f8a7667f7bb3e30a335d6f0900e9534eb88b260cb29344c723fedfbe7ac9c5a33f4bf0d023100aa35fddf0fdc9017860b378f801cd806f3e2d754cd2fd94eb7bb36a46ce828cef87e9ebbf447068e630b87fee385ad8f", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041099bb45100f55f5a85cca3de2b3bd5e250f4f6fad6631a3156c2e52a33d7d615dd279f79f8b4baff7c713ac00000000e6c9b736a8929f2ed7be0c753a54cbb48b8469e0411eaf93a4a82459ba0b681bba8f5fb383b4906d4901a3303e2f1557", + "wx": "1099bb45100f55f5a85cca3de2b3bd5e250f4f6fad6631a3156c2e52a33d7d615dd279f79f8b4baff7c713ac00000000", + "wy": "00e6c9b736a8929f2ed7be0c753a54cbb48b8469e0411eaf93a4a82459ba0b681bba8f5fb383b4906d4901a3303e2f1557" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041099bb45100f55f5a85cca3de2b3bd5e250f4f6fad6631a3156c2e52a33d7d615dd279f79f8b4baff7c713ac00000000e6c9b736a8929f2ed7be0c753a54cbb48b8469e0411eaf93a4a82459ba0b681bba8f5fb383b4906d4901a3303e2f1557", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEJm7RRAPVfWoXMo94rO9XiUPT2+tZjGj\nFWwuUqM9fWFd0nn3n4tLr/fHE6wAAAAA5sm3NqiSny7Xvgx1OlTLtIuEaeBBHq+T\npKgkWboLaBu6j1+zg7SQbUkBozA+LxVX\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 480, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100d4a8f3b0b4d3a5769e3a0bbc644b35f1d509355ed1fe401e170f667b661f693b32598e8c143a817a958982845042bb48023004cc07578bbd1981dbf6e8a97a354c98d41b8b6f6e8a2c2b1763c7c2a29d79e24f8476075c9aed9aec6c64dff50461ae", + "result": "valid" + }, + { + "tcId": 481, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100c286d1928e9c79fdd3bebdf22a1dbd37c8105e8ecf41e9e3777fe341b6b8d5a89b9d986827d6d1dbb381cd8239484a220230201119ae305b9360aa9b5e5d1567e0674c09e4f025556ebf81b987466b0f421b8d31f72bbe95f3ce2aa9874a84edfd40", + "result": "valid" + }, + { + "tcId": 482, + "comment": "x-coordinate of the public key has many trailing 0's", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100d9c678550167f10c511e62acb4bd0a3f7f336bc090c94e6c6b02622439c348a2159c5f41f9b5aa4b470590d40dcd7cc202301fd5eaee295abb4081cb626745f4ad279ceb44604062830b58e6c0465c562d41f02ba588fc0db1ebbe339cdc008d7a1b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04000000002b089edd754169010145f263f334fc167cc19dae8225970ae19cc8cb7ec73593d6a465c370f5478b0e539d69d1951d597b56a67345acb25809581f07cd0eb78d9538a3f8a65f300e68a1eb78507df76de650e8f8ee63a5f0c5687c98", + "wx": "2b089edd754169010145f263f334fc167cc19dae8225970ae19cc8cb7ec73593d6a465c370f5478b0e539d69", + "wy": "00d1951d597b56a67345acb25809581f07cd0eb78d9538a3f8a65f300e68a1eb78507df76de650e8f8ee63a5f0c5687c98" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004000000002b089edd754169010145f263f334fc167cc19dae8225970ae19cc8cb7ec73593d6a465c370f5478b0e539d69d1951d597b56a67345acb25809581f07cd0eb78d9538a3f8a65f300e68a1eb78507df76de650e8f8ee63a5f0c5687c98", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEAAAAACsInt11QWkBAUXyY/M0/BZ8wZ2u\ngiWXCuGcyMt+xzWT1qRlw3D1R4sOU51p0ZUdWXtWpnNFrLJYCVgfB80Ot42VOKP4\npl8wDmih63hQffdt5lDo+O5jpfDFaHyY\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 483, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023020fee7c71b6cb0d1da3641ec6622c055a3b16a1f596c64b34da1b2d0b868b66a8f0a0d0db983b3dc7e53bb7295da81970231008141a931d3579aec1cac9887d2fff9c6f12d47a27e4aab8cf262a9d14a715bca0b2057cbc3f18b6fd3d1df76f7410f16", + "result": "valid" + }, + { + "tcId": 484, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100913eecc559b3cf7108a65d6cc3076bfdf36c6f94dcc6693d06690470f34a2e81564241e1de5f5f51421de30af467f10f0230649bd3717244e8ef3c6b0eda983f84dca5ea86d1bec15386b9c473ec43a8cd0ba558eee819f791d9ff9272b9afd59551", + "result": "valid" + }, + { + "tcId": 485, + "comment": "x-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3064023023855c46403a97b76cbb316ec3fe7e2c422b818387604bda8c3d91121b4f20179d9107c5f92dedc8b620d7db87fccccd023050f57343ab148e50662320c4161e44543c35bc992011ea5b1680b94382cf224ea0ec5da511e102f566cb67201f30a2ee", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b33600000000208b3f5ad3b3937acc9d606cc5ececab4a701f75ed42957ea4d7858d33f5c26c6ae20a9cccda56996700d6b4", + "wx": "00fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b336", + "wy": "208b3f5ad3b3937acc9d606cc5ececab4a701f75ed42957ea4d7858d33f5c26c6ae20a9cccda56996700d6b4" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b33600000000208b3f5ad3b3937acc9d606cc5ececab4a701f75ed42957ea4d7858d33f5c26c6ae20a9cccda56996700d6b4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+wG6rV8Lj3m5zRBNEqq5MQFGrdfWtMAi\n2HrmcRF4uU1hjKezrxOFSxxYiHnod7M2AAAAACCLP1rTs5N6zJ1gbMXs7KtKcB91\n7UKVfqTXhY0z9cJsauIKnMzaVplnANa0\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 486, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3066023100d200958d491fcebde667cd736c9dba0961c70db2ecaf573c31dd7fa41ecca32b40b5896f9a0ddf272110e3d21e84593a023100c2ecf73943b9adce596bac14fce62495ae93825c5ff6f61c247d1d8afcba52082fc96f63a26e55bccfc3779f88cfd799", + "result": "valid" + }, + { + "tcId": 487, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "306402306ac17d71260c79f81a7566124738cb3ee5d0aa690e73a98ae9e766f1336691e500cad51ba1302366c09cc06b8f7049e0023032ca965d6d7012ec187c7cab9544334d66c2a7658ddefa67e4ad40429815518ecc87b1492ddd57333bd2300b4660a835", + "result": "valid" + }, + { + "tcId": 488, + "comment": "y-coordinate of the public key is small", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3065023100e19a4646f0ed8a271fe86ba533f8be4fd81bbf4674716f668efa89a40cac51eec2a6cfbd92327d25efe91ca4ff712bc502304a86b2e8e12378e633dec2691e3b1eed4e932cc48b28e45fa3d464cc0e948c02cc9decf2bb43b25937fcf37e9ad86ef0", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b336ffffffffdf74c0a52c4c6c8533629f933a131354b58fe08a12bd6a815b287a71cc0a3d92951df5633325a96798ff294b", + "wx": "00fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b336", + "wy": "00ffffffffdf74c0a52c4c6c8533629f933a131354b58fe08a12bd6a815b287a71cc0a3d92951df5633325a96798ff294b" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004fb01baad5f0b8f79b9cd104d12aab9310146add7d6b4c022d87ae6711178b94d618ca7b3af13854b1c588879e877b336ffffffffdf74c0a52c4c6c8533629f933a131354b58fe08a12bd6a815b287a71cc0a3d92951df5633325a96798ff294b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE+wG6rV8Lj3m5zRBNEqq5MQFGrdfWtMAi\n2HrmcRF4uU1hjKezrxOFSxxYiHnod7M2/////990wKUsTGyFM2KfkzoTE1S1j+CK\nEr1qgVsoenHMCj2SlR31YzMlqWeY/ylL\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 489, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3064023015aac6c0f435cb662d110db5cf686caee53c64fe2d6d600a83ebe505a0e6fc62dc5705160477c47528c8c903fa865b5d02307f94ddc01a603f9bec5d10c9f2c89fb23b3ffab6b2b68d0f04336d499085e32d22bf3ab67a49a74c743f72473172b59f", + "result": "valid" + }, + { + "tcId": 490, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "306602310090b95a7d194b73498fba5afc95c1aea9be073162a9edc57c4d12f459f0a1730baf2f87d7d6624aea7b931ec53370fe47023100cbc1ef470e666010604c609384b872db7fa7b8a5a9f20fdefd656be2fcc75db53948102f7ab203ea1860a6a32af246a1", + "result": "valid" + }, + { + "tcId": 491, + "comment": "y-coordinate of the public key is large", + "flags": [ + "EdgeCasePublicKey" + ], + "msg": "4d657373616765", + "sig": "3066023100dd4391ce7557cbd005e3d5d727cd264399dcc3c6501e4547505b6d57b40bbf0a7fac794dcc8d4233159dd0aa40d4e0b9023100a77fa1374fd60aa91600912200fc83c6aa447f8171ecea72ae322df32dccd68951dc5caf6c50380e400e45bf5c0e626b", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-non-minimal-tag", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0429bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc9a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3", + "wx": "29bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc", + "wy": "009a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000429bdb76d5fa741bfd70233cb3a66cc7d44beb3b0663d92a8136650478bcefb61ef182e155a54345a5e8e5e88f064e5bc9a525ab7f764dad3dae1468c2b419f3b62b9ba917d5e8c4fb1ec47404a3fc76474b2713081be9db4c00e043ada9fc4a3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEKb23bV+nQb/XAjPLOmbMfUS+s7BmPZKo\nE2ZQR4vO+2HvGC4VWlQ0Wl6OXojwZOW8mlJat/dk2tPa4UaMK0GfO2K5upF9XoxP\nsexHQEo/x2R0snEwgb6dtMAOBDran8Sj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 492, + "comment": "signature with non-minimal SEQUENCE tag", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "3f1064023032401249714e9091f05a5e109d5c1216fdc05e98614261aa0dbd9e9cd4415dee29238afbd3b103c1e40ee5c9144aee0f02304326756fb2c4fd726360dd6479b5849478c7a9d054a833a58c1631c33b63c3441336ddf2c7fe0ed129aae6d4ddfeb753", + "result": "invalid" + }, + { + "tcId": 493, + "comment": "signature with non-minimal INTEGER tag on r", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "30651f023032401249714e9091f05a5e109d5c1216fdc05e98614261aa0dbd9e9cd4415dee29238afbd3b103c1e40ee5c9144aee0f02304326756fb2c4fd726360dd6479b5849478c7a9d054a833a58c1631c33b63c3441336ddf2c7fe0ed129aae6d4ddfeb753", + "result": "invalid" + }, + { + "tcId": 494, + "comment": "signature with non-minimal INTEGER tag on s", + "flags": [ + "InvalidEncoding" + ], + "msg": "", + "sig": "3065023032401249714e9091f05a5e109d5c1216fdc05e98614261aa0dbd9e9cd4415dee29238afbd3b103c1e40ee5c9144aee0f1f02304326756fb2c4fd726360dd6479b5849478c7a9d054a833a58c1631c33b63c3441336ddf2c7fe0ed129aae6d4ddfeb753", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e", + "wx": "016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f", + "wy": "43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEAW0ttnVhvBJq1sNE1u6ycTqeKJLGSa8P\nAVxrdhfxYMijs6iK3WadcVUCUHPFrFtPQ78u0AiK8IZFyAqgokpWepS6LXlOlonT\nrUsYW8XS3QCDM+LdLrtQaamzIlGjysce\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 495, + "comment": "r = 2, x = 2 is valid", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3036020102023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043354c45736316411d883a2b6fd4db06eba3f265a91b785483a7ae20762fa3c4c079d07ade93074c25bebe755ba359907acba758be8e3c4e0c2e7b81d31296dc4bb0ce13d3eeac936b016260912c6dc0e98c95b2455bf9f9633d80c5430054663", + "wx": "3354c45736316411d883a2b6fd4db06eba3f265a91b785483a7ae20762fa3c4c079d07ade93074c25bebe755ba359907", + "wy": "acba758be8e3c4e0c2e7b81d31296dc4bb0ce13d3eeac936b016260912c6dc0e98c95b2455bf9f9633d80c5430054663" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043354c45736316411d883a2b6fd4db06eba3f265a91b785483a7ae20762fa3c4c079d07ade93074c25bebe755ba359907acba758be8e3c4e0c2e7b81d31296dc4bb0ce13d3eeac936b016260912c6dc0e98c95b2455bf9f9633d80c5430054663", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEM1TEVzYxZBHYg6K2/U2wbro/JlqRt4VI\nOnriB2L6PEwHnQet6TB0wlvr51W6NZkHrLp1i+jjxODC57gdMSltxLsM4T0+6sk2\nsBYmCRLG3A6YyVskVb+fljPYDFQwBUZj\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 496, + "comment": "r = 3, x = 2 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3036020103023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e", + "wx": "016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f", + "wy": "43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004016d2db67561bc126ad6c344d6eeb2713a9e2892c649af0f015c6b7617f160c8a3b3a88add669d7155025073c5ac5b4f43bf2ed0088af08645c80aa0a24a567a94ba2d794e9689d3ad4b185bc5d2dd008333e2dd2ebb5069a9b32251a3cac71e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEAW0ttnVhvBJq1sNE1u6ycTqeKJLGSa8P\nAVxrdhfxYMijs6iK3WadcVUCUHPFrFtPQ78u0AiK8IZFyAqgokpWepS6LXlOlonT\nrUsYW8XS3QCDM+LdLrtQaamzIlGjysce\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 497, + "comment": "r = 2 + n, x = 2 is invalid; r was not reduced mod n", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52975023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "041ffc8be6cf440e2649263c7b0c535b5828effcd7403d1e3c0460b5d06e179eb09f4672c299ef0839719f01e3212522136df29eae630caabbfd328c538de8989e651a6192ba52a7117dccb23d822ccc3e1875a39d8c9621676fc67c952ac6e304", + "wx": "1ffc8be6cf440e2649263c7b0c535b5828effcd7403d1e3c0460b5d06e179eb09f4672c299ef0839719f01e321252213", + "wy": "6df29eae630caabbfd328c538de8989e651a6192ba52a7117dccb23d822ccc3e1875a39d8c9621676fc67c952ac6e304" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200041ffc8be6cf440e2649263c7b0c535b5828effcd7403d1e3c0460b5d06e179eb09f4672c299ef0839719f01e3212522136df29eae630caabbfd328c538de8989e651a6192ba52a7117dccb23d822ccc3e1875a39d8c9621676fc67c952ac6e304", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEH/yL5s9EDiZJJjx7DFNbWCjv/NdAPR48\nBGC10G4XnrCfRnLCme8IOXGfAeMhJSITbfKermMMqrv9MoxTjeiYnmUaYZK6UqcR\nfcyyPYIszD4YdaOdjJYhZ2/GfJUqxuME\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 498, + "comment": "r = n - 2, x = n - 1 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3066023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52971023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "0401b54a697305092bac2939fb906d7471b411c4eba8654169166a5da3810e1fc96795df921f7abbf519be4a027435176ca19012a3518773d508106d4153adee43c3c384fa62ce36a4addea08f593ec9c76b09a6b9c69d29bd7d47eb48e167dd2f", + "wx": "01b54a697305092bac2939fb906d7471b411c4eba8654169166a5da3810e1fc96795df921f7abbf519be4a027435176c", + "wy": "a19012a3518773d508106d4153adee43c3c384fa62ce36a4addea08f593ec9c76b09a6b9c69d29bd7d47eb48e167dd2f" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b810400220362000401b54a697305092bac2939fb906d7471b411c4eba8654169166a5da3810e1fc96795df921f7abbf519be4a027435176ca19012a3518773d508106d4153adee43c3c384fa62ce36a4addea08f593ec9c76b09a6b9c69d29bd7d47eb48e167dd2f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEAbVKaXMFCSusKTn7kG10cbQRxOuoZUFp\nFmpdo4EOH8lnld+SH3q79Rm+SgJ0NRdsoZASo1GHc9UIEG1BU63uQ8PDhPpizjak\nrd6gj1k+ycdrCaa5xp0pvX1H60jhZ90v\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 499, + "comment": "r = 2, x = n + 2 is the smallest possible x with a reduction", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3036020102023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "valid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "043c8ea2db06ef48ecd59f8c0e1accb1d0c40b9f5ff4e5af3d326c9c8cb74bc941b8fa489468a607bb04b9817ce039d6099629deac1964857b6d7268fb3ff50330a6dafc2510f557053bf42f11c61cf85ececc95cfa754725a05f5a8184920056a", + "wx": "3c8ea2db06ef48ecd59f8c0e1accb1d0c40b9f5ff4e5af3d326c9c8cb74bc941b8fa489468a607bb04b9817ce039d609", + "wy": "9629deac1964857b6d7268fb3ff50330a6dafc2510f557053bf42f11c61cf85ececc95cfa754725a05f5a8184920056a" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200043c8ea2db06ef48ecd59f8c0e1accb1d0c40b9f5ff4e5af3d326c9c8cb74bc941b8fa489468a607bb04b9817ce039d6099629deac1964857b6d7268fb3ff50330a6dafc2510f557053bf42f11c61cf85ececc95cfa754725a05f5a8184920056a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEPI6i2wbvSOzVn4wOGsyx0MQLn1/05a89\nMmycjLdLyUG4+kiUaKYHuwS5gXzgOdYJlinerBlkhXttcmj7P/UDMKba/CUQ9VcF\nO/QvEcYc+F7OzJXPp1RyWgX1qBhJIAVq\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 500, + "comment": "r = 3, x = n + 2 is invalid", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "3036020103023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "044e5e4f1a6e97059a6cf2f4e8129e5c7c64cb84f9994a41ff5bf30b29c1bf5ba6898627c91a23c73e05cd1a43c8f908c006a0aed7f1e63a728f87dbd5360a67571a076ab0b4cde81b10d499959814ddb3a8c7854b0bbfa87cc272f90bca2a2254", + "wx": "4e5e4f1a6e97059a6cf2f4e8129e5c7c64cb84f9994a41ff5bf30b29c1bf5ba6898627c91a23c73e05cd1a43c8f908c0", + "wy": "06a0aed7f1e63a728f87dbd5360a67571a076ab0b4cde81b10d499959814ddb3a8c7854b0bbfa87cc272f90bca2a2254" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200044e5e4f1a6e97059a6cf2f4e8129e5c7c64cb84f9994a41ff5bf30b29c1bf5ba6898627c91a23c73e05cd1a43c8f908c006a0aed7f1e63a728f87dbd5360a67571a076ab0b4cde81b10d499959814ddb3a8c7854b0bbfa87cc272f90bca2a2254", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETl5PGm6XBZps8vToEp5cfGTLhPmZSkH/\nW/MLKcG/W6aJhifJGiPHPgXNGkPI+QjABqCu1/HmOnKPh9vVNgpnVxoHarC0zegb\nENSZlZgU3bOox4VLC7+ofMJy+QvKKiJU\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 501, + "comment": "r = p - n + 2, x = 2 is invalid; r is too large to compare r + n with x", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "304d0218389cb27e0bc8d21fa7e5f24cb74f58851313e696333ad68e023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-r-s-edge-cases", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "04a7d0faaa124302cddcc1f46addca5a4cac48e02387ed0c51c46641a58999f16278255343522467f104bb296670458f817896fa77fb2eb80058b4d86b94a633bc82184843c9b163155e3071c4e1c876f6de2c91444393b22019e4f83a8d34b0d2", + "wx": "a7d0faaa124302cddcc1f46addca5a4cac48e02387ed0c51c46641a58999f16278255343522467f104bb296670458f81", + "wy": "7896fa77fb2eb80058b4d86b94a633bc82184843c9b163155e3071c4e1c876f6de2c91444393b22019e4f83a8d34b0d2" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b8104002203620004a7d0faaa124302cddcc1f46addca5a4cac48e02387ed0c51c46641a58999f16278255343522467f104bb296670458f817896fa77fb2eb80058b4d86b94a633bc82184843c9b163155e3071c4e1c876f6de2c91444393b22019e4f83a8d34b0d2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEp9D6qhJDAs3cwfRq3cpaTKxI4COH7QxR\nxGZBpYmZ8WJ4JVNDUiRn8QS7KWZwRY+BeJb6d/suuABYtNhrlKYzvIIYSEPJsWMV\nXjBxxOHIdvbeLJFEQ5OyIBnk+DqNNLDS\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 502, + "comment": "r = 2^384 - n + 2, x = 2 is invalid; r + n is too large to compare r + n with x, and overflows 2^384 bits", + "flags": [ + "ArithmeticError" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "304d0218389cb27e0bc8d220a7e5f24db74f58851313e695333ad68f023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52970", + "result": "invalid" + } + ] + }, + { + "type": "EcdsaVerify", + "source": { + "name": "github/davidben/ecdsa-s-pow2", + "version": "0.1" + }, + "publicKey": { + "type": "EcPublicKey", + "curve": "secp384r1", + "keySize": 384, + "uncompressed": "040a2fc2edd21336babc59da04aa566dc9b6b068162f7970e311136883b61be8f894da03cc8e93a64803d4f4f83a19c1b973076220bf4d40aa9a41cacbafbd32d1f0bd183c327153cd6601bfa81d5e2ec21c0ecc517e004dd3fbedeca7f975a9ed", + "wx": "0a2fc2edd21336babc59da04aa566dc9b6b068162f7970e311136883b61be8f894da03cc8e93a64803d4f4f83a19c1b9", + "wy": "73076220bf4d40aa9a41cacbafbd32d1f0bd183c327153cd6601bfa81d5e2ec21c0ecc517e004dd3fbedeca7f975a9ed" + }, + "publicKeyDer": "3076301006072a8648ce3d020106052b81040022036200040a2fc2edd21336babc59da04aa566dc9b6b068162f7970e311136883b61be8f894da03cc8e93a64803d4f4f83a19c1b973076220bf4d40aa9a41cacbafbd32d1f0bd183c327153cd6601bfa81d5e2ec21c0ecc517e004dd3fbedeca7f975a9ed", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAECi/C7dITNrq8WdoEqlZtybawaBYveXDj\nERNog7Yb6PiU2gPMjpOmSAPU9Pg6GcG5cwdiIL9NQKqaQcrLr70y0fC9GDwycVPN\nZgG/qB1eLsIcDsxRfgBN0/vt7Kf5dant\n-----END PUBLIC KEY-----\n", + "sha": "SHA-384", + "tests": [ + { + "tcId": 503, + "comment": "s = 2^128", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "304502304fd5dd99138e6f1002d2d23591b2f94071a7f5ad49ddb970dc859275bfe51f193470d443e793196901e88bbe749614d702110100000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 504, + "comment": "s = n - 2^128", + "flags": [ + "ValidSignature" + ], + "msg": "68656c6c6f2c20776f726c64", + "sig": "306502304fd5dd99138e6f1002d2d23591b2f94071a7f5ad49ddb970dc859275bfe51f193470d443e793196901e88bbe749614d7023100ffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372dde581a0db248b0a77aecec196accc52973", + "result": "valid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ed25519_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ed25519_test.json new file mode 100644 index 000000000..3f991dd56 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/ed25519_test.json @@ -0,0 +1,4528 @@ +{ + "algorithm": "EDDSA", + "schema": "eddsa_verify_schema_v1.json", + "numberOfTests": 210, + "header": [ + "Test vectors of type EddsaVerify are intended for testing" + ], + "notes": { + "CompressedSignature": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains a signature where r and s overlap or where 0 bytes were cut from the signature. This signature was specifically generated.", + "effect": "The effect of the bug is unclear without further analysis. It could be rather benign and just allow signature malleability in some cases or it could hide a more severe flaw." + }, + "InvalidEncoding": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains a signature with an invalid encoding of the values. The vector checks that invalid encodings are not accepted. For the vectors that modify the encoding of R, S has been recomputed so that the hash matches the modified R and the R recovered from S and the hash equals the original R. Such vectors are accepted only by verifiers that decode R leniently or that compare R to the recovered R incompletely.", + "effect": "Accepting such signatures means the encoding of a signature is not unique. A holder of the private key can generate multiple distinct signatures for the same message, and different verifiers can disagree about which signatures are valid." + }, + "InvalidKtv": { + "bugType": "UNKNOWN", + "description": "The test vector contains a known invalid signature." + }, + "InvalidSignature": { + "bugType": "AUTH_BYPASS", + "description": "The test vector contains a signature with edge case values such as 0 or the order of the group.", + "effect": "The effect of accepting such signatures probably indicates that signatures can be forged without even knowing the message itself." + }, + "Ktv": { + "bugType": "BASIC", + "description": "The test vector contains a known valid signature." + }, + "SignatureMalleability": { + "bugType": "SIGNATURE_MALLEABILITY", + "description": "EdDSA signatures are non-malleable, if implemented correctly. If an implementation fails to check the range of S then it may be possible to modify a signature in such a way that it still verifies. See RFC 8032, Section 5.1.7 and Section 8.4." + }, + "SignatureWithGarbage": { + "bugType": "SIGNATURE_MALLEABILITY", + "description": "The test vector contains a signature with additional content. EdDSA signature are expected to be non-malleable. Signatures of the wrong length should be rejected. See RFC 8032, Section 5.1.7 and Section 8.4." + }, + "TinkOverflow": { + "bugType": "KNOWN_BUG", + "description": "The test vector contains a signature that caused an arithmetic overflow in tink." + }, + "TruncatedSignature": { + "bugType": "AUTH_BYPASS", + "description": "The test vector contains a signature that was truncated.", + "effect": "Accepting such signatures likely means that signatures can be forged." + }, + "Valid": { + "bugType": "BASIC", + "description": "The test vector is an ordinary valid signature." + }, + "SmallOrderPublicKey": { + "bugType": "CAN_OF_WORMS", + "description": "The public key is a canonical point in the Ed25519 torsion subgroup. These signatures satisfy the cofactored verification equation in RFC 8032, Section 5.1.7. Implementations may reject them under a stricter public-key policy.", + "effect": "Verifiers with different public-key validation policies may disagree on these signatures.", + "links": [ + "https://www.rfc-editor.org/rfc/rfc8032#section-5.1.7" + ] + }, + "MixedOrderPublicKey": { + "bugType": "CAN_OF_WORMS", + "description": "The public key has a nonzero torsion component and is not in the prime-order subgroup. Signatures that satisfy the cofactored verification equation in RFC 8032, Section 5.1.7 are acceptable; implementations may reject them under a stricter subgroup policy. Signatures that fail this equation are invalid.", + "effect": "Verifiers with different subgroup policies may disagree on equation-valid signatures.", + "links": [ + "https://github.com/paragonie/sodium_compat/commit/e4d4933af9463a96a1a3cbaeb94327b90e3350ca", + "https://www.rfc-editor.org/rfc/rfc8032#section-5.1.7" + ] + } + }, + "testGroups": [ + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa" + }, + "publicKeyDer": "302a300506032b65700321007d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAfU0Of2FTpptiQrUiq77mhf2kQg+INLEIw72uNp71Sfo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "fU0Of2FTpptiQrUiq77mhf2kQg-INLEIw72uNp71Sfo" + }, + "tests": [ + { + "tcId": 1, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "d4fbdb52bfa726b44d1786a8c0d171c3e62ca83c9e5bbe63de0bb2483f8fd6cc1429ab72cafc41ab56af02ff8fcc43b99bfe4c7ae940f60f38ebaa9d311c4007", + "result": "valid" + }, + { + "tcId": 2, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "78", + "sig": "d80737358ede548acb173ef7e0399f83392fe8125b2ce877de7975d8b726ef5b1e76632280ee38afad12125ea44b961bf92f1178c9fa819d020869975bcbe109", + "result": "valid" + }, + { + "tcId": 3, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d", + "result": "valid" + }, + { + "tcId": 4, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "48656c6c6f", + "sig": "1c1ad976cbaae3b31dee07971cf92c928ce2091a85f5899f5e11ecec90fc9f8e93df18c5037ec9b29c07195ad284e63d548cd0a6fe358cc775bd6c1608d2c905", + "result": "valid" + }, + { + "tcId": 5, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bf0cf5b3a289976458a1be6277a5055545253b45b07dcc1abd96c8b989c00f301", + "result": "valid" + }, + { + "tcId": 6, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "000000000000000000000000", + "sig": "d46543bfb892f84ec124dcdfc847034c19363bf3fc2fa89b1267833a14856e52e60736918783f950b6f1dd8d40dc343247cd43ce054c2d68ef974f7ed0f3c60f", + "result": "valid" + }, + { + "tcId": 7, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", + "sig": "879350045543bc14ed2c08939b68c30d22251d83e018cacbaf0c9d7a48db577e80bdf76ce99e5926762bc13b7b3483260a5ef63d07e34b58eb9c14621ac92f00", + "result": "valid" + }, + { + "tcId": 8, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f60", + "sig": "7bdc3f9919a05f1d5db4a3ada896094f6871c1f37afc75db82ec3147d84d6f237b7e5ecc26b59cfea0c7eaf1052dc427b0f724615be9c3d3e01356c65b9b5109", + "result": "valid" + }, + { + "tcId": 9, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "ffffffffffffffffffffffffffffffff", + "sig": "5dbd7360e55aa38e855d6ad48c34bd35b7871628508906861a7c4776765ed7d1e13d910faabd689ec8618b78295c8ab8f0e19c8b4b43eb8685778499e943ae04", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa" + }, + "publicKeyDer": "302a300506032b65700321007d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAfU0Of2FTpptiQrUiq77mhf2kQg+INLEIw72uNp71Sfo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "fU0Of2FTpptiQrUiq77mhf2kQg-INLEIw72uNp71Sfo" + }, + "tests": [ + { + "tcId": 10, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 11, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "00000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 12, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0000000000000000000000000000000000000000000000000000000000000000ecd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 13, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0000000000000000000000000000000000000000000000000000000000000000edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 14, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0000000000000000000000000000000000000000000000000000000000000000edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "invalid" + }, + { + "tcId": 15, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 16, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "01000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 17, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0100000000000000000000000000000000000000000000000000000000000000ecd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 18, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0100000000000000000000000000000000000000000000000000000000000000edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 19, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "0100000000000000000000000000000000000000000000000000000000000000edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "invalid" + }, + { + "tcId": 20, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edd3f55c1a631258d69cf7a2def9de14000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 21, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edd3f55c1a631258d69cf7a2def9de14000000000000000000000000000000100100000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 22, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010ecd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 23, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 24, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "invalid" + }, + { + "tcId": 25, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 26, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0100000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 27, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fecd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 28, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fedd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010", + "result": "invalid" + }, + { + "tcId": 29, + "comment": "special values for r and s", + "flags": [ + "InvalidSignature" + ], + "msg": "3f", + "sig": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fedffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa" + }, + "publicKeyDer": "302a300506032b65700321007d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAfU0Of2FTpptiQrUiq77mhf2kQg+INLEIw72uNp71Sfo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "fU0Of2FTpptiQrUiq77mhf2kQg-INLEIw72uNp71Sfo" + }, + "tests": [ + { + "tcId": 30, + "comment": "empty signature", + "flags": [ + "TruncatedSignature" + ], + "msg": "54657374", + "sig": "", + "result": "invalid" + }, + { + "tcId": 31, + "comment": "s missing", + "flags": [ + "TruncatedSignature" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab0", + "result": "invalid" + }, + { + "tcId": 32, + "comment": "signature too short", + "flags": [ + "TruncatedSignature" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946", + "result": "invalid" + }, + { + "tcId": 33, + "comment": "signature too long", + "flags": [ + "SignatureWithGarbage" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d2020", + "result": "invalid" + }, + { + "tcId": 34, + "comment": "include pk in signature", + "flags": [ + "SignatureWithGarbage" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "result": "invalid" + }, + { + "tcId": 35, + "comment": "prepending 0 byte to signature", + "flags": [ + "SignatureWithGarbage" + ], + "msg": "54657374", + "sig": "007c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d", + "result": "invalid" + }, + { + "tcId": 36, + "comment": "prepending 0 byte to s", + "flags": [ + "SignatureWithGarbage" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab0007a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d", + "result": "invalid" + }, + { + "tcId": 37, + "comment": "appending 0 byte to signature", + "flags": [ + "SignatureWithGarbage" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b30d00", + "result": "invalid" + }, + { + "tcId": 38, + "comment": "removing 0 byte from signature", + "flags": [ + "CompressedSignature" + ], + "msg": "546573743137", + "sig": "93de3ca252426c95f735cb9edd92e83321ac62372d5aa5b379786bae111ab6b17251330e8f9a7c30d6993137c596007d7b001409287535ac4804e662bc58a3", + "result": "invalid" + }, + { + "tcId": 39, + "comment": "removing 0 byte from signature", + "flags": [ + "CompressedSignature" + ], + "msg": "54657374313236", + "sig": "dffed33a7f420b62bb1731cfd03be805affd18a281ec02b1067ba6e9d20826569e742347df59c88ae96db1f1969fb189b0ec34381d85633e1889da48d95e0e", + "result": "invalid" + }, + { + "tcId": 40, + "comment": "removing leading 0 byte from signature", + "flags": [ + "CompressedSignature" + ], + "msg": "546573743530", + "sig": "6e170c719577c25e0e1e8b8aa7a6346f8b109f37385cc2e85dc3b4c0f46a9c6bcafd67f52324c5dbaf40a1b673fb29c4a56052d2d6999d0838a8337bccb502", + "result": "invalid" + }, + { + "tcId": 41, + "comment": "dropping byte from signature", + "flags": [ + "CompressedSignature" + ], + "msg": "54657374333437", + "sig": "b0928b46e99fbbad3f5cb502d2cd309d94a7e86cfd4d84b1fcf4cea18075a9c36993c0582dba1e9e519fae5a8654f454201ae0c3cb397c37b8f4f8eef18400", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa" + }, + "publicKeyDer": "302a300506032b65700321007d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAfU0Of2FTpptiQrUiq77mhf2kQg+INLEIw72uNp71Sfo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "fU0Of2FTpptiQrUiq77mhf2kQg-INLEIw72uNp71Sfo" + }, + "tests": [ + { + "tcId": 42, + "comment": "modified bit 0 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "647c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2b1d125e5538f38afbcc1c84e489521083041d24bc6240767029da063271a1ff0c", + "result": "invalid" + }, + { + "tcId": 43, + "comment": "modified bit 1 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "677c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bc108ca4b87a49c9ed2cf383aecad8f54a962b2899da891e12004d7993a627e01", + "result": "invalid" + }, + { + "tcId": 44, + "comment": "modified bit 2 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "617c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2b9ce23fc6213ed5b87912e9bbf92f5e2c780eae26d15c50a112d1e97d2ea33c06", + "result": "invalid" + }, + { + "tcId": 45, + "comment": "modified bit 7 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "e57c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bbb3eb51cd98dddb235a5f46f2bded6af184a58d09cce928bda43f41d69118a03", + "result": "invalid" + }, + { + "tcId": 46, + "comment": "modified bit 8 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657d1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bcd237dda9a116501f67a5705a854b9adc304f34720803a91b324f2c13e0f5a09", + "result": "invalid" + }, + { + "tcId": 47, + "comment": "modified bit 16 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1592402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2b6b167bbdc0d881cc04d28905552c1876f3709851abc5007376940cc8a435c300", + "result": "invalid" + }, + { + "tcId": 48, + "comment": "modified bit 31 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1412402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2b7fd2ac7da14afffcceeb13f2a0d6b887941cb1a5eb57a52f3cb131a16cce7b0e", + "result": "invalid" + }, + { + "tcId": 49, + "comment": "modified bit 32 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492412ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2b7373ba13ebbef99cd2a8ead55ce735c987d85a35320925a8e871702dc7c5c40d", + "result": "invalid" + }, + { + "tcId": 50, + "comment": "modified bit 63 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab54e03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bd35bd331c03f0855504ca1cab87b83c36a028425a3cf007ede4f4254c261cb00", + "result": "invalid" + }, + { + "tcId": 51, + "comment": "modified bit 64 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce02e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2bcb35101f73cf467deac8c1a03b6c3dc35af544132734b7e57ab20c89b2e4750d", + "result": "invalid" + }, + { + "tcId": 52, + "comment": "modified bit 97 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f2384d051b9cf3570f1207fc78c1bcc98c281c2bb58d2e8878290bff8d3355fdd4ea381924ee578752354eb6dee678ab4011c301", + "result": "invalid" + }, + { + "tcId": 53, + "comment": "modified bit 127 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d851b9cf3570f1207fc78c1bcc98c281c2bb978c866187ffb1cc7b29a0b4045aefc08768df65717194ff0c6e63f4dea0d02", + "result": "invalid" + }, + { + "tcId": 54, + "comment": "modified bit 240 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281d2b0576ecf8eaf675f00f3dfbe19f75b83b7607a6c96414f6821af920a2498d0305", + "result": "invalid" + }, + { + "tcId": 55, + "comment": "modified bit 247 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c289c2be5241a345c7b5428054c74b7c382fa10d4a5f1e8f8b79a71d3fdea2254f1ff0e", + "result": "invalid" + }, + { + "tcId": 56, + "comment": "modified bit 248 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c2a63950c85cd6dc96364e768de50ff7732b538f8a0b1615d799190ab600849230e", + "result": "invalid" + }, + { + "tcId": 57, + "comment": "modified bit 253 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c0b543bd3da0a56a8c9c152f59c9fec12f31fa66434d48b817b30d90cb4efa8b501", + "result": "invalid" + }, + { + "tcId": 58, + "comment": "modified bit 254 in R. Accepted only by verifiers that ignore this bit when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281c6b8da07efd07a6dafb015ed6a32fe136319a972ffbc341f3a0beae97ccf8136505", + "result": "invalid" + }, + { + "tcId": 59, + "comment": "modified bit 255 in R. This flips the sign of x and yields the canonical encoding of the negated R point. Accepted only by verifiers that ignore the sign of x when comparing R to the recovered R.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "657c1492402ab5ce03e2c3a7f0384d051b9cf3570f1207fc78c1bcc98c281cab227aedf259f910f0f3a759a335062665217925d019173b88917eae294f75d40f", + "result": "invalid" + }, + { + "tcId": 60, + "comment": "R==0", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "0000000000000000000000000000000000000000000000000000000000000000e0b8e7770d51c7a36375d006c5bffd6af43ff54aaf47e4330dc118c71d61ec02", + "result": "invalid" + }, + { + "tcId": 61, + "comment": "invalid R", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff463a1908382e7eb7693acef9884f7cf931a215e0791876be22c631a59881fd0e", + "result": "invalid" + }, + { + "tcId": 62, + "comment": "all bits flipped in R", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "9a83eb6dbfd54a31fc1d3c580fc7b2fae4630ca8f0edf803873e433673d7e3d40e94254586cb6188c5386c3febed477cb9a6cb29e3979adc4cb27cf5278fb70a", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa" + }, + "publicKeyDer": "302a300506032b65700321007d4d0e7f6153a69b6242b522abbee685fda4420f8834b108c3bdae369ef549fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAfU0Of2FTpptiQrUiq77mhf2kQg+INLEIw72uNp71Sfo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "fU0Of2FTpptiQrUiq77mhf2kQg-INLEIw72uNp71Sfo" + }, + "tests": [ + { + "tcId": 63, + "comment": "the encoded s was replaced by s + L. The scalar is unchanged mod L. Accepted only by verifiers that fail to enforce s < L. See RFC 8032, Section 5.1.7.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab067654bce3832c2d76f8f6f5dafc08d9339d4eef676573336a5c51eb6f946b31d", + "result": "invalid" + }, + { + "tcId": 64, + "comment": "the encoded s was replaced by s + 2L. The scalar is unchanged mod L. Accepted only by verifiers that fail to enforce s < L. See RFC 8032, Section 5.1.7.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab05439412b5395d42f462c67008eba6ca839d4eef676573336a5c51eb6f946b32d", + "result": "invalid" + }, + { + "tcId": 65, + "comment": "the encoded s was replaced by s + 4L. The scalar is unchanged mod L. Accepted only by verifiers that fail to enforce s < L. See RFC 8032, Section 5.1.7.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab02ee12ce5875bf9dff26556464bae2ad239d4eef676573336a5c51eb6f946b34d", + "result": "invalid" + }, + { + "tcId": 66, + "comment": "the encoded s was replaced by s + 8L. The scalar is unchanged mod L. Accepted only by verifiers that fail to enforce s < L. See RFC 8032, Section 5.1.7.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab0e2300459f1e742404cd934d2c595a6253ad4eef676573336a5c51eb6f946b38d", + "result": "invalid" + }, + { + "tcId": 67, + "comment": "the encoded s was replaced by s + 2^253. The scalar differs from the valid s mod L, so verification fails even without a range check on s. Accepted only by parsers that silently clear bit 253 of s.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b32d", + "result": "invalid" + }, + { + "tcId": 68, + "comment": "the encoded s was replaced by s + 2^254. The scalar differs from the valid s mod L, so verification fails even without a range check on s. Accepted only by parsers that silently clear bit 254 of s.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b34d", + "result": "invalid" + }, + { + "tcId": 69, + "comment": "the encoded s was replaced by s + 2^255. The scalar differs from the valid s mod L, so verification fails even without a range check on s. Accepted only by parsers that silently clear bit 255 of s.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab07a9155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b38d", + "result": "invalid" + }, + { + "tcId": 70, + "comment": "the encoded s was replaced by s + p where p is the field prime 2^255 - 19. The scalar differs from the valid s mod L, so verification fails even without a range check on s. Accepted only by verifiers that reduce s mod p instead of checking s < L.", + "flags": [ + "SignatureMalleability" + ], + "msg": "54657374", + "sig": "7c38e026f29e14aabd059a0f2db8b0cd783040609a8be684db12f82a27774ab0679155711ecfaf7f99f277bad0c6ae7e39d4eef676573336a5c51eb6f946b38d", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "a12c2beb77265f2aac953b5009349d94155a03ada416aad451319480e983ca4c" + }, + "publicKeyDer": "302a300506032b6570032100a12c2beb77265f2aac953b5009349d94155a03ada416aad451319480e983ca4c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAoSwr63cmXyqslTtQCTSdlBVaA62kFqrUUTGUgOmDykw=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "oSwr63cmXyqslTtQCTSdlBVaA62kFqrUUTGUgOmDykw" + }, + "tests": [ + { + "tcId": 71, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "5056325d2ab440bf30bbf0f7173199aa8b4e6fbc091cf3eb6bc6cf87cd73d992ffc216c85e4ab5b8a0bbc7e9a6e9f8d33b7f6e5ac0ffdc22d9fcaf784af84302", + "result": "valid" + }, + { + "tcId": 72, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "78", + "sig": "481fafbf4364d7b682475282f517a3ac0538c9a6b6a562e99a3d8e5afb4f90a559b056b9f07af023905753b02d95eb329a35c77f154b79abbcd291615ce42f02", + "result": "valid" + }, + { + "tcId": 73, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "54657374", + "sig": "8a9bb4c465a3863abc9fd0dd35d80bb28f7d33d37d74679802d63f82b20da114b8d765a1206b3e9ad7cf2b2d8d778bb8651f1fa992db293c0039eacb6161480f", + "result": "valid" + }, + { + "tcId": 74, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "48656c6c6f", + "sig": "d839c20abfda1fd429531831c64f813f84b913e9928540310cf060b44c3dbf9457d44a7721fdc0d67724ff81cb450dd39b10cfb65db15dda4b8bf09d26bd3801", + "result": "valid" + }, + { + "tcId": 75, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "313233343030", + "sig": "9bbb1052dcfa8ad2715c2eb716ae4f1902dea353d42ee09fd4c0b4fcb8b52b5219e2200016e1199d0061891c263e31b0bc3b55673c19610c4e0fa5408004160b", + "result": "valid" + }, + { + "tcId": 76, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "000000000000000000000000", + "sig": "f63b5c0667c7897fc283296416f7f60e84bbde9cbd832e56be463ed9f568069702b17a2f7c341ebf590706a6388ac76ac613c1675ec0f2c7118f2573422a500b", + "result": "valid" + }, + { + "tcId": 77, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "6161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", + "sig": "1bc44d7001e6b5b9090fef34b2ca480f9786bbefa7d279353e5881e8dfb91b803ccd46500e270ef0109bfd741037558832120bc2a4f20fbe7b5fb3c3aaf23e08", + "result": "valid" + }, + { + "tcId": 78, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f60", + "sig": "ea8e22143b02372e76e99aece3ed36aec529768a27e2bb49bdc135d44378061e1f62d1ac518f33ebf37b2ee8cc6dde68a4bd7d4a2f4d6cb77f015f71ca9fc30d", + "result": "valid" + }, + { + "tcId": 79, + "comment": "", + "flags": [ + "Valid" + ], + "msg": "ffffffffffffffffffffffffffffffff", + "sig": "8acd679e1a914fc45d5fa83d3021f0509c805c8d271df54e52f43cfbd00cb6222bf81d58fe1de2de378df67ee9f453786626961fe50a9b05f12b6f0899ebdd0a", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" + }, + "publicKeyDer": "302a300506032b6570032100d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo" + }, + "tests": [ + { + "tcId": 80, + "comment": "draft-josefsson-eddsa-ed25519-02: Test 1", + "flags": [ + "Ktv" + ], + "msg": "", + "sig": "e5564300c360ac729086e2cc806e828a84877f1eb8e5d974d873e065224901555fb8821590a33bacc61e39701cf9b46bd25bf5f0595bbe24655141438e7a100b", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c" + }, + "publicKeyDer": "302a300506032b65700321003d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAPUAXw+hDiVqStwqnTRt+vJyYLM8uxJaMwM1V8Sr0Zgw=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "PUAXw-hDiVqStwqnTRt-vJyYLM8uxJaMwM1V8Sr0Zgw" + }, + "tests": [ + { + "tcId": 81, + "comment": "draft-josefsson-eddsa-ed25519-02: Test 2", + "flags": [ + "Ktv" + ], + "msg": "72", + "sig": "92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025" + }, + "publicKeyDer": "302a300506032b6570032100fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA/FHNjmIYoaONpH7QAjDwWAgW7RO6MwOsXeuRFUiQgCU=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "_FHNjmIYoaONpH7QAjDwWAgW7RO6MwOsXeuRFUiQgCU" + }, + "tests": [ + { + "tcId": 82, + "comment": "draft-josefsson-eddsa-ed25519-02: Test 3", + "flags": [ + "Ktv" + ], + "msg": "af82", + "sig": "6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "278117fc144c72340f67d0f2316e8386ceffbf2b2428c9c51fef7c597f1d426e" + }, + "publicKeyDer": "302a300506032b6570032100278117fc144c72340f67d0f2316e8386ceffbf2b2428c9c51fef7c597f1d426e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAJ4EX/BRMcjQPZ9DyMW6Dhs7/vyskKMnFH+98WX8dQm4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "J4EX_BRMcjQPZ9DyMW6Dhs7_vyskKMnFH-98WX8dQm4" + }, + "tests": [ + { + "tcId": 83, + "comment": "draft-josefsson-eddsa-ed25519-02: Test 1024", + "flags": [ + "Ktv" + ], + "msg": "08b8b2b733424243760fe426a4b54908632110a66c2f6591eabd3345e3e4eb98fa6e264bf09efe12ee50f8f54e9f77b1e355f6c50544e23fb1433ddf73be84d879de7c0046dc4996d9e773f4bc9efe5738829adb26c81b37c93a1b270b20329d658675fc6ea534e0810a4432826bf58c941efb65d57a338bbd2e26640f89ffbc1a858efcb8550ee3a5e1998bd177e93a7363c344fe6b199ee5d02e82d522c4feba15452f80288a821a579116ec6dad2b3b310da903401aa62100ab5d1a36553e06203b33890cc9b832f79ef80560ccb9a39ce767967ed628c6ad573cb116dbefefd75499da96bd68a8a97b928a8bbc103b6621fcde2beca1231d206be6cd9ec7aff6f6c94fcd7204ed3455c68c83f4a41da4af2b74ef5c53f1d8ac70bdcb7ed185ce81bd84359d44254d95629e9855a94a7c1958d1f8ada5d0532ed8a5aa3fb2d17ba70eb6248e594e1a2297acbbb39d502f1a8c6eb6f1ce22b3de1a1f40cc24554119a831a9aad6079cad88425de6bde1a9187ebb6092cf67bf2b13fd65f27088d78b7e883c8759d2c4f5c65adb7553878ad575f9fad878e80a0c9ba63bcbcc2732e69485bbc9c90bfbd62481d9089beccf80cfe2df16a2cf65bd92dd597b0707e0917af48bbb75fed413d238f5555a7a569d80c3414a8d0859dc65a46128bab27af87a71314f318c782b23ebfe808b82b0ce26401d2e22f04d83d1255dc51addd3b75a2b1ae0784504df543af8969be3ea7082ff7fc9888c144da2af58429ec96031dbcad3dad9af0dcbaaaf268cb8fcffead94f3c7ca495e056a9b47acdb751fb73e666c6c655ade8297297d07ad1ba5e43f1bca32301651339e22904cc8c42f58c30c04aafdb038dda0847dd988dcda6f3bfd15c4b4c4525004aa06eeff8ca61783aacec57fb3d1f92b0fe2fd1a85f6724517b65e614ad6808d6f6ee34dff7310fdc82aebfd904b01e1dc54b2927094b2db68d6f903b68401adebf5a7e08d78ff4ef5d63653a65040cf9bfd4aca7984a74d37145986780fc0b16ac451649de6188a7dbdf191f64b5fc5e2ab47b57f7f7276cd419c17a3ca8e1b939ae49e488acba6b965610b5480109c8b17b80e1b7b750dfc7598d5d5011fd2dcc5600a32ef5b52a1ecc820e308aa342721aac0943bf6686b64b2579376504ccc493d97e6aed3fb0f9cd71a43dd497f01f17c0e2cb3797aa2a2f256656168e6c496afc5fb93246f6b1116398a346f1a641f3b041e989f7914f90cc2c7fff357876e506b50d334ba77c225bc307ba537152f3f1610e4eafe595f6d9d90d11faa933a15ef1369546868a7f3a45a96768d40fd9d03412c091c6315cf4fde7cb68606937380db2eaaa707b4c4185c32eddcdd306705e4dc1ffc872eeee475a64dfac86aba41c0618983f8741c5ef68d3a101e8a3b8cac60c905c15fc910840b94c00a0b9d0", + "sig": "0aab4c900501b3e24d7cdf4663326a3a87df5e4843b2cbdb67cbf6e460fec350aa5371b1508f9f4528ecea23c436d94b5e8fcd4f681e30a6ac00a9704a188a03", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "100fdf47fb94f1536a4f7c3fda27383fa03375a8f527c537e6f1703c47f94f86" + }, + "publicKeyDer": "302a300506032b6570032100100fdf47fb94f1536a4f7c3fda27383fa03375a8f527c537e6f1703c47f94f86", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEA/fR/uU8VNqT3w/2ic4P6Azdaj1J8U35vFwPEf5T4Y=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "EA_fR_uU8VNqT3w_2ic4P6Azdaj1J8U35vFwPEf5T4Y" + }, + "tests": [ + { + "tcId": 84, + "comment": "Signature with S just under the bound. [David Benjamin]", + "flags": [ + "Ktv" + ], + "msg": "124e583f8b8eca58bb29c271b41d36986bbc45541f8e51f9cb0133eca447601e", + "sig": "dac119d6ca87fc59ae611c157048f4d4fc932a149dbe20ec6effd1436abf83ea05c7df0fef06147241259113909bc71bd3c53ba4464ffcad3c0968f2ffffff0f", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "100fdf47fb94f1536a4f7c3fda27383fa03375a8f527c537e6f1703c47f94f86" + }, + "publicKeyDer": "302a300506032b6570032100100fdf47fb94f1536a4f7c3fda27383fa03375a8f527c537e6f1703c47f94f86", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEA/fR/uU8VNqT3w/2ic4P6Azdaj1J8U35vFwPEf5T4Y=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "EA_fR_uU8VNqT3w_2ic4P6Azdaj1J8U35vFwPEf5T4Y" + }, + "tests": [ + { + "tcId": 85, + "comment": "Signature with S just above the bound. [David Benjamin]", + "flags": [ + "InvalidKtv" + ], + "msg": "6a0bc2b0057cedfc0fa2e3f7f7d39279b30f454a69dfd1117c758d86b19d85e0", + "sig": "0971f86d2c9c78582524a103cb9cf949522ae528f8054dc20107d999be673ff4e25ebf2f2928766b1248bec6e91697775f8446639ede46ad4df4053000000010", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "8fd659b77b558ed93882c1157438450ac86ec62d421d568e98ee236f3810295a" + }, + "publicKeyDer": "302a300506032b65700321008fd659b77b558ed93882c1157438450ac86ec62d421d568e98ee236f3810295a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAj9ZZt3tVjtk4gsEVdDhFCshuxi1CHVaOmO4jbzgQKVo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "j9ZZt3tVjtk4gsEVdDhFCshuxi1CHVaOmO4jbzgQKVo" + }, + "tests": [ + { + "tcId": 86, + "comment": "Random test failure 1", + "flags": [ + "Ktv" + ], + "msg": "b0729a713593a92e46b56eaa66b9e435f7a09a8e7de03b078f6f282285276635f301e7aaafe42187c45d6f5b13f9f16b11195cc125c05b90d24dfe4c", + "sig": "7db17557ac470c0eda4eedaabce99197ab62565653cf911f632ee8be0e5ffcfc88fb94276b42e0798fd3aa2f0318be7fc6a29fae75f70c3dcdc414a0ad866601", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2a606bf67ac770c607038b004101b325edb569efd3413d2d1f2c3e6b4e6e3082" + }, + "publicKeyDer": "302a300506032b65700321002a606bf67ac770c607038b004101b325edb569efd3413d2d1f2c3e6b4e6e3082", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAKmBr9nrHcMYHA4sAQQGzJe21ae/TQT0tHyw+a05uMII=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "KmBr9nrHcMYHA4sAQQGzJe21ae_TQT0tHyw-a05uMII" + }, + "tests": [ + { + "tcId": 87, + "comment": "Random test failure 2", + "flags": [ + "Ktv" + ], + "msg": "a8546e50ba31cae3234310d32672447be213fad91a227a19669c53d309b959782b0e6b71f8791fdb470043b58122003157d2d96a43a6cbd7d3a8d86bf4c97391883e268d50af80e1e6e12939c2bd50ca746cdadfad4edf1bda875299740724148efb1ebe73fb60088cda890317658627a5f7ab5a0c075d9d8f3f97b6492b35519e50ff6b38377432a7081f9176bb1c29a862deac1336ca20b097a47829cec10a6a7cec178eda2d12f6dc6c87f910454af0123555ba184e68804d9cced60fd5c8c90943e56599c8f0ba59a38491ba5e5a53460682474c07e40ca142983314fd762856bb1093f359da6eb0a756bd93a3160c10dd8feea6b97e7c6a17cb54bd5d7649c05c66d7bdee056671dfdaf689fa3945bb8e29a429f4bd5d355dce9687b06f01d5e33e3999f0e8", + "sig": "67d84d4c3945aaf06e06d524be63acbfb5dbb1988c4aea96a5ee9f7a9b9eecc29df4f66b8aa1d9e8607a58fb1ef0c2ad69aac005b4f58e34103344a9c8871a09", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c9c946cbc5544ac74eef491f07c5881c16faf7ec31ce4aa91bb60ae7b4539051" + }, + "publicKeyDer": "302a300506032b6570032100c9c946cbc5544ac74eef491f07c5881c16faf7ec31ce4aa91bb60ae7b4539051", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAyclGy8VUSsdO70kfB8WIHBb69+wxzkqpG7YK57RTkFE=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "yclGy8VUSsdO70kfB8WIHBb69-wxzkqpG7YK57RTkFE" + }, + "tests": [ + { + "tcId": 88, + "comment": "Random test failure 3", + "flags": [ + "Ktv" + ], + "msg": "cd2212eddb0706f62c995cef958634f0cb7793444cbf4d30e81c27c41ebea6cb02607510131f9c015692dfd521b148841e9a2d3564d20ac401f6cb8e40f520fe0cafbeaa88840b83013369d879f013463fe52a13267aa0c8c59c45cde9399cd1e6be8cc64cf48315ac2eb31a1c567a4fb7d601746d1f63b5ac020712adbbe07519bded6f", + "sig": "24087d47f3e20af51b9668ae0a88ce76586802d0ec75d8c0f28fc30962b5e1d1a1d509571a1624ed125a8df92a6e963728d6b5de99200b8e285f70feb6f05207", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 89, + "comment": "Random test failure 4", + "flags": [ + "Ktv" + ], + "msg": "ec5c7cb078", + "sig": "d920d421a5956b69bfe1ba834c025e2babb6c7a6d78c97de1d9bb1116dfdd1185147b2887e34e15578172e150774275ea2aad9e02106f7e8ca1caa669a066f0c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 90, + "comment": "Random test failure 5", + "flags": [ + "Ktv" + ], + "msg": "4668c6a76f0e482190a7175b9f3806a5fe4314a004fa69f988373f7a", + "sig": "4f62daf7f7c162038552ad7d306e195baa37ecf6ca7604142679d7d1128e1f8af52e4cb3545748c44ef1ff1c64e877e4f4d248259b7f6eb56e3ef72097dc8e0c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c29ec1894e06d27b4e40486b4fa5063d66a746c7f9c323b12203c03b72b8b78a" + }, + "publicKeyDer": "302a300506032b6570032100c29ec1894e06d27b4e40486b4fa5063d66a746c7f9c323b12203c03b72b8b78a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAwp7BiU4G0ntOQEhrT6UGPWanRsf5wyOxIgPAO3K4t4o=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "wp7BiU4G0ntOQEhrT6UGPWanRsf5wyOxIgPAO3K4t4o" + }, + "tests": [ + { + "tcId": 91, + "comment": "Random test failure 6", + "flags": [ + "Ktv" + ], + "msg": "0f325ffd87e58131ffa23c05ea4579513b287fdba87b44", + "sig": "6669acf94667c5b541afe5307bde9476b13ae7e0e6058a772101ac8eb0a94331428eb4db0a2c68a9b6c1763b8624dab259b0876cdcfaeacc17b21a18e3fc010a", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10" + }, + "publicKeyDer": "302a300506032b6570032100cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAz9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "z9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA" + }, + "tests": [ + { + "tcId": 92, + "comment": "Random test failure 7", + "flags": [ + "Ktv" + ], + "msg": "ec5c7cb078", + "sig": "30490c28f806298225df62103521dcee047153912c33ab8ab8bbdd1ffabd70fd4fdb360f05be535b067d1cf4e78c2cb432206bf280aab3bd21aaa1cb894c5b06", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 93, + "comment": "Random test failure 8", + "flags": [ + "Ktv" + ], + "msg": "5dc9bb87eb11621a93f92abe53515697d2611b2eef73", + "sig": "deecafb6f2ede73fec91a6f10e45b9c1c61c4b9bfbe6b6147e2de0b1df6938971f7896c3ab83851fb5d9e537037bff0fca0ccb4a3cc38f056f91f7d7a0557e08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10" + }, + "publicKeyDer": "302a300506032b6570032100cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAz9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "z9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA" + }, + "tests": [ + { + "tcId": 94, + "comment": "Random test failure 9", + "flags": [ + "Ktv" + ], + "msg": "67484059b2490b1a0a4f8dee77979e26", + "sig": "4cd4f77ed473a6647387f3163541c67a1708a3c3bd1673247cb87f0cb68b3c56f04bfa72970c8a483efe659c87009ab4020b590b6641316b3deddb5450544e02", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 95, + "comment": "Random test failure 10", + "flags": [ + "Ktv" + ], + "msg": "7dcfe60f881e1285676f35b68a1b2dbcdd7be6f719a288ababc28d36e3a42ac3010a1ca54b32760e74", + "sig": "7f8663cf98cbd39d5ff553f00bcf3d0d520605794f8866ce75714d77cc51e66c91818b657d7b0dae430a68353506edc4a714c345f5ddb5c8b958ba3d035f7a01", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10" + }, + "publicKeyDer": "302a300506032b6570032100cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAz9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "z9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA" + }, + "tests": [ + { + "tcId": 96, + "comment": "Random test failure 11", + "flags": [ + "Ktv" + ], + "msg": "a020a4381dc9141f47ee508871ab7a8b5a3648727c4281ae9932376f23a8e1bcda0626b7129197d864178631ec89c4332dbb18", + "sig": "1e41a24fe732bd7cab14c2a2f5134ee8c87fcbd2e987e60957ed9239e5c32404d56977e1b4282871896cb10625a1937468e4dc266e16a9c1b8e9891177eca802", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 97, + "comment": "Random test failure 12", + "flags": [ + "Ktv" + ], + "msg": "58e456064dff471109def4ca27fa8310a1df32739655b624f27e6418d34b7f007173f3faa5", + "sig": "6aab49e5c0bc309b783378ee03ffda282f0185cdf94c847701ff307a6ee8d0865411c44e0a8206f6a5f606107451940c2593af790ce1860f4c14ab25b2deae08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "529919c9c780985a841c42ba6c180ff2d67a276ccfbe281080e47ab71a758f56" + }, + "publicKeyDer": "302a300506032b6570032100529919c9c780985a841c42ba6c180ff2d67a276ccfbe281080e47ab71a758f56", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAUpkZyceAmFqEHEK6bBgP8tZ6J2zPvigQgOR6txp1j1Y=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "UpkZyceAmFqEHEK6bBgP8tZ6J2zPvigQgOR6txp1j1Y" + }, + "tests": [ + { + "tcId": 98, + "comment": "Random test failure 13", + "flags": [ + "Ktv" + ], + "msg": "e1cbf2d86827825613fb7a85811d", + "sig": "01abfa4d6bbc726b196928ec84fd03f0c953a4fa2b228249562ff1442a4f63a7150b064f3712b51c2af768d2c2711a71aabf8d186833e941a0301b82f0502905", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10" + }, + "publicKeyDer": "302a300506032b6570032100cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAz9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "z9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA" + }, + "tests": [ + { + "tcId": 99, + "comment": "Random test failure 14", + "flags": [ + "Ktv" + ], + "msg": "a25176b3afea318b2ec11ddacb10caf7179c0b3f8eabbfa2895581138d3c1e0e", + "sig": "2a833aadecd9f28235cb5896bf3781521dc71f28af2e91dbe1735a61dce3e31ac15ca24b3fc47817a59d386bbbb2ce60a6adc0a2703bb2bdea8f70f91051f706", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 100, + "comment": "Random test failure 15", + "flags": [ + "Ktv" + ], + "msg": "a1", + "sig": "1a74ed2cbdc7d8f3827014e8e6ecf8fd2698ac8f86833acccdd400df710fe0d6b0543c9cfa00d52bf024ab7ce0d91981944097233ec134d5c7abbd44bfd32d0d", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2252b3d57c74cbf8bc460dc2e082847926bc022f09ab6ae95756362bfd1167c1" + }, + "publicKeyDer": "302a300506032b65700321002252b3d57c74cbf8bc460dc2e082847926bc022f09ab6ae95756362bfd1167c1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAIlKz1Xx0y/i8Rg3C4IKEeSa8Ai8Jq2rpV1Y2K/0RZ8E=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "IlKz1Xx0y_i8Rg3C4IKEeSa8Ai8Jq2rpV1Y2K_0RZ8E" + }, + "tests": [ + { + "tcId": 101, + "comment": "Random test failure 16", + "flags": [ + "Ktv" + ], + "msg": "975ef941710071a9e1e6325a0c860becd7c695b5117c3107b686e330e5", + "sig": "af0fd9dda7e03e12313410d8d8844ebb6fe6b7f65141f22d7bcba5695a25414a9e54326fb44d59fb14707899a8aae70857b23d4080d7ab2c396ef3a36d45ce02", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c0a773110f975de3732355bb7ec7f0c41c091c0252966070205516693b992a4a" + }, + "publicKeyDer": "302a300506032b6570032100c0a773110f975de3732355bb7ec7f0c41c091c0252966070205516693b992a4a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAwKdzEQ+XXeNzI1W7fsfwxBwJHAJSlmBwIFUWaTuZKko=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "wKdzEQ-XXeNzI1W7fsfwxBwJHAJSlmBwIFUWaTuZKko" + }, + "tests": [ + { + "tcId": 102, + "comment": "Random test failure 17", + "flags": [ + "Ktv" + ], + "msg": "", + "sig": "0280427e713378f49d478df6373c6cac847b622b567daa2376c839e7ac10e22c380ab0fa8617c9dcfe76c4d9db5459b21dc1413726e46cc8f387d359e344f407", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10" + }, + "publicKeyDer": "302a300506032b6570032100cfda5b899e35764c5229e59295fe1222b7ddce176643697c29e46ecbba10cf10", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAz9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "z9pbiZ41dkxSKeWSlf4SIrfdzhdmQ2l8KeRuy7oQzxA" + }, + "tests": [ + { + "tcId": 103, + "comment": "Random test failure 18", + "flags": [ + "Ktv" + ], + "msg": "a9e6d94870a67a9fe1cf13b1e6f9150cdd407bf6480ec841ea586ae3935e9787163cf419c1", + "sig": "c97e3190f83bae7729ba473ad46b420b8aad735f0808ea42c0f898ccfe6addd4fd9d9fa3355d5e67ee21ab7e1f805cd07f1fce980e307f4d7ad36cc924eef00c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 104, + "comment": "Random test failure 19", + "flags": [ + "Ktv" + ], + "msg": "11cb1eafa4c42a8402c4193c4696f7b2e6d4585e4b42dcf1a8b67a80b2da80bc9d4b649fb2f35eaf1f56c426fd0b", + "sig": "14ceb2eaf4688d995d482f44852d71ad878cd7c77b41e60b0065fd01a59b054ee74759224187dbde9e59a763a70277c960892ef89fba997aba2576b2c54ba608", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c9c946cbc5544ac74eef491f07c5881c16faf7ec31ce4aa91bb60ae7b4539051" + }, + "publicKeyDer": "302a300506032b6570032100c9c946cbc5544ac74eef491f07c5881c16faf7ec31ce4aa91bb60ae7b4539051", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAyclGy8VUSsdO70kfB8WIHBb69+wxzkqpG7YK57RTkFE=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "yclGy8VUSsdO70kfB8WIHBb69-wxzkqpG7YK57RTkFE" + }, + "tests": [ + { + "tcId": 105, + "comment": "Random test failure 20", + "flags": [ + "Ktv" + ], + "msg": "27d465bc632743522aefa23c", + "sig": "c2656951e2a0285585a51ff0eda7e9a23c2dfd2ffa273aee7808f4604e8f9a8c8ea49e9fce4eb2d8d75d36b7238fe6fc13b6c5d9427dd58f8c6615d033c0bd0f", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c29ec1894e06d27b4e40486b4fa5063d66a746c7f9c323b12203c03b72b8b78a" + }, + "publicKeyDer": "302a300506032b6570032100c29ec1894e06d27b4e40486b4fa5063d66a746c7f9c323b12203c03b72b8b78a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAwp7BiU4G0ntOQEhrT6UGPWanRsf5wyOxIgPAO3K4t4o=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "wp7BiU4G0ntOQEhrT6UGPWanRsf5wyOxIgPAO3K4t4o" + }, + "tests": [ + { + "tcId": 106, + "comment": "Random test failure 21", + "flags": [ + "Ktv" + ], + "msg": "5ffa", + "sig": "931e5152fcef078c22cc5d6a3a65f06e396289f6f5f2d1efa6340254a53526ef5dc6874eeddf35c3f50991c53cd02bf06313e37d93ee1f7022128ffa3b8f300b", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "529919c9c780985a841c42ba6c180ff2d67a276ccfbe281080e47ab71a758f56" + }, + "publicKeyDer": "302a300506032b6570032100529919c9c780985a841c42ba6c180ff2d67a276ccfbe281080e47ab71a758f56", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAUpkZyceAmFqEHEK6bBgP8tZ6J2zPvigQgOR6txp1j1Y=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "UpkZyceAmFqEHEK6bBgP8tZ6J2zPvigQgOR6txp1j1Y" + }, + "tests": [ + { + "tcId": 107, + "comment": "Random test failure 22", + "flags": [ + "Ktv" + ], + "msg": "25", + "sig": "e4ae21f7a8f4b3b325c161a8c6e53e2edd7005b9c2f8a2e3b0ac4ba94aa80be6f2ee22ac8d4a96b9a3eb73a825e7bb5aff4a3393bf5b4a38119e9c9b1b041106", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2252b3d57c74cbf8bc460dc2e082847926bc022f09ab6ae95756362bfd1167c1" + }, + "publicKeyDer": "302a300506032b65700321002252b3d57c74cbf8bc460dc2e082847926bc022f09ab6ae95756362bfd1167c1", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAIlKz1Xx0y/i8Rg3C4IKEeSa8Ai8Jq2rpV1Y2K/0RZ8E=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "IlKz1Xx0y_i8Rg3C4IKEeSa8Ai8Jq2rpV1Y2K_0RZ8E" + }, + "tests": [ + { + "tcId": 108, + "comment": "Random test failure 23", + "flags": [ + "Ktv" + ], + "msg": "80fdd6218f29c8c8f6bd820945f9b0854e3a8824", + "sig": "e097e0bd0370bff5bde359175a11b728ee9639095d5df8eda496395565616edfe079977f7d4dc8c75d6113a83d6a55e6e1676408c0967a2906339b43337dcb01", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2a606bf67ac770c607038b004101b325edb569efd3413d2d1f2c3e6b4e6e3082" + }, + "publicKeyDer": "302a300506032b65700321002a606bf67ac770c607038b004101b325edb569efd3413d2d1f2c3e6b4e6e3082", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAKmBr9nrHcMYHA4sAQQGzJe21ae/TQT0tHyw+a05uMII=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "KmBr9nrHcMYHA4sAQQGzJe21ae_TQT0tHyw-a05uMII" + }, + "tests": [ + { + "tcId": 109, + "comment": "Random test failure 24", + "flags": [ + "Ktv" + ], + "msg": "b477b0480bb84642608b908d29a51cf2fce63f24ee95", + "sig": "28fafbb62b4d688fa79e1ac92851f46e319b161f801d4dc09acc21fdd6780a2c4292b8c1003c61c2bcebe7f3f88ccc4bb26d407387c5f27cb8c94cf6ce810405", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 110, + "comment": "Random test failure 25", + "flags": [ + "Ktv" + ], + "msg": "aa365b442d12b7f3c925", + "sig": "83c40ce13d483cc58ff65844875862d93df4bd367af77efa469ec06a8ed9e6d7905a04879535708ddf225567a815c9b941d405c98e918fd0c151165cea7fb101", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "54cda623245759ad6d43e620a606908befc633d60792bc7798447a0ef38e7311" + }, + "publicKeyDer": "302a300506032b657003210054cda623245759ad6d43e620a606908befc633d60792bc7798447a0ef38e7311", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAVM2mIyRXWa1tQ+YgpgaQi+/GM9YHkrx3mER6DvOOcxE=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "VM2mIyRXWa1tQ-YgpgaQi-_GM9YHkrx3mER6DvOOcxE" + }, + "tests": [ + { + "tcId": 111, + "comment": "Random test failure 26", + "flags": [ + "Ktv" + ], + "msg": "27e792b28b2f1702", + "sig": "14d9b497c19b91d43481c55bb6f5056de252d9ecb637575c807e58e9b4c5eac8b284089d97e2192dc242014363208e2c9a3435edf8928fb1d893553e9be4c703", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2362bac514d5fad33802642e979a1e82de6eb6f1bcbf6a5b304f2bb02b9e57fe" + }, + "publicKeyDer": "302a300506032b65700321002362bac514d5fad33802642e979a1e82de6eb6f1bcbf6a5b304f2bb02b9e57fe", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAI2K6xRTV+tM4AmQul5oegt5utvG8v2pbME8rsCueV/4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "I2K6xRTV-tM4AmQul5oegt5utvG8v2pbME8rsCueV_4" + }, + "tests": [ + { + "tcId": 112, + "comment": "Random test failure 27", + "flags": [ + "Ktv" + ], + "msg": "eef3bb0f617c17d0420c115c21c28e3762edc7b7fb048529b84a9c2bc6", + "sig": "242ddb3a5d938d07af690b1b0ef0fa75842c5f9549bf39c8750f75614c712e7cbaf2e37cc0799db38b858d41aec5b9dd2fca6a3c8e082c10408e2cf3932b9d08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "32ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e" + }, + "publicKeyDer": "302a300506032b657003210032ad026f693d0d2afe7f4388d91c4c964426fcb9e3665c3ebd8650009b815c8e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMq0Cb2k9DSr+f0OI2RxMlkQm/LnjZlw+vYZQAJuBXI4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Mq0Cb2k9DSr-f0OI2RxMlkQm_LnjZlw-vYZQAJuBXI4" + }, + "tests": [ + { + "tcId": 113, + "comment": "Random test failure 28", + "flags": [ + "Ktv" + ], + "msg": "475f", + "sig": "71a4a06a34075f2fd47bc3abf4714d46db7e97b08cb6180d3f1539ac50b18ce51f8af8ae95ed21d4fa0daab7235925631ecea1fd9d0d8a2ba7a7583fd04b900c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "037b55b427dc8daa0f80fcebaf0846902309f8a6cf18b465c0ce9b6539629ac8" + }, + "publicKeyDer": "302a300506032b6570032100037b55b427dc8daa0f80fcebaf0846902309f8a6cf18b465c0ce9b6539629ac8", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAA3tVtCfcjaoPgPzrrwhGkCMJ+KbPGLRlwM6bZTlimsg=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "A3tVtCfcjaoPgPzrrwhGkCMJ-KbPGLRlwM6bZTlimsg" + }, + "tests": [ + { + "tcId": 114, + "comment": "Test case for overflow in signature generation", + "flags": [ + "Ktv" + ], + "msg": "01234567", + "sig": "c964e100033ce8888b23466677da4f4aea29923f642ae508f9d0888d788150636ab9b2c3765e91bbb05153801114d9e52dc700df377212222bb766be4b8c020d", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "9c0007698f177998a7666c7cf7973e2b88e9c4946e33804a7bbe8968d2394b2e" + }, + "publicKeyDer": "302a300506032b65700321009c0007698f177998a7666c7cf7973e2b88e9c4946e33804a7bbe8968d2394b2e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAnAAHaY8XeZinZmx895c+K4jpxJRuM4BKe76JaNI5Sy4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "nAAHaY8XeZinZmx895c-K4jpxJRuM4BKe76JaNI5Sy4" + }, + "tests": [ + { + "tcId": 115, + "comment": "Test case for overflow in signature generation", + "flags": [ + "Ktv" + ], + "msg": "9399a6db9433d2a28d2b0c11c8794ab7d108c95b", + "sig": "176065c6d64a136a2227687d77f61f3fca3b16122c966276fd9a8b14a1a2cea4c33b3533d11101717016684e3810efbea63bb23773f7cc480174199abd734f08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "ed3a6f9721dc9729c1f76635bcf080d7036e1c2f0228654ccbbe1e738c17b963" + }, + "publicKeyDer": "302a300506032b6570032100ed3a6f9721dc9729c1f76635bcf080d7036e1c2f0228654ccbbe1e738c17b963", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA7TpvlyHclynB92Y1vPCA1wNuHC8CKGVMy74ec4wXuWM=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "7TpvlyHclynB92Y1vPCA1wNuHC8CKGVMy74ec4wXuWM" + }, + "tests": [ + { + "tcId": 116, + "comment": "Test case for overflow in signature generation", + "flags": [ + "Ktv" + ], + "msg": "7af783afbbd44c1833ab7237ecaf63b94ffdd003", + "sig": "7ca69331eec8610d38f00e2cdbd46966cb359dcde98a257ac6f362cc00c8f4fe85c02285fe4d66e31a44cadb2bf474e1a7957609eb4fe95a71473fe6699aa70d", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "4abfb535313705a6570018440cdec1a3ae33e51f352112fa6acbd0c6bc3ea859" + }, + "publicKeyDer": "302a300506032b65700321004abfb535313705a6570018440cdec1a3ae33e51f352112fa6acbd0c6bc3ea859", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEASr+1NTE3BaZXABhEDN7Bo64z5R81IRL6asvQxrw+qFk=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Sr-1NTE3BaZXABhEDN7Bo64z5R81IRL6asvQxrw-qFk" + }, + "tests": [ + { + "tcId": 117, + "comment": "Test case for overflow in signature generation", + "flags": [ + "Ktv" + ], + "msg": "321b5f663c19e30ee7bbb85e48ecf44db9d3f512", + "sig": "f296715e855d8aecccba782b670163dedc4458fe4eb509a856bcac450920fd2e95a3a3eb212d2d9ccaf948c39ae46a2548af125f8e2ad9b77bd18f92d59f9200", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "4f2162e6bf03a712db0efa418b7e7006e23871d9d7ec555a313885c4afd96385" + }, + "publicKeyDer": "302a300506032b65700321004f2162e6bf03a712db0efa418b7e7006e23871d9d7ec555a313885c4afd96385", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEATyFi5r8DpxLbDvpBi35wBuI4cdnX7FVaMTiFxK/ZY4U=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "TyFi5r8DpxLbDvpBi35wBuI4cdnX7FVaMTiFxK_ZY4U" + }, + "tests": [ + { + "tcId": 118, + "comment": "Test case for overflow in signature generation", + "flags": [ + "Ktv" + ], + "msg": "c48890e92aeeb3af04858a8dc1d34f16a4347b91", + "sig": "367d07253a9d5a77d054b9c1a82d3c0a448a51905343320b3559325ef41839608aa45564978da1b2968c556cfb23b0c98a9be83e594d5e769d69d1156e1b1506", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "4abfb535313705a6570018440cdec1a3ae33e51f352112fa6acbd0c6bc3ea859" + }, + "publicKeyDer": "302a300506032b65700321004abfb535313705a6570018440cdec1a3ae33e51f352112fa6acbd0c6bc3ea859", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEASr+1NTE3BaZXABhEDN7Bo64z5R81IRL6asvQxrw+qFk=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Sr-1NTE3BaZXABhEDN7Bo64z5R81IRL6asvQxrw-qFk" + }, + "tests": [ + { + "tcId": 119, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "321b5f663c19e30ee7bbb85e48ecf44db9d3f512", + "sig": "f296715e855d8aecccba782b670163dedc4458fe4eb509a856bcac450920fd2e95a3a3eb212d2d9ccaf948c39ae46a2548af125f8e2ad9b77bd18f92d59f9200", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "4f2162e6bf03a712db0efa418b7e7006e23871d9d7ec555a313885c4afd96385" + }, + "publicKeyDer": "302a300506032b65700321004f2162e6bf03a712db0efa418b7e7006e23871d9d7ec555a313885c4afd96385", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEATyFi5r8DpxLbDvpBi35wBuI4cdnX7FVaMTiFxK/ZY4U=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "TyFi5r8DpxLbDvpBi35wBuI4cdnX7FVaMTiFxK_ZY4U" + }, + "tests": [ + { + "tcId": 120, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "c48890e92aeeb3af04858a8dc1d34f16a4347b91", + "sig": "367d07253a9d5a77d054b9c1a82d3c0a448a51905343320b3559325ef41839608aa45564978da1b2968c556cfb23b0c98a9be83e594d5e769d69d1156e1b1506", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0717d75ce27ea181ed5a30e6456c649b5cf453a6b4c12cd3f9fd16b31e0c25cd" + }, + "publicKeyDer": "302a300506032b65700321000717d75ce27ea181ed5a30e6456c649b5cf453a6b4c12cd3f9fd16b31e0c25cd", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEABxfXXOJ+oYHtWjDmRWxkm1z0U6a0wSzT+f0Wsx4MJc0=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "BxfXXOJ-oYHtWjDmRWxkm1z0U6a0wSzT-f0Wsx4MJc0" + }, + "tests": [ + { + "tcId": 121, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "26d5f0631f49106db58c4cfc903691134811b33c", + "sig": "9588e02bc815649d359ce710cdc69814556dd8c8bab1c468f40a49ebefb7f0de7ed49725edfd1b708fa1bad277c35d6c1b9c5ec25990997645780f9203d7dd08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "db5b9eab7e84e5a13505865fa711c9c896c898609fc11fc9bc1e55028f9496df" + }, + "publicKeyDer": "302a300506032b6570032100db5b9eab7e84e5a13505865fa711c9c896c898609fc11fc9bc1e55028f9496df", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA21ueq36E5aE1BYZfpxHJyJbImGCfwR/JvB5VAo+Ult8=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "21ueq36E5aE1BYZfpxHJyJbImGCfwR_JvB5VAo-Ult8" + }, + "tests": [ + { + "tcId": 122, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "2a71f064af982a3a1103a75cef898732d7881981", + "sig": "2217a0be57dd0d6c0090641496bcb65e37213f02a0df50aff0368ee2808e1376504f37b37494132dfc4d4887f58b9e86eff924040db3925ee4f8e1428c4c500e", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7bac18f6d2625d3915f233434cda38a577247a7332a5170b37142a34644145e0" + }, + "publicKeyDer": "302a300506032b65700321007bac18f6d2625d3915f233434cda38a577247a7332a5170b37142a34644145e0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAe6wY9tJiXTkV8jNDTNo4pXckenMypRcLNxQqNGRBReA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "e6wY9tJiXTkV8jNDTNo4pXckenMypRcLNxQqNGRBReA" + }, + "tests": [ + { + "tcId": 123, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "bf26796cef4ddafcf5033c8d105057db0210b6ad", + "sig": "1fda6dd4519fdbefb515bfa39e8e5911f4a0a8aa65f40ef0c542b8b34b87f9c249dc57f320718ff457ed5915c4d0fc352affc1287724d3f3a9de1ff777a02e01", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7bac18f6d2625d3915f233434cda38a577247a7332a5170b37142a34644145e0" + }, + "publicKeyDer": "302a300506032b65700321007bac18f6d2625d3915f233434cda38a577247a7332a5170b37142a34644145e0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAe6wY9tJiXTkV8jNDTNo4pXckenMypRcLNxQqNGRBReA=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "e6wY9tJiXTkV8jNDTNo4pXckenMypRcLNxQqNGRBReA" + }, + "tests": [ + { + "tcId": 124, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "bf26796cef4ddafcf5033c8d105057db0210b6ad", + "sig": "1fda6dd4519fdbefb515bfa39e8e5911f4a0a8aa65f40ef0c542b8b34b87f9c249dc57f320718ff457ed5915c4d0fc352affc1287724d3f3a9de1ff777a02e01", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "38ead304624abebf3e2b31e20e5629531e3fc659008887c9106f5e55adbbc62a" + }, + "publicKeyDer": "302a300506032b657003210038ead304624abebf3e2b31e20e5629531e3fc659008887c9106f5e55adbbc62a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAOOrTBGJKvr8+KzHiDlYpUx4/xlkAiIfJEG9eVa27xio=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "OOrTBGJKvr8-KzHiDlYpUx4_xlkAiIfJEG9eVa27xio" + }, + "tests": [ + { + "tcId": 125, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "ae03da6997e40cea67935020152d3a9a365cc055", + "sig": "068eafdc2f36b97f9bae7fbda88b530d16b0e35054d3a351e3a4c914b22854c711505e49682e1a447e10a69e3b04d0759c859897b64f71137acf355b63faf100", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "e9bc95049af7e4817b17c402269ba5e767b7348757ac8002fec9e08390c0a9cf" + }, + "publicKeyDer": "302a300506032b6570032100e9bc95049af7e4817b17c402269ba5e767b7348757ac8002fec9e08390c0a9cf", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA6byVBJr35IF7F8QCJpul52e3NIdXrIAC/sngg5DAqc8=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "6byVBJr35IF7F8QCJpul52e3NIdXrIAC_sngg5DAqc8" + }, + "tests": [ + { + "tcId": 126, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "489d473f7fb83c7f6823baf65482517bccd8f4ea", + "sig": "43670abc9f09a8a415e76f4a21c6a46156f066b5a37b3c1e867cf67248c7b927e8d13a763e37abf936f5f27f7a8aa290539d21f740efd26b65fd5ad27085f400", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "ee8155ca4e8fe7bc5bca5992044eab7f8c3c6a13db1176f42f46c29da5b064f4" + }, + "publicKeyDer": "302a300506032b6570032100ee8155ca4e8fe7bc5bca5992044eab7f8c3c6a13db1176f42f46c29da5b064f4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA7oFVyk6P57xbylmSBE6rf4w8ahPbEXb0L0bCnaWwZPQ=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "7oFVyk6P57xbylmSBE6rf4w8ahPbEXb0L0bCnaWwZPQ" + }, + "tests": [ + { + "tcId": 127, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "1b704d6692d60a07ad1e1d047b65e105a80d3459", + "sig": "56388f2228893b14ce4f2a5e0cc626591061de3a57c50a5ecab7b9d5bb2caeea191560a1cf2344c75fdb4a085444aa68d727b39f498169eaa82cf64a31f59803", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "db507bfcc9576393f7157bb360532b05c5fcf2e764b690cc6698a4a30d349095" + }, + "publicKeyDer": "302a300506032b6570032100db507bfcc9576393f7157bb360532b05c5fcf2e764b690cc6698a4a30d349095", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA21B7/MlXY5P3FXuzYFMrBcX88udktpDMZpikow00kJU=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "21B7_MlXY5P3FXuzYFMrBcX88udktpDMZpikow00kJU" + }, + "tests": [ + { + "tcId": 128, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "dc87030862c4c32f56261e93a367caf458c6be27", + "sig": "553e5845fc480a577da6544e602caadaa00ae3e5aa3dce9ef332b1541b6d5f21bdf1d01e98baf80b8435f9932f89b3eb70f02da24787aac8e77279e797d0bd0b", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "994eaf03309d6ad9d95a656bc1744e2886f029023a3750b34f35086b3c7227f8" + }, + "publicKeyDer": "302a300506032b6570032100994eaf03309d6ad9d95a656bc1744e2886f029023a3750b34f35086b3c7227f8", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAmU6vAzCdatnZWmVrwXROKIbwKQI6N1CzTzUIazxyJ/g=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "mU6vAzCdatnZWmVrwXROKIbwKQI6N1CzTzUIazxyJ_g" + }, + "tests": [ + { + "tcId": 129, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "7f41ef68508343ef18813cb2fb332445ec6480cd", + "sig": "bc10f88081b7be1f2505b6e76c5c82e358cf21ec11b7df1f334fb587bada465b53d9f7b4d4fec964432ee91ead1bc32ed3c82f2167da1c834a37515df7fe130e", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "127d37e406e0d83e4b55a09e21e8f50fb88af47e4a43f018cdebffc1948757f0" + }, + "publicKeyDer": "302a300506032b6570032100127d37e406e0d83e4b55a09e21e8f50fb88af47e4a43f018cdebffc1948757f0", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEn035Abg2D5LVaCeIej1D7iK9H5KQ/AYzev/wZSHV/A=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "En035Abg2D5LVaCeIej1D7iK9H5KQ_AYzev_wZSHV_A" + }, + "tests": [ + { + "tcId": 130, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "e1ce107971534bc46a42ac609a1a37b4ca65791d", + "sig": "00c11e76b5866b7c37528b0670188c1a0473fb93c33b72ae604a8865a7d6e094ff722e8ede3cb18389685ff3c4086c29006047466f81e71a329711e0b9294709", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d83ba84edfb4bec49f29be31d80a64b7c0b5a502438cdb1d0dd1e0e3e55786de" + }, + "publicKeyDer": "302a300506032b6570032100d83ba84edfb4bec49f29be31d80a64b7c0b5a502438cdb1d0dd1e0e3e55786de", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA2DuoTt+0vsSfKb4x2Apkt8C1pQJDjNsdDdHg4+VXht4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "2DuoTt-0vsSfKb4x2Apkt8C1pQJDjNsdDdHg4-VXht4" + }, + "tests": [ + { + "tcId": 131, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "869a827397c585cf35acf88a8728833ab1c8c81e", + "sig": "0a6f0ac47ea136cb3ff00f7a96638e4984048999ee2da0af6e5c86bffb0e70bb97406b6ad5a4b764f7c99ebb6ec0fd434b8efe253b0423ef876c037998e8ab07", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d3c9aa2f3d6ef217a166e8ae403ed436c37facbbe3beceb78df6eb439f8fa04a" + }, + "publicKeyDer": "302a300506032b6570032100d3c9aa2f3d6ef217a166e8ae403ed436c37facbbe3beceb78df6eb439f8fa04a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA08mqLz1u8hehZuiuQD7UNsN/rLvjvs63jfbrQ5+PoEo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "08mqLz1u8hehZuiuQD7UNsN_rLvjvs63jfbrQ5-PoEo" + }, + "tests": [ + { + "tcId": 132, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "619d8c4f2c93104be01cd574a385ceca08c33a9e", + "sig": "b7cbb942a6661e2312f79548224f3e44f5841c6e880c68340756a00ce94a914e8404858265985e6bb97ef01d2d7e5e41340309606bfc43c8c6a8f925126b3d09", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d53280367c1c0b95ac4112218b92c6a71c51fb6312ce668de196c7d52a136155" + }, + "publicKeyDer": "302a300506032b6570032100d53280367c1c0b95ac4112218b92c6a71c51fb6312ce668de196c7d52a136155", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA1TKANnwcC5WsQRIhi5LGpxxR+2MSzmaN4ZbH1SoTYVU=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "1TKANnwcC5WsQRIhi5LGpxxR-2MSzmaN4ZbH1SoTYVU" + }, + "tests": [ + { + "tcId": 133, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "5257a0bae8326d259a6ce97420c65e6c2794afe2", + "sig": "27a4f24009e579173ff3064a6eff2a4d20224f8f85fdec982a9cf2e6a3b51537348a1d7851a3a932128a923a393ea84e6b35eb3473c32dceb9d7e9cab03a0f0d", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "94ac2336ba97a476fb4c9f2b5563e4167ca292c6e99e422350a911ae3172c315" + }, + "publicKeyDer": "302a300506032b657003210094ac2336ba97a476fb4c9f2b5563e4167ca292c6e99e422350a911ae3172c315", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAlKwjNrqXpHb7TJ8rVWPkFnyiksbpnkIjUKkRrjFywxU=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "lKwjNrqXpHb7TJ8rVWPkFnyiksbpnkIjUKkRrjFywxU" + }, + "tests": [ + { + "tcId": 134, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "5acb6afc9b368f7acac0e71f6a4831c72d628405", + "sig": "985b605fe3f449f68081197a68c714da0bfbf6ac2ab9abb0508b6384ea4999cb8d79af98e86f589409e8d2609a8f8bd7e80aaa8d92a84e7737fbe8dcef41920a", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "e1e7316d231f7f275bdf403360304da1509fdf1af1fd25ca214eaac0a289398f" + }, + "publicKeyDer": "302a300506032b6570032100e1e7316d231f7f275bdf403360304da1509fdf1af1fd25ca214eaac0a289398f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA4ecxbSMffydb30AzYDBNoVCf3xrx/SXKIU6qwKKJOY8=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "4ecxbSMffydb30AzYDBNoVCf3xrx_SXKIU6qwKKJOY8" + }, + "tests": [ + { + "tcId": 135, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "3c87b3453277b353941591fc7eaa7dd37604b42a", + "sig": "1c8fbda3d39e2b441f06da6071c13115cb4115c7c3341704cf6513324d4cf1ef4a1dd7678a048b0dde84e48994d080befcd70854079d44b6a0b0f9fa002d130c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "fffbeea71215efaf9888fec2cc68edb3703ff11a66fd629b53cbda5eabc18750" + }, + "publicKeyDer": "302a300506032b6570032100fffbeea71215efaf9888fec2cc68edb3703ff11a66fd629b53cbda5eabc18750", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA//vupxIV76+YiP7CzGjts3A/8Rpm/WKbU8vaXqvBh1A=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "__vupxIV76-YiP7CzGjts3A_8Rpm_WKbU8vaXqvBh1A" + }, + "tests": [ + { + "tcId": 136, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "0a68e27ef6847bfd9e398b328a0ded3679d4649d", + "sig": "59097233eb141ed948b4f3c28a9496b9a7eca77454ecfe7e46737d1449a0b76b15aacf77cf48af27a668aa4434cfa26c504d75a2bcc4feac46465446234c0508", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "19ccc0527599cb032e0b4c4d74e60f13901768a99df041c3bc1bf6c0ef271169" + }, + "publicKeyDer": "302a300506032b657003210019ccc0527599cb032e0b4c4d74e60f13901768a99df041c3bc1bf6c0ef271169", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAGczAUnWZywMuC0xNdOYPE5AXaKmd8EHDvBv2wO8nEWk=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "GczAUnWZywMuC0xNdOYPE5AXaKmd8EHDvBv2wO8nEWk" + }, + "tests": [ + { + "tcId": 137, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "4e9bef60737c7d4dd10bd52567e1473a36d3573d", + "sig": "519105608508fe2f1b6da4cc8b23e39798b1d18d25972beed0404cec722e01ba1b6a0f85e99e092cca8076b101b60d4ac5035684357f4d0daacdc642da742a06", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0e726e27047563aa0a1a9c2e085d8d26af2acba129d0869c65031e3e6cac329a" + }, + "publicKeyDer": "302a300506032b65700321000e726e27047563aa0a1a9c2e085d8d26af2acba129d0869c65031e3e6cac329a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEADnJuJwR1Y6oKGpwuCF2NJq8qy6Ep0IacZQMePmysMpo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "DnJuJwR1Y6oKGpwuCF2NJq8qy6Ep0IacZQMePmysMpo" + }, + "tests": [ + { + "tcId": 138, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "cc82b3163efda3ba7e9240e765112caa69113694", + "sig": "d8b03ee579e73f16477527fc9dc37a72eaac0748a733772c483ba013944f01ef64fb4ec5e3a95021dc22f4ae282baff6e9b9cc8433c6b6710d82e7397d72ef04", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "e77717b54a2b5e5bce5bccb8f0c5fdb5fd7df77ac254020fc9120dc0d4df4178" + }, + "publicKeyDer": "302a300506032b6570032100e77717b54a2b5e5bce5bccb8f0c5fdb5fd7df77ac254020fc9120dc0d4df4178", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA53cXtUorXlvOW8y48MX9tf1993rCVAIPyRINwNTfQXg=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "53cXtUorXlvOW8y48MX9tf1993rCVAIPyRINwNTfQXg" + }, + "tests": [ + { + "tcId": 139, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "923a5c9e7b5635bb6c32c5a408a4a15b652450eb", + "sig": "26da61fdfd38e6d01792813f27840c8b4766b0faaed39d0ee898cb450d94a5d5f57e58b6a003d7f9b56b20561954c6edcf66492d116b8b5e91f205a3a6449d0b", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "6220972d3f7d150b36790d7d522384876d64d640cd9913186815e1629582ed36" + }, + "publicKeyDer": "302a300506032b65700321006220972d3f7d150b36790d7d522384876d64d640cd9913186815e1629582ed36", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAYiCXLT99FQs2eQ19UiOEh21k1kDNmRMYaBXhYpWC7TY=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "YiCXLT99FQs2eQ19UiOEh21k1kDNmRMYaBXhYpWC7TY" + }, + "tests": [ + { + "tcId": 140, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "6f2f0245de4587062979d0422d349f93ccdc3af2", + "sig": "4adeaff7a58c5010a5a067feea0ae504d37b0c6a76c6c153e222f13409dff2df0fab69bc5059b97d925dc1b89e9851d7c627cb82d65585f9fd976124553f8902", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7b64a28c50ec7678a90e3e1a21522e30ac9db7b5215aea2bfb33bea037eab987" + }, + "publicKeyDer": "302a300506032b65700321007b64a28c50ec7678a90e3e1a21522e30ac9db7b5215aea2bfb33bea037eab987", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAe2SijFDsdnipDj4aIVIuMKydt7UhWuor+zO+oDfquYc=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "e2SijFDsdnipDj4aIVIuMKydt7UhWuor-zO-oDfquYc" + }, + "tests": [ + { + "tcId": 141, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "6e911edb27a170b983d4dee1110554f804330f41", + "sig": "4204d620cde0c3008c0b2901f5d6b44f88f0e3cb4f4d62252bf6f3cb37c1fb150a9ccb296afe5e7c75f65b5c8edd13dc4910ffe1e1265b3707c59042cf9a5902", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "724452210a9e4c994819229bf12bf84e95768a3a97c08d8d8f5f939a4cad34c5" + }, + "publicKeyDer": "302a300506032b6570032100724452210a9e4c994819229bf12bf84e95768a3a97c08d8d8f5f939a4cad34c5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAckRSIQqeTJlIGSKb8Sv4TpV2ijqXwI2Nj1+TmkytNMU=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "ckRSIQqeTJlIGSKb8Sv4TpV2ijqXwI2Nj1-TmkytNMU" + }, + "tests": [ + { + "tcId": 142, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "b8cf807eea809aaf739aa091f3b7a3f2fd39fb51", + "sig": "f8a69d3fd8c2ff0a9dec41e4c6b43675ce08366a35e220b1185ffc246c339e22c20ac661e866f52054015efd04f42eca2adcee6834c4df923b4a62576e4dff0e", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "bad265b294ed2f422cb6a141694086238fbfe987571aa765d8b4f3a24105aa01" + }, + "publicKeyDer": "302a300506032b6570032100bad265b294ed2f422cb6a141694086238fbfe987571aa765d8b4f3a24105aa01", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAutJlspTtL0IstqFBaUCGI4+/6YdXGqdl2LTzokEFqgE=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "utJlspTtL0IstqFBaUCGI4-_6YdXGqdl2LTzokEFqgE" + }, + "tests": [ + { + "tcId": 143, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "01a2b5f7fee813b4e9bd7fc25137648004795010", + "sig": "61792c9442bc6338ac41fd42a40bee9b02ec1836503d60ff725128c63d72808880c36e6190b7da525cbee5d12900aa043547dd14a2709ef9e49d628f37f6b70c", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0aaee4b723db9b51ba7d22eb23eb8a76a5ac02f4fc9dd06f77bea42e1d37ec5a" + }, + "publicKeyDer": "302a300506032b65700321000aaee4b723db9b51ba7d22eb23eb8a76a5ac02f4fc9dd06f77bea42e1d37ec5a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEACq7ktyPbm1G6fSLrI+uKdqWsAvT8ndBvd76kLh037Fo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "Cq7ktyPbm1G6fSLrI-uKdqWsAvT8ndBvd76kLh037Fo" + }, + "tests": [ + { + "tcId": 144, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "0fbf5d47cb5d498feace8f98f1896208da38a885", + "sig": "fa3cd41e3a8c00b19eecd404a63c3cb787cd30de0dfc936966cff2117f5aff18db6bef80fcfd8856f3fb2e9c3dc47593e9471103032af918feee638a33d40505", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "812344af15a91ba83c2c91e96f1727ac0f3c4c41385b9fa84efa399ada5168be" + }, + "publicKeyDer": "302a300506032b6570032100812344af15a91ba83c2c91e96f1727ac0f3c4c41385b9fa84efa399ada5168be", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAgSNErxWpG6g8LJHpbxcnrA88TEE4W5+oTvo5mtpRaL4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "gSNErxWpG6g8LJHpbxcnrA88TEE4W5-oTvo5mtpRaL4" + }, + "tests": [ + { + "tcId": 145, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "36e67c1939750bffb3e4ba6cb85562612275e862", + "sig": "97fbbcd7a1d0eb42d2f8c42448ef35a2c2472740556b645547865330d6c57068af377fced08aaf810c08cd3c43d296f1975710312e9334c98b485f831efa4103", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0ee5cb5597fbdf8dccc48b01485e39b33aa133b52d30d23740277267cfec3e3e" + }, + "publicKeyDer": "302a300506032b65700321000ee5cb5597fbdf8dccc48b01485e39b33aa133b52d30d23740277267cfec3e3e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEADuXLVZf7343MxIsBSF45szqhM7UtMNI3QCdyZ8/sPj4=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "DuXLVZf7343MxIsBSF45szqhM7UtMNI3QCdyZ8_sPj4" + }, + "tests": [ + { + "tcId": 146, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "13945c894c1d3fe8562e8b20e5f0efaa26ade8e3", + "sig": "d7dbaa337ffd2a5fd8d5fd8ad5aeccc0c0f83795c2c59fe62a40b87903b1ae62ed748a8df5af4d32f9f822a65d0e498b6f40eaf369a9342a1164ee7d08b58103", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "9fba1de92b60b5b4703089763d0d6f9125e4dd7efae41f08a22882aef96892c4" + }, + "publicKeyDer": "302a300506032b65700321009fba1de92b60b5b4703089763d0d6f9125e4dd7efae41f08a22882aef96892c4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAn7od6StgtbRwMIl2PQ1vkSXk3X765B8IoiiCrvloksQ=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "n7od6StgtbRwMIl2PQ1vkSXk3X765B8IoiiCrvloksQ" + }, + "tests": [ + { + "tcId": 147, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "4de142af4b8402f80a47fa812df84f42e283cee7", + "sig": "09a2ed303a2fa7027a1dd7c3b0d25121eeed2b644a2fbc17aa0c8aea4524071ede7e7dd7a536d5497f8165d29e4e1b63200f74bbae39fbbbccb29889c62c1f09", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "7582ab1b52e1316e5c13671f43b39ca36b28133cd0832831bcddd0b0f23398cb" + }, + "publicKeyDer": "302a300506032b65700321007582ab1b52e1316e5c13671f43b39ca36b28133cd0832831bcddd0b0f23398cb", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAdYKrG1LhMW5cE2cfQ7Oco2soEzzQgygxvN3QsPIzmMs=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "dYKrG1LhMW5cE2cfQ7Oco2soEzzQgygxvN3QsPIzmMs" + }, + "tests": [ + { + "tcId": 148, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "563357f41b8b23b1d83f19f5667177a67da20b18", + "sig": "e6884a6e6b2e60a0b5862251c001e7c79d581d777d6fc11d218d0aecd79f26a30e2ca22cc7c4674f8b72655bc4ee5cb5494ca07c05177656142ac55cc9d33e02", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "dd2d678bae222f3fb6e8278f08cc9e1a66339c926c29ac0a16f9717f5ee18cd8" + }, + "publicKeyDer": "302a300506032b6570032100dd2d678bae222f3fb6e8278f08cc9e1a66339c926c29ac0a16f9717f5ee18cd8", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA3S1ni64iLz+26CePCMyeGmYznJJsKawKFvlxf17hjNg=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "3S1ni64iLz-26CePCMyeGmYznJJsKawKFvlxf17hjNg" + }, + "tests": [ + { + "tcId": 149, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "931bbf9c877a6571cf7d4609fc3eb867edd43f51", + "sig": "6124c206d864507ea5d984b363b4cf583314db6856a45ded5e61eebff4d5e337e0b4c82b445ae2e52d549d2d961eace2ea01f81158e09a9686baa040db65ad08", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "ccbe7cb2e4bc215cee2f885e1d22f7e0d582b2bbbd782c104e548b152d26fc69" + }, + "publicKeyDer": "302a300506032b6570032100ccbe7cb2e4bc215cee2f885e1d22f7e0d582b2bbbd782c104e548b152d26fc69", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAzL58suS8IVzuL4heHSL34NWCsru9eCwQTlSLFS0m/Gk=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "zL58suS8IVzuL4heHSL34NWCsru9eCwQTlSLFS0m_Gk" + }, + "tests": [ + { + "tcId": 150, + "comment": "regression test for arithmetic error", + "flags": [ + "TinkOverflow" + ], + "msg": "44530b0b34f598767a7b875b0caee3c7b9c502d1", + "sig": "cfbd450a2c83cb8436c348822fe3ee347d4ee937b7f2ea11ed755cc52852407c9eec2c1fa30d2f9aef90e89b2cc3bcef2b1b9ca59f712110d19894a9cf6a2802", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/cpu/eddsazerosigngen", + "version": "1.0" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a" + }, + "publicKeyDer": "302a300506032b6570032100d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA11qYAYKxCrfVS/7TyWQHOg7hcvPapiMlrwIaaPcHURo=\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "OKP", + "crv": "Ed25519", + "kid": "none", + "x": "11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo" + }, + "tests": [ + { + "tcId": 151, + "comment": "R encodes y = 1 with the sign bit of x set. The only point with y = 1 has x = 0, so decoding must fail (RFC 8032, Section 5.1.3). Accepted only by verifiers that ignore the sign of x.", + "flags": [ + "InvalidEncoding" + ], + "msg": "313233343030", + "sig": "0100000000000000000000000000000000000000000000000000000000000080c803ee1f2342aa96ff698a393d1ab5e66f3eda101d6d120b394c3fd32c117d0a", + "result": "invalid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0100000000000000000000000000000000000000000000000000000000000000" + }, + "publicKeyDer": "302a300506032b65700321000100000000000000000000000000000000000000000000000000000000000000", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 152, + "comment": "identity public key universal forgery", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "6d657373616765", + "sig": "58666666666666666666666666666666666666666666666666666666666666660100000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a" + }, + "publicKeyDer": "302a300506032b6570032100c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAxxdqcD1N2E+6PAt2DRBnDyogU/osOczGTsf9d5KsA3o=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 153, + "comment": "canonical Ed25519 torsion point 1 of 7 (order 8)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "746f7273696f6e2d312d3134", + "sig": "b63dd4baa9c75ea9f3f1021ada3bf7dd6872e4cfbdac9653965ef78c4be9845d27df2ce4101220ec96bc5ccbcefa1336871b76e6ef52a0fb35745bb187b1a10d", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0000000000000000000000000000000000000000000000000000000000000080" + }, + "publicKeyDer": "302a300506032b65700321000000000000000000000000000000000000000000000000000000000000000080", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 154, + "comment": "canonical Ed25519 torsion point 2 of 7 (order 4)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "", + "sig": "c459280d27f66a3285aa648ca1cc444cdfcde27a6062d117c6cb399e0969d6edf8b80551824c3e7275922ac8751e59a42793406560453c4e366999f900480506", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05" + }, + "publicKeyDer": "302a300506032b657003210026e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAJuiVj8KyJ7BFw/SJ8u+Y8NXfrAXTxjM5sTgCiG1T/AU=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 155, + "comment": "canonical Ed25519 torsion point 3 of 7 (order 8)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "746f7273696f6e2d332d34", + "sig": "afd0270f467226b517fa8f911d1d320906df0065fe0045593c8fd0394770b83e6bb6f264bca826f9a4631816571f8f42681a94db6d3f032e64721265a06c7009", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f" + }, + "publicKeyDer": "302a300506032b6570032100ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA7P///////////////////////////////////////38=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 156, + "comment": "canonical Ed25519 torsion point 4 of 7 (order 2)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "", + "sig": "f8cea2efb481e92ca61b8972098e07aa1c16f2166cbd8da7ae682b55e433693920b491d7e08ab6c8e521b2f0300befbfcbfd7078340bc153a251896ef8b7c805", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85" + }, + "publicKeyDer": "302a300506032b657003210026e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAJuiVj8KyJ7BFw/SJ8u+Y8NXfrAXTxjM5sTgCiG1T/IU=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 157, + "comment": "canonical Ed25519 torsion point 5 of 7 (order 8)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "746f7273696f6e2d352d3231", + "sig": "54df79ed63c1bfdc39fd6408ad5f04143bcfc22b7e1dd0e5ea3bc00eccbbbf8260faa75789f6428d7a8a5a3b850b6779171de7edd504ffcfb5db320dd9864b06", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0000000000000000000000000000000000000000000000000000000000000000" + }, + "publicKeyDer": "302a300506032b65700321000000000000000000000000000000000000000000000000000000000000000000", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 158, + "comment": "canonical Ed25519 torsion point 6 of 7 (order 4)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "", + "sig": "520679470254237dbe8f93dc12e8b05363f5236b5671ebff01251649930f6c287531efeb34b73a6fe0f3170a211ce386ae269b0d145d5a7e63bb4ba15ce0c408", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa" + }, + "publicKeyDer": "302a300506032b6570032100c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAxxdqcD1N2E+6PAt2DRBnDyogU/osOczGTsf9d5KsA/o=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 159, + "comment": "canonical Ed25519 torsion point 7 of 7 (order 8)", + "flags": [ + "SmallOrderPublicKey" + ], + "msg": "746f7273696f6e2d372d39", + "sig": "b57aca4330dc58dcfd4ca75a1f7f3161aaf394a57769c7a9e9837d27cf7a80f7e88557a67e0b4792628285f53ed0f4fac97bc187e436fac5ea0513d320d5560f", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "15deb30729eb3e465c88f11b57d0c8d36eb0f670c3b22d2f80ea6049eeb2c23b" + }, + "publicKeyDer": "302a300506032b657003210015deb30729eb3e465c88f11b57d0c8d36eb0f670c3b22d2f80ea6049eeb2c23b", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAFd6zBynrPkZciPEbV9DI026w9nDDsi0vgOpgSe6ywjs=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 160, + "comment": "prime-order point 1 plus nonidentity torsion point 1", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d302d312d38", + "sig": "49b0d4daf5493b98c7220f7b785fdf10f4befad3262e00f2cd6813c90d1319f6a7c6c0d69149f691d0c6b428642bb08d7046e0abff7e68e6b83547129f51080b", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "31f20adf0f25a04f6d0940d2eb6a0b7d4aa2f18c9571a6f7eb74bf059b0d7215" + }, + "publicKeyDer": "302a300506032b657003210031f20adf0f25a04f6d0940d2eb6a0b7d4aa2f18c9571a6f7eb74bf059b0d7215", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAMfIK3w8loE9tCUDS62oLfUqi8YyVcab363S/BZsNchU=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 161, + "comment": "prime-order point 1 plus nonidentity torsion point 2", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "d9f1148f0b13b3e801455c65d8314e7103706166ac6844ad43ead64ee310cc9f04e345b79bca79e83fbe7511fb5d17b347e2a2a98c247a92ba81b4a182116b0f", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "db3274482b52f4937b405c00496b0511a364c58d4798ceae171262803d465729" + }, + "publicKeyDer": "302a300506032b6570032100db3274482b52f4937b405c00496b0511a364c58d4798ceae171262803d465729", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA2zJ0SCtS9JN7QFwASWsFEaNkxY1HmM6uFxJigD1GVyk=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 162, + "comment": "prime-order point 1 plus nonidentity torsion point 3", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d302d332d31", + "sig": "989e808156e71fb17c146080890b2726d0e9ba1ab29a0832b680bac5849c41e04e97cb8d756d0890b1c8d7eff77de4b1a0301404338874b8819c4bb5bf204a08", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "fb8ae86afa72f86ab074c3a51440df0d72c13c44cd1c4ae510681b419504974a" + }, + "publicKeyDer": "302a300506032b6570032100fb8ae86afa72f86ab074c3a51440df0d72c13c44cd1c4ae510681b419504974a", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA+4roavpy+GqwdMOlFEDfDXLBPETNHErlEGgbQZUEl0o=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 163, + "comment": "prime-order point 1 plus nonidentity torsion point 4", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "df0ea594369382b35dd6c26bb71a7984f0fda2890a19bbb69bbbaf62242ee74dd7f1bba3c0da7caa20ebf1337bcc2d39a2547e4e95e132a2daaf272439af8a05", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d8214cf8d614c1b9a3770ee4a82f372c914f098f3c4dd2d07f159fb6114d3dc4" + }, + "publicKeyDer": "302a300506032b6570032100d8214cf8d614c1b9a3770ee4a82f372c914f098f3c4dd2d07f159fb6114d3dc4", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA2CFM+NYUwbmjdw7kqC83LJFPCY88TdLQfxWfthFNPcQ=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 164, + "comment": "prime-order point 1 plus nonidentity torsion point 5", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d302d352d32", + "sig": "f31beed5c32641a1baca414ba1f6a39cd4e0da3fe95027d937a41df3d6a6e5a7f70d47674a0fb90b618e6465e7bd133f1615ae72eb790b05082342e12021180d", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "bc0df520f0da5fb092f6bf2d1495f482b55d0e736a8e5908148b40fa64f28dea" + }, + "publicKeyDer": "302a300506032b6570032100bc0df520f0da5fb092f6bf2d1495f482b55d0e736a8e5908148b40fa64f28dea", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAvA31IPDaX7CS9r8tFJX0grVdDnNqjlkIFItA+mTyjeo=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 165, + "comment": "prime-order point 1 plus nonidentity torsion point 6", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "bef3aa8b7c0a70ef4b689bc839aff99c7cb5d62b3ec733079338400ec5deb0ccabaafcae9ecd7d8cff17c1094353e85ec9d201e41f308589a3141c23895c030d", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "12cd8bb7d4ad0b6c84bfa3ffb694faee5c9b3a72b8673151e8ed9d7fc2b9a8d6" + }, + "publicKeyDer": "302a300506032b657003210012cd8bb7d4ad0b6c84bfa3ffb694faee5c9b3a72b8673151e8ed9d7fc2b9a8d6", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEs2Lt9StC2yEv6P/tpT67lybOnK4ZzFR6O2df8K5qNY=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 166, + "comment": "prime-order point 1 plus nonidentity torsion point 7", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d302d372d33", + "sig": "71e7486ab6df0686580902797c785ffcfb2fe3b61d46c8e5da432e168e05d9c59ec91d092c7c8c635de89a97b37e383a4cec89d3c6015fb3fa7fbf43900dae04", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c1b047f0106ff174487ba336a56d48127ed0563dcca139fd555cf113f609ac71" + }, + "publicKeyDer": "302a300506032b6570032100c1b047f0106ff174487ba336a56d48127ed0563dcca139fd555cf113f609ac71", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAwbBH8BBv8XRIe6M2pW1IEn7QVj3MoTn9VVzxE/YJrHE=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 167, + "comment": "prime-order point 2 plus nonidentity torsion point 1", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "3c48db3cce8f2f154ddfe665a697de2f8dce6dd965eb0a18dbb95e90df01f2d595225ab03a2452216368b9f6f7590b72b804bb8d3258c4c9caa15922e3bff50a", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "280fa1145bb421c1586eeadfb0f96ba1a25673111eca768773dafedf9b4e5a38" + }, + "publicKeyDer": "302a300506032b6570032100280fa1145bb421c1586eeadfb0f96ba1a25673111eca768773dafedf9b4e5a38", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAKA+hFFu0IcFYburfsPlroaJWcxEeynaHc9r+35tOWjg=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 168, + "comment": "prime-order point 2 plus nonidentity torsion point 2", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d312d322d38", + "sig": "5c56e4644b99902901a9666a72c52ab6b029d4e81b07bb84b875c39f8f911938db1068dfa06b293fdeadafa97613fe10b2684b85184f5fccc6503096c316ba00", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "66f35e3ae56c736132dde77ae1faaeb01ebfc1bd79c98d43737e945b0744aaed" + }, + "publicKeyDer": "302a300506032b657003210066f35e3ae56c736132dde77ae1faaeb01ebfc1bd79c98d43737e945b0744aaed", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAZvNeOuVsc2Ey3ed64fqusB6/wb15yY1Dc36UWwdEqu0=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 169, + "comment": "prime-order point 2 plus nonidentity torsion point 3", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "5caa2cb4b66f9db52ca1dfa1a3068e36ba0fa66f3a5912d7ab9a55808edb6fe29be93e6714f72d9a0d83e736b88a4a74bd7237d739c85edbbfa99d5c518c7505", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c243dfb46f771baa41247bdb387f07475c78b8b9bb99b1089be6fd371420ccc3" + }, + "publicKeyDer": "302a300506032b6570032100c243dfb46f771baa41247bdb387f07475c78b8b9bb99b1089be6fd371420ccc3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAwkPftG93G6pBJHvbOH8HR1x4uLm7mbEIm+b9NxQgzMM=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 170, + "comment": "prime-order point 2 plus nonidentity torsion point 4", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d312d342d31", + "sig": "66250edaea83744886f3dfa139424148ced9e0646be033ab72b75d8413afbea453eefb6735dabe1491aff1f308bbd73060c669c3c3772ae2f94ab4f387642a02", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2c4fb80fef900e8bb7845cc95a92b7ed812fa9c2335ec602aaa30eec09f6538e" + }, + "publicKeyDer": "302a300506032b65700321002c4fb80fef900e8bb7845cc95a92b7ed812fa9c2335ec602aaa30eec09f6538e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEALE+4D++QDou3hFzJWpK37YEvqcIzXsYCqqMO7An2U44=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 171, + "comment": "prime-order point 2 plus nonidentity torsion point 5", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "fc91f328ca137afe81ff69d75118b89455b96d6fd6cb88a46b99fc68074175b1ac6be310033c348fe42f41cbef8c004774563c77ab781217c165d13fc273b202", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "c5f05eeba44bde3ea79115204f06945e5da98ceee13589788c25012064b1a5c7" + }, + "publicKeyDer": "302a300506032b6570032100c5f05eeba44bde3ea79115204f06945e5da98ceee13589788c25012064b1a5c7", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAxfBe66RL3j6nkRUgTwaUXl2pjO7hNYl4jCUBIGSxpcc=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 172, + "comment": "prime-order point 2 plus nonidentity torsion point 6", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d312d362d34", + "sig": "cc93d04669be4a2b68dd7d82944563b4468fa1392ae97fa36fe388d89e3d81a59588aa307e357bd12635702d077014daf525afd7400acb78d0c9a2f9f506c60a", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "870ca1c51a938c9ecd2218851e05514fe1403e42863672bc8c816ba4f8bb5512" + }, + "publicKeyDer": "302a300506032b6570032100870ca1c51a938c9ecd2218851e05514fe1403e42863672bc8c816ba4f8bb5512", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAhwyhxRqTjJ7NIhiFHgVRT+FAPkKGNnK8jIFrpPi7VRI=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 173, + "comment": "prime-order point 2 plus nonidentity torsion point 7", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "c28aa73d32d98a6f0f956392279cd13fc35d9d67ea54c99941eadea5d08ba760398f5845bbbb509102326b53ab93e33398b6c673331a194dd85173495e13ff0a", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "85e7bfc77e932799ae948a1abd8ea287c56dd48fb8b4221931e4f8652e1eea20" + }, + "publicKeyDer": "302a300506032b657003210085e7bfc77e932799ae948a1abd8ea287c56dd48fb8b4221931e4f8652e1eea20", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAhee/x36TJ5mulIoavY6ih8Vt1I+4tCIZMeT4ZS4e6iA=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 174, + "comment": "prime-order point 3 plus nonidentity torsion point 1", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d322d312d30", + "sig": "e85ba67b317ad0f48848892ce0a585d2d47ccd49e7895bf93629bf3e4723f92c3de51cdced1b12654fc834d3e675488e98f2628fa0a01b058f17dfb81603c300", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "349a3840d09eb68a97b06eae781f4fbece569c6ffd70c238ff8406ec82fb587d" + }, + "publicKeyDer": "302a300506032b6570032100349a3840d09eb68a97b06eae781f4fbece569c6ffd70c238ff8406ec82fb587d", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEANJo4QNCetoqXsG6ueB9Pvs5WnG/9cMI4/4QG7IL7WH0=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 175, + "comment": "prime-order point 3 plus nonidentity torsion point 2", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "1505ddb0ea2479d7751bdb60693727d448d1c22193cfe548ce6905f8c5da1a0c13a889c2a7d2b30c3b78015086972386d377060c9a97ea15d6dd8da04f8c7702", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "0cf1b0a8da530a0f0b30f5b130391652f249680e0f3f7c80284bdc5ab955cfa3" + }, + "publicKeyDer": "302a300506032b65700321000cf1b0a8da530a0f0b30f5b130391652f249680e0f3f7c80284bdc5ab955cfa3", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEADPGwqNpTCg8LMPWxMDkWUvJJaA4PP3yAKEvcWrlVz6M=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 176, + "comment": "prime-order point 3 plus nonidentity torsion point 3", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d322d332d33", + "sig": "793423634e1945c284aa538008fa41767a46964acf14fddabc2ac7eeb3733b4a81b3075118fcaaf8499749a992df4949bc866de91ab0b1a98cae9459db2f710f", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "628c21a85bec28f1d0c0ea44b2c6e731f47a1b01be58d1028892f947351bfa61" + }, + "publicKeyDer": "302a300506032b6570032100628c21a85bec28f1d0c0ea44b2c6e731f47a1b01be58d1028892f947351bfa61", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAYowhqFvsKPHQwOpEssbnMfR6GwG+WNECiJL5RzUb+mE=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 177, + "comment": "prime-order point 3 plus nonidentity torsion point 4", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "f8410c87623213d696e74b9a23b30926fbf8036a931678db8155956440ac192e4ed451d782a41df339f56cd4e8482de55601eefd92301d55bb067e90bb5db009", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "68184038816cd866516b75e542715d783a922b70474bdde6ce1b079ad1e115df" + }, + "publicKeyDer": "302a300506032b657003210068184038816cd866516b75e542715d783a922b70474bdde6ce1b079ad1e115df", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAaBhAOIFs2GZRa3XlQnFdeDqSK3BHS93mzhsHmtHhFd8=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 178, + "comment": "prime-order point 3 plus nonidentity torsion point 5", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d322d352d38", + "sig": "a02a0c28d4735b1fa7803ce1e1f410828ffd07018b0b1f5255fe69381a04d788d575682aceb9efe1c12f158b920ef213bfbcc53cdbb36dbd81383ecd91b7dc03", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "b965c7bf2f614975684f915187e0b04131a96390028f3dc7007bf9137d04a782" + }, + "publicKeyDer": "302a300506032b6570032100b965c7bf2f614975684f915187e0b04131a96390028f3dc7007bf9137d04a782", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAuWXHvy9hSXVoT5FRh+CwQTGpY5ACjz3HAHv5E30Ep4I=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 179, + "comment": "prime-order point 3 plus nonidentity torsion point 6", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "", + "sig": "358d21d481ef812343dffa2b55b1398ade7d630c64ff2a4f48c9a634f7ae9b9f99766d982121c3ea719b338e942d95557cf41e3385c269ba6f51aa31a4956e0a", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "e10e4f5725acf5f0f4cf0a4ecfc6e9ad0db697f1f0c0837fd7b423a546aa305c" + }, + "publicKeyDer": "302a300506032b6570032100e10e4f5725acf5f0f4cf0a4ecfc6e9ad0db697f1f0c0837fd7b423a546aa305c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA4Q5PVyWs9fD0zwpOz8bprQ22l/HwwIN/17QjpUaqMFw=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 180, + "comment": "prime-order point 3 plus nonidentity torsion point 7", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "6d697865642d6f726465722d322d372d32", + "sig": "abce1d42c9c8da97d4ecebbbf58934b5d0f86a775a43c57fc0261b39be7a1ea1b0f208edcf4093ef5c61c9552bbcdd2946be36d1a1e7878d669a42bc523c5d0d", + "result": "acceptable" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "f2741795058d07954f8b3c5aebbf20f28d3ec3bb32e3b51aef97e4be6afb68b5" + }, + "publicKeyDer": "302a300506032b6570032100f2741795058d07954f8b3c5aebbf20f28d3ec3bb32e3b51aef97e4be6afb68b5", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA8nQXlQWNB5VPizxa678g8o0+w7sy47Ua75fkvmr7aLU=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 181, + "comment": "valid control paired with torsion point 0", + "flags": [ + "Valid" + ], + "msg": "6d657373616765", + "sig": "854619fb2351b7a4f6ff982512e3be8c35bbb551991f42d241d44c7406dab4398188e758a19c325d24d683556dec79f7d72291a8e5c65f0ea440a95a28d4470d", + "result": "valid" + }, + { + "tcId": 182, + "comment": "valid control paired with torsion point 1", + "flags": [ + "Valid" + ], + "msg": "746f7273696f6e2d312d3134", + "sig": "e1427249d2d8f07b7ed4ef639de59e17c823e821ad0d0b1e693b826bdc4cf29e94a83d6d3f382dfe0a0c1f18b73d6a1b501bb9bcd1f7232cd60db05c8a9dc009", + "result": "valid" + }, + { + "tcId": 183, + "comment": "valid control paired with torsion point 2", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "8dfc13f28ef98fc6a766f3bbd0c80cde4f9cafe4ba7687e7a993851f82338844a371f634c6f2e16292429426226090347e4d19c6ce60eb0e169fe9a00003d30b", + "result": "valid" + }, + { + "tcId": 184, + "comment": "valid control paired with torsion point 3", + "flags": [ + "Valid" + ], + "msg": "746f7273696f6e2d332d34", + "sig": "b149c4197787df8113491f36cb24dc5f11c1e80f9f51e1ae0031e674ea279f499df81717719f9c27b44611042cf20abb9bf0cbf0449a3b8040ea0fdaf1e93f01", + "result": "valid" + }, + { + "tcId": 185, + "comment": "valid control paired with torsion point 4", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "7274931dbc8c3a18a739ff8f187bdb5e6b524320c6d3976b70ce7fc016449344cdfd9e0cc96ba9efe1bf71d8ef5339d9b70f8bceacfc66547e3b94d4e2deef06", + "result": "valid" + }, + { + "tcId": 186, + "comment": "valid control paired with torsion point 5", + "flags": [ + "Valid" + ], + "msg": "746f7273696f6e2d352d3231", + "sig": "7e17e7cdfda11ab37b2bf09f724b0bc2c61bbbbe6516d261b291f44ac35238502071de037a3296bba04ee65258ae39b63407aba333342775a1d7b830b11c9a0a", + "result": "valid" + }, + { + "tcId": 187, + "comment": "valid control paired with torsion point 6", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "42558ff4b1a47724c98fb3c15e1d64f68b49ab538b37c33f1c11d0fb44cc201d1b7557b725655fec353a5ae7a47d37e92ef62f9870ccd845298acb2e12246202", + "result": "valid" + }, + { + "tcId": 188, + "comment": "valid control paired with torsion point 7", + "flags": [ + "Valid" + ], + "msg": "746f7273696f6e2d372d39", + "sig": "37dcc58c48d0bae5b932bcda52d52361abc2a5616bf77508a3978af9ca42964b9a481ff328c8b2263fdfd6e4a15cfa66908edb16891c9c05183cdfb87ea0fa0a", + "result": "valid" + }, + { + "tcId": 189, + "comment": "valid control paired with mixed-order point 1/1", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d302d312d38", + "sig": "0ae8d293de2640c14c01f5a8c7c56d5a756128e90e436d3a2ffece7fd5830ba17181539db012fdf463ed03af9f531c663639fb86a9e2c3fee98690db160ae90a", + "result": "valid" + }, + { + "tcId": 190, + "comment": "valid control paired with mixed-order point 1/2", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "61c6d52a5a68f19f24ba14e5cf78fd8a7152ca7d3d40094d58852b2adef86e6959159edc65f0e997d058f1921fe7a042a70e0b4663008187a531ecd3e83a8604", + "result": "valid" + }, + { + "tcId": 191, + "comment": "valid control paired with mixed-order point 1/3", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d302d332d31", + "sig": "ec00e7504ffa36aec4fb8e721b7f808ec6ca0cfc04a5017af6cdd48efc73d730c40e1874e3e43ff521d62142c8d5dfcbcc214ba2c47f7b5825f2956bd9f19505", + "result": "valid" + }, + { + "tcId": 192, + "comment": "valid control paired with mixed-order point 1/4", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "4be9edab3535cc97587f84f2ed5881338755702cdc975a572e328352a5450dd56ff0fb42afb2cb9a1028eebb3ee0fba061789d4f7abaab06ca38ea332b1ed90c", + "result": "valid" + }, + { + "tcId": 193, + "comment": "valid control paired with mixed-order point 1/5", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d302d352d32", + "sig": "fe7c8cfaefecc01cae674fb2fc92626d175752824d9756548dd601be73e4353072fd18da1e55e552d1becb2d3be3fe7bb60a2748fd648faa5f08a46d1b963004", + "result": "valid" + }, + { + "tcId": 194, + "comment": "valid control paired with mixed-order point 1/6", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "a0a03118b7d9746f89b3d5a0deb5147c0f440e7d914ceb181232b972a099caefad8258c0fb0fef3e1da74d413d1da6c38a06f2a93abf3cec796ea701c1b1d601", + "result": "valid" + }, + { + "tcId": 195, + "comment": "valid control paired with mixed-order point 1/7", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d302d372d33", + "sig": "944b48f67a3d51c002e3781990778b57bf71017639e0441de7ae467c55fabc26bef8cf69bfda88633828d56751cfd6c8c8180cec5efe057f97fc6c20b2a5290a", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "2bbc204b9088e455bedb8424c780f8b8a387474644664ef7641902c8ebdf333c" + }, + "publicKeyDer": "302a300506032b65700321002bbc204b9088e455bedb8424c780f8b8a387474644664ef7641902c8ebdf333c", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAK7wgS5CI5FW+24Qkx4D4uKOHR0ZEZk73ZBkCyOvfMzw=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 196, + "comment": "valid control paired with mixed-order point 2/1", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "98b7602a3e45efb7d899687ee0ec2f81f7afe8056837a720e703b3e803cf1f8f3bbb3adeeaf502dd7222db467d04c0a8859a6a80f67c33a84674e2d0476a860e", + "result": "valid" + }, + { + "tcId": 197, + "comment": "valid control paired with mixed-order point 2/2", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d312d322d38", + "sig": "c0f317d6b580cfd42ac199e94ce489706b6f33bb31c5300b5e13e97ca93a3e5b1268b95e1c103624704528f1c56d456bf957f7b627b4a4c33ff53a4ffe3ea007", + "result": "valid" + }, + { + "tcId": 198, + "comment": "valid control paired with mixed-order point 2/3", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "920dc46731eabe1a17f4ecc0c494fdf61f75e25f11e04de75f632d574a5d51fc61d298f11ca8e5c3f9ccae708b5b2dedb525bf543cfa7b15a0fee46450544e0c", + "result": "valid" + }, + { + "tcId": 199, + "comment": "valid control paired with mixed-order point 2/4", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d312d342d31", + "sig": "26eb6f36777f5d04275cc0e5743c8ab428799288c2df0d5b8700aaebbfc0c664ffa55f90637bc6817390c114526dadfd3bd8a49e1512ddaf0b1b975778f1ea0b", + "result": "valid" + }, + { + "tcId": 200, + "comment": "valid control paired with mixed-order point 2/5", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "f107a692bf3ce4f10338f7b546bc16a194f625bf034e57ea9259b6102bfd9082c74224294c828a41ff069bac623f26b815cafe1b4af1bc0cf8297d0e39ea0505", + "result": "valid" + }, + { + "tcId": 201, + "comment": "valid control paired with mixed-order point 2/6", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d312d362d34", + "sig": "4683fec91d18d841760debf390e7d41cd92ea386b9bb095a5e4629ea7a0f1c41c1daeb539b4a9373858d5f4b843022e91051dbd461b1359c20e2a0775a671300", + "result": "valid" + }, + { + "tcId": 202, + "comment": "valid control paired with mixed-order point 2/7", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "390a6f169020d371c8a63ff2580fac5b24cccda3929ccf88d9481aa97d32be2fe410f91c0a22ce4a008e2191a3fc1d6ea2f26afb6d764328c478b40f1322a804", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "8b73de57a413d70e2f3f15bb4d3918ce0b85e4fe41a72efd776d06b8cae4059e" + }, + "publicKeyDer": "302a300506032b65700321008b73de57a413d70e2f3f15bb4d3918ce0b85e4fe41a72efd776d06b8cae4059e", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAi3PeV6QT1w4vPxW7TTkYzguF5P5Bpy79d20GuMrkBZ4=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 203, + "comment": "valid control paired with mixed-order point 3/1", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d322d312d30", + "sig": "d637793ab7d172e2156000955e1fa77c3ba0641d9f6dd20362d208c8eb6d5de62d67eeebb72fe8fc50a77b5e7862dca0c5e40f1fde27a29e9a9c9fe81c545007", + "result": "valid" + }, + { + "tcId": 204, + "comment": "valid control paired with mixed-order point 3/2", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "46d9381b0b3838aa7ee64fe8a1c7cfed680dc4c40e087417d5afe9bb38352ac06dfbfe9fac07dc83e62c61c1a75cfffee394644c5e3ff8431d3f41a119448b05", + "result": "valid" + }, + { + "tcId": 205, + "comment": "valid control paired with mixed-order point 3/3", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d322d332d33", + "sig": "c12e8b07833d88c5c016117273fc60a9531c39ebf89de916839ae8789b535bbc6ebac6f1bc2f3523afa93142573d93643cb20a57f56a4c22dac587da32ddfd04", + "result": "valid" + }, + { + "tcId": 206, + "comment": "valid control paired with mixed-order point 3/4", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "ea080c9adc37a7c93155883251286c8fd6dced33073582f6042c5a8cf02790f3b923a0a877b56c5dec0f79b7152f0192f74f3902281f165a4ccff2953d36590b", + "result": "valid" + }, + { + "tcId": 207, + "comment": "valid control paired with mixed-order point 3/5", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d322d352d38", + "sig": "f6e379c50289cf1ac8c5c8caab924740c6bc07475104c9b714bda0288f7a91e986c33153568615a8d0f519d6a65b8821d2fcc7b1d8dc8d93fdef3f2142df100d", + "result": "valid" + }, + { + "tcId": 208, + "comment": "valid control paired with mixed-order point 3/6", + "flags": [ + "Valid" + ], + "msg": "", + "sig": "c275256bd5699eea59126cd9f5b22c540ebb873c80c046eb4dc7523bd2367a982283d5edbc2042101e67b803a9725e9f7b23f809172845e9ce670d511fab580f", + "result": "valid" + }, + { + "tcId": 209, + "comment": "valid control paired with mixed-order point 3/7", + "flags": [ + "Valid" + ], + "msg": "6d697865642d6f726465722d322d372d32", + "sig": "845813c2ac916dc3977f05862e28fccb403d32f71fbcc817ae3ebe10d841c189dc8b663018aaa36438193f081ea7f57c904d32af78eb2fb20394d8eb640e6f06", + "result": "valid" + } + ] + }, + { + "type": "EddsaVerify", + "source": { + "name": "github/paragonie/sodium_compat/boundary-regressions", + "version": "2.5.2" + }, + "publicKey": { + "type": "EDDSAPublicKey", + "curve": "edwards25519", + "keySize": 255, + "pk": "d1e06adf4e05e248e1e52beca14b6be4da0af01b41645d2849b407ec22f41d47" + }, + "publicKeyDer": "302a300506032b6570032100d1e06adf4e05e248e1e52beca14b6be4da0af01b41645d2849b407ec22f41d47", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA0eBq304F4kjh5SvsoUtr5NoK8BtBZF0oSbQH7CL0HUc=\n-----END PUBLIC KEY-----\n", + "tests": [ + { + "tcId": 210, + "comment": "sodium_compat v2.5.1 mixed-order subgroup regression", + "flags": [ + "MixedOrderPublicKey" + ], + "msg": "af82", + "sig": "6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/rsa_pss_2048_sha256_mgf1_32_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/rsa_pss_2048_sha256_mgf1_32_test.json new file mode 100644 index 000000000..bdb7694c4 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/rsa_pss_2048_sha256_mgf1_32_test.json @@ -0,0 +1,1138 @@ +{ + "algorithm": "RSASSA-PSS", + "schema": "rsassa_pss_verify_schema_v1.json", + "numberOfTests": 108, + "header": [ + "Test vectors of class RsassaPssVerify are intended for checking the", + "verification of RSASSA-PSS signatures." + ], + "notes": { + "ModifiedSignature": { + "bugType": "CAN_OF_WORMS", + "description": "The test vector contains an invalid signature. This signature was obtained by modifying the padding before signing it.", + "effect": "Accepting modified paddings may indicate that the verification is implemented by decoding the encoded message EM instead of encoding the hash as described in Section 8.2.2 of RFC 8017. A carelessly implemented decoding operation can lead to signature forgeries." + }, + "Normal": { + "bugType": "BASIC", + "description": "The test vector contains a pseudorandomly generated, valid test case. Implementations are expected to pass this test." + }, + "SpecialCaseHash": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a signature where the hash of the message is a special case, e.g., contains a long run of 0 or 1 bits." + }, + "WrongPrimitive": { + "bugType": "WRONG_PRIMITIVE", + "description": "The signature is a valid PKCS #1 v1.5 signature. Expected was an RSASSA-PSS signature. Implementations should not accept multiple signature schemes." + } + }, + "testGroups": [ + { + "type": "RsassaPssVerify", + "source": { + "name": "google-wycheproof", + "version": "0.9" + }, + "keySize": 2048, + "sha": "SHA-256", + "mgf": "MGF1", + "mgfSha": "SHA-256", + "sLen": 32, + "publicKey": { + "modulus": "00a2b451a07d0aa5f96e455671513550514a8a5b462ebef717094fa1fee82224e637f9746d3f7cafd31878d80325b6ef5a1700f65903b469429e89d6eac8845097b5ab393189db92512ed8a7711a1253facd20f79c15e8247f3d3e42e46e48c98e254a2fe9765313a03eff8f17e1a029397a1fa26a8dce26f490ed81299615d9814c22da610428e09c7d9658594266f5c021d0fceca08d945a12be82de4d1ece6b4c03145b5d3495d4ed5411eb878daf05fd7afc3e09ada0f1126422f590975a1969816f48698bcbba1b4d9cae79d460d8f9f85e7975005d9bc22c4e5ac0f7c1a45d12569a62807d3b9a02e5a530e773066f453d1f5b4c2e9cf7820283f742b9d5", + "publicExponent": "010001" + }, + "publicKeyAsn": "3082010a0282010100a2b451a07d0aa5f96e455671513550514a8a5b462ebef717094fa1fee82224e637f9746d3f7cafd31878d80325b6ef5a1700f65903b469429e89d6eac8845097b5ab393189db92512ed8a7711a1253facd20f79c15e8247f3d3e42e46e48c98e254a2fe9765313a03eff8f17e1a029397a1fa26a8dce26f490ed81299615d9814c22da610428e09c7d9658594266f5c021d0fceca08d945a12be82de4d1ece6b4c03145b5d3495d4ed5411eb878daf05fd7afc3e09ada0f1126422f590975a1969816f48698bcbba1b4d9cae79d460d8f9f85e7975005d9bc22c4e5ac0f7c1a45d12569a62807d3b9a02e5a530e773066f453d1f5b4c2e9cf7820283f742b9d50203010001", + "publicKeyDer": "30820122300d06092a864886f70d01010105000382010f003082010a0282010100a2b451a07d0aa5f96e455671513550514a8a5b462ebef717094fa1fee82224e637f9746d3f7cafd31878d80325b6ef5a1700f65903b469429e89d6eac8845097b5ab393189db92512ed8a7711a1253facd20f79c15e8247f3d3e42e46e48c98e254a2fe9765313a03eff8f17e1a029397a1fa26a8dce26f490ed81299615d9814c22da610428e09c7d9658594266f5c021d0fceca08d945a12be82de4d1ece6b4c03145b5d3495d4ed5411eb878daf05fd7afc3e09ada0f1126422f590975a1969816f48698bcbba1b4d9cae79d460d8f9f85e7975005d9bc22c4e5ac0f7c1a45d12569a62807d3b9a02e5a530e773066f453d1f5b4c2e9cf7820283f742b9d50203010001", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAorRRoH0KpfluRVZxUTVQ\nUUqKW0YuvvcXCU+h/ugiJOY3+XRtP3yv0xh42AMltu9aFwD2WQO0aUKeidbqyIRQ\nl7WrOTGJ25JRLtincRoSU/rNIPecFegkfz0+QuRuSMmOJUov6XZTE6A+/48X4aAp\nOXofomqNzib0kO2BKZYV2YFMItphBCjgnH2WWFlCZvXAIdD87KCNlFoSvoLeTR7O\na0wDFFtdNJXU7VQR64eNrwX9evw+Ca2g8RJkIvWQl1oZaYFvSGmLy7obTZyuedRg\n2Pn4Xnl1AF2bwixOWsD3waRdElaaYoB9O5oC5aUw53MGb0U9H1tMLpz3ggKD90K5\n1QIDAQAB\n-----END PUBLIC KEY-----\n", + "publicKeyJwk": { + "kty": "RSA", + "alg": "PS256", + "n": "orRRoH0KpfluRVZxUTVQUUqKW0YuvvcXCU-h_ugiJOY3-XRtP3yv0xh42AMltu9aFwD2WQO0aUKeidbqyIRQl7WrOTGJ25JRLtincRoSU_rNIPecFegkfz0-QuRuSMmOJUov6XZTE6A-_48X4aApOXofomqNzib0kO2BKZYV2YFMItphBCjgnH2WWFlCZvXAIdD87KCNlFoSvoLeTR7Oa0wDFFtdNJXU7VQR64eNrwX9evw-Ca2g8RJkIvWQl1oZaYFvSGmLy7obTZyuedRg2Pn4Xnl1AF2bwixOWsD3waRdElaaYoB9O5oC5aUw53MGb0U9H1tMLpz3ggKD90K51Q", + "e": "AQAB", + "kid": "none" + }, + "tests": [ + { + "tcId": 1, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "", + "sig": "4f01e0c12b08625ecac89a69231906edf826380f37c959a96690d046316d68ffce9d5c471694fcebfc6b45534864689256e4fc81c78e583f675d0c94b449647451e81beff01a11a516d5e5ce3f1a910437cb8a3a5096b19fb15f4524a35b23d89cdba12cf5b71aac1047b28c562df7c5542c34ce23a182cf7e0e231934b17294799d44877a1d68ef1b8f073619b7618e6b7c22db20030d98cf591ffc3d4da5f58613ecd5ecfc3b40a1d02f40891ca43695cd4c088b05a8054c89c595a47e274816f35384226f74459ee63e25a1bfc03c360490552ec38343f8ace502f065303b00bc0ec320711b211fde92e57feb9013c3609342495ec0d7cabdec21e54acc38", + "result": "valid" + }, + { + "tcId": 2, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "0000000000000000000000000000000000000000", + "sig": "0658c68fe0895646056d9bca422a64fe48813b4e14f0c8c4122e56d345b6813dc6286ffde014617e351c7af0a0d2c0f285def79cb734e1e055a25fa6fddc1c07da17b4b235c637413b1849c24311fa72331f4c0458c364a4916de8619b884d7e37288fad12926fc091f4851686a04fd0a504dbce3db370663a6ea6128fea86c2ca94c63e0d34d7f2c845b5d71d9a5e544451f524a451acb85c49bba7864e0a34a48613a819caf3dfd0d510c940f1df21c3373915be1f3509a557fa4d5a4e9f273e85467961133e2482c0907386454228fb0246638616fc31bbb6fa7c2361b8035994eec69a923f4c0bb0ba8696dfe8b1400c2398d7b343fdf498b1116c8de602", + "result": "valid" + }, + { + "tcId": 3, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "54657374", + "sig": "401eb03cdb47ca88033e3030f6bdecbac8f5c8fc1dd6a13d23d379ed9a2b309891d13d74fea9d21d159b9e6d8f37efa2489962e24555f56dd434ff1d31ce4f9f5abd3f22cbea8b691d6a11e44efb83e2bca155e6a164325e0fde2a8865afd5c9f51161a9d615f62af7ec2e31b3e5ab649c164490d31d88cfae35b84aea7925690f929a144b6d2f48e8fb894a52deecd1b9a6496990c4ecf1588699a42cacd10c53af350514e4291ea9a058e77f101e32c1c0cefa61d945f7bc931f8bd19e7ba3169358a60e5a8b0123bc3199b9fdcafe8e519c41ba675491a27b85e44ef2d77277c10fe107293c8290186913bc9a99b640d8da041b64f31eab1d35920985f4a5", + "result": "valid" + }, + { + "tcId": 4, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "313233343030", + "sig": "68caf07e71ee654ffabf07d342fc4059deb4f7e5970746c423b1e8f668d5332275cc35eb61270aebd27855b1e80d59def47fe8882867fd33c2308c91976baa0b1df952caa78db4828ab81e79949bf145cbdfd1c4987ed036f81e8442081016f20fa4b587574884ca6f6045959ce3501ae7c02b1902ec1d241ef28dee356c0d30d28a950f1fbc683ee7d9aad26b048c13426fe3975d5638afeb5b9c1a99d162d3a5810e8b074d7a2eae2be52b577151f76e1f734b0a956ef4f22be64dc20a81ad1316e4f79dff5fc41fc08a20bc612283a88415d41595bfea66d59de7ac12e230f72244ad9905aef0ead3fa41ed70bf4218863d5f041292f2d14ce0a7271c6d36", + "result": "valid" + }, + { + "tcId": 5, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "4d657373616765", + "sig": "599724adc1bae31e84eb6e1399cd90cd67f48b432c63719b600402384aaea9b21ee864cdcf259029180877c847a223912b0647f066a59a65df6c2d3a6675b1450f0b05185cee486bfac56cfded182babcefe60568a6954f026cb2f59002a2f755e9bce49793f280d89822c9bd3a06a7ad2209c3d6cab7c1f74c8bbf4bf374e7ae8a539fccb83a78cff96a4f538adeba0869659d0e9647d98f96cb55d9cb7e58440c4c9d85b8e9dc602e909e29e45f2b82ded44f40e9ceb1292da20063967e3a116f4aeb202863cea523f215b8ec7fc4f6a22cd8652ed661e33803f3fa1be966fa8754cc7b0fa894cee0f045efba14c4f4a1d7cb837cea69e30522526b8a5878f", + "result": "valid" + }, + { + "tcId": 6, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "61", + "sig": "4e68a8375e086990bde05fc4bbde2d368f8d96a5bbcf16d9239fcdd45942d764fc2317d90f4f62ec80059490240be8f32dfc32414a427c7e34be25ed0dcaee6927881e797db97a0341fdde459b9cc915d0a348e15dcbfe1b0780472f52a887faffc988a9ceb677e1cf5638e44a9d6f2532417ed0bde5d67f5dc9229ef1f3cfd9cb46c695738fd006cc62d02f5df76996270223060f72505ccfbdf4e88d961e2e7763705480335148ecdd23d1202c26a963860dc769a43e44c72285092ba7f24d81844e612bf03f9c2ddd4e5960622f71672f4e42b8a8f36c6847a05f70400207471c575d6a960fac1de809118efb52903ca37f12d40f6de74decb9a5b8a415d4", + "result": "valid" + }, + { + "tcId": 7, + "comment": "valid signature", + "flags": [ + "Normal" + ], + "msg": "e0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + "sig": "8bdd6db90323f3bf26a36a4ab5b92180c96881bd32b66317c4b48c2ba1421f8434000c06adde4264c6ea2d5346468c6d5e97cb13d3cb932e523ac57b59c814fa0397ca6dcc9bec4be1147d77abcd318a6aba1af46ede2f5640da06511a006fd1bd5fb8e04be22789956adc47bbec7988be477150f9b24a07dff51530e8f0c14cfef7d25ca141f512939987b7eb0825633d41a48742bd7f56d4db9733d92ac0f36b4041f51332695f551ec91076da2301120c438eb9ec197cbe318d4571b6b79098d17eded0ca47747a143e34f882ad6e3f490f3a710ff7ec1bffce022027165d96281e593180c67f44aeda9ce6605e6b8e5eac1347695dab211a965bb3d3f928", + "result": "valid" + }, + { + "tcId": 8, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343236343739373234", + "sig": "3a52bec84b5b41e09358a7fe24bb7ae0cb39364374c911e0d3f011f2c4c79667f43eb700fcb33e44533654b3efdb37e627eaf1352d21a187a70a86b79b2c34ae3eef944e3e61d361c3baa446dd465f2ddc0b2ae7bc8beec1761922fb5d7aa6cc4fab9d1a0835f15cd71ccb3fcb57c578a46a7197dab478b7d1ed7c6235dea3b117472c334c3a18fb8a574922f511d7ebf030201dd7457a3860a6af6252ddaf90d07d90aca03f7037223400c066db1d7feb91d84815af2430190a2170ac7eeff898ebd5c4c7e9bed19aa86293aa257a9ad0a5146be80e7ce6081c8906d269d06bf037e34ee18aba113dcfc98eca70abed7249dc9a49f971648e58d7db2282ed6a", + "result": "valid" + }, + { + "tcId": 9, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37313338363834383931", + "sig": "0b47d3bfedac89323cef0d273035674b937f4106355c0baabf6664a57b3064a789592ec5ec4a63997b6f3dd81b0514a78b8824edb2b0ffaf45f8ae6432ce3521bf77e01912df0da5d6fad9f554a3d69b402866526e6914b5c78af847233d3482598143dd6fc65a81df92cfe119f38b0d4f9d1a51a99aa569e42cdec9b42a0598f5f0bbaa1bcd44c19c7614202e0aebaaefff7f3d197635e490bba81927ce491a5810952593f8fd57a80f60bc3c0b2a7b10a0f9dd4930db8172bcb1642f6d03332a7d90ce1edc1f8054b5bd4f4760996bcd565bddd2c6dc8f54fc6da5e6fe80a2248f920216b1bb836d7885a023d92edad5d20b0e47cf5beb2cbb1393c624eb3a", + "result": "valid" + }, + { + "tcId": 10, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130333539333331363638", + "sig": "20c9d447ee65a4cf7883ab724df0c454814029c8178ddd25eaafab34344d6e06877d5a7121af22c7e5333e2d4f2bdf42450b7b735c335ebdfb461f7b20dbb77c68c449b7826ad14668e2103b636b300a675a9b3b1aca936420cf3fd8deb2ac8aec6528409f6419d8d5ac9ec2757ad4781e9cbda98912f4304710d3a89053ebfa7a84353c86b0c48eea5a541af4644ffa21b766e738f0d94cc796004b625f244f63c41666b2213317f778f0d9d7d09a1003cbe1b2bfef585f1580f941398059a09ec07ae35bb690728ce85c2e192d423a71b513008c29582b37df1f83e40a699c88048aadd81211322b3c9bb449addb037c553551d7835e90d53f1a1883766d5b", + "result": "valid" + }, + { + "tcId": 11, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33393439343031323135", + "sig": "7c5e135d7670a57d8fd7a1c9c7b33a6e07a57d957f7a5d9594200eaa9647a1d460bbebc40e0036a7d7665ebaca9ffe3a166fa1411c704049975a5e46b4d4fa03adbf69d1a18adf59505e6d2cfbb82d5d32b7e3dceb8542e9ed8c7ac248f9f7a84abf3f16e862726a4dd189c61d6979d85ba982db3a5b2903f38d2558cc115d6481952506182a09e04ec257b19235f6c6e2c6587bedb90709298c142fa31742f401f22e2b4b446f9642b598cf43d4d29bd0934f4853ef70ec72b97f6bfb084f45ea439c4dd8242d059bc3c1a851c67d94357f93587014b2860d7f195f7b6bfb39afa712338c684f68501c5fb9a67dbb36544e6bae5f72dcc85815c2d4d70b5baa", + "result": "valid" + }, + { + "tcId": 12, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31333434323933303739", + "sig": "80ff5c8258bc0c74993dbdc0ba644e050cf47213a6a19bc83d5e4b2080adcca763a55918a7e19d85a0da38c5cc4c0b958884fc79578d4c91bc403756c6dc353740df2d0330f32e1ca91136933f2491c6e7e9a01ea7bcc87088d7863e048fe9796d955ec7cf1d166ac36a431e4f858d93d8caebc6ff60a678d38ffc0c88e8ee0ea655d4c1a46345556e4633ffdce68914c75a55f071d4e59a2eb0d6fb6fe4f28b63adfc590a4f5fc72812dacc547fa0c4985620d4019083eef115dbddd673847b79540a4bee6dc4ee8de267057e321c44aae047d7bef2302369cff291f6efa90dde97672ec3cdf4953f27f26ce62e77251fbf5077fa986dab5213f1f94b19e127", + "result": "valid" + }, + { + "tcId": 13, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33373036323131373132", + "sig": "70eddb0b9cdacf82add0c58a154ff2c0ca5cbe2877dbac3e5596de69c686ac2710a78caaf6492af18b42956c450dc4eb1a3e6fd669100d55e06b3428c6285254291fab9c80634c6f9c874db77c2107db37720b43982d9763cf34f79283265dd70f03e444158e82709555db72fd7d13a004290140c80511985fc5ad275a72abfa7ab878cf043e6694340ec6b3cbef5728f2c3c63747ff75906673be53800a7eac17a47debac1c5a9dd36eebba9c23575ffe1ed4ccd2fd3a4b9902f563b17f2bd9638d2348af175e1cb918a0681691a84444751750463325ebef2c40493f049c655077a70bf420b50917906315657178e7cfe607e9c22a23e67fb88590b753411c", + "result": "valid" + }, + { + "tcId": 14, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333433363838373132", + "sig": "0ff6e37a9aa03391e6ec8270b926c123c7e6853e01e4530382ae1e9067c2c447f2d21ea4f6b8cffea5cdead0e7bbf4c26c07418397f7dd85f4bbac0376aa099574dbd3142081428762e0092388142b351483b67fd8abfb5b73f10383d33fc21aeedc6a0e6f8a3d47f11c8b319425f9768cbbf498adee29e7d52611feff8596b1ef21ebd203397d5842cacf570d79cf0b4308a32d0951a7fbf794b84e540cb52bb076972f003ad59a35deb7af887bedfd26cc7b2bf334e242518978ff2e48224f89c7894737bb835bc353f4c0139553d3aa4722d0cb15c5e0aca5f5eb91dc9f4639aa81314038367c2779ba5521b250b5ada48ea3d2bc41a1680900bcf3cf66bb", + "result": "valid" + }, + { + "tcId": 15, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31333531353330333730", + "sig": "22bee45100f26f64d7d994187841d9eed5ae1af0601604b72ea005fae6e28cf0ac2ddd9761046eda1ee55949820c5545a0af3fced402bdd463f43070da8a4dff41531a0ce09b2eaa14bbd3713b79bdf00a144167cd2142df7aa8c5a24be69c4c1a728cd04421183658726c5765b36701f0d61d26d062baec16eb59b1594a185363d8eff993ab9c6d5a5899199169ada44b77eba624c53bd7b745b053c55355da88e6b83e74069d7d7e51964a0ad666ff027ec4792c6f139f1baaee769debc55abdcbfd22fe84d6d6c70a1cd14597e7e3c218b36f35f57d4b4dae3f1c1dee433259e961cf69c3e019438ab60dbdbae050519fc3620ff677d5ce9ed6fc43868e1b", + "result": "valid" + }, + { + "tcId": 16, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36353533323033313236", + "sig": "1b41b1021b3bd5fc186eed5c1d2a69f7e648d75a03b0fbd62104442c55a707812ef635c7269cfcb124f464d6532f28880b26f91b4f3f826207c0b25401ba1eed2b4895737080085ade80f13620c20bce004a157e708f450bc615fd35c1d248ed0f9cbfdc77222d847fa8143e85f3eddcddbb137bc7bdb2ceabadbff8aadee86aaaa217a3533939fef1d6f5f3b5277d7f8ef1ca07194730edee92cc3fc9ade2faa603117e5ab812ad5a375429ebb913fb370eeeff362727c9bf2901cdf34c6d3f03ca5adc849759ec2c8dd64fa24716af610749ce462f189a5c3c947e4cc65d66983ea9efa2927dd4d9054c2e0b969428b18aab616d3f95d24d8a725d2686d10c", + "result": "valid" + }, + { + "tcId": 17, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31353634333436363033", + "sig": "52449f163676b9a8249b63d0340d82305cf36a920f173389f304044503b3f5dbb503b8c09cae20a24cb6253a16d2e63559e0746f05c6ddd8fd657c34c2de6fee62cfd2d4c6c4258b138b7e827326110812b1a04573989b969c769d29c888e1e64546419d17a16ce9abebc2bc00f8822401ee1ecfb9aae39f35792338f607791acd3d7dfd3e6b584dc9382f558990607d26f1f461c5b57879d2b0d1b6f50d8ba23b37015da559c41fad4ba3607b5cb40d18c2131091102a4295555ea37e9ce92cc7dd2f41bb5eb30d02c305116c0f65464e8e9584d1757f4be2aa2814ce6b387cdd7ae78aa0032ad5935d74d4d56659e804342aea3a785d6bfb70c0cb44897903", + "result": "valid" + }, + { + "tcId": 18, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34343239353339313137", + "sig": "33c76df07a9ae7335f5e31b3d14d7412cc79c8761ffc7fb5528ade2e5088d3be3e269962088f356830f6dbb460c73a526057d57648cbc709c14c23d85f85c11ad5c6cc7e3ceb5238be9e8380bd789106cd10e034036873ba7b8ac9470a01cf4048b488782587e2e5d7b4d2116e34b94f9c3d22983115c0fe96b42063b4f6fef5943fbc891a320f09e62f36cb1a6d83752a1c4fa6b62899afff5118af7102e123fe9c7b2a51cf3056670848240be93aaa0385ed093da763c91726debaf1bb9a48df4be342a3cb9c335d2b3ef999da4eab94d15ba37b07d049f885572f47e7dc33b5d481b5ce1a3f8b3a4237befbf04f015a97217dae6b16e7d855b9413d7c2271", + "result": "valid" + }, + { + "tcId": 19, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130393533323631333531", + "sig": "2daebad5dc34fd919164e3ef95bbad50efca0ef2364b6db55dddc8fd703cd046e12d2d2181002d3e6c79a3671e2c7ce180176c3482baacc90076da7727c9b0c958ac40f547376b44e4f266df35419779a4fd30603c0042fc473d4a37ca3f069a915d2d0ab95b81bee5366c053b99d156cc31b2f3d68b0ea5f98da4848eb8a4dfce8ba1e167cba0ae2584757e5c1e46398d4695dd7a96412e2e1c7e62b3475a6689c5a80cc6b7c4be01a3cce6045a43aab732530898e60f55aff427afb201e85694b61e81ee86e58959a174ea87dd7f244d29c616b85cb426e7473bf568a2649f1efc40592b700499314bc809d4d9668946d60e27af852c02f6c7210dbf96ac82", + "result": "valid" + }, + { + "tcId": 20, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35393837333530303431", + "sig": "5c4799e86c698d3e09d8c806104ca3e7cb604d922d4373d7119324e95befda0669732294666e9009f9c7711b130ce531b1cd16ca5a147490a39f8726b3482cb3f2683a8a14d04ed59012005df79d2500730360dfd40f6d7f90ec71c101a686f02cf38c598efc33a60bd5d9c6d4b2c084258f865b8e77e802dc85fa8c2f59d4530fbd1e2aee005c3d446ff8f59c807f0664e5e62f38eee7be9b2eea3f8f98eb2b44a0848a7076271ca986de8599830a59a1289734774118a967e70f63df1bb82374a1a08fd91222ec77117f2af9706abb91230b06d5022e2a8784919344647a3b2660cb5a689f062ac84c3613278043be9204a4239169fd14fa05c34d8a6a6e64", + "result": "valid" + }, + { + "tcId": 21, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33343633303036383738", + "sig": "32753c1f0fff11b1aae620f21f4b25ee32eb5319413c201a71da0503d32077c911e40fae8a14d944bc57b36b05d85a9b4e2d92f260f6cde67739b6d252e4800c8e5c9499f603eced7f97651e1ee878654c0bb205ba39b59285a695619963f7f36dfdb7a2040552bba7ff13d047d273f0fc1ca3892e7692609d43adc0de6e3191f2ee58f3069531509a94de113fc10c3e5d4c886108394a55dbc2fa4baab0623db347cd0f6e6306af8973f0f166558c31901c9458ef274332c15ed9c4a6ff8df090becb7841ce5cdc40705b799277825f029582eb21890e23712837088826c108341028c96b4c6a0dd7b37defcd82622bde64a2d54e4749b065db7da5a515eff6", + "result": "valid" + }, + { + "tcId": 22, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "39383137333230323837", + "sig": "a2226016f848d96442f82bbc33bfbf098c4cad85b07915dcbc323baad479bd971f81faa49b063776147c448210d4adef7f06fef44baddc672501e0444fe8a28f871f49f6ec634bf4f49d13e4f73c832c978bd227bc1e85804122157885c8744d31f777168a8cdbe7a4742366cdcf0bce50a0f550cc1729f2089c927990d94f73cc962af25d70a1fc4da6df8457ddb5a4969bfca4d2b1964bae88226ab11047da7b6e7adf8f96dbd772747f29bd9b9361244a04b7558df62d84828f7aad2e562f2306a96973a068b176008b0c7534eebf0ae9f7979a0902212d4e20dcf162ab51cd55944d9bc07692348f8306ca90a80306d404d21724a28efbdd228e2080dc89", + "result": "valid" + }, + { + "tcId": 23, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323232303431303436", + "sig": "6b9a45ec517bf838a535ed93fb36bb027471b11d20d0bf6b1edaaeefa25bccdf5881f34409a042dadbe4a7b3c41bf24abe66c1f7f37b92b9658f59c55fa88aa1632465ba8245c5f0c98d082fcabb5e9fb834d727a354f8f8a7fcdb8d3230725472a6a4ecb6f3d97540773e53eb45383acbe4bc81168e244fe769b1a7d5220dbcaf831e46c93f6ea7ca2ee30ce9281dd9674fccdc796fd6147be4bd99c53a12eacfd4b9b00972b0539e3d94b85911694ea98f27496b567a29fd3087842ba01402901d1bb1ba6b3c7931f1329ff5644989bdc1f7025059d0d069517fbb682c0be049ec7e38b614af1cf9cc37eab74e20e6bca468f93d3f13749557b70129ef95e5", + "result": "valid" + }, + { + "tcId": 24, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36363636333037313034", + "sig": "01926cbf92190fe7ccd7f858c260036a7a9d554bf636a82d43edd3d2cf0f5f7006c2e0d6dc43c7c427e49940cdc5c397df66841897d3e118cfa86f5188c54409ffc169e8f192c3a84896931d98ae8a9e83075e6dabe4d28a56f0a9282432511ab09a1a0ed420be665521936a1c9834a456997c0e5e2c1fc56ab45927b6042d3571163ba59d994b902aa5ed416ceff4313fb1c67334ed7be715d2e96c045d6c0bfd20f2f5040e09fbb077a01f982384ccd883cfa2fa25d35320746728ae530bb796f5ae6ec2c36aad3344ce69045b793052cf3a569293a2d232eab378853dc4030b91e1f08c31348224b774e8b71a7e23e77403cb26d1f2b1bb800c772860451d", + "result": "valid" + }, + { + "tcId": 25, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31303335393531383938", + "sig": "363ca23ec7d980a83a5f367cba3e9a2225b3a3ecaf6434b5a347e3baa5ce5ea27824fec727ec7b3ba2d41cdc9723f5cff3e75dc7f7b9200baaa2c02b4d8399b1760a1011231e2b26bad9326204c5079ac1c1303ac08fbae42f6a4032407e87915fa3759c43b29ca07a1a3259fbee4274b63a52860c6351246f8c1c84538e5e6f6add7ff6152acca4dedddab146a25bbdf0076e2879ecf93baf9d647b32cf32a9e62718eec599cd7b51510a70fd989a77426049092621c2386a82771b06a4c5b86bc28fdd630e76fe43f21c5d22fa63001da300ef9777c9dc4121158840bd084394d600a6db284b1e771112b56b63364f007cd71666902cac56323c6e5494d50c", + "result": "valid" + }, + { + "tcId": 26, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31383436353937313935", + "sig": "4a2dc205db899d51447b689d3ad601003eafb70a51051ae4e570c5125afae66427056fc2c9f71bc42610ef85ba0f49a2721247d4a77c6dc9f01429c2d9b909fc84dfb049bd351872301a7736195596a1c49ccb1b367544a190d188e4e66749731a760d76aa116fa4a189665a98975b7ec803e2695fef42eae7c7f8e274e4fb1c99ab0eebc76ad6bc8d768d2dfd5969181e78b3ee72fa900c31510f071a1da8b7589e49e254de8850db02b1be841af478045a847f2db9126a4281887e02beb58f1f0bbe67c9c7acfb49b5e4ec4fc76ef30654b5d3ffcfcdf7cc912c5e1f2b20d91bdd6114d25405ab65215c05c4ad2b6fae6662ae5130d17652ce42c0ce86c153", + "result": "valid" + }, + { + "tcId": 27, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33313336303436313839", + "sig": "45a2550893820ad511eabae35039a13457350df7ec21cedc1484530dc37ad332a170af8bb305e4bd6da78cfa4382045ddfbe2499a19d51838b3a553d7a849c49e284093e1f2fe4b269295a75f12dcd0e727a79c1f0e9cd2a89e295a355a52da7ee1dc2547fa43d96abef1a3b5121bca67cf450cd087c9d904cf797834057334f788c96763a4ff0a899068363621d90136eb530c32041ef3ede97a44be137d08c2a7019f31f8e27e156e509227860c723e3aef19685a5e3a10b78df66b38f299d60b2338bc6a943bc1b2f9261977ef4e08d1b6b42de17c4c652099d377a7ab983ff983c3bbbca99f79c8148f2afa9b0f1bee51e322ffc05b051e17d132a6e90c4", + "result": "valid" + }, + { + "tcId": 28, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32363633373834323534", + "sig": "258d169322a9546caa2b68089b481bd38348159fa9ed192d2eb60839029552a420d5b24644c3381a5ffbf2ed46072974918d777f1c53ad51f9ce8a91aff95dbcd817f50ef13ebfc9efb6c36987dfaaa96e37aa89dd7a32348906bcc22f4d0b5104c42181f76974651e3ced20d5412f70467d834cb49b1b7e1532ff417f91dcf653f18c43a6ad9ff4469600890f836c553963bc2379d5bd79ad338035f7f4aa6a27fbd924b5bc8d8b5373de7f4cdac75cbe0b8abd3961db17b819d46ccb4cceddcdb3636309d6754c6d82a61f5d9b9bfabd0c948777264c1138c6fb6064fdd5a797e551c1d0e545d1d32d63e1ebdfcb78275692cb50717910312da9917052cf53", + "result": "valid" + }, + { + "tcId": 29, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363532313030353234", + "sig": "824d0372c40297e3a0059236a93f60db3d2514defe409bfaa2890f4d04cb21043ba1871b8374fa51f1c4d7392d0e244222b1eccd118009e46bbfd2a84bac9e84ddc5102eb4508f5b9d77450f7aed31cbf5b6a4032bb44fd808bad403e8b78af3756f472563e050526527debc1ec49ecf5d5c10f279d06a5dbb7cca188ba212be9fd36c7eef8b187405da50dfea140c4b604dc313f28941f2c4447143a1420b31cd23663252ec0426c8465ade55cecbb9b9cf4f88e2b4b7c86cc5e2c6a4fb25c55835a2eca1780fbdbb8b354ba512d412e84e73764e055514e10d7ea32ad7e1a3c20dfc53732d85fae40ca951b5fc18f9ab21c9001dae67c6200b9cfc6d142565", + "result": "valid" + }, + { + "tcId": 30, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35373438303831363936", + "sig": "8367893d5ad77be24a739cffdaa7bd414d66442357db9bb339a7ce862b400363d9e7014aa1ced3a8c31d65f247e96ba5649df636fb759df04b7a62da27a64025bbb9719c7ab1d74d63d2ad5a324db8718742e5438b780ae630499bea065e2215df9313fd45a57941e9632ce66fe13a5359900a0ad5de9261aef6a11c3b98be765c94a6d24fb7c88fdec9d6fa52ffe975917d3b3d68794c6fc899b0f6901173fa91345df15f1d08dbaa0ed77e692f9de80d6670a95bce1b014beeba77543baf4092f4b2158a1f27b62cedb0bd3f2cdd381d9a46bae1aa34c2b8c36a65d4e44fa5aab1cd188d4202227d6fd537776980ebe636dd81d3bc0775bab23ccd9623d423", + "result": "valid" + }, + { + "tcId": 31, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36333433393133343638", + "sig": "99f149e9940d2a6eb2e824b48838d56f383e4503cea71e9ececaf2a6e9d616c1e941fc0f8994a0373ca6325f6de2b76be043e4812d361d89cce166e7c0f4ae8e0c2c8aa053ebe4568e0c5434acb6535902dd13901446a38d7905eefa51a22bb5b2a05b242b061643a8b1538c342255438d46824c43c5df1fb84631147b9cc689d7b828f2bd5abfb48bd40a1b0ff6866eadfd9588a0361d9bc6a076b978b9f855a36732207816c8b3c426914c73c9613ca53ef8261fc30dc7a15cf7c858609265946626000a1465d41b076ac9ded93b86e95de58c1a4d2b5cfed5d311b6f24cbf257fb03c47e443cabaf1e766167f524e6fb665e42ee046144f25544d46d34efa", + "result": "valid" + }, + { + "tcId": 32, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31353431313033353938", + "sig": "20d044f045bdddb0bfe994a34b5437e61446f9568f3c7d09137430cfa17e3929ab8b849ec7cd632079a88f994c0f4a0ce23f2976595df198b4f1431205c29b3fa1d37980855446d25327ee669324c3666022c0100cf1bf855c8774f3aa4898dace7a16693c614eac00cb337f05ec2588f670370c3ee40f29e8e900da16d1dd28aaeb098f8f3b918c562f8c2512af238ed4ecb3be4ae39374eb638b021419a3e00890a4eff70876fabd74eea1bd56de05dca208928d434e7342e9179471e958e235a298f35edcf9ad77411f824d5c53b4308cd08b0443b58fc5a868399538e5294dcbd2e94d02c719aa91ac12c3839bea47cec649620b73235f368fd5d977e033", + "result": "valid" + }, + { + "tcId": 33, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130343738353830313238", + "sig": "4c8d64aeabd2e12c8f2e3d31ac3f4b861723ab8f9a52cb8910b298fa3a735bf91284e9ad92bef3995a1058fdb0f696143d92a99c69c233f60f64873882c1c9ca8e54cd03350804aac319747c5cb8ec6e42f6100474158111b30548519e02ae9ab39507efe50b8b212caa82305d9f2d2c43b2f75c5538b0ffe9423e1044b5fa05bd675e1afbe6d22e73ced8dddb3a00ef37211136838bfcd37655203bf2c830a62f2c707030e2b964443df1ea24ab1271fd06b3d6c1ab78b13374c086edab36267ac065bf5ad799d2f27a6f4bae708be1103841aaf21ff547474634e94c7ffec8b4bdf81cd00cf0f0e6f234cf2d208e2af2e2fec001944e9444b005c8ed919903", + "result": "valid" + }, + { + "tcId": 34, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130353336323835353638", + "sig": "0e97e294583f528af631e44c02563344657ed47783c119a9d28d6c0f39b6ebea40e1847b9f2fe2708bedf44d2037ef4ba7464c630b8ea5bfe1c66d4b8729b20ffd22fb5721199e884b3b314ed1a6b8abf11c72314dce375aca1d02aab773d88830d1b56e86f45b1862482242d9ff57a1473876c476c33fb8228420f3a6a31f85b77aec3a8d60b383eed4f07dbade1020f5afcc08132d0423319e85f51235b4aa5e16c0b183e0fd653e594c6b17f25d055b410b78c890f29c7966a8096cc248906084176e090af500c9c5d9235a2d35f231bae74deb9b860a541d2bb933ff0a200ccff8ea3642e3350562cf29dc2c1100401a9ae0c0f5e1e6420b219e34416254", + "result": "valid" + }, + { + "tcId": 35, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393533393034313035", + "sig": "80aa94e49ee824191050c8bbaa73b352fea2311893d8b8e00e61a2d14701783d364e15fc09035482747711fa1fa72629460fafdb23474564527447e0c05be2ba895e2dd1853b9e6079afc1464f7c8689b2ad74f8cd2bbbc7690c91bfe2671bf3fdb1a43927c5e73123f4dcddb8dff9f06bf254ca2cda0a039939ceaf2e196f2cb268eea37c515d0082e5e9b4a82719c6f5ddd6e6a779054325c1ac45d6c2599f2c83def50881cd9d3a8508749646c9296ae2429a96f580d7cfc54b2f08726ed3caf7c3e5ab37d32aff309b1f34c1b8d77e2da69b619e3804ae6ce439e796f86340dd0bbbe7ea823857d9e4eb1aeb7604fa16f4b0683f78a8253d00fedb5b6024", + "result": "valid" + }, + { + "tcId": 36, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "393738383438303339", + "sig": "1e10e4135796443ff3a815be4c873f9f61675c85137ff4397f600f4f5ff79634aa4ffde2195419fc78ac82eb7be206f91443b12d743457cf7fdbfac6d7f66fabe26fba464d7f984c6a502b19c8d4b634cded91d4289bd84ea7b2fdf2e6229bf47b40feb368692f60277eef9c0228bd315a3237458107c8fbfde830f8c32acc4d172e8eeccfac19e99021cf8122487f93175981bf9b797ff869153b8addaaed1f184a677fd694d88ee0eda3959bb3a0d8f66c361658359eb117eaa91f02c6c0889f69f9a14fad91d2fa443d2bb17f3aaa41928546e163ec2d09ec5cc9758c7cda12fb29692f09abb987a135892f17afac78014624298b1af79a523fc0cbdeb120", + "result": "valid" + }, + { + "tcId": 37, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33363130363732343432", + "sig": "73e39468a5640718bb56f26939ca18406995013cd10a7a72e65d2e6b1df2e841c1a7394135ce0e5da4a830bdfaac5bc5b2d8ddbe6b5098a3d9de96cc639823f7a1b23f769ba18d0d4772c1e989891a4d60a95bcd42160a78931361522da1ce1f10204f57c519a10c2cc9ee3145a0a2ac31c37b3b5e5572aaffda559f05a684402bb5c3b28c6a2ae263214073999508d96a96c30bf02fde3de162d937c4f2b31ffdebc42f9267e621855fd18eb97c0cfa4977c1a3765b4ebce955a9c87130baef1853497407b1922be2f43b6deaf7910d6f8fbfa97d870f16e17a3b9c133be1391e847e103096fee4905f246facbbe8c95f62d15f302cb27e8d4b69ec249af4bd", + "result": "valid" + }, + { + "tcId": 38, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31303534323430373035", + "sig": "40e3504284c59620caf145dd9f2425c39c66bb4e0d7abddd694b810be4a9e2f728d706531019e7e07293066de0dd6c7c68ccf32ff2d91dea74c592c504916148551c99ddd5e4ea0a906500341b1f7f6a03c4901827fabddffaf1f028139db5292554186b867a012520d554bbc42b1d73d52b397a7c310e7d195037f15fb1fe729f577d1847894436b9828eca4fe881945c1a38a40805365dddf6cf7708cba2948a15b756757d6246dad90985222e4baecc7823e4e7e99d568a9da144a5b556220aae30b8a8d916a050a869c70368607dd0092ca9b5a00865d3bc1ee0ec06df53f9828327127f33a97796f6b0b255f1cee34328cfd2ca1ea3e692d0a94e457ecd", + "result": "valid" + }, + { + "tcId": 39, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35313734343438313937", + "sig": "72f7f4bf01a6784face7d31b19c19ba1c75b16eff419f81b39c1c17cd489ecafffdb2dfeb33045cf679a455336bd6869ae61109043687293bf98ef7ad03afe6e71ce4d43319743c07c313b12a728c8a98256bd1fd735152d1d2c83de2b8b57cf9bed4691ade15eabd261377c8e26bab03d0da055086dc4ca5870bdcd9ef3e7e0973be871738a3e389d774d5d04d71ae0a3be03746aa4b7f20afbb3a44d9163cbf4e675e36d01f016087d4e7c68b2e3020f6fad363948804b0494d7b38d2ad4ee1288bfc5166b59ae3db2c2c03971fd42d04e6fecbd36cba6390fdd878b67a2c6565a7826671144712108e37adbe8198a2bb3a371c90d8c6880dbcc948cb4f775", + "result": "valid" + }, + { + "tcId": 40, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31393637353631323531", + "sig": "084cf6628f8f96ad842105198bc30a72bc3ea4aa4bb01176780f384f9f4ef2dc9b591d042c56c898e48d468226a9a361a9c8e0b27986fe6499112d9f425e08c778d01d3b221dc110411006373ff903d78678b5b04319b5f96ad14d1395defa4a517d5ca7307983a7819192ae7d87828eda55391444cfb737889f479437112b1a45c687a563a07660223d7fa199e0924d6b80ea18de201a6d8e08a80ddd0954032cd3f9ce0d85d0180a08a88d813c6ed289decf3f1c1514adef9a9662334d6e5177d3dcd24a2a170a6555d218aa30638a206b1783edef43aeb6f64192f2fec52e2f82f4dfe23726719e16a3ef873ae37488449634833ef2b74b4766f4ccffeb2a", + "result": "valid" + }, + { + "tcId": 41, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33343437323533333433", + "sig": "4a510dd6edc7eaea7ee9302b007844433b010dca7be4ad12a8165da93fb8ff74ee5b836769608a1e207e208a7d7fb2606c9f0bdcf71391ed5171100ab738e54d0180a629706db39efb88b690783ca9ad25234bcd6ce0920a01f74c9afaf36500434519afb3e8ed2b65a947298101a751ba46cb7ee51c37903d60f6ac8a7f3bc726f394dfd5b53c12d5703fd719aac9589046f9f4064853fde4c92374c1da4fad27a4f603cf23a9ec4ee478677f000ce18feb791b130c037d4347abe36901586728fb3b09262ccd0feb79aa61eb3503283ebdb495316814a74c74f5819b165e2d0efd65d53e4f1e73d76da1847f8f8b955678437b4584bf6d8a8a291684a1a99b", + "result": "valid" + }, + { + "tcId": 42, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333638323634333138", + "sig": "12b06df28dbdb8c6c34610ebca8c6a730558f6669bf160b8083b4a18a4d641c333d770d03c5a6a165db07305c0d0deb6721355d4c5963a0b614bf0ad522ce2f339fec301c61bd3540d0a7bf295cd67a7ab81401e3af1c66e5ac4d77e95c8b5d00bf128dd1f47a847ab78ade22f6ddb158e6da46950c13eeb10921bdf3b5818506d635020810535db03e291c503902f25cd67e2d2f731122d9f18c7118ece369adaace1c74222b47046476d6f48910a7d6b6dc4fa528199d54a47282e59948ea66bdc52b9dfad6d2ad34f19017b2f929ce5684ab59d30e0252b96c762987c35c77eb9af34e568fb7a2c2c7f698cd487af1852e17af1bc2b25feffd31315a6cead", + "result": "valid" + }, + { + "tcId": 43, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33323631313938363038", + "sig": "29c01987266ac014487e26052c19cdd9658966444197025bda28c8d47a67f7017dce389dec619d61c01f7f1758f8d550f9d4aa98d6abfea6aed8143fa4143c853d4af2ba3c5c5df1f1811d3151d35c6bab09ec94aba0198383e326955a1ce54d064c6d734f35bab7b18d3d36d1ff0ace46701c7db004b75cb44ba1bcd2dcd2cc76d1b46cfd91d2b2f5b03296224a8e4e450031a32abef86c1f06a008b56b1c3c499b8eb951ccbcc9404d3cbc68e0b0292c4d141030d6f3db18800c987c34730e689a43f0436ff002233da7e8be5b242abb13238db247b0b39af3064066d3d6b44da065ac9005ea21a1ace2b8ca2729f5de2f579f66f201e91bcc31d5b430e322", + "result": "valid" + }, + { + "tcId": 44, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "39363738373831303934", + "sig": "400026440dc38f61c873f0e4eca152d72e4237a685ca69091b71938cad2259fa045af81d9a8e568f71b2f42b9b5fdba86bc3d5d5dd85dfaf2c128200bf786ba209c783d9a9ccdc0cddfcfef579f6c9abc4aa4b4ef41f39136fe1d960047778fe29712bf6b27817069554ac10f2853cbc825882bfad9845ef304c17e2587e124c6979427a3be80965b25b6ed25878758cf3376c7ec7c2bb8ecf2529475ed24ab2e37beac3307fbc2bc0d51b39005da9fe87d848cbc1f8625d47d7dd855acd1b1fc74edf0778fe649892f1e9750110adde7e3606f32551533845a5c45453e9c17d4b812ded1c9ccba702a1d2148c64547f6b53b8cdf854b9fc9ec493c52830d769", + "result": "valid" + }, + { + "tcId": 45, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34393538383233383233", + "sig": "5ea77a298d24682962746d11dc54c138a79ada1c4e1431bd06bad97ac4d0424a500b7532a3540b657f934a7232f988ee659c0243337d7aaad534bf15eaac5735144cffda19e96599f1d1e1e187da6da5fbe2f9ce7c1240a3d2aaa3c639c5eb8edbbe4eaf69ae8df45286f85dac27eed162a87f71dcd4e70a9960e706e6a4e3b5c5afe00d741a97418e89f0f3bc44137f06935c767bb04338a3dec5917351c65251d74af5e5698248eb498dcfdf498aae03ea8cc88593b98b34988417ba697bdfd419001216e57b182781d07d3afd0371e1de64004fafa538c01e6040926bb193c34f3ba820331f8fceefd87e78fa09b07afd0d116993ec549cb3b7f1043ca605", + "result": "valid" + }, + { + "tcId": 46, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "383234363337383337", + "sig": "6567fa3a976c472555e45472bb8a6ecfec7e0e80e802d58ba53a255669101d3d362e64cc3460942d61fbe617772d381dd345b73f4bd37673375823801bfc6d1bea2e0e9cce5e607afc3e66c3da25cb29e23359cd93626efcff1e9e79b0a7cedb75badb69e10a0cc09e26b3684ea11e3c43d3af040da87cce5b1e30bdbdcdc7bdfebbe5be5542e18b62935b0c2bf8b3cf2507aaf2bed209bf4e7fab1fcdeed47c9f7e2b0dd2e4b0b8d3b2bad9368f58c6de0ce61eeefb9b3b98dcfe7881e81e67e8e8908a6c71011ff69ce21fcc31398a99804c9ab48f50bcbca80104a8b67a8003880cdcb114c13255d7b1d1dcd7f08aeeaad06637aaa051cb0eaffad2420df4", + "result": "valid" + }, + { + "tcId": 47, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3131303230383333373736", + "sig": "742e9bee462eecfef3e7a05d24c498259e56c5bdb9d0a52aaa24e07d68c9efdcd64dfa5d3d44ce73c197188a9168ec7aada05a3aafb8d3e8c45b2d2094f2b2f9df6125e9f0a5c129f33db1387dfaf7724cfd548f08a94593893558c34d9e66d331bb0719fc73152241f3e305d1a7604328c12e65be342c0f49d0650e4b32bd8db65b8674c3284549d4b6853db320cab0d019287a8afaf2486d749b8bbdd80378455112d5d54265c5e94cc3debaac80a6e3f0ba47e58311bd0f0407ac90b35d66a8aa432f7bc59cf0f6ff134852a33f997a24c737817c90c89b22cf313d30d9b9dade41371f8d6abec63a8e01532b4d4c504fc4e78ababdf325970f4dc617e4d1", + "result": "valid" + }, + { + "tcId": 48, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "313333383731363438", + "sig": "2507373f2b7f35f58d9ea31cade482f13a066f4dc89f38a9359f5c6adb8b4119f0a62fad114417431a6408869a2331386dcede6967fce30a06216f1464b2a86f130b4eb64ee63ede489687c82d578c33046f6530b1f27d65d026f9498409fc8458f7aa6032d64f692c163daeae124b2ef879c5360d78985327fb6f20db8cccc32ede8823ed05313e4a3cc7784ea029a42b110d07186338e9adcfee27826d04150e5d81bb02cb1a5d7a0950688f213a955ef2703a3dd4702abcdb6a9ea85a6c764ba627afa354ddd98d2108a05bdc3f6d4740ab24f2dc306c1ed9a55fe724507ad51855fc82b86ee6000eef49918000381f717e12b6a6942feb1313cac525712e", + "result": "valid" + }, + { + "tcId": 49, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "333232313434313632", + "sig": "82d4d4acff7bdb073c4f9230b81f910fd919dd1f8795e7a6e8bb3b968bf92fb2d62b592080c3bc6e3bcbc1433a2f3bb4f1548e78ad86ba9e7cd1f11b0317eff4c3e7eac79bfbf15bfd3896b537afdd3f41011ceb716edb7cf63f5db774c3f50655b13e5c587606ebd6004edc169b6802425e20a382e24e54f77cf4b6adf0e8568cf2c8b588bee5ffcfc9017e67aabe73165304e883635182d19f489596f7e9079c26fa97ad9e02ee41717179bc0ca3b380f9e639052ac3608514a235387b593fd6470a3aee56f9b8d73b5707ceb6f6c926ecc4b8ed9cd75b8d9a8931f72251e366415372fa8fbcce42d77c353ca926fb3f12f60543111cbdbdb1842382fad25a", + "result": "valid" + }, + { + "tcId": 50, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3130363836363535353436", + "sig": "7be5861600d3196bd6124161c3272ab36167b4137b0705b648e93cb9cad8a4be37107b2ab449f421fd57a55bc3fe9c6fb6b829dd6d6fcbe88eeca9bb93433764fd0a88113155a67a5fb514fb2101372e6dcfe9341c9538d8673472a0e75c028ccda4aa2e10f793cd0e10162167a98c9bf6880a78651f77774eb20339f3968e9cfab74dac2261ded111c047ccb187e11ddf255d3695e25192863d632257444d5e469fcf0ed88fdc954ee94164d70218ef033cc598ba974d8a53bcbd01de333d4e185faf85b86acff65b29f15d97321ddc21f9afacca674eccce7fce1287ba508cc2a55c534a2c5d678b92b86dd02de641684c7c8b0f14863cfaec3d7eb8430486", + "result": "valid" + }, + { + "tcId": 51, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "3632313535323436", + "sig": "602440aba9a9add4716555fda1dbc6a934224c6b762433485e160620fee1607e9079eb265ddbbfaf75fa266b19d752b7721d4ea5203ee2dca840f078dad7517ea2392142e4a9086401bc3ff19ed5b7628390b0175bc982668fc86e2fab33acf17f3ac229d12ab7cdc29ffb98649669ae3e6443d0916b611489c9642d356ca1bfd3aee35d96bf9bc7a9b6734be5f77f96ddf2b9cb366650619c53dc5b5beadc7d5815e7b36b58f3cede2d47ff228cacce2789b8d875edaef9b0919bdccb9cf90a7b5eb4e7b996215c943c017e24d1f2ad8c3bd844668d0deb566d587e378c38d547f8aa473465fadec8624fdff1f980c9506ca12eb999f2b8f18f0f5c9b2bf460", + "result": "valid" + }, + { + "tcId": 52, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "37303330383138373734", + "sig": "1bf65b125ccf21ec8894576bb4662a39ea4e34e3bda2ca48718c56719d1ec0d9a0645d06440c2dbe96b1f85fd20206b001279ad273e1a656b554fecab03d588aafa8cbe957a5d58c976f85fffbe155bacf78f7a39788027a1cbde3c01c7957f6bd2b9708ac5d6611a82e43f1363f72ecf4583a32c9c887ff5af1a70b0f0815db3d89f6dba2f06cbcb19cfc49851b0220832809a158ae9a8aa4508880f1169a301e7096ab74dd4477b3f1b6242f8bc6591e61bb46d871efa0b74836fcdecf371c04cf786c9899d8c0cb47acb6790327f6b4edcce4b1ff651fba61c4442ae3e4d9a23601ca8f8aea8c6055c3b1cae8fe4b506771a4b15ec8d2c1d141dced2d908a", + "result": "valid" + }, + { + "tcId": 53, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "35393234353233373434", + "sig": "9fb119ffbaeab1f338eb3c8db5aff1e13310172cfb7b9773620a9fb6e8454f029840c88ae4f33f85558a82a9b9bc2b9aa4ce6d49f5343f79011f67f2c2f46ec7b787299b8fb9d0c46a18acce3530c9b88153022964d87dfdbfa74794f5067a39bf3e445cced358bf57bbc45b7a29e550b5fbdc0aa91d1b4db74b11d99e995ba2e1ac76c0fba496fa95016b8c9544105328b14b3a3f1cd45314ab67dd8758df4d4e66a01dc89dc541e9d46feec6d1469846c778d8893d39a337d317f66ed7725196af6e878d53663e05b8c6ea215264d2c897424af9c30aee5021086b6cb6db4bbe27bda99e929469df9192bbdfdba572864b15f468916f25f7bb87d3d02f39c2", + "result": "valid" + }, + { + "tcId": 54, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31343935353836363231", + "sig": "77590c1437b5657d4df385c0c639e0e4eecf14df26e89d673033944c5938bb6b1772b5a9aefdf91c19641c1fdca98836bea1dc8219c01edc9eac96afa2f04587b76e85287f78518cf3fbe1e84ab574a9358c1b0ae3f5a843382faad16d0a7f58a7fd73868e4ac2dfa57f8ba692734a689fc0b4eb270a425a69fd3dfca7fa30e09996684dbe7f959df6025649c1b45b0697315b98fd66e587ed09abd43f0ccf4dff7ad83a8a29a701be77ff87982c3b828b48410b7bc27aa01d659e88aae6f09ddc3b221fad1523f72e0804f34518d213c65b47f235fd626419edd0c93734eaf11a91c0bf8c4c3e7a9c95c8f66f0a690e6d7ef75b6bb3080db75a8ecc3be86853", + "result": "valid" + }, + { + "tcId": 55, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "34303035333134343036", + "sig": "8cf02d19d7dc5f00ec2938220bf400befa2044fd4033e874ddee5b9b1f71961bb151e670743e36f167e02a8c49b227930e236e09cec23db417eca18740f78c752e85879c32c1b3e21139ef929e99149fcb0ecf0e334f24242780273e9ef0893df58996bc156779afaae7dea56328875cd85b030c8b4cb4f466a87c449926d9133f452ff7510fdcdfd66f0fca6e9d1a84b2fb9a7d001885f52ed63aee3a22059963df11eb6a67f11030d2841cdb90d3a096739f36ffed1eb538c1b095f8172dfcb1b5a325468f78a9ba11e028e1fca67758ee0f66a7c7002f9d4b31784b93e99e838c44efed881756c5934798b9b934b751d4343626ffc6875676f4373051351d", + "result": "valid" + }, + { + "tcId": 56, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "33303936343537353132", + "sig": "0e44384d7e96521340c9f02ae7e320636e685e965780e191f9b6b89df8c1c8f68008c1691b3e706e015911b519f08813bf8fa5377e2ec2ab858237b9dbd458a277e5e42bae0e0ded39f7c8c4f95fef46044217d2e4a64632741c7b84e0063a13be92380a46fd43f6764ceffb5d8a32eb0bf3af7af9a3b4e07ce56262a4ea3ea2f3abd4a5eb71849820031f61335e4fb8269b9c201c8f6ca662d22ae1bc9b5834a291cab864c9aca7e1120ddcc6597efee5fe3ff2bc8f707b6567603b536b8d17d3f0f0bd9ce74a535c2012faf0b6bbba544a376af338f825165ba31bbc5f88fa86ba8bac02f4035eaed4708ce7972563272296097a132968aa37030af8e3c5e7", + "result": "valid" + }, + { + "tcId": 57, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32373834303235363230", + "sig": "905801fa11f3066c89d0976a303f21f97f042dab0102a066763dda907ac822a23f9bb99a93daa2d414df4e7122f74cdeae5970dc132cd0ff141c5698eecf43dc6ed1c93ed6f6abf8b5f056f674e96dc9a69e293510019515decf3c1396cd84f5a8ea6eb6a82a9197dc8af18fd4715ae24f0638edfcd1c12c5fbaf6c7c9b270e918457b3afb0b9a4be1f238410e85bdd7072ed684b1db2d96e0af02b7388624107132c7e120041fdf0ba46a7f0c12e18b8e72dcfa1a293cd399893e053080773a5b9e703e6d6bebbfb81fa23da8145329fdeeeb72d60130bf057839ce758ce6136bc467daa8ee8dc9d7cfdb966a96bbae15a33167c101f3fbddc164cdc0e94e04", + "result": "valid" + }, + { + "tcId": 58, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "32363138373837343138", + "sig": "366ab7ae0fc28753f7cc8e7111398b78c8323de7177e51f9b6679a87888873f9e550aaba9fd7dd25f2db2b5224664d5e738afb98cbf7b2e86d2ec9a10e68cfc8228adf866f7cace0c6dbcd381ea62dcf4e239a2b7bbff1b83db5790df09f2b8bdaabf48c38bc5d00914961aeea73c6e703bde78b806dd41047d1799ba8add7160d6abe468aed61f78cab2dc739b95f5ff2b9da3a2cabb0129e1e064af17d37a194133e0498d7f2c8319c01ef20ac6f4b81eaa037c86104bcd03dc3d8e5cdd65af7ce55d6c483520521399aadf7f2c434838067a255e1ee7e35641b1997836f010902ccf3b2b16748ec87bc52db2e658350c110aa50bdc742422270d3a2bd315b", + "result": "valid" + }, + { + "tcId": 59, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "31363432363235323632", + "sig": "92832328c12807514ddcd919636b9bd125192ca98883069b2ca8edfbfb0d4225db3a621bd03a7116f9b919b16b2568a897a793d20e9c4328add71ab2a2045c78ab1c3cb769ab957af2a3b572b3bf2c0453bee10bbb9fa7efc60605215989979d7ee5724f73ce85c710aa00f24961e5444f09a83a82eafe3839f8dc3fa5e27a6cb122ad34f80b181142f762a87fdf8e8e77b42b3416502158cc66dc2dce34e29f1c9ebde9d60c7969b72d9e841110e035807e2a6f85cdcdb875b3bf8e3ab1f6d05f4adb3d738e9965c52d81387cd0a702ab85576a50072a994f13c7e691c3eb1fc4c46652a5a3f482ff8fc25888154cc8a1348913d1cd0c19d77c55b6e46e50f9", + "result": "valid" + }, + { + "tcId": 60, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "36383234313839343336", + "sig": "3fc17de411c99243a0e5d4afd5131f177bcb4edce034c91ad9dfa87e3c31dedea675574e917954832608dabc72544729fbcf91fdd1f114ca43df0af73e2226b73a1797fde7daa3cea6b086217d656798f9abde4a563e5a8de203480b42af12e636ffaf7c72d2dd791165ce3ce4b1e21e8b749cf8e91b78f561867c892361c1529c2c9ee780b6a79b72b447639ced5b4a04fd3d2d716923bcafd793cd1454710da5c785ecd2c44cac2f79520bcded6d3d27f9d2a7137a68e69c34d15592e963f915e88b8030cb7f275a3be498b25310ab4cfba7bdc0756aadcfd3944a609c40b9531cfed55e7f9f6914d53cc17dbf1d9707fc57ded6bc04f690519cdb2bdcea29", + "result": "valid" + }, + { + "tcId": 61, + "comment": "special case for hash", + "flags": [ + "SpecialCaseHash" + ], + "msg": "343834323435343235", + "sig": "467d466cb8e157b9cf3f51920b18f1db2401f4d2c397ec58bd3c6ddb1d5e9d9414583534060773a13382f93f0d8852fed208e4ff560ecc2030772955022aa594767262dd02f1a89ac48bf4f7a2c34e8c764e32b39b9f9d1d857164fdacea8a93e3456f4dfd9658080e3e45c0f17bb599c456e2cf5946140d467755eeabeafeef440c72272af08a4a4a1391d96d750211361e5fb78e9439c3e3b39e01ac66e40d84727908db4dd7ca742c1454762b2022dca5e1bb1ca5d051589988336bd5334f72d12fe9ee85a9c77ad4e09e4183928661e72cff1c0b480215b9afaef2601399a47fe6286acc710850b7c22d276e901219028a296edf83bfd5ef21598e5fb55a", + "result": "valid" + }, + { + "tcId": 62, + "comment": "first byte of m_hash modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "67d1d1c0a398148625317c3f5e44b738bdf461c27a59594b39ebb2aebef233c7809379e54411411b82d2e7ac88f989b58373d532c758baea121878ce9759441738d121881c1fa2d04421f02dd565b12770d844611ed1873a0b64d822709a6b78d6d3892b294404bce6711001d6c3a54546c76a1d17819674b0be904497a233b466fe4becc832dee740f9ab79e5b9f5db0b0f9aac0084ba05cebf42303b5ca2ad95e3d61b29ed6475545c02e93e7b0e118af92f5cddb1faeb2cbc23c9e69c120e29df7fe31991e887b3b29e77688c60e80be65cccf3d7861a7a14c39e6a6e5645568e2cc5e4a17b75db1dd415aadb45e112a9b582b2ff6e82a43d7a7347b7b56d", + "result": "invalid" + }, + { + "tcId": 63, + "comment": "first byte of m_hash modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "842348f2b2cdd4c72cda7dbec0fb8b114e419cbfc1ee1b7ce5d70ec56a833c4ebc8c114dc3c92164b13f4692f236d6b88e5618b23af9fa979fe9b5d8eb228b1efd0da8e47b4c4042965c8b9f08eb9f6fdf7e472c88f532d4d851623b4bf99e021e82ef313c7d93179af810b70aaf929a395ece713d5fec3339e394210b56f1edf26dedfb04083bd24eb0d3ca117761f38319c3b97a9453993dafd3d2dd8c01cd63117f8fda46f52565e4d7de9f718f1f23254c4f9ee77ad1414af4d4dcf959a89bef438329516cc9b79149db058d206e6d7c0133e7c870335f0490b8c569d787443c4a84ff665dbc6f4353dec66f9c488a3f91071ce19553a7c156025f1f81b2", + "result": "invalid" + }, + { + "tcId": 64, + "comment": "last byte of m_hash modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "77c9dd7786f0b5cbe76f20abf24361f8979d3a6c6c122e798eda906b0b9700cd2dd26e5286ddd39d07b7c24379cb40f8350354a36b0759bfade61d3d770702b58218c5dc64ddd0d5fce405a16fbc4de3a5fbe7737032605c06ac82e174619c3004d24bbf22bd1ab3e4d432b4ae36c23573cbad845c16a1842e5de1a3bfa2f12d3496a3114fda830dd6061cf538a4571fe088cc03dd7e8762fb08b84501843f5f0362a4fb097d6fe9b96970c0c505d2f6a59754c42684908627fa8c734ecd587c161de7b7bdd69924c0b4d06cb7db2a70dd9257876d1da1ed8cc00fa68279525c346b7256c916ccf1df9386ff9d1eb27f0a5d83a00a2738fa2dbfaa500baea789", + "result": "invalid" + }, + { + "tcId": 65, + "comment": "last byte of m_hash modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "455221c385f769fedd123afa37a42b7477d6c3ed968ce44d4982c41ad29a3f59baeb2b566dbacc91b423fbaec371f3809c20cad6afcc2b8df782e472c954cdeffca49553f6eca58781894c67fed1d9326a53422f9642031b69ff45e6a826d18e4241b5214231f7d252d4c640386a17c2a1839ba9c5a34e94b2b8f30fb259fa752339f134e54375a9a4f3a5dbd5f3fb93c38b59fc33a77dbdea9b8fab7c209e6f403d188958b5fa5481bd225b266bee6761132104890c8c25f04583084eb01c266ccbca401617120c61a388cc683fdd5d195c8dcd48f4d1a9be80c07727f78a10cd26359c8dd1d87614f8acac1506c5bba79b30c0af745c872433f17e8a52a94e", + "result": "invalid" + }, + { + "tcId": 66, + "comment": "all bits in m_hash flipped", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "5d1f5b3ada8d4507a7447829f26764b9f794ccb4c287870b5c5aac649f9272fbbe22f064cb75e5b3813bf874c6977dc286ef1deddeee1a84a9302fbbc9c8f86ec45eed5469bb85eed8618efdaf29ea4bc0a9cd0c0be71e82bdab6f15a9f7a637f297e0b5ad4c7885bd27b89f4a52452f0176df3d266f9c13fc44d3fcc3e71e3cc5ede3fe2555ff2bf2b72a2198af709e29c2f6f5ce44997c02ea7aebc9a33d0c609ff0f586e753e585ee5052a0bf2f71247cf43ac244818c84347662338384d6c1a4c9b9ebc14f912db688e658d453bb2082c8def4c440a6b25e03ea4459c1c9bd5495e2ce9343439cbbf03affca63856cc50936d49cf2dcfc73679c9aa32e56", + "result": "invalid" + }, + { + "tcId": 67, + "comment": "s_len changed to 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "5e91b5dcbf02d6f19621d41a83dc8f15ea83c0edb83765ef029b0acac2e1ec8918b1d2afe1fadf11c48d27594cb9c01fed79d90e5d5a8085c438450111aa7d9fa39c2345b14fc3c2cb34128f86db5eb00bdf8dfe38d61f29a41fe31342e7aaefcb4b122eb5d63c2f5c263c8df8450e9428ffef974d535818d51dc03a7d60c8b2d16c999ae46d73ab40515fe601d9b89b1d09c6d60cd51639a97c1d211e097609ba5e8c319c6fbd21b34a634ec8fb8971c5aae21c70b847a4539cc10dc314ddd8a9629e8a0e51c66c0cb61fd1f7228c01c6769190abe9bac9a3897800050014358594e0fb20dbb458b12aa1346826cc9f7e9c5352b073d62853dafe77c848cb1f", + "result": "invalid" + }, + { + "tcId": 68, + "comment": "s_len changed to 1", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "92ffe544edeba2213ed7d54488432dcd7cc1c71fd958acdc56c41fbbc8f1c16b565b1595fd3b88c48ecce181f9cf6bcfef4636c2398ac06ef8088e14cbc97426a501c05aa71a54a3329aa53a4f259c3299756a429a7baa7a50f78da8012e4fc232eec623145388d37c41e6cfbdb1afaabe38e31db381022a428b353d2c7f374c58f10c551419b1c3bc455b6f66b75c26b5068861f8f96f3700ea37cbc0b4d3ff6603a1c6308409d040aebeac2a661f94940122acef1771d44c5cab2455535421451bb81d0656605f8df2d0ff29a07766092dff2fa20cf68ffee574bb4b2b0a3f828670fe93d2de100ff0c9443319ec7283c242a617eab3d445b655ba674687e0", + "result": "invalid" + }, + { + "tcId": 69, + "comment": "s_len changed to 20", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "57e8cc1dc00c07383d89a79b5c8e4f5bde2a2ba55a3c7201b3291c4d805b1b2eb36f8f326b542342da180abe508669bb6cc2dd54e327bc70c1e317ba93a0fd21e7fce22a0c597c7420d1d5602ac43d9348ba3eba561f250e301ab955b0dc33e4abde32946b9b3e86c8bf07a44646ca595960bb988fef04b2824967e9da8b0264f1da0659373935313a574b5380f0b54ce1bc0dde423bd3a54f6ae5fafa772a55c1c44eb6edffecf13e6e5e1edaf87a79e338577304141fbc44f0e9eeb286f553f879addd6e12e436fa3af51ad53a72f2679f0ed102d504ee08706fe111eaee49d880d1a0b91924b3b79968ed0f9bff446dac199ee89b158c074927d27b864498", + "result": "invalid" + }, + { + "tcId": 70, + "comment": "s_len changed to 31", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "5d8c3644e0e18da9d81ba3fd33436e4379d3c3fa8127b41f2eb901836b31a78f0954d3287d452887ee3a285701a920b0f6fb8da0e017c7bcbe59cb9bf5d5aacb1032cdc4ddd85492c0638519a4694f686e77305d138b9d3491460f408abb8abfd7e3622aff5a4a96b383ff87560e9be962aa4696be3668645e6a43b460b18c93af0578a8de3b4d2fc657376c7ec9a23c473a81ac57da1262b47204c13f5befc0ce2b4339b83999cbedafa334ddc73624eae8b7002c082d8ca7064b6963b443ae32b2a16fcdb4ad5e8c9b8073305ac4c14fe0c29514320d09b6e48ddea9f3e02cf3273f5cb5871a0bb81a935606b7fe56bebe410c5afea5a8af3c426b72cd291a", + "result": "invalid" + }, + { + "tcId": 71, + "comment": "s_len changed to 33", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "563e94111eade9526d1f2e93da16ee171273291abfb90aeb94ae7b95f16395949ef3d3f0994852de035cebf8cd002b76579d0758325c6750ffc917be419174d255a2b798ce287f6240a97d4fcae47e88308658898ce37407e9684caca197c46ec9f66a0ba4e8aecf6a7ae749304fddf1ec4155a17de5d01117a3cbf2a34fa77d0556a39451b697c869e6fab3283541816bd6c7520b5eb0ee6b592a19331ffcccdcaa403f4f25e732a847ff260ec40ecfb52abc6f65f95d21715acd2c0dadb23d7e1c0fa8cac3e60c6f19b430f9c252ce1f392cd2f7bc87a4be0a4dc0b7f909afa7c25ed1b5be611bf86a648592786385f02c345eaedd03c4b0bb5bb758254d9d", + "result": "invalid" + }, + { + "tcId": 72, + "comment": "s_len changed to 222", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "09a166092799e0dcc9b4e758223012162cc0d8560b77833412c1bd37c8b0ee5260fd79e25a5dd1fa6a78134b26c85b4643f8992a933990f1505d0309bdea2bc41418e32f9966163730d805fa688e93f3aa5a8f01dc1095556b612218932ee15f72cb6033d3cdfb44d67fe53abf255180a521f7d5392c3b0ea864c4daed26ce9003f1b62cfa8333ca201a5ab3b78958a4b706a45763152e2b7b7006991ea80a7f06aa1b7ed23e72a9ea0f4d987588189124647318bee2a7f0a420a21d5c7763b50d2f1ffc6a3d692c840fe6004707a9990c29bb0e069b03702a8d25f4d4f54b9568a7ff96d078d9c2ad9b51b625b968893c66b92d96031d4a10a95b98bbcdeaeb", + "result": "invalid" + }, + { + "tcId": 73, + "comment": "salt is all 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "1591ae743c58ceb723a76f502e21ff6a65c24cabf5f527bab5a6f2a69f20c776fd2251e43ad22e09b1486ceb1935b2dc2ade95e233f296cc0e5a8af8109659be76b6bfdf37e14837fd6c34bfed1f19ec9d21f974b984fe4d4773896ebcc7fb862fd641cd0d77178485c70c2d68b4d9be1d863f6f254b77991fc9053f5d5415d1aa74ba9067e2e6607fb651638c9cc0430a40c9b691977b557a31d95a290a95b56ef2ec8e4313686a9c5ef48235912b210fdd2c50aafac28131104c795c42ae75810b0284b2d257e81ecac4240622ebc261ab8bceeeebe80f1cfa70f18d782aebb97d803ea3a895be541be6941df103eaaabd870848bfaf58cdaf6cecdd5a10bf", + "result": "valid" + }, + { + "tcId": 74, + "comment": "salt is all 1", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "6f2f650ac10d5aa2c16703f657233da8c035da67a6e9e950dfd0391399da3a86ca7837dd7cf23e864d9cfca1fe77dae45a01ba21d23dd918ca7bba094aae376100198f59834396ec942fcffdd7d6a44953f69bc60291b1eed5921a0434d8b8953beb9d1e1b15fdca7090fa5c646847c0b759e94f056911ad188d4b0cc399c8c345757d5022f1a38926de0cbda8648a7affd9f031262b1079a3681d58249186fec4f6e98bf151c9b680a46b88dada9b42cca365cf908ed0501cd21e02a5bc4c0675f23ece50987b703499eeb94b6c40b5cdf22299776fe30800f887a1dfff18cd8a7da8c2388060dcb78c925c54b4e620cd3fe7546accfb3bbae9de08ba886009", + "result": "valid" + }, + { + "tcId": 75, + "comment": "byte 0 in zero padding modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "37487b948dac95a1e57bf1ac40888b8e074cf9db9c9825e7b7267d3b105a8c67cb9b33c0e5fd641836798f41b8b1f024b13243da4fa5e527098337e5cac41e0523a28fb135ae060e7c1e4eb9556222bc43bf1659f65a2a2db108ac9b7c9942a5658fcbca5622c115e34ead883ea4ef03f7f62990f282fa791b04489053771329a482467cba8a13ad98f27ff7b61c24a452e085d432130b7259e59b2866e55320119b21e3c706f3596ec174517c43cdbe957e012b573961b1fa925373945ab3209a1007d197e1e9301dd0afa485acf6643ba0587a69f7c44bdf1e53c32f05a3b96db0c462509c292d7de09a6c78ebf1131453d37ab037176011296730f57cda97", + "result": "invalid" + }, + { + "tcId": 76, + "comment": "byte 7 in zero padding modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "241a3a7569210a47b83125fb67039a68d9859b971a49af62bfd4bde01e3b955ab166bba5165657fbfa519573027ef1a0f40cf7533f941d64e09fcfcc35cdd564c1ee0823166dfc054ed93e01c5831c036920335d8b8daa32220dd5c0b6a071f08d19411c6418aaa9883375587b19f0720e79f184535d7ed8c5360e667ade541c1ddbf9c0629255d8d286eae8defd34f000a3be1fa7fea65a4cd4f64b11c641806fa57d67b4c6b7b49892f38dc5d13abdabfaa6cb91ed6022d4fb467cdb6046b13fcc8142a97bc34eddd045796f4e19b1885d04c51f53e5bc0c272678990aea50a124274cdf048ecdb7074ca86f36841a7ade80a8aec6a653a0292c82a1b5c678", + "result": "invalid" + }, + { + "tcId": 77, + "comment": "all bytes in zero padding modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "484d71be451d1f3667e01f3e7f1a80db9764f751ca87ffc6352953a773f6519e8a0f210d6d43b417670d9c0ce3c11a668cc83394a5e2d7bcd4ae98e50ed26c0ab66b41ad2e28fa703f2da04db0963875842d90a77899642dc297cf37a76fdb007a990c5b7af83e264be9323149fb680acb69a19e0c5aa949c2094e0a18abfa1b199b73363654638d86f9abe73a678ff0a41f6b702b70ea1aedb287add79b9a7f4a97535d0db46c05983072481dbe43fe6dfe33229ca1aec42e19afeb5bd35f1e44264c1fc6c18fddc95fadf1b1676f185e5b55f9a2bfe6b6d40289f240633513828a7b967748bbf0ccd1d3fb9f6240f31790a789d8c709c278ddbb0f706778b5", + "result": "invalid" + }, + { + "tcId": 78, + "comment": "first byte of hash h modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3f27e0fafc57629ccc0432827187766a30537e821a2fcd5f1088100d4d8b6a6a9ce950f51102e3b55167d4b49e0b6a306e0fdf90837d0630859093e90a94fa564b7a4a82f4ccb772377e07a2b5a6873d98bf665c92df1ce7cbdb583cda83947b3c9c3df5b3807b470f23f8d08df9fba78e13d6b635f9f59d2d4baa34831dc6c3e5a29695645b1ed50f3a3389e9e119de765e6d7daaff0b454eadd10f445e402bf3cf4d14f4d16c2d9e4fb5571cea7929d53019d414d118e82d491bf3fb3bd7427abd6eb48a0ed277221c42840eaa1fd5e7ce658f7763099c1d59431e498cb58357a659aea8e181ec0fb5ad8a55d1c0f129500a25b85cbcc8733fa3dfa9ea30a4", + "result": "invalid" + }, + { + "tcId": 79, + "comment": "first byte of hash h modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "006e3f343b22fbf5cce816efbfe06636c1619632665591f9b1fd2bd0aaac9a0f776c501d7a232fd2edcc12ac63b3b56aa12ae87982c1997e5ac5fd50f6a5c350e6e84fc17d2149547babc4830f8c2eef1885e4bfb15c9b73322b693ea74eabf43e5050c477c0e75ecf75cfe487f41f4a2df4972a16e0580d57946d504fb073f23ea691086e5bc40e2b2e1dd653f2ab201ad609fd06983a5cebb98678c039150563f6c944bd6558b422de25b9720887d97ef63b34cdee0139391c48558941ba94bdc0c22e605dd9cae669406c3ddb361787ec6437c87a688b0c64f0290b1bc0ce17466592a48b83b27f0442bdb15ef753ad56eaabeb08bb3b7ace7f9620fea113", + "result": "invalid" + }, + { + "tcId": 80, + "comment": "last byte of hash h modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "838d0ad34f2393aec53682ed48f937a458a32216a74dcc4a1e591a538119c3b56cad78b1c4b722948373c51c04a50e46fb5f3034f43c5d260364617e6f03af7d75d66baf3dfa1ca94e75e77d304c63ea5015cdd7fb1e1cdfbd6b5ebef2b2addf697f14c97cf9b5cbb1bab7f612b3a428d32cefbb788bdb70729e53d5b8cd14f586aa2b9410bbae2d093bd11f491469479eb640847514d72269cddab484d882aaa9761839aca9851b3d409211de83df742674d6305cc3a71143fa5077bce9d3c8da1f6da0df5c271f048ba589e5c34a23ef12747299d9dc4299589364f2137ace59781e3f01011ae145a5e1af20c74516e0b56d729e49b3de310c197e7a760efa", + "result": "invalid" + }, + { + "tcId": 81, + "comment": "last byte of hash h modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "6b19a03c774e1c3c24ea889b552e99fe0068a6cda022d5ccb6d75a447cfa0b16b5b144208dd407e440230ffaad4f12a0746da108dab5d4f162bdc9b24dc68a2e9e077ef5702472c4ceaa89c29cac41b4782b92f6c87e014df2483580cadf2b455f823fe12c9c79a155ea32a9f1ed120fe0f13b10ab4792fd94b99e0aa6ffd27c04ef7088e3cb935436529650894fee6b5b78e0bb5aa59ee7bbb2fb46af784e2c33eb76a12cdd7d0087a081d82d3e466a381dd37d25d3b4a92756723cb1f1f49d0481d12baa21ff77c0291f902682226d99d77d36bfe58d1825988c97d9d00e15ab48c9919583fd60593fa93ab1ca8e7dabaa912f6535bbb05e82bbfaa8537b0e", + "result": "invalid" + }, + { + "tcId": 82, + "comment": "all bytes of h replaced by 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "682673d7c98ae70039e9f259275c884da7c77136e06d47e8af72f82a09614a08ed125c6d3a80f701a61dc2ad967e9637662bf40b48543e5b620daf37e3088d2a54a8c5147ef99227cd5cfd0a478d1fd1ec62c495cb89046df756908621099913aa4142c3dba2a62de6a8899f0acc7932e33581d4102020423a99876777c59292d597428f50b846a39d709d38c3a842f9a9531f26dc2a11f518950eee92560fb6b6667a113237a3e6d7bdae48bafc90a76a6839b97e6301e546f5b136ff23d662593f74920dccb56d47fea557adca4b36820469425cdd4071ade7c5c14f365ba4e0da97cdd62cec66fdc724d3f309b6297c1c84091a74d656b4b030787df593b0", + "result": "invalid" + }, + { + "tcId": 83, + "comment": "all bits of h replaced by 1s", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "1452cef4f4e0d46ca8caf3a628074f7ed0acafd0a16c4c4c423cd361cd61319d5e912b162bb2b7326e56e20d5f9814d6339e0cc44da9ba1be28e473880b6276a86b8cdfd91d2f5fa830024b842834bcf2d425c48b5a58464b7a3111f55ade2d3b9cdb958392efd559f6b6136cd158e157faa4b7ee86a3457dcdbd877b82d53c23d6e71488e554574b78f0be72da8d4160aee680ce485f9fa544562a12a89328560a773ff25138decf4200e2558e3b5a364a4372cd1f64fb25887b8c2b3938aca10d8727535d0eb0b73af2b7ad70656f97c5c1a97d3e2c2d1cd2732c5fe8fdc5ba6f554bd5190a54742313a6175db2a77d36d24934dc056d66cc6bd83abac61e0", + "result": "invalid" + }, + { + "tcId": 84, + "comment": "all bits in hash h flipped", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "2f5ab041e87b74c0ffa6f5b0a4c5ec8d0ee3d2357a0fd2face275dbc6b50a230f2108b4b37fa45d5bb1211fb26b96d315cec9391d198ad7713faf3c4fb60806cbe6378c7a08c2e75a67848ca98c80a02680650eda98ff0c818f1e7af9ff3a3236150699a4c900c394c2a00ea65b39fea873504898c6fced5e4520bf3d69a11debd3e66ad681b7d03bbca940fbc809f03f99079d0f24f31cdc76afab73ec0b4f5baff4437b0a304a8893cf593bcf47b2f63a401f1b456f1741b3b3641e3154e6f4bc035723fc3532ee22d4f65a3963c1b278c1a9a8ce7e04876e8c327a70463e3785b9a5aa5b4a50cb4e35d92085172a61cc5407af2752a59d06b58a242926328", + "result": "invalid" + }, + { + "tcId": 85, + "comment": "hash of salt missing", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "83d3f4b18d2653189572e75e9b4464292ca649591a82b1569ce13838c245da67371b1ea78e4215eba8de713411ff060a980405f0bad99546989153017a380f9c7b566500fdd5a15830eb0c5f4723e341391268933a41311e9832b340efbc2cffb4baa9c5dd47783eac81a41e3d6336572d38b034dfe5ef4b94e5c3f903cf3e8e0a3c2c59cfd13f99f696b0fbfe71368cda5a1d28bad1af3c8976e3f6c1bac08707d2684f6d55c2ed4b433c9efde91b206e0842e534be7e88fa219763b960d9d5a43a479990aa9732661693b9e4da89a7bb5dda878ae43f5e1a11944f7a5c6efad600ddd13a148c1fc8fd2574b9667342c73f2a8b96511a5f75cb1ce486b9df81", + "result": "invalid" + }, + { + "tcId": 86, + "comment": "first byte of ps modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "31ce7ca597f76ab95d47563f728ff93bf43d9864e5bd1229b824ae26b5a13c79f6f7957217b37e1af0537fea81616187ff08a0d5c98a92da8dba61bc5c14da3321fd1146d83c2cbd0ec0687d81f6d7349f5a0cab0840e22cbfa83f02a79d321ff88830d47d4842c0b032c27a181ac06a42cd0bfedaf75f2daa53f64eacb5986545bcf150b8d433e66b698f2553f9da259bec319d8c0cec05d9c320e7300463d41eb077028c1e0a7d6d87d4dddf54c5b78d6a15e4527e37110b9b9ad2f3b2dd0db591227d41cc9f26f2349581dd89e0ba639d0cf9f8c86fe819dbadc688522b58d7284caabf843e7143395255e9a0d710ffbef6ad13f6a9361e20d2f6f5a414f5", + "result": "invalid" + }, + { + "tcId": 87, + "comment": "last byte of ps modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "5798785187910703680cb2109f492c3f0a91b4a8f11d3da775aba891eedec3d76fd30a939f5d7a2baf7290c573e886cec8ecec0b1598f2cd169d53b4abf8accc09709187f32a12c80fdb42ed98d9e98b0923828f0e38acc338234f7b7a0ee377644a655f48816ea4a5bff0f6d63c3945dc3aaf921e9404864594bc323c1f3ef42f9361ed6cb8fcff2994293e17865e2fad2d885277251fa24d7e7aacebc48d61c3b48047dd7c99826b3105d2f820cd62404cad5d758da461af67677e39e55086d8fa52ea0334bc3b77f95191ffacd28ead07a34e4672577c4c65b5bb9d5f9cab6e1f1242216291b69a0c98714452f01f37722ff26589734cf6020c5ac9196374", + "result": "invalid" + }, + { + "tcId": 88, + "comment": "all bytes of ps changed to 0xff", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3747c7c116cf30567e24fd4213c126ec84366a26eb304a65d144dd9b453054df4e5036c861b5807137934b1cef351411e40654bae5df6fbe3c42d763407f273d3dbe059fc6412a366775603e064b1561a58e70860edf954dbe666f8fe44f44f87df3b0e3f3e19c904966ada52f00806f975f256d4a855cee973e20f33c31f9f2b3792fcf326f075f86f275d8ef8df2dd0abac83d491d485fc167cd40f3802f66036df4fd64fc441ac8a25b405d5ef960127623c269ca836671a66a6bf2f39c0792dade17564d31863c7e0161ee0bb88522ac0c9054bebcedb603a2d18ddb0f64a91ca5a2f0086afd0d8c07cb0c1e7f24d12f866cdcde46d663c1d4dc7f7c6f62", + "result": "invalid" + }, + { + "tcId": 89, + "comment": "all bytes of ps changed to 0x80", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "1377d4997c03d885e4b95f0350b1c8091a4d9beef9533dc6abd194a1439c383622b9dca5a49da247cd55c02186829f695ebb007ef0535c4757baad057d7bf76dcfe37cb9181b0c290db16d0abc51ff32d03b6a8e56ecd270dac231c81e50c7e0203d22b991291fec650b9904b2539a8a330172843bcff0cf46f06e32f55bec1f5a734e70ec8e4e8883e3c22eab7561d9c76737025352b5c9fa9c76eaacb909d23d0d7d7b6f1094ccec8ba94f149f81946faedb39ac557cc28817c9114a89a6f720d849f90cb23ad202ed4682036b3cb70b6fd5df0225900eaec7a21e39fd433d3200aed4bb4abc3b531393fa462fbc920c918f1938d33ca86e7ca3bbf1d34d74", + "result": "invalid" + }, + { + "tcId": 90, + "comment": "ps followed by 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "7d0f3cebb4372569e8f02df9f42222151cc31659df8d5078e9ee8e91030735d27e66da8c87039a27ac28588e8431d7ad1583534e8570318cbb2554c07016bfb02fe59af00576b7908286f4b27e36f768a118c3f3a1ceaeffee03a1b67270c3e489cce5c5f1171e0a8734553403047faff680dbcd70bf0fc1f0f4461bd4e68c6c0978da3490a137ddd8f62bd79c6a1daf70f7a9a3e90056ccd41c62f04915bf128f74dabcc47cba85b0fae47a04da32e17799ca150814d27793816e6a198390c35d1f35abf6816761a5ff0c28b1e60eeed244b1f24934174a1d2c469475f3eb8842eb9f5c6224386994aff9579f26ea7d73c668a113ef7dee8b2bda576135d452", + "result": "invalid" + }, + { + "tcId": 91, + "comment": "ps followed by 0xff", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "53f2db262358c21792eca635806ea1c1ad041d9334e977a25c1de0fc8233ec6f01737adcf1fb4dbedbd0078406ecad921e37c77d4585b5eb5ecc74c07ada1864a3c13acaba9372f852aef55ff2dc42c0aaef74bb656b8e0beccb7b9eae587fdf3b52eb678af1032e60ad12321c9c10c445448df523856ad262208a06b8817ee229df825f080a72d5e1a43f222215824a8ea6d455c80b2563c65be1eaa0455714ae576ae67e46d006934cf0c137b8c9900af9ed716391ce96ec43296e83a5a10390ed91f2e6753ed0254f0290ad899462b3b7af42c3c5f0893863a3b5e6052d3a6dee554746960a07fb6ecdf781e47b96023ba01cfde4c7214611a1be5735e2fd", + "result": "invalid" + }, + { + "tcId": 92, + "comment": "shifted salt", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "11e8938238a20f0e6947015987380dfd88a1661606bd05bbe4298f4746e81e3bbf34aeceba5360f1839ee0d7d7fe3e578cacc2d24b15eefe2064edb1fd04ff9a44c0a600ebf00f64fbb1ead4246e5ffbad0c22441ed073462f26e30b61a0a9142b4f993d1b26fa32e11382da33b9eb5855cef6736bec2f4f5bc6bf82fdf7da62346a4d9696c53e1cfa789667b721f32f7779daf7df85474096a9e9a7291afc76df3a66c7a0b997b41bfb71fedbdb4e65095efe1a81d35b66be55432e0a6e33905475b46a94e05bce7fee84645f500d8ebd7c0282c35f22774e7089262210f83ed485cd2b045acd5d62b4bb53dcbeb2588dc6535518189cb0220a7c9406e454d6", + "result": "invalid" + }, + { + "tcId": 93, + "comment": "including garbage", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "39a8e947c919ecfad7ee28bb708c1f9e825036374ea0f610bf5531d89b813d506fd00bdc15850b250ac50fc556a676c894fb641dc650999eb6239b91e2c755126bbb9fef5783a5ab834e0ad91c60e720e80e096c091167a2a1dae838a16fe0ebaa8efb3573c89ac5d8e0584b5ec4e2168ef097f937ef0f0d2a2f964a8e6a810dd15b9c27b234d788af3c4f54dc97035657ff19f2835555dbafd02c4ed3c76654fa868babb71534bfe84674eeddbfc2b27a517f666bd03a27d8173bb92826a231cd9a241c171445b416934ebec5f7eea4fb41a61937d9a98f61b2fd1ca8e2be125e85cc8d16d553b114ab72395e86fea52f54edd853e9c5156557e38f621b975a", + "result": "invalid" + }, + { + "tcId": 94, + "comment": "bit 7 of masked_db not cleared", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "9c13d877ac2bd8c02c11e29ffcc0c1046dbc9870177e843c30b499c2bf7fd09daa43469caf2b8c3e955ded95e4d62209f7571bb45593f4cd8b0c7bc9470a8a693837248b5a7854dc8e37e752d949479272642994182061d7af80b0ac6f6e984874c8cdc6a5d7d17dc9e9de5ad12120cdb9f6c0d09c0e11b87b3423e37ba9437a4f76cc1e6124579e5f79832b89710de1968ce46e3e69fa185c0a924e8cb5f996ee5963f6826dd37714de264d75545e8509caf8735330cde7ed4228e5779471827b83757c466022117c45d598f5a4a7fed7be4e1b4d320f894879061a75d1a41efd8dcaf3c61733ed8ca2cc2f83714f8fdbc7a97cd6d6b97ea3d36ebd69890633", + "result": "invalid" + }, + { + "tcId": 95, + "comment": "first byte of masked_db changed to 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "00566c95524ad0995eda7d668fa08e8f75bea868b60972d6488cbe8939bbde68fa5206e671f35555f628fa707ce7ba0f468cfa8b9737e0ef64e0e23c901e4965ccaaeefa9b84363a3037cf5f9e044e295fe57f32c1125ca70c639b22732aa4c4b3e5562690bc1d7e7e74dd01c674212dcb63c58fa23333d45e1e4ccffa5d186443cc785c5ece3f2d7a8995e25de6a171cbc960c272c2899f6f87ceadb72eea1be085245669ac08993591e72bb9aff8bc29388b35c99f1ba7477af9d16754894a50d4caea4bc80e2aef2ced27f4a1c88be284bbb40cb8ae279b4e38a4cd8a51a92a279a799b3316c2938e1386043ae7ab1d8605cd310d7239c805a07a19c7b17d", + "result": "invalid" + }, + { + "tcId": 96, + "comment": "last byte in em modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "2b46a0aab5f573e32ffbcb411cd99d2f90aa9b1abbc600b0cda0d824f79020aab47a2494caea20fc93017e77b99eb73a1f8a550b611e2747ad29207772629c2ec40918c07adef1c90c99a15cddb9eac88955b4093a9e743d2420b4647e167bff8ddb07ce197db89d8a7d3f327058a41cc459ed4f6d5d23dfc015479d95e195da37f5b1fc318a3f74a0ac5fe2b9569c7fd99b8eb3ed3967a5eda1d246a3b225548f67ff860202033e7164d4b99dcf95f4232d18a7913f7258a33179133a6fb4ab5a4937b642eacb92908cf79495745abc583524cb0236fbfadd2c7e8b0a6597017912b4737fc01432625a508355869670bef25d32afe6753c38cfd96ec38953fb", + "result": "invalid" + }, + { + "tcId": 97, + "comment": "last byte in em modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "3b65975357ab2a410c2fae7f2f0381e6c40951260451f2eff05f0dc707abd013a996fc10658a6963f462877a808f61ad0362b9f640750b19debf3d59692134e357a49ed3693f50924b7c8a1824ccafcb4b93f7679dd892823cd479895d41fd1c40fb89fb1da19bc1fdc72eb038782f24ba3326428cfb166a475a9fd27f94d1a0ca6fa0e6a0d2c2883db3eeb2c0a59474da36211695fb811b9e8bc7f05ccb1f50d26d71a2dd209b0d269a736610c7dc1f7343a4736fa2b8c27827dfcad49bc4a86822cde1579dfbd646474f11e1a60f5e4ac2f2a3a5421a7baa9dea5d24be03cb6fee771dd808b67f886b37be5a300f6551d7e7636e9997b3255ceed5187ebcc0", + "result": "invalid" + }, + { + "tcId": 98, + "comment": "last byte in em modified", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "4516c8a39b8544d1c65d96472fea0b2753060330e76e6f90f41ab349953d26ab1b95fd87484535b68c0afcf1542a9b966a9bf98b89a53bb28877b34d168a4ba8201215c55f9e86d30b7159093517682e6e956078947e54e3f3a779da032af7dc6bcab1c0b2a6693fe0eeb9de0d158bcc125293a6f10ccaf1499b6ad912ed5912537e3c3c5f18eb0ab8e701056d7b973b8b61af918858b87152b6c40671bf96735ab1a112972346e771e7cd9482f6f59d320b8798a271cf21779747f964281afa1303142eb3e1841772de825b4b5e68024dea014193c4e1c206bdc6121a8f2d41837be3d13833ed615d5b9df4ac4c86cd25344fe1022df0adabfe2d46f7d9f0d0", + "result": "invalid" + }, + { + "tcId": 99, + "comment": "signature is 0", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "result": "invalid" + }, + { + "tcId": 100, + "comment": "signature is 1", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "result": "invalid" + }, + { + "tcId": 101, + "comment": "signature is n-1", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "a2b451a07d0aa5f96e455671513550514a8a5b462ebef717094fa1fee82224e637f9746d3f7cafd31878d80325b6ef5a1700f65903b469429e89d6eac8845097b5ab393189db92512ed8a7711a1253facd20f79c15e8247f3d3e42e46e48c98e254a2fe9765313a03eff8f17e1a029397a1fa26a8dce26f490ed81299615d9814c22da610428e09c7d9658594266f5c021d0fceca08d945a12be82de4d1ece6b4c03145b5d3495d4ed5411eb878daf05fd7afc3e09ada0f1126422f590975a1969816f48698bcbba1b4d9cae79d460d8f9f85e7975005d9bc22c4e5ac0f7c1a45d12569a62807d3b9a02e5a530e773066f453d1f5b4c2e9cf7820283f742b9d4", + "result": "invalid" + }, + { + "tcId": 102, + "comment": "signature is n", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "a2b451a07d0aa5f96e455671513550514a8a5b462ebef717094fa1fee82224e637f9746d3f7cafd31878d80325b6ef5a1700f65903b469429e89d6eac8845097b5ab393189db92512ed8a7711a1253facd20f79c15e8247f3d3e42e46e48c98e254a2fe9765313a03eff8f17e1a029397a1fa26a8dce26f490ed81299615d9814c22da610428e09c7d9658594266f5c021d0fceca08d945a12be82de4d1ece6b4c03145b5d3495d4ed5411eb878daf05fd7afc3e09ada0f1126422f590975a1969816f48698bcbba1b4d9cae79d460d8f9f85e7975005d9bc22c4e5ac0f7c1a45d12569a62807d3b9a02e5a530e773066f453d1f5b4c2e9cf7820283f742b9d5", + "result": "invalid" + }, + { + "tcId": 103, + "comment": "signature is not reduced", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "675ee6980d92ab6d27c29fbb88a6b913cb0a42ba4f2bdfa35808166c454e708cd1e1a7e30d8e0e4e814ef107afc5d0d0e1831bccdc8092995c156a8d247b26aa0c14538423e4804be22fd2140c143515fb9abc828a7565e8bbb984d8cfd21fa2e5a897074437daf0324d18d2b2643d667a2fc4f286bf60c3e7d53e4a3f2f3fb1030098c673c19a8b4660fd934e702c0fa8a8aff154f6ee19afc7ea6cc7675002b9bf73f05c02944aecdd5f3c371f1a13c1d5f3128d2a754782958a05b341d185c1d6ff50ca68764b8966ddb089d4c66bd1d7afdeb01fd0fc7b46df3355c8db6c33dcbd125fee54eea860a94ccadfe789548256eb36ca481247719278299f560600", + "result": "invalid" + }, + { + "tcId": 104, + "comment": "prepending 0's to signature", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "000068caf07e71ee654ffabf07d342fc4059deb4f7e5970746c423b1e8f668d5332275cc35eb61270aebd27855b1e80d59def47fe8882867fd33c2308c91976baa0b1df952caa78db4828ab81e79949bf145cbdfd1c4987ed036f81e8442081016f20fa4b587574884ca6f6045959ce3501ae7c02b1902ec1d241ef28dee356c0d30d28a950f1fbc683ee7d9aad26b048c13426fe3975d5638afeb5b9c1a99d162d3a5810e8b074d7a2eae2be52b577151f76e1f734b0a956ef4f22be64dc20a81ad1316e4f79dff5fc41fc08a20bc612283a88415d41595bfea66d59de7ac12e230f72244ad9905aef0ead3fa41ed70bf4218863d5f041292f2d14ce0a7271c6d36", + "result": "invalid" + }, + { + "tcId": 105, + "comment": "appending 0's to signature", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "68caf07e71ee654ffabf07d342fc4059deb4f7e5970746c423b1e8f668d5332275cc35eb61270aebd27855b1e80d59def47fe8882867fd33c2308c91976baa0b1df952caa78db4828ab81e79949bf145cbdfd1c4987ed036f81e8442081016f20fa4b587574884ca6f6045959ce3501ae7c02b1902ec1d241ef28dee356c0d30d28a950f1fbc683ee7d9aad26b048c13426fe3975d5638afeb5b9c1a99d162d3a5810e8b074d7a2eae2be52b577151f76e1f734b0a956ef4f22be64dc20a81ad1316e4f79dff5fc41fc08a20bc612283a88415d41595bfea66d59de7ac12e230f72244ad9905aef0ead3fa41ed70bf4218863d5f041292f2d14ce0a7271c6d360000", + "result": "invalid" + }, + { + "tcId": 106, + "comment": "truncated signature", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "68caf07e71ee654ffabf07d342fc4059deb4f7e5970746c423b1e8f668d5332275cc35eb61270aebd27855b1e80d59def47fe8882867fd33c2308c91976baa0b1df952caa78db4828ab81e79949bf145cbdfd1c4987ed036f81e8442081016f20fa4b587574884ca6f6045959ce3501ae7c02b1902ec1d241ef28dee356c0d30d28a950f1fbc683ee7d9aad26b048c13426fe3975d5638afeb5b9c1a99d162d3a5810e8b074d7a2eae2be52b577151f76e1f734b0a956ef4f22be64dc20a81ad1316e4f79dff5fc41fc08a20bc612283a88415d41595bfea66d59de7ac12e230f72244ad9905aef0ead3fa41ed70bf4218863d5f041292f2d14ce0a7271c", + "result": "invalid" + }, + { + "tcId": 107, + "comment": "empty signature", + "flags": [ + "ModifiedSignature" + ], + "msg": "313233343030", + "sig": "", + "result": "invalid" + }, + { + "tcId": 108, + "comment": "PKCS #1 v1.5 signature with SHA-256", + "flags": [ + "WrongPrimitive" + ], + "msg": "313233343030", + "sig": "1758eb94588e6fc4f50c1be1afcaa41027869f304cad513b1fb12c2f446d63cdc05c4830a7e3e630da7b2da4f7867cc173bf6420f9732277282596de41ded32e21d0cc31441174da8765f57419c7764ea758f55bc17646eb100c435d1ac0eed6fc7ba6de5f832094ee2f479979765e05ac9976788db3c241a9e32a0da864f0019a87646ba623d63f4411af5dee1be9ec488c7e3e1b231479de70b9ac5f78a17b1f4120aece45f26c07e7bb345fdfeb05e14bcaacc614672a465fc523624cb19f66f9c6c3f642b832ca44cb25176d679f0e05606c3fed022cac24c2bf960a406d48818e3eb7ed53b0446032469047dfed95fc18088c92d91d93722c47f88163a8", + "result": "invalid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/Fixtures/wycheproof/x25519_test.json b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/x25519_test.json new file mode 100644 index 000000000..1ffa8e68f --- /dev/null +++ b/tests/Titanium.Tls.Tests/Fixtures/wycheproof/x25519_test.json @@ -0,0 +1,6056 @@ +{ + "algorithm": "XDH", + "schema": "xdh_comp_schema_v1.json", + "numberOfTests": 518, + "header": [ + "Test vectors of type XdhComp are intended for tests that verify the", + "computation of an Xdh key exchange." + ], + "notes": { + "EdgeCaseMultiplication": { + "bugType": "CONFIDENTIALITY", + "description": "The public key in this test vector has been constructed, so that an edge case during the multiplication with a small k occurs. I.e., these are cases where during the multiplication one of the internal variables has a values such as -1, 0 or 1. This checks for errors in the integer arithmetic.", + "effect": "The effect of arithmetic errors in the multiplication is that information about the private key is leaked. In the worst case such an error could be exploited to find the private key." + }, + "EdgeCasePrivateKey": { + "bugType": "EDGE_CASE", + "description": "The private key in this test vector contains a special case value. The goal of the test vector is to check for edge case behaviour." + }, + "EdgeCaseShared": { + "bugType": "EDGE_CASE", + "description": "The values in this test case have been constructed such that the shared secret is an edge case. The goal is to detect errors in the integer arithmetic." + }, + "Ktv": { + "bugType": "BASIC", + "description": "Known test vector from RFC. We assume that these test cases have been checked before. Hence, if such a test vector fails then we may reasonably assume that there is an error in the setup." + }, + "LowOrderPublic": { + "bugType": "DEFINED", + "description": "The curves and its twists contain some points of low order. This test vector contains a public key with such a point. While many libraries reject such public keys, doing so is not a strict requirement according to RFC 7748." + }, + "NonCanonicalPublic": { + "bugType": "DEFINED", + "description": "The public key is in non-canonical form. RFC 7748, section 5 defines the value that this public key represents. Section 7 of the same RFC recommends accepting such keys. If a non-canonical key is accepted then it must follow the RFC." + }, + "Normal": { + "bugType": "BASIC", + "description": "The test vector contains a pseudorandomly generated, valid test case. Implementations are expected to pass this test." + }, + "SmallPublicKey": { + "bugType": "DEFINED", + "description": "The public key is insecure and does not belong to a valid private key. Some libraries reject such keys." + }, + "SpecialPublicKey": { + "bugType": "EDGE_CASE", + "description": "The test vector contains a public key that has a special form. The goal of the test vector is to check for errors in the implementation of the integer arithmetic." + }, + "Twist": { + "bugType": "DEFINED", + "description": "Public keys are either points on a given curve or points on its twist. The functions X25519 and X448 are defined for points on a twist with the goal that the output of computations do not leak private keys. Implementations may accept or reject points on a twist. If a point multiplication is performed then it is important that the result is correct, since otherwise attacks with invalid keys are possible." + }, + "ZeroSharedSecret": { + "bugType": "DEFINED", + "description": "Some libraries include a check that the shared secret is not all-zero. This check is described in Section 6.1 of RFC 7748." + } + }, + "testGroups": [ + { + "type": "XdhComp", + "source": { + "name": "google-wycheproof", + "version": "0.9rc5" + }, + "curve": "curve25519", + "tests": [ + { + "tcId": 1, + "comment": "normal case", + "flags": [ + "Normal" + ], + "public": "504a36999f489cd2fdbc08baff3d88fa00569ba986cba22548ffde80f9806829", + "private": "c8a9d5a91091ad851c668b0736c1c9a02936c0d3ad62670858088047ba057475", + "shared": "436a2c040cf45fea9b29a0cb81b1f41458f863d0d61b453d0a982720d6d61320", + "result": "valid" + }, + { + "tcId": 2, + "comment": "public key on twist", + "flags": [ + "Twist" + ], + "public": "63aa40c6e38346c5caf23a6df0a5e6c80889a08647e551b3563449befcfc9733", + "private": "d85d8c061a50804ac488ad774ac716c3f5ba714b2712e048491379a500211958", + "shared": "279df67a7c4611db4708a0e8282b195e5ac0ed6f4b2f292c6fbd0acac30d1332", + "result": "acceptable" + }, + { + "tcId": 3, + "comment": "public key on twist", + "flags": [ + "Twist" + ], + "public": "0f83c36fded9d32fadf4efa3ae93a90bb5cfa66893bc412c43fa7287dbb99779", + "private": "c8b45bfd32e55325d9fd648cb302848039000b390e44d521e58aab3b29a6964b", + "shared": "4bc7e01e7d83d6cf67632bf90033487a5fc29eba5328890ea7b1026d23b9a45f", + "result": "acceptable" + }, + { + "tcId": 4, + "comment": "public key on twist", + "flags": [ + "Twist" + ], + "public": "0b8211a2b6049097f6871c6c052d3c5fc1ba17da9e32ae458403b05bb283092a", + "private": "f876e34bcbe1f47fbc0fddfd7c1e1aa53d57bfe0f66d243067b424bb6210be51", + "shared": "119d37ed4b109cbd6418b1f28dea83c836c844715cdf98a3a8c362191debd514", + "result": "acceptable" + }, + { + "tcId": 5, + "comment": "public key on twist", + "flags": [ + "Twist" + ], + "public": "343ac20a3b9c6a27b1008176509ad30735856ec1c8d8fcae13912d08d152f46c", + "private": "006ac1f3a653a4cdb1d37bba94738f8b957a57beb24d646e994dc29a276aad45", + "shared": "cc4873aed3fcee4b3aaea7f0d20716b4276359081f634b7bea4b705bfc8a4d3e", + "result": "acceptable" + }, + { + "tcId": 6, + "comment": "public key on twist", + "flags": [ + "Twist" + ], + "public": "fa695fc7be8d1be5bf704898f388c452bafdd3b8eae805f8681a8d15c2d4e142", + "private": "08da77b26d06dff9d9f7fd4c5b3769f8cdd5b30516a5ab806be324ff3eb69e60", + "shared": "b6f8e2fcb1affc79e2ff798319b2701139b95ad6dd07f05cbac78bd83edfd92e", + "result": "acceptable" + }, + { + "tcId": 7, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0200000000000000000000000000000000000000000000000000000000000000", + "private": "d03edde9f3e7b799045f9ac3793d4a9277dadeadc41bec0290f81f744f73775f", + "shared": "b87a1722cc6c1e2feecb54e97abd5a22acc27616f78f6e315fd2b73d9f221e57", + "result": "acceptable" + }, + { + "tcId": 8, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0300000000000000000000000000000000000000000000000000000000000000", + "private": "e09d57a914e3c29036fd9a442ba526b5cdcdf28216153e636c10677acab6bd6a", + "shared": "a29d8dad28d590cd3017aa97a4761f851bf1d3672b042a4256a45881e2ad9035", + "result": "acceptable" + }, + { + "tcId": 9, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ff00000000000000000000000000000000000000000000000000000000000000", + "private": "e0ed78e6ee02f08bec1c15d66fbbe5b83ffc37ea14e1512cc1bd4b2ea6d8066f", + "shared": "e703bc8aa94b7d87ba34e2678353d12cdaaa1a97b5ca3e1b8c060c4636087f07", + "result": "acceptable" + }, + { + "tcId": 10, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffff000000000000000000000000000000000000000000000000000000000000", + "private": "a8a1a2ec9fa9915ae7aace6a37c68591d39e15995c4ef5ebd3561c02f72dda41", + "shared": "ff5cf041e924dbe1a64ac9bdba96bdcdfaf7d59d91c7e33e76ed0e4c8c836446", + "result": "acceptable" + }, + { + "tcId": 11, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000010000000000000000000000000000000000000000000000000000000000", + "private": "a8c9df5820eb399d471dfa3215d96055b3c7d0f4ea49f8ab028d6a6e3194517b", + "shared": "a92a96fa029960f9530e6fe37e2429cd113be4d8f3f4431f8546e6c76351475d", + "result": "acceptable" + }, + { + "tcId": 12, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffff0f00000000000000000000000000000000000000000000000000000000", + "private": "d0d31c491cbd39271859b4a63a316826507b1db8c701709fd0ffe3eb21c4467c", + "shared": "9f8954868158ec62b6b586b8cae1d67d1b9f4c03d5b3ca0393cee71accc9ab65", + "result": "acceptable" + }, + { + "tcId": 13, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffff00000000000000000000000000000000000000000000000000000000", + "private": "d053e7bf1902619cd61c9c739e09d54c4147f46d190720966f7de1d9cffbbd4e", + "shared": "6cbf1dc9af97bc148513a18be4a257de1a3b065584df94e8b43c1ab89720b110", + "result": "acceptable" + }, + { + "tcId": 14, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000000000001000000000000000000000000000000000000000000000000000", + "private": "a021d75009a4596e5a33f12921c10f3670933bc80dde3bba22881b6120582144", + "shared": "38284b7086095a9406028c1f800c071ea106039ad7a1d7f82fe00906fd90594b", + "result": "acceptable" + }, + { + "tcId": 15, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000000000000001000000000000000000000000000000000000000000000000", + "private": "a89c6687f99bd569a01fd8bd438236160d15ce2c57c1d71ebaa3f2da88233863", + "shared": "c721041df0244071794a8db06b9f7eaeec690c257265343666f4416f4166840f", + "result": "acceptable" + }, + { + "tcId": 16, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffffffffffff000000000000000000000000000000000000000000000000", + "private": "68964bca51465bf0f5ba524b1482ceff0e960a1ed9f48dcc30f1608d0e501a50", + "shared": "25ff9a6631b143dbdbdc207b38e38f832ae079a52a618c534322e77345fd9049", + "result": "acceptable" + }, + { + "tcId": 17, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000000000000000000000000100000000000000", + "private": "a8e56bb13a9f2b33b8e6750b4a6e6621dc26ae8c5c624a0992c8f0d5b910f170", + "shared": "f294e7922c6cea587aefe72911630d50f2456a2ba7f21207d57f1ecce04f6213", + "result": "acceptable" + }, + { + "tcId": 18, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000", + "private": "e045f55c159451e97814d747050fd7769bd478434a01876a56e553f66384a74c", + "shared": "ff4715bd8cf847b77c244ce2d9b008b19efaa8e845feb85ce4889b5b2c6a4b4d", + "result": "acceptable" + }, + { + "tcId": 19, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffff030000f8ffff1f0000c0ffffff000000feffff070000f0ffff3f000000", + "private": "105d621e1ef339c3d99245cfb77cd3a5bd0c4427a0e4d8752c3b51f045889b4f", + "shared": "61eace52da5f5ecefafa4f199b077ff64f2e3d2a6ece6f8ec0497826b212ef5f", + "result": "acceptable" + }, + { + "tcId": 20, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f0000", + "private": "d88a441e706f606ae7f630f8b21f3c2554739e3e549f804118c03771f608017b", + "shared": "ff1b509a0a1a54726086f1e1c0acf040ab463a2a542e5d54e92c6df8126cf636", + "result": "acceptable" + }, + { + "tcId": 21, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000000000000000000000000000000000800000", + "private": "80bbad168222276200aafd36f7f25fdc025632d8bf9f6354bb762e06fb63e250", + "shared": "f134e6267bf93903085117b99932cc0c7ba26f25fca12102a26d7533d9c4272a", + "result": "acceptable" + }, + { + "tcId": 22, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1f", + "private": "68e134092e94e622c8a0cd18aff55be23dabd994ebdee982d90601f6f0f4b369", + "shared": "74bfc15e5597e9f5193f941e10a5c008fc89f051392723886a4a8fe5093a7354", + "result": "acceptable" + }, + { + "tcId": 23, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000020", + "private": "e8e43fc1ebac0bbc9b99c8035ee1ac59b90f19a16c42c0b90f96adfcc5fdee78", + "shared": "0d41a5b3af770bf2fcd34ff7972243a0e2cf4d34f2046a144581ae1ec68df03b", + "result": "acceptable" + }, + { + "tcId": 24, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "000000fcffff070000e0ffff3f000000ffffff010000f8ffff0f0000c0ffff7f", + "private": "18bffb16f92680a9e267473e43c464476d5372ddd1f664f3d0678efe7c98bc79", + "shared": "5894e0963583ae14a0b80420894167f4b759c8d2eb9b69cb675543f66510f646", + "result": "acceptable" + }, + { + "tcId": 25, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "ffffffffffffff00000000000000ffffffffffffff00000000000000ffffff7f", + "private": "300305eb002bf86c71fe9c0b311993727b9dc618d0ce7251d0dfd8552d17905d", + "shared": "f8624d6e35e6c548ac47832f2e5d151a8e53b9290363b28d2ab8d84ab7cb6a72", + "result": "acceptable" + }, + { + "tcId": 26, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffff7f", + "private": "80da9f02842247d4ade5ddbac51dbce55ea7dca2844e7f97ab8987ce7fd8bc71", + "shared": "bfe183ba3d4157a7b53ef178613db619e27800f85359c0b39a9fd6e32152c208", + "result": "acceptable" + }, + { + "tcId": 27, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "edfffffffffffffffffffffffffffeffffffffffffffffffffffffffffffff7f", + "private": "806e7f26ca3246de8182946cbed09f52b95da626c823c7b50450001a47b7b252", + "shared": "bca4a0724f5c1feb184078448c898c8620e7caf81f64cca746f557dff2498859", + "result": "acceptable" + }, + { + "tcId": 28, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "edfffffffffffffeffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "58354fd64bc022cba3a71b2ae64281e4ea7bf6d65fdbaead1440eeb18604fe62", + "shared": "b3418a52464c15ab0cacbbd43887a1199206d59229ced49202300638d7a40f04", + "result": "acceptable" + }, + { + "tcId": 29, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "edffffffffffefffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "f0019cf05159794cc8052b00c2e75b7f46fb6693c4b38c02b12a4fe272e8556a", + "shared": "fcde6e0a3d5fd5b63f10c2d3aad4efa05196f26bc0cb26fd6d9d3bd015eaa74f", + "result": "acceptable" + }, + { + "tcId": 30, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "edfeffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "d0fca64cc5f3a0c8e75c824e8b09d1615aa79aeba139bb7302e2bb2fcbe54b40", + "shared": "7d62f189444c6231a48afab10a0af2eee4a52e431ea05ff781d616af2114672f", + "result": "acceptable" + }, + { + "tcId": 31, + "comment": "public key on twist", + "flags": [ + "Twist", + "SpecialPublicKey" + ], + "public": "eaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "d02456e456911d3c6cd054933199807732dfdc958642ad1aebe900c793bef24a", + "shared": "07ba5fcbda21a9a17845c401492b10e6de0a168d5c94b606694c11bac39bea41", + "result": "acceptable" + }, + { + "tcId": 32, + "comment": "public key = 0", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000000", + "private": "88227494038f2bb811d47805bcdf04a2ac585ada7f2f23389bfd4658f9ddd45e", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 33, + "comment": "public key = 1", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "0100000000000000000000000000000000000000000000000000000000000000", + "private": "48232e8972b61c7e61930eb9450b5070eae1c670475685541f0476217e48184f", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 34, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000000", + "private": "a8386f7f16c50731d64f82e6a170b142a4e34f31fd7768fcb8902925e7d1e25a", + "shared": "34b7e4fa53264420d9f943d15513902342b386b172a0b0b7c8b8f2dd3d669f59", + "result": "valid" + }, + { + "tcId": 35, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0001000000000000000000000000000000000000000000000000000000000000", + "private": "d05abd08bf5e62538cb9a5ed105dbedd6de38d07940085072b4311c2678ed77d", + "shared": "3aa227a30781ed746bd4b3365e5f61461b844d09410c70570abd0d75574dfc77", + "result": "valid" + }, + { + "tcId": 36, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000001000000000000000000000000000000000000000000000000000000000", + "private": "f0b8b0998c8394364d7dcb25a3885e571374f91615275440db0645ee7c0a6f6b", + "shared": "97755e7e775789184e176847ffbc2f8ef98799d46a709c6a1c0ffd29081d7039", + "result": "valid" + }, + { + "tcId": 37, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000000001000000000000000000000000000000000000000000000000000000", + "private": "d00c35dc17460f360bfae7b94647bc4e9a7ad9ce82abeadb50a2f1a0736e2175", + "shared": "c212bfceb91f8588d46cd94684c2c9ee0734087796dc0a9f3404ff534012123d", + "result": "valid" + }, + { + "tcId": 38, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffff0f00000000000000000000000000000000000000000000000000", + "private": "385fc8058900a85021dd92425d2fb39a62d4e23aef1d5104c4c2d88712d39e4d", + "shared": "388faffb4a85d06702ba3e479c6b216a8f33efce0542979bf129d860f93b9f02", + "result": "valid" + }, + { + "tcId": 39, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffff00000000000000000000000000000000000000000000000000", + "private": "e0614b0c408af24d9d24c0a72f9137fbd6b16f02ccc94797ea3971ab16073a7f", + "shared": "877fec0669d8c1a5c866641420eea9f6bd1dfd38d36a5d55a8c0ab2bf3105c68", + "result": "valid" + }, + { + "tcId": 40, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000000000000000010000000000000000000000000000000000000000000000", + "private": "f004b8fd05d9fffd853cdc6d2266389b737e8dfc296ad00b5a69b2a9dcf72956", + "shared": "180373ea0f23ea73447e5a90398a97d490b541c69320719d7dd733fb80d5480f", + "result": "valid" + }, + { + "tcId": 41, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffff000000000000000000000000000000000000", + "private": "e80bf0e609bf3b035b552f9db7e9ecbc44a04b7910b1493661a524f46c3c2277", + "shared": "208142350af938aba52a156dce19d3c27ab1628729683cf4ef2667c3dc60cf38", + "result": "valid" + }, + { + "tcId": 42, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000010000000000000000000000000000000000", + "private": "48890e95d1b03e603bcb51fdf6f296f1f1d10f5df10e00b8a25c9809f9aa1a54", + "shared": "1c3263890f7a081cefe50cb92abd496582d90dcc2b9cb858bd286854aa6b0a7e", + "result": "valid" + }, + { + "tcId": 43, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffff00000000000000000000000000000000", + "private": "a806f1e39b742615a7dde3b29415ed827c68f07d4a47a4d9595c40c7fccb9263", + "shared": "56128e78d7c66f48e863e7e6f2caa9c0988fd439deac11d4aac9664083087f7a", + "result": "valid" + }, + { + "tcId": 44, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000000001000000000000000000000000000000", + "private": "9899d5e265e1fc7c32345227d6699a6d6b5517cf33b43ab156ee20df4878794e", + "shared": "30eca56f1f1c2e8ff780134e0e9382c5927d305d86b53477e9aeca79fc9ced05", + "result": "valid" + }, + { + "tcId": 45, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000", + "private": "d842316e5476aeaee838204258a06f15de011ba40b9962705e7f6e889fe71f40", + "shared": "cb21b7aa3f992ecfc92954849154b3af6b96a01f17bf21c612da748db38eb364", + "result": "valid" + }, + { + "tcId": 46, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000", + "private": "a0933ee30512b25ee4e900aaa07f73e507a8ec53b53a44626e0f589af4e0356c", + "shared": "c5caf8cabc36f086deaf1ab226434098c222abdf8acd3ce75c75e9debb271524", + "result": "valid" + }, + { + "tcId": 47, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "0000000000000000000000000000000000000000000000000000000001000000", + "private": "38d6403e1377734cdce98285e820f256ad6b769d6b5612bcf42cf2b97945c073", + "shared": "4d46052c7eabba215df8d91327e0c4610421d2d9129b1486d914c766cf104c27", + "result": "valid" + }, + { + "tcId": 48, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03", + "private": "182191b7052e9cd630ef08007fc6b43bc7652913be6774e2fd271b71b962a641", + "shared": "a0e0315175788362d4ebe05e6ac76d52d40187bd687492af05abc7ba7c70197d", + "result": "valid" + }, + { + "tcId": 49, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffff0f000000ffffff0f000000ffffff0f000000ffffff0f000000ffffff0f", + "private": "106221fe5694a710d6e147696c5d5b93d6887d584f24f228182ebe1b1d2db85d", + "shared": "5e64924b91873b499a5402fa64337c65d4b2ed54beeb3fa5d7347809e43aef1c", + "result": "valid" + }, + { + "tcId": 50, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "000000fcffff030000e0ffff1f000000ffffff000000f8ffff070000c0ffff3f", + "private": "d035de9456080d85a912083b2e3c7ddd7971f786f25a96c5e782cf6f4376e362", + "shared": "c052466f9712d9ec4ef40f276bb7e6441c5434a83efd8e41d20ce83f2dbf5952", + "result": "valid" + }, + { + "tcId": 51, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "private": "a8f37318a4c760f3cb2d894822918735683cb1edacf3e666e15694154978fd6d", + "shared": "d151b97cba9c25d48e6d576338b97d53dd8b25e84f65f7a2091a17016317c553", + "result": "valid" + }, + { + "tcId": 52, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f", + "private": "20d4d624cf732f826f09e8088017742f13f2da98f4dcf4b40519adb790cebf64", + "shared": "5716296baf2b1a6b9cd15b23ba86829743d60b0396569be1d5b40014c06b477d", + "result": "valid" + }, + { + "tcId": 53, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fff7f", + "private": "d806a735d138efb3b404683c9d84485ab4af540d0af253b574323d8913003c66", + "shared": "ddbd56d0454b794c1d1d4923f023a51f6f34ef3f4868e3d6659307c683c74126", + "result": "valid" + }, + { + "tcId": 54, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "fffffffffeffff7ffffffffffeffff7ffffffffffeffff7ffffffffffeffff7f", + "private": "184198c6228177f3ef41dc9a341258f8181ae365fe9ec98d93639b0bbee1467d", + "shared": "8039eebed1a4f3b811ea92102a6267d4da412370f3f0d6b70f1faaa2e8d5236d", + "result": "valid" + }, + { + "tcId": 55, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffff7f", + "private": "f0a46a7f4b989fe515edc441109346ba746ec1516896ec5b7e4f4d903064b463", + "shared": "b69524e3955da23df6ad1a7cd38540047f50860f1c8fded9b1fdfcc9e812a035", + "result": "valid" + }, + { + "tcId": 56, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffffffffffffffffffffffffffffffffffffffffffffffeffffffffffff7f", + "private": "881874fda3a99c0f0216e1172fbd07ab1c7df78602cc6b11264e57aab5f23a49", + "shared": "e417bb8854f3b4f70ecea557454c5c4e5f3804ae537960a8097b9f338410d757", + "result": "valid" + }, + { + "tcId": 57, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffffffffffffffffffffffffffffffeffffffffffffffffffffffffffff7f", + "private": "b8d0f1ae05a5072831443150e202ac6db00322cdf341f467e9f296588b04db72", + "shared": "afca72bb8ef727b60c530c937a2f7d06bb39c39b903a7f4435b3f5d8fc1ca810", + "result": "valid" + }, + { + "tcId": 58, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffffffffffffffeffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "c8619ba988859db7d6f20fbf3ffb8b113418cc278065b4e8bb6d4e5b3e7cb569", + "shared": "7e41c2886fed4af04c1641a59af93802f25af0f9cba7a29ae72e2a92f35a1e5a", + "result": "valid" + }, + { + "tcId": 59, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "f8d4ca1f37a30ec9acd6dbe5a6e150e5bc447d22b355d80ba002c5b05c26935d", + "shared": "dd3abd4746bf4f2a0d93c02a7d19f76d921c090d07e6ea5abae7f28848355947", + "result": "valid" + }, + { + "tcId": 60, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edffffefffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "88037ac8e33c72c2c51037c7c8c5288bba9265c82fd8c31796dd7ea5df9aaa4a", + "shared": "8c27b3bff8d3c1f6daf2d3b7b3479cf9ad2056e2002be247992a3b29de13a625", + "result": "valid" + }, + { + "tcId": 61, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "edfffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "5034ee7bf83a13d9167df86b0640294f3620f4f4d9030e5e293f9190824ae562", + "shared": "8e1d2207b47432f881677448b9d426a30de1a1f3fd38cad6f4b23dbdfe8a2901", + "result": "valid" + }, + { + "tcId": 62, + "comment": "edge case public key", + "flags": [ + "SpecialPublicKey" + ], + "public": "ebffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "40bd4e1caf39d9def7663823502dad3e7d30eb6eb01e9b89516d4f2f45b7cd7f", + "shared": "2cf6974b0c070e3707bf92e721d3ea9de3db6f61ed810e0a23d72d433365f631", + "result": "valid" + }, + { + "tcId": 63, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b800", + "private": "e0f978dfcd3a8f1a5093418de54136a584c20b7b349afdf6c0520886f95b1272", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 64, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "5f9c95bca3508c24b1d0b1559c83ef5b04445cc4581c8e86d8224eddd09f1157", + "private": "387355d995616090503aafad49da01fb3dc3eda962704eaee6b86f9e20c92579", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 65, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "Twist", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "c8fe0df92ae68a03023fc0c9adb9557d31be7feed0d3ab36c558143daf4dbb40", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 66, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b880", + "private": "c8d74acde5934e64b9895d5ff7afbffd7f704f7dfccff7ac28fa62a1e6410347", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 67, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "5f9c95bca3508c24b1d0b1559c83ef5b04445cc4581c8e86d8224eddd09f11d7", + "private": "b85649d5120e01e8ccaf7b2fb8d81b62e8ad6f3d5c0553fdde1906cb9d79c050", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 68, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret", + "Twist" + ], + "public": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "2064b2f4c9dc97ec7cf58932fdfa3265ba6ea4d11f0259b8efc8afb35db88c48", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 69, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000000", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 70, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0100000000000000000000000000000000000000000000000000000000000000", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 71, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret", + "Twist" + ], + "public": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 72, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "5f9c95bca3508c24b1d0b1559c83ef5b04445cc4581c8e86d8224eddd09f1157", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 73, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b800", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 74, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 75, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 76, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000080", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 77, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0100000000000000000000000000000000000000000000000000000000000080", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 78, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret", + "Twist" + ], + "public": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 79, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "5f9c95bca3508c24b1d0b1559c83ef5b04445cc4581c8e86d8224eddd09f11d7", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 80, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b880", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 81, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 82, + "comment": "public key with low order", + "flags": [ + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "786a33a4f7af297a20e7642925932bf509e7070fa1bc36986af1eb13f4f50b55", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 83, + "comment": "public key == 0", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "40ff586e73d61f0960dc2d763ac19e98225f1194f6fe43d5dd97ad55b3d35961", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 84, + "comment": "public key == 0", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000080", + "private": "7887889bac4c629a101d3724f2ed8b98d936fde79e1a1f77d86779626bf8f263", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 85, + "comment": "public key == 1", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "eeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "584fceaebae944bfe93b2e0d0a575f706ce5ada1da2b1311c3b421f9186c7a6f", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 86, + "comment": "public key == 1", + "flags": [ + "SmallPublicKey", + "LowOrderPublic", + "NonCanonicalPublic", + "SpecialPublicKey", + "ZeroSharedSecret" + ], + "public": "0100000000000000000000000000000000000000000000000000000000000080", + "private": "e07971ee820e48b0b266d8be3cdbbb5e900a43f59ee8535c6572418615de4962", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 87, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "Twist", + "SpecialPublicKey" + ], + "public": "efffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "0016b62af5cabde8c40938ebf2108e05d27fa0533ed85d70015ad4ad39762d54", + "shared": "b4d10e832714972f96bd3382e4d082a21a8333a16315b3ffb536061d2482360d", + "result": "acceptable" + }, + { + "tcId": 88, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "Twist", + "SpecialPublicKey" + ], + "public": "f0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "d83650ba7cec115881916255e3fa5fa0d6b8dcf968731bd2c9d2aec3f561f649", + "shared": "515eac8f1ed0b00c70762322c3ef86716cd2c51fe77cec3d31b6388bc6eea336", + "result": "acceptable" + }, + { + "tcId": 89, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "f1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "88dd14e2711ebd0b0026c651264ca965e7e3da5082789fbab7e24425e7b4377e", + "shared": "6919992d6a591e77b3f2bacbd74caf3aea4be4802b18b2bc07eb09ade3ad6662", + "result": "acceptable" + }, + { + "tcId": 90, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "98c2b08cbac14e15953154e3b558d42bb1268a365b0ef2f22725129d8ac5cb7f", + "shared": "9c034fcd8d3bf69964958c0105161fcb5d1ea5b8f8abb371491e42a7684c2322", + "result": "acceptable" + }, + { + "tcId": 91, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "Twist", + "SpecialPublicKey" + ], + "public": "0200000000000000000000000000000000000000000000000000000000000080", + "private": "c0697b6f05e0f3433b44ea352f20508eb0623098a7770853af5ca09727340c4e", + "shared": "ed18b06da512cab63f22d2d51d77d99facd3c4502e4abf4e97b094c20a9ddf10", + "result": "acceptable" + }, + { + "tcId": 92, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "Twist", + "SpecialPublicKey" + ], + "public": "0300000000000000000000000000000000000000000000000000000000000080", + "private": "18422b58a18e0f4519b7a887b8cfb649e0bfe4b34d75963350a9944e5b7f5b7e", + "shared": "448ce410fffc7e6149c5abec0ad5f3607dfde8a34e2ac3243c3009176168b432", + "result": "acceptable" + }, + { + "tcId": 93, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "0400000000000000000000000000000000000000000000000000000000000080", + "private": "20620d82487707bedf9ee3549e95cb9390d2618f50cf6acba47ffaa103224a6f", + "shared": "03a633df01480d0d5048d92f51b20dc1d11f73e9515c699429b90a4f6903122a", + "result": "acceptable" + }, + { + "tcId": 94, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "daffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "285a6a7ceeb7122f2c78d99c53b2a902b490892f7dff326f89d12673c3101b53", + "shared": "9b01287717d72f4cfb583ec85f8f936849b17d978dbae7b837db56a62f100a68", + "result": "acceptable" + }, + { + "tcId": 95, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey", + "Twist" + ], + "public": "dbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "c8e0330ae9dceeff887fba761225879a4bd2e0db08799244136e4721b2c88970", + "shared": "dfe60831c9f4f96c816e51048804dbdc27795d760eced75ef575cbe3b464054b", + "result": "acceptable" + }, + { + "tcId": 96, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "dcffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "10db6210fc1fb13382472fa1787b004b5d11868ab3a79510e0cee30f4a6df26b", + "shared": "50bfa826ca77036dd2bbfd092c3f78e2e4a1f980d7c8e78f2f14dca3cce5cc3c", + "result": "acceptable" + }, + { + "tcId": 97, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey", + "Twist" + ], + "public": "eaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "9041c6e044a277df8466275ca8b5ee0da7bc028648054ade5c592add3057474e", + "shared": "13da5695a4c206115409b5277a934782fe985fa050bc902cba5616f9156fe277", + "result": "acceptable" + }, + { + "tcId": 98, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "ebffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "b8d499041a6713c0f6f876db7406587fdb44582f9542356ae89cfa958a34d266", + "shared": "63483b5d69236c63cddbed33d8e22baecc2b0ccf886598e863c844d2bf256704", + "result": "acceptable" + }, + { + "tcId": 99, + "comment": "non-canonical public key", + "flags": [ + "NonCanonicalPublic", + "SpecialPublicKey" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "private": "c85f08e60c845f82099141a66dc4583d2b1040462c544d33d0453b20b1a6377e", + "shared": "e9db74bc88d0d9bf046ddd13f943bccbe6dbb47d49323f8dfeedc4a694991a3c", + "result": "acceptable" + }, + { + "tcId": 100, + "comment": "RFC 7748", + "flags": [ + "Ktv" + ], + "public": "e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c", + "private": "a046e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449a44", + "shared": "c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a28552", + "result": "valid" + }, + { + "tcId": 101, + "comment": "RFC 7748", + "flags": [ + "Ktv", + "Twist" + ], + "public": "e5210f12786811d3f4b7959d0538ae2c31dbe7106fc03c3efc4cd549c715a413", + "private": "4866e9d4d1b4673c5ad22691957d6af5c11b6421e0ea01d42ca4169e7918ba4d", + "shared": "95cbde9476e8907d7aade45cb4b873f88b595a68799fa152e6f8f7647aac7957", + "result": "acceptable" + }, + { + "tcId": 102, + "comment": "RFC 8037, Section A.6", + "flags": [ + "Ktv" + ], + "public": "de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f", + "private": "77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a", + "shared": "4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742", + "result": "valid" + }, + { + "tcId": 103, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "b7b6d39c765cb60c0c8542f4f3952ffb51d3002d4aeb9f8ff988b192043e6d0a", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "0200000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 104, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "3b18df1e50b899ebd588c3161cbd3bf98ebcc2c1f7df53b811bd0e91b4d5153d", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "0900000000000000000000000000000000000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 105, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "cab6f9e7d8ce00dfcea9bbd8f069ef7fb2ac504abf83b87db601b5ae0a7f7615", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "1000000000000000000000000000000000000000000000000000000000000000", + "result": "valid" + }, + { + "tcId": 106, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "4977d0d897e1ba566590f60f2eb0db6f7b24c13d436918ccfd32708dfad7e247", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "result": "acceptable" + }, + { + "tcId": 107, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "98730bc03e29e8b057fb1d20ef8c0bffc822485d3db7f45f4e3cc2c3c6d1d14c", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "fcffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "result": "valid" + }, + { + "tcId": 108, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "97b4fff682df7f096cd1756569e252db482d45406a3198a1aff282a5da474c49", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "f9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "result": "acceptable" + }, + { + "tcId": 109, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "317781b0163bae74accc06c0d44ef9a911a22b0d37faf7726621591f9343ea2f", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "result": "valid" + }, + { + "tcId": 110, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "7e26f8f24cb590027f9d1bc49b0e1a242c7d8f43624d3e8fab28ee08e02cb45e", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03", + "result": "valid" + }, + { + "tcId": 111, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "e96d2780e5469a74620ab5aa2f62151d140c473320dbe1b028f1a48f8e76f95f", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "e5ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "acceptable" + }, + { + "tcId": 112, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "8d612c5831aa64b057300e7e310f3aa332af34066fefcab2b089c9592878f832", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "e3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "acceptable" + }, + { + "tcId": 113, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared" + ], + "public": "8d44108d05d940d3dfe5647ea7a87be24d0d036c9f0a95a2386b839e7b7bf145", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "ddffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "valid" + }, + { + "tcId": 114, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "21a35d5db1b6237c739b56345a930aeee373cdcfb4701266782a8ac594913b29", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "dbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "result": "acceptable" + }, + { + "tcId": 115, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "3e5efb63c352ce942762482bc9337a5d35ba55664743ac5e93d11f957336cb10", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "0000000000000000000000000000000000000000000000000000000000000002", + "result": "acceptable" + }, + { + "tcId": 116, + "comment": "edge case for shared secret", + "flags": [ + "EdgeCaseShared", + "Twist" + ], + "public": "8e41f05ea3c76572be104ad8788e970863c6e2ca3daae64d1c2f46decfffa571", + "private": "60a3a4f130b98a5be4b1cedb7cb85584a3520e142d474dc9ccb909a073a9767f", + "shared": "0000000000000000000000000000000000000000000000000000000000008000", + "result": "acceptable" + }, + { + "tcId": 117, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "SmallPublicKey", + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000000", + "private": "c8d07c46bbfb827753b92c70e49583ce8bfa44641a7382258ea903d6a832c96b", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 118, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "SmallPublicKey", + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "0100000000000000000000000000000000000000000000000000000000000000", + "private": "90b7ef237a055f348dcb4c4364a59d7d31edc7ab78f2ca254e2c810975c3f543", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 119, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0200000000000000000000000000000000000000000000000000000000000000", + "private": "e0a8be63315c4f0f0a3fee607f44d30a55be63f09561d9af93e0a1c9cf0ed751", + "shared": "0c50ac2bfb6815b47d0734c5981379882a24a2de6166853c735329d978baee4d", + "result": "acceptable" + }, + { + "tcId": 120, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1200000000000000000000000000000000000000000000000000000000000000", + "private": "0840a8af5bc4c48da8850e973d7e14220f45c192cea4020d377eecd25c7c3643", + "shared": "77557137a2a2a651c49627a9b239ac1f2bf78b8a3e72168ccecc10a51fc5ae66", + "result": "valid" + }, + { + "tcId": 121, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1400000000000000000000000000000000000000000000000000000000000000", + "private": "0092229c753a71284d0853909470ad847ab62f439ea51482fb41d30cc3b44743", + "shared": "c88e719ae5c2248b5f90da346a92ae214f44a5d129fd4e9c26cf6a0da1efe077", + "result": "acceptable" + }, + { + "tcId": 122, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0000000000000000000000000080000000000000000000000000000000000000", + "private": "b8da2bd2d7cf25a3e54e5f87ee15911effb9ff86baec4076d56c8e953670bf5b", + "shared": "4bf6789c7ea036f973cde0af02d6fdb9b64a0b957022111439570fad7d7a453f", + "result": "valid" + }, + { + "tcId": 123, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ffffffffffffffffffffffffffff000000000000000000000000000000000000", + "private": "684cd420af41abb3d10c61e773238cf729c2155f941ac27e15f4c37f49b29576", + "shared": "bcac235ae15cc7148372e11f9315e3bc76ceb904b3d2a8246bd9d9be2082bb62", + "result": "valid" + }, + { + "tcId": 124, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0100000000000000000000000000010000000000000000000000000000000000", + "private": "38cfacaa4460796b4de434bdd6739f0d043671f97fa829517511e6b47aa93474", + "shared": "5dd7d16fff25cc5fdf9e03c3157cb0a235cea17d618f36e6f13461567edeb943", + "result": "acceptable" + }, + { + "tcId": 125, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0000000000000000000000000000000000000000000000000000004000000000", + "private": "30832e8cb627ac195f77b1105258e4bb18b99a5ed944404bfacb3a039fbdb14b", + "shared": "2816fd031d51d6750f9225ede950625cca47441ca97e43092650396991afcb6d", + "result": "valid" + }, + { + "tcId": 126, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0000000000000000000000000000000000000000000000000000008000000000", + "private": "d818fd6971e546447f361d33d3dbb3eadcf02fb28f246f1d5107b9073a93cd4f", + "shared": "7ed8f2d5424e7ebb3edbdf4abe455447e5a48b658e64abd06c218f33bd151f64", + "result": "acceptable" + }, + { + "tcId": 127, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000", + "private": "1021cd8682bdc3f5da9100adff5b2230b3acd836b3a455db8352a2c27e69d17e", + "shared": "e8620ed5ca89c72c5ea5503e6dcd01131cd5e875c30e13d5dc619ce28ec7d559", + "result": "acceptable" + }, + { + "tcId": 128, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0100000000000000000000000000000000000000000000000000000001000000", + "private": "20e4c9247102292655d6765d7d84c6fce5309b8004045daea6d7d7dcad462871", + "shared": "ceadb264379dcadd6e3bb8ad24dd653d2a609dd703d41da6caf3ad00f001862c", + "result": "valid" + }, + { + "tcId": 129, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a8b9c7372118a53a9de9eaf0868e3b1a3d88e81cb2e407ff7125e9f5c5088715", + "private": "90b150d462de512056d5bd55173074969b496f262fb6916b733f6263a8078971", + "shared": "f86cc7bf1be49574fc97a074282e9bb5cd238e002bc8e9a7b8552b2d60eccb52", + "result": "acceptable" + }, + { + "tcId": 130, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "aab9c7372118a53a9de9eaf0868e3b1a3d88e81cb2e407ff7125e9f5c5088715", + "private": "9887286b3261c8d857a16f6db21277f75d88d4e861b3ebe7596699047e816668", + "shared": "ccbb8fd9dee165a398b2dbd7c8396f81736c1b3da36b35fbec8f326f38f92767", + "result": "acceptable" + }, + { + "tcId": 131, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "585007a5930d77623cf29756038ca197d3ebfd9e4c80a69585efe0274092c115", + "private": "20ca2c85cc8762e96b7047bf15c71c050ffe0ed1616040a953ae32a1297ad871", + "shared": "46add6f48ffff461777d4f89b6fdf1155aa051a96387d45f3e5e371a236b6e52", + "result": "valid" + }, + { + "tcId": 132, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "fbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1f", + "private": "d027656605b10bf18dea28bc52546f9f1f08cef06cafd200fc84f87dbb4ebe46", + "shared": "1adbe32207e21f71e1af53884d2a2276481e298e557f4dacb3720f2458e3082d", + "result": "valid" + }, + { + "tcId": 133, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000020", + "private": "4867a83ee9d01b7510840867db1af6a6049bdbb056b74443f70c358e162c8867", + "shared": "e12cc58fbeb70a5e35c861c33710be6516a6a92e52376060211b2487db542b4f", + "result": "acceptable" + }, + { + "tcId": 134, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "afa00e4a271beec478e42fad0618432fa7d7fb3d99004d2b0bdfc14f8024832b", + "private": "a015970a8add940fca5b1b5d23875397d547d8d494fcb314f2045a67a2d12c4b", + "shared": "421bed1b26da1e9adbeada1f32b91a0fb4ced0f1110e0a4a88e735a19ee4571e", + "result": "valid" + }, + { + "tcId": 135, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "b1a00e4a271beec478e42fad0618432fa7d7fb3d99004d2b0bdfc14f8024832b", + "private": "4058cb6b9aaba02a338aaa392dbc10039e26e9e444117e758e24c5d8b232ea5e", + "shared": "d7b47463e2f4ca9a1a7deea098da8e74ac3b4a109083d997259b12992e7e7e06", + "result": "valid" + }, + { + "tcId": 136, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "fbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2f", + "private": "b876b05daff0530b139d9e11250563418077178246c5fa7005ba00e9b6647763", + "shared": "686eb910a937211b9147c8a051a1197906818fdc626668eb5f5d394afd86d41b", + "result": "acceptable" + }, + { + "tcId": 137, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "22231c64ef73ad62318b8a87bc38e272e1bb8bf1a60d7c00476d0b059d7b3c35", + "private": "d87fd6aa5d8deef6dee9619a56846a0829620590f2da40835d8e251597e39078", + "shared": "09559733b35bcc6bb8ac574b5abe3a4d8841deff051c294a07487e3eec3c5558", + "result": "valid" + }, + { + "tcId": 138, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "private": "90036321b63751f7622aa93da34d85e59ce81009ac5b9a068921d83bc4715b57", + "shared": "f7d5cbcf39eb722b01ed20c85563ebb81d076511aead4ccc429027866b9fd270", + "result": "valid" + }, + { + "tcId": 139, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "private": "a06781fd4c4a0874e00e72ba131b9dd87a83b2904e294de176e8a9af1f695d67", + "shared": "e995ad6a1ec6c5ab32922cff9d204721704673143c4a11deaa203f3c81989b3f", + "result": "acceptable" + }, + { + "tcId": 140, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "feffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3f", + "private": "b822d72d8b68bdb4fbf67e56a61d672b2c7747e94479fe5ae4072d0accdd6571", + "shared": "32b6dabe01d13867f3b5b0892fefd80dca666f2edc5afb43cd0baf703c3e6926", + "result": "acceptable" + }, + { + "tcId": 141, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0000000000000000000000000000000000000000000000000000000000000040", + "private": "d08ce1237e248d02cdf619d20bea5848ade4f6ffd171b8dee8793fc67c459640", + "shared": "a93d83fc9ea0f6cb0cc8b631da600019b76cbb2ec57222f2e42dd540e3da850b", + "result": "valid" + }, + { + "tcId": 142, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cbdce39b108c529dce74757843c71d8d1e44740e59f283ffb892f4fa6284c34a", + "private": "180ae3c928514cfb9edd06e7dc1d5d066160e967445a5c58e4463b69ed205e6d", + "shared": "017cbfa2b38e9ef3297a339ecce1a917bdcf7e910036086a41d1e22d04241870", + "result": "valid" + }, + { + "tcId": 143, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "3c5ff1b5d8e4113b871bd052f9e7bcd0582804c266ffb2d4f4203eb07fdb7c54", + "private": "e881d806a110560cd8fee899d59c0249f1233a4322c41aa369c7a2a99f5b5962", + "shared": "71133905b8a57ea8c38de0ecf213699a75b096c2df21f07f7e9eb03e9fa53f5c", + "result": "valid" + }, + { + "tcId": 144, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "3e5ff1b5d8e4113b871bd052f9e7bcd0582804c266ffb2d4f4203eb07fdb7c54", + "private": "08e410e1d7e8b9411236af4a35d6b62a5d8931478e4c62197cfafb491467b162", + "shared": "3dc7b70e110766b2bf525252ebed98a100b2e532dc69544464da1bbab8625f6d", + "result": "valid" + }, + { + "tcId": 145, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f2ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f", + "private": "e02fdf7e0ee3d55b4440f01432dd253c949793bc04da44ddece83e54c8c39b40", + "shared": "e317e5cc438b5f79ead5533ac7c45519a117b31033cc2140b19edf8572011240", + "result": "valid" + }, + { + "tcId": 146, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f6ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5f", + "private": "f05d18f68ef7a5865c14db3a9c255fdf2dabea2aa36581e94f68b727b582867b", + "shared": "d86810516aeddc18061036f599a9eb84d1c6146b0f543652dd4526743ba42c04", + "result": "valid" + }, + { + "tcId": 147, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "95aff85a6cf2889dc30d68a9fc735e682c140261b37f596a7a101fd8bf6d3e6a", + "private": "00c103578d5c079d7bcc22c1c31e787c1b15c57fcb493fdafefa20371cfc746b", + "shared": "dfa988a477003be125b95ccbf2223d97729577d25e1d6e89e3da0afabdd0ae71", + "result": "acceptable" + }, + { + "tcId": 148, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "434638c8dee75ac56216150f7971c4e5c27717e34d1bf8008eda160a3af7786a", + "private": "7005bb927485c435642b424a3dde014bcf76345e5be64ae6e9b24db39e1cdb51", + "shared": "d450af45b8ed5fe140cc5263ffb7b52e66736899a8b872b6e28552129819b25b", + "result": "acceptable" + }, + { + "tcId": 149, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "454638c8dee75ac56216150f7971c4e5c27717e34d1bf8008eda160a3af7786a", + "private": "0822039a5dc13c40fcccf346e2a7769b4fd272052d43260ad626468a50d44162", + "shared": "58002c89bf8bc32ae6fc205b796acd13ef7f8476f6492ae4b2be47f1095e8a4f", + "result": "valid" + }, + { + "tcId": 150, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ecfffffffffffffffffffffffffffeffffffffffffffffffffffffffffffff7f", + "private": "40a6349c03f0dc0a42358f6353ca67632af687b14c9dff626c54e211e8fc355a", + "shared": "7773aad6e72eb1735b65ad51f7dad258c11d7bfff53094424cb103cd6bfb4368", + "result": "valid" + }, + { + "tcId": 151, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "eefffffffffffffffffffffffffffeffffffffffffffffffffffffffffffff7f", + "private": "50696d4d05209971d6ba0676ea274262ba639aac74fa75e5df4570768ad8ae74", + "shared": "c118ddf6462fbea80f14ef1f2972a1ab12cafa511d1323d4d22d0d426d651b5b", + "result": "valid" + }, + { + "tcId": 152, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "edffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffff7f", + "private": "68bb680c853f4e4daa47c586dc886cf4568d7b0383770f6df439a53be4a3236d", + "shared": "cc0775bfd970a2706b11c7222a4436a3d17160382c83b76f89b66192c81b4408", + "result": "valid" + }, + { + "tcId": 153, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ebffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "b0f6c28dbdc647068a76d71805ef770f087cf76b82afdc0d26c45b71ace49768", + "shared": "f0097fa0ba70d019126277ab15c56ecc170ca88180b2bf9d80fcda3d7d74552a", + "result": "valid" + }, + { + "tcId": 154, + "comment": "special case public key", + "flags": [ + "EdgeCaseMultiplication", + "LowOrderPublic", + "Twist", + "ZeroSharedSecret" + ], + "public": "ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "private": "18630f93598637c35da623a74559cf944374a559114c7937811041fc8605564a", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 155, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0000000000000000000008000000000000000000000000000000000000000000", + "private": "581ecbda5a4a228044fefd6e03df234558c3c79152c6e2c5e60b142c4f26a851", + "shared": "59e7b1e6f47065a48bd34913d910176b6792a1372aad22e73cd7df45fcf91a0e", + "result": "acceptable" + }, + { + "tcId": 156, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "77af0d3897a715dfe25df5d538cf133bc9ab7ad52df6bd922a2fb75621d59901", + "private": "b0561a38000795b7cb537b55e975ea452c2118506295d5eb15fd9c83b67f7a50", + "shared": "179f6b020748acba349133eaa4518f1bd8bab7bfc4fb05fd4c24e7553da1e960", + "result": "valid" + }, + { + "tcId": 157, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4e39866127b6a12a54914e106aab86464af55631f3cb61766d5999aa8d2e070e", + "private": "b00f7df2d47128441c7270b9a87eee45b6056fc64236a57bdf81dbcccf5f5d42", + "shared": "43c5ee1451f213ef7624729e595a0fee7c9af7ee5d27eb03278ee9f94c202352", + "result": "valid" + }, + { + "tcId": 158, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "adc6799ed8495ed5ab6eb1ef955479b9b50aa9ce0c349e8992a6665572d1f811", + "private": "c8f7a0c0bfb1e9c72576c534f86854fbe4af521d4fa807f67e2440e100ec8852", + "shared": "2f350bcf0b40784d1d756c9ca3e38ec9dd68ba80faf1f9847de50779c0d4902a", + "result": "valid" + }, + { + "tcId": 159, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "770f4218ef234f5e185466e32442c302bbec21bbb6cd28c979e783fe5013333f", + "private": "58181f581aa37022ff71c56c6e68e6175d967c5c995a249885f66565074ded4d", + "shared": "d5d650dc621072eca952e4344efc7320b2b1459aba48f5e2480db881c50cc650", + "result": "acceptable" + }, + { + "tcId": 160, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "5c6118c4c74cfb842d9a87449f9d8db8b992d46c5a9093ce2fcb7a49b535c451", + "private": "301c935cae4357070b0adaf9cd6192830b2c989c153729eed99f589eb45f884b", + "shared": "909cc57275d54f20c67b45f9af9484fd67581afb7d887bee1db5461f303ef257", + "result": "acceptable" + }, + { + "tcId": 161, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4039866127b6a12a54914e106aab86464af55631f3cb61766d5999aa8d2e076e", + "private": "d002292d4359a3d42bc8767f1380009332e7a0df2f3379011ab78f789f6baa54", + "shared": "4a7e2c5caf1d8180eb1c4f22692f29a14b4cdc9b193bd1d16e2f27438eef1448", + "result": "valid" + }, + { + "tcId": 162, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "078fa523498fb51cba1112d83b20af448b8009d8eea14368564d01b8f9b6086f", + "private": "d0c2c49e644ab738270707ff9917065942687e2f12886d961161db46c05b565f", + "shared": "c0ee59d3685fc2c3c803608b5ee39a7f8da30b48e4293ae011f0ea1e5aeb7173", + "result": "acceptable" + }, + { + "tcId": 163, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "9fc6799ed8495ed5ab6eb1ef955479b9b50aa9ce0c349e8992a6665572d1f871", + "private": "f087d38b274c1dad1bce6eaa36b48e2190b90b9bf8ca59669cc5e00464534342", + "shared": "b252bc8eabfaa68c56e54d61b99061a35d11e3a7b9bda417d90f69b1119bcf45", + "result": "valid" + }, + { + "tcId": 164, + "comment": "special case for E in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7650f2c76858ea201da2022ac730ecc43654852ad209426dd5d048a9de2a667e", + "private": "48dbcc5a695f1514bbbaa6ad00842b69d9ae5216b1963add07fb2947c97b8447", + "shared": "fbda33bc930c08df837208e19afdc1cfe3fd0f8f0e3976be34775e58a4a7771f", + "result": "valid" + }, + { + "tcId": 165, + "comment": "D = 0 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "e0eb7a7c3b41b8ae1656e3faf19fc46ada098deb9c32b1fd866205165f49b800", + "private": "5891c9272cf9a197735b701e5715268d36d7436b7e351a3e997a0862e4807d4d", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 166, + "comment": "D = 0 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "LowOrderPublic", + "ZeroSharedSecret" + ], + "public": "5f9c95bca3508c24b1d0b1559c83ef5b04445cc4581c8e86d8224eddd09f1157", + "private": "c0f9c60aea73731d92ab5ed9f4cea122f9a6eb2577bda72f94948fea4d4cc65d", + "shared": "0000000000000000000000000000000000000000000000000000000000000000", + "result": "acceptable" + }, + { + "tcId": 167, + "comment": "special case for DA - CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b0224e7134cf92d40a31515f2f0e89c2a2777e8ac2fe741db0dc39399fdf2702", + "private": "0066dd7674fe51f9326c1e239b875f8ac0701aae69a804c25fe43595e8660b45", + "shared": "8dacfe7beaaa62b94bf6e50ee5214d99ad7cda5a431ea0c62f2b20a89d73c62e", + "result": "acceptable" + }, + { + "tcId": 168, + "comment": "special case for DA - CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "601e3febb848ec3e57fce64588aad82afc9c2af99bbcdffcc4cd58d4b3d15c07", + "private": "80067f30f40d61318b420c859fce128c9017ab81b47b76028a57bc30d5856846", + "shared": "20f1d3fe90e08bc6f152bf5dacc3ed35899785333f1470e6a62c3b8cbe28d260", + "result": "valid" + }, + { + "tcId": 169, + "comment": "special case for DA - CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "82a3807bbdec2fa9938fb4141e27dc57456606301f78ff7133cf24f3d13ee117", + "private": "584577669d21ce0ae3e30b02c9783ffe97709cbfe396889aa31e8ee43352dc52", + "shared": "2b28cc5140b816add5ad3a77a81b1c073d67bf51bf95bda2064a14eb12d5f766", + "result": "acceptable" + }, + { + "tcId": 170, + "comment": "special case for DA - CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f329ab2376462e5f3128a2682086253c19222ac1e2bca45692f0c3b528f4c428", + "private": "18e597a4e2ccdb5e8052d57c9009938c2d4c43d6d8c9f93c98727b7311035953", + "shared": "8392160083b9af9e0ef44fcfce53ba8ff7282ee7a6c71ab66f8843a55d09cd68", + "result": "valid" + }, + { + "tcId": 171, + "comment": "special case for DA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4fce3bb6c8aaf022dbd100e3cde3941b37d543f00401dba7da9bc143dfc55709", + "private": "88281cc51d5512d8814ea5249b879dcbad0323d38512dafbdc7ba85bba8c8d5d", + "shared": "42184e22c535530c457bd3b4f1084cbf5e297f502fe136b8d1daecf5334cc96c", + "result": "valid" + }, + { + "tcId": 172, + "comment": "special case for DA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "15c68851c1db844b5a1ef3456a659f188854b1a75fbdb2f68f514c9289ce711f", + "private": "d0e795450df0a813c6573496ec5793ca02e1bdbad10ed08df83fdaed68b3385f", + "shared": "f654d78e5945b24bc63e3e6d790e0ae986e53937764068b1bce920e1d79b756f", + "result": "valid" + }, + { + "tcId": 173, + "comment": "special case for DA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4200a242434337b8914f49345301ed782b13594f9ede089c41fb1e7ea82c9053", + "private": "30b69a1cc1eb2d0b83ea213846e90a2c922088bdf294a6995bf6e6e77c646c41", + "shared": "cd8a09b04795edcc7061867373981aa748651ebdce5ec218a335b878cefe4872", + "result": "valid" + }, + { + "tcId": 174, + "comment": "special case for DA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "baabf0174aaaea4de48cc83adfb0401461a741903ea6fb130d7d64b7bf03a966", + "private": "78b30bb63cd8ade71b7a77d426f4419d05f199ffef349e89faa9d9a5f21f6654", + "shared": "c9f8258f237db1c80702c5c4d9048dfba9dfe259da4aeee90dc2945526961275", + "result": "valid" + }, + { + "tcId": 175, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f12f18bd59c126348f6a7a9f4a5fdd9fcaf581345073a851fba098e5d64b4a0c", + "private": "c0b386f4ef0d4698686404977e7b60cb6c1f8b6012a22e29d6224c5947439041", + "shared": "6600cbe900616a770a126b8b19156d5e27e1174bd538d0944eb3c0be4899c758", + "result": "valid" + }, + { + "tcId": 176, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "bee386527b772490aeb96fc4d23b9304037cb4430f64b228f3d8b3b498319f22", + "private": "9886602e719bacafea092bb75b51ae7258abe1a364c176857f3dc188c03e6759", + "shared": "3fe710d6344ff0cb342e52349e1c5b57b7a271f2a133bb5249bbe40dc86e1b40", + "result": "acceptable" + }, + { + "tcId": 177, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cf911ac91b0d944049cec66ae5ef0c4549d1e612e107c68e87263a2fbcf8323f", + "private": "b83960f5d0613cdaac6dda690351666e9f277bba6bd406b0e27a1886bb2d3e46", + "shared": "71373ebe67f39a2c230027c7db4b3b74bab80ed212b232679785ee10f47c304e", + "result": "valid" + }, + { + "tcId": 178, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1e6ee536e4f26bbfb63139951a10f3bab62e19ed1ef8397178d9c5d04307cd40", + "private": "d03b75f09ac807dfd2ee352c04a1f25984720f785ffaa0af88bc5db6ff9c3453", + "shared": "238eef43c589822e1d3de41c1cc46dcfec7a93febf37c8546b6625e1a123815d", + "result": "valid" + }, + { + "tcId": 179, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2f1c79ad8488db6f5146903b2dc46cfbfc834bbcf09b4dd70c274c4b67ce605d", + "private": "d036948c0ec223f0ee577e390dbf87222358ed199f2823345ad154bbc4cbcc47", + "shared": "87a79c9c231d3b9526b49bf3d683bf38c3c319af7c7c5d1456487398da535010", + "result": "valid" + }, + { + "tcId": 180, + "comment": "special case for x_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "fccfe742a63ed9cb70958560b5a02260350a7ecbaf8c57ae045f671a29b4b573", + "private": "d054ded613febf2950ac5c927fcb120c387de0ba61b331cd33024c8b6e737048", + "shared": "d683ca6194452d878c12d7da35f22833f99728bba89931a51274f61210336a5f", + "result": "valid" + }, + { + "tcId": 181, + "comment": "special case for AA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "cb3d4a90f86b3011da3369d9988597c7fff1499273b4a04f84d0e26ed1683c0d", + "private": "e82c480631fb153ba2211fe603032b3e71b162dbd3c11bec03208ffcd510655f", + "shared": "dbf6203516635840cf69a02db87cf0d95dae315da7fc1ec7ce2b29e1f2db6666", + "result": "acceptable" + }, + { + "tcId": 182, + "comment": "special case for AA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "101e13f7bc0570fa2638caa20a67c6e0c21dab132f4b456191590264c493d018", + "private": "c0c01d28c1cab01f59700aca5f18d2697658b37fdd54a339ff391c0a1a1b1645", + "shared": "1fe314744390d525278b1f5fbf108101b8ded587081375ed4ac4ac690d92414f", + "result": "acceptable" + }, + { + "tcId": 183, + "comment": "special case for AA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "dce1ec0843fa8f05d9c7355df598391f3de254ecd0b4ba9e6ea6fd9b3b6c2f67", + "private": "c82bde72df36479688c485a8bf442f4a34412e429c02db97704f03daf4dfd542", + "shared": "ad454395ee392be677be7b9cb914038d57d2d87ec56cc98678dd84f19920912b", + "result": "acceptable" + }, + { + "tcId": 184, + "comment": "special case for AA in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "21c2b56f0794cfee25cc9626677a6838000eb66d8c4b5fb07b2f1d912e97c372", + "private": "503f697617fb02a7b8ef00ba34e7fc8ce93f9ec3e1cbfe4bf2c05bcee0cb9757", + "shared": "c6d6499255133398f9dd7f32525db977a538118800bfaf3aad8bcd26f02c3863", + "result": "valid" + }, + { + "tcId": 185, + "comment": "special case for BB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cc3d4a90f86b3011da3369d9988597c7fff1499273b4a04f84d0e26ed1683c0d", + "private": "58cd4ca1e4331188de2b2889419ce20ec5ef88a0e93af092099065551b904e41", + "shared": "0d74214da1344b111d59dfad3713eb56effe7c560c59cbbb99ec313962dbba58", + "result": "valid" + }, + { + "tcId": 186, + "comment": "special case for BB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "111e13f7bc0570fa2638caa20a67c6e0c21dab132f4b456191590264c493d018", + "private": "004ea3448b84ca509efec5fcc24c63ee984def63b29deb9037894709709c0957", + "shared": "7b9dbf8d6c6d65898b518167bf4011d54ddc265d953c0743d7868e22d9909e67", + "result": "acceptable" + }, + { + "tcId": 187, + "comment": "special case for BB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "dde1ec0843fa8f05d9c7355df598391f3de254ecd0b4ba9e6ea6fd9b3b6c2f67", + "private": "c8a6eb00a4d74bbdff239522c3c891ed7ce1904be2a329cd0ae0061a253c9542", + "shared": "fb0e0209c5b9d51b401183d7e56a59081d37a62ab1e05753a0667eebd377fd39", + "result": "valid" + }, + { + "tcId": 188, + "comment": "special case for BB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "22c2b56f0794cfee25cc9626677a6838000eb66d8c4b5fb07b2f1d912e97c372", + "private": "50322ff0d0dcdd6b14f307c04dfecefe5b7cdeaf92bffb919e9d62ed27079040", + "shared": "dbe7a1fe3b337c9720123e6fcc02cf96953a17dc9b395a2206cb1bf91d41756e", + "result": "valid" + }, + { + "tcId": 189, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "e58baccede32bcf33b3b6e3d69c02af8284a9631de74b6af3f046a9369df040f", + "private": "e0328c7d188d98faf2ac72d728b7d14f2bbbd7a94d0fbd8e8f79abe0b1fe1055", + "shared": "97bd42093e0d48f973f059dd7ab9f97d13d5b0d5eedffdf6da3c3c432872c549", + "result": "valid" + }, + { + "tcId": 190, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c6d5c693fc0a4e2df6b290026860566a166b6d7aebe3c98828d492745c8df936", + "private": "5017679a17bd23adf95ad47e310fc6526f4ba9ca3b0839b53bd0d92839eb5b4f", + "shared": "99bcbc7b9aa5e25580f92bf589e95dae874b83e420225d8a93e18e96dac00b63", + "result": "valid" + }, + { + "tcId": 191, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d15f4bf2ef5c7bda4ee95196f3c0df710df5d3d206360fc3174ea75c3aa3a743", + "private": "2864aaf61c146df06cc256b065f66b34985cc015da5b1d647a6ed4e2c76bfc43", + "shared": "afa2adb52a670aa9c3ec3020d5fda285474ede5c4f4c30e9238b884a77969443", + "result": "valid" + }, + { + "tcId": 192, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "6dffb0a25888bf23cf1ac701bfbdede8a18e323b9d4d3d31e516a05fce7ce872", + "private": "184a6cfbabcbd1507a2ea41f52796583dbdb851b88a85781ee8e3c28782c3349", + "shared": "e6a2fc8ed93ce3530178fef94bb0056f43118e5be3a6eabee7d2ed384a73800c", + "result": "acceptable" + }, + { + "tcId": 193, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "21f86d123c923a92aaf2563df94b5b5c93874f5b7ab9954aaa53e3d72f0ff67e", + "private": "c85f954b85bc102aca799671793452176538d077862ee45e0b253619767dff42", + "shared": "7fc28781631410c5a6f25c9cfd91ec0a848adb7a9eb40bc5b495d0f4753f2260", + "result": "acceptable" + }, + { + "tcId": 194, + "comment": "special case for D in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "587c347c8cb249564ab77383de358cc2a19fe7370a8476d43091123598941c7f", + "private": "50e3e5a9a19be2ee3548b0964672fb5e3134cb0d2f7adf000e4556d0ffa37643", + "shared": "314d8a2b5c76cc7ee1217df2283b7e6724436e273aeb80628dce0600ab478a63", + "result": "valid" + }, + { + "tcId": 195, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f5c6311a1dd1b9e0f8cfd034ac6d01bf28d9d0f962a1934ae2cb97cb173dd810", + "private": "08ece580bb6ddf96559b81d7a97dd4531def6cc78d448a70cebabdd26caab146", + "shared": "2bfd8e5308c34498eb2b4daf9ed51cf623da3beaeb0efd3d687f2b8becbf3101", + "result": "valid" + }, + { + "tcId": 196, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9316c06d27b24abc673ffb5105c5b9a89bdfaa79e81cdbb89556074377c70320", + "private": "a886033e9dc2b6a913fffbc2bd402e8c11ec34d49c0dc0fa1429329b694a285f", + "shared": "d53c3d6f538c126b9336785d1d4e6935dc8b21f3d7e9c25bc240a03e39023363", + "result": "acceptable" + }, + { + "tcId": 197, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8a4179807b07649e04f711bf9473a79993f84293e4a8b9afee44a22ef1000b21", + "private": "98b1cc2020a8ec575d5c46c76024cf7c7ad7628eb909730bc4f460aaf0e6da4b", + "shared": "4531881ad9cf011693ddf02842fbdab86d71e27680e9b4b3f93b4cf15e737e50", + "result": "acceptable" + }, + { + "tcId": 198, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a773277ae1029f854749137b0f3a02b5b3560b9c4ca4dbdeb3125ec896b81841", + "private": "c8e193de162aa349a3432c7a0c0521d92cbc5e3bf82615e42955dd67ec12345f", + "shared": "7ba4d3de697aa11addf3911e93c94b7e943beff3e3b1b56b7de4461f9e48be6b", + "result": "acceptable" + }, + { + "tcId": 199, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1eceb2b3763231bc3c99dc62266a09ab5d3661c756524cddc5aabcedee92da61", + "private": "88e01237b336014075676082afbde51d595d47e1fa5214b51a351abbf6491442", + "shared": "bcf0884052f912a63bbab8c5c674b91c4989ae051fa07fcf30cb5317fb1f2e72", + "result": "acceptable" + }, + { + "tcId": 200, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9a2acbb3b5a386a6102e3728be3a97de03981d5c71fd2d954604bee3d3d0ce62", + "private": "e82313e451a198dce4ae95c6832a8281d847fc87b28db00fe43757c16cc49c4a", + "shared": "e5772a92b103ee696a999705cf07110c460f0545682db3fac5d875d69648bc68", + "result": "acceptable" + }, + { + "tcId": 201, + "comment": "special case for DA + CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "27430e1c2d3089708bca56d7a5ad03792828d47685b6131e023dd0808716b863", + "private": "2828594d16768e586df39601ecc86d3fad6389d872b53fca3edcaf6fb958f653", + "shared": "378c29e3be97a21b9f81afca0d0f5c242fd4f896114f77a77155d06ce5fbfa5e", + "result": "acceptable" + }, + { + "tcId": 202, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4ef367901aac8ba90a50e0cf86ca4e4a3ff164fb121605be346e2e48d04ac912", + "private": "a84f488e193139f986b0e5b249635b137d385e420342aef1f194fcde1fe5e850", + "shared": "7eb48a60b14fb9ea5728f6410aef627d1522fad481b934af64e2c483b64d585f", + "result": "valid" + }, + { + "tcId": 203, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d1de303c4ddd05d57c29df92ad172dd8c8f424e63ec93445beaea44f9d124b17", + "private": "30fd2a781e095c34a483907b3dd2d8bd2736e279617bfa6b8b4e0e1cf90fbd46", + "shared": "b71bdbed78023a06deed1c182e14c98f7cf46bc627a4a2c102ad23c41cf32454", + "result": "valid" + }, + { + "tcId": 204, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "5bccd739fd7517d9344bf6b2b0f19a1e0c38d9349a25ad1f94af4a2cdcf5e837", + "private": "28312e17b47dd32d90561168245187963c7469a31c881e4a5c94384262b71959", + "shared": "5bb56877caf2cdac98611b60367fbb74265984614e5e73996e8ea1bd6f749f1a", + "result": "valid" + }, + { + "tcId": 205, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8a7a939310df7ea768454df51bcd0dfbd7be4fcbb2ffc98429d913ec6911f337", + "private": "a87640cf8237b473c638b3e9df08644e8607e563b5964363ccc42133b2996742", + "shared": "b568ed46d04f6291f8c176dca8aff6d221de4c9cce4b404d5401fbe70a324501", + "result": "acceptable" + }, + { + "tcId": 206, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "fe3590fc382da7a82e28d07fafe40d4afc91183a4536e3e6b550fee84a4b7b4b", + "private": "780c5b882720d85e5ddfaf1033e9a1385df9e21689eeda4dcc7444ad28330a50", + "shared": "11fb44e810bce8536a957eaa56e02d04dd866700298f13b04ebeb48e20d93647", + "result": "acceptable" + }, + { + "tcId": 207, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "fad9ab3e803b49fc81b27ee69db6fc9fdb82e35453b59ef8fab2a3beb5e1134c", + "private": "209e5e0ae1994bd859ce8992b62ec3a66df2eb50232bcc3a3d27b6614f6b014d", + "shared": "85d9db8f182bc68db67de3471f786b45b1619aec0f32b108ace30ee7b2624305", + "result": "acceptable" + }, + { + "tcId": 208, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "98bed955f1516c7a442751ac590046d7d52ca64f76df82be09d32e5d33b49073", + "private": "806d1dee5ff6aea84a848916991a89ef3625583e1bd4ae0b3dd25c2524a4ff46", + "shared": "61d4ef71cbe7be3128be829ab26ed3463eb4ab25937c309788e876b23412aa7c", + "result": "valid" + }, + { + "tcId": 209, + "comment": "special case for z_2 in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "e59be4917b3f05b6fc8748c9b90f1b910273c9c6e17ff96ef415ff3d927d987e", + "private": "00f98b02ae0df5274cc899f526eb1b877289e0963440a57dd97e414cdd2f7c51", + "shared": "5ba4394ed1a664811b01557944becf7585652a8acbdbf806742911207bd79346", + "result": "valid" + }, + { + "tcId": 210, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8c9885a26cb334054700a270f7a5f4aac06bad8263b651ebf0712eca1ebb6416", + "private": "d86c18f2be396b3bb72f22e6ece22e273af6e1506a1c09ad4d01bdd2f439f843", + "shared": "a5952588613eb7a5cd49dd526f1f20a4f0ffe9423e82cea302c2dd90ce559955", + "result": "acceptable" + }, + { + "tcId": 211, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f6135fe9741c2c9de7dcf7627ef08832f351cb325dbb3a26f93a2b48620e1727", + "private": "f81aadb9053eb698996d0f781d9cda67f82ddefa3987d276ff5a94ffdf5d255f", + "shared": "cb6fb623084b6197443ec9ba1050c0923332e5e829ae0194269cfaf920a43601", + "result": "acceptable" + }, + { + "tcId": 212, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f6ffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffff3f", + "private": "305b4db4321b4923fc559bf91df677d0e12c3a31b16ec655cb708b759d7c114d", + "shared": "9e526079c2fcf12426ae6c2a54b5ffb70f2ec662e29ea5ce0c8385c3b21cd162", + "result": "valid" + }, + { + "tcId": 213, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f6ffffffffffffffffffffffffffff3f00000000000000000000000000000040", + "private": "900638d1979802db9b52e4dd84fa19579f61cd7bef3c0b62fcccaeaa15fa484d", + "shared": "6329c7dc2318ec36153ef4f6f91bc6e7d1e008f5293065d9586ab88abb58f241", + "result": "valid" + }, + { + "tcId": 214, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f6eba0168be3d3621823089d810f77cd0cae34cda244c5d906c5d4b79df1e858", + "private": "38575cf7c8691ecc79cd5f8d7d4703aa48592ff6e7f64731c2d98a19aeae514f", + "shared": "603f4fc410081f880944e0e13d56fc542a430eec813fad302b7c5ac380576f1c", + "result": "valid" + }, + { + "tcId": 215, + "comment": "special case for A in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "60677a5d934ccbfab8ff5d8f085a0b553f94527d9c49ae140f8ed135e1449b69", + "private": "e88bd02c7016547a24f428bc2a9dcccad6c6f880c17bffcf66fc68459627af4e", + "shared": "834bbad5470e1498c4b0148782dfe630e8bfadff1997de802ac8ce302a1bda28", + "result": "acceptable" + }, + { + "tcId": 216, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8d9885a26cb334054700a270f7a5f4aac06bad8263b651ebf0712eca1ebb6416", + "private": "9036ed7d68f7448ac440dc51216b49840dcabd3d5e32e3b4ffc32a5fe9e96742", + "shared": "ec9070ad3491a5ff50d7d0db6c9c844783dde1c6fbd4fe163e9ade1ce9cd041d", + "result": "acceptable" + }, + { + "tcId": 217, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f7135fe9741c2c9de7dcf7627ef08832f351cb325dbb3a26f93a2b48620e1727", + "private": "90c55e77aa0fe4afb1287109fd010f526364dea18d88e2fd870ac01b66e3fa4e", + "shared": "dc6d05b92edcdb5dc334b1fc3dff58fe5b24a5c5f0b2d4311555d0fc945d7759", + "result": "acceptable" + }, + { + "tcId": 218, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f7ffffffffffffffffffffffffffffbfffffffffffffffffffffffffffffff3f", + "private": "a021ba2fd4e3ad57bcbf204d6f6c3e8018d8978552633b6dff1b7447bf529459", + "shared": "1b174b189981d81bc6887932083e8488df8bbbed57f9214c9cfa59d59b572359", + "result": "valid" + }, + { + "tcId": 219, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f7ffffffffffffffffffffffffffff3f00000000000000000000000000000040", + "private": "3035083e984837587f6b7346af871bf3fc9581c50eb55c83aefabeed68cee349", + "shared": "15a052148abaad1b0f2e7481a34edb61403589439b5bd5e5646cecebe2a1be2b", + "result": "valid" + }, + { + "tcId": 220, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f7eba0168be3d3621823089d810f77cd0cae34cda244c5d906c5d4b79df1e858", + "private": "30435ce187f2723f9a3bdea0eef892207e152e4cee8985fa72d2db4147bd2a53", + "shared": "1d048cbe2f8df07c233a8f93706f307d17130c2497fb752eeaa31fe3edfc725a", + "result": "valid" + }, + { + "tcId": 221, + "comment": "special case for B in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "61677a5d934ccbfab8ff5d8f085a0b553f94527d9c49ae140f8ed135e1449b69", + "private": "580f0a9bba7281a30fb033490e0f429f22e3f267852caeacefa3e5291f0e614e", + "shared": "cb92a98b6aa99ac9e3c5750cea6f0846b0181faa5992845b798923d419e82756", + "result": "acceptable" + }, + { + "tcId": 222, + "comment": "special case for C in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c8239b710136fe431fb4d98436157e47c9e78a10f09ff92e98baff159926061c", + "private": "709098feb2e25c67b4bfd3be0a01af409adb6da52b3fbe3d970642dd2c983856", + "shared": "f1bd12d9d32c6f4c5b2dcb3a5c52d9fd454d52ca704c2c137956ec8ad9aef107", + "result": "acceptable" + }, + { + "tcId": 223, + "comment": "special case for C in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "b7a2f79e0de9b58147691b5546d9ec463da8325e1440e58bb20aa129d1b97327", + "private": "185ac62e729f88528950926c0de7c481c924bf9cf26a122f443b861e8b6af640", + "shared": "e6f1c494c9e4bd2325c17183e82d31ab0bbee6c847d4b0e4a99c7c6891117c3f", + "result": "valid" + }, + { + "tcId": 224, + "comment": "special case for C in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2dc624e1663f42a7b9336350f277541b50b8ddc7ee0d86133ad53273aed4e62e", + "private": "f03743eead7c2f7719794324f271072817d1a04cbda42b232f3bee43f397cc40", + "shared": "aa2a12edf752d279bdb000fb1405a5df8c5f1d41309b4f2bd41aed7ac1ed0149", + "result": "valid" + }, + { + "tcId": 225, + "comment": "special case for C in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0e5eceee9104a64f82c9093b9bf7b4076ee5bc70815af7ee9f942ef015756176", + "private": "a8fbb4f90da45794981405d59ef310621e3c3b6b7760b5e30308c7822c88ae5f", + "shared": "74d5606ba0b6ad1d8ba36ae6f264d6315f479b3984de573e9b001e0555247c32", + "result": "valid" + }, + { + "tcId": 226, + "comment": "special case for CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "737d45477e2beb77a6c38b98e2a19b05c395df7da998cb91f6dfab5819614f27", + "private": "c887886fd07107c7221f6d9dd36c305ec779ceca132ac933ff77dab2beac6345", + "shared": "8cf4538ae5f445cc6d273df4ad300a45d7bb2f6e373a562440f1b37773904e32", + "result": "acceptable" + }, + { + "tcId": 227, + "comment": "special case for CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "873f8b260ea9d9ddac08b7b030727bf0072315ab54075ecc393a37a975882b7e", + "private": "58096ee29361978f630ad1fb00c1267c5a901f99c502f9569b933ad0dcce0f50", + "shared": "d5766753211d9968de4ac2559998f22ef44e8aa879f3328cbc46aa858dcb433c", + "result": "valid" + }, + { + "tcId": 228, + "comment": "special case for CB in multiplication by 2", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "75e1587c5eefc83715d71020aa6be5347bb9ec9d91ce5b28a9bbb74c92ef407e", + "private": "0829a49046dce2c07ab28440dbad146453e128960e85dd2e6a69a1512873dd44", + "shared": "761d8cecf13f93b379a772e5fac5b9ffe996cad9af06152580afe87ff9651c71", + "result": "valid" + }, + { + "tcId": 229, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f85a06065ea2527238fc5ec1b75ead9262e6b1aed61feff83b91230aeb4b7d01", + "private": "587ac36b9a23594632679adea1a826f2f62d79738220fb487464039f36ca2372", + "shared": "f12acd36f6299a4d192c03aa4efeea7df51e2d15d763172e68accf7bc6f5c230", + "result": "acceptable" + }, + { + "tcId": 230, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "6e0f1d00b1099d2a71f7be86655feb8988bba5577b02f964043a49f00c749613", + "private": "a8a442b7c0a99227b4cb5c75fb9e5a72cea25eba8a0bdf07271bb4a93c2b6665", + "shared": "b2bbbd173f41d952d329251da973a9500300628177ad0fb79d01e2e263905b38", + "result": "valid" + }, + { + "tcId": 231, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "696757ced3097fa960c8390a09e8bd6d390dbde8d1fa170261f3422edc192929", + "private": "d8f7233e9612c00c9dca2c751ec1d3f5f67bad77c2e714a20e71eb3f220a6671", + "shared": "45ecfa275f1daa25d3fadf33cdf89a152afea25eae37e68e00b30c367789887a", + "result": "acceptable" + }, + { + "tcId": 232, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "fd84b3f2fbfa16aebf40c27f46e18d77bafa0c7971bedde4909212e771bd3c35", + "private": "d80c7c7557c9907e1b11e844bf1369cba669bc38e9b7b253e51f239bda322374", + "shared": "595e144e07bbe65b38e0e4163d02ad75a65e422e74067db35c90dfa6e055d456", + "result": "acceptable" + }, + { + "tcId": 233, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "805485703ccfc4a221ef281267f52b61cebc879f0f13b1e5f521c17352a0784f", + "private": "8002a85115ad7b41c50f84f35fac750ee8e19734807102830ff6a306beed4464", + "shared": "226e16a279ac81e268437eb3e09e07406324cb72a9d4ee58e4cf009147497201", + "result": "acceptable" + }, + { + "tcId": 234, + "comment": "special case for x_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "80642a3279da6bf5fc13db14a569c7089db014225cfcae7dff5a0d25ecc9235b", + "private": "782db0c8e3e68f106fe0c56415e0bd13d812dea0e94cbd18bdf6761295613a6d", + "shared": "790d09b1726d210957ce8f65869ca1ec8fa0b2b06b6bcf9483b3eb55e49e9272", + "result": "acceptable" + }, + { + "tcId": 235, + "comment": "special case for z_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "84e827f78cae0cf063e4340198f788c284e07430b3a94a3873df38b1f872ce02", + "private": "909fb0bdbf53a69a2fe39c8b2497abd4fa57d2d54e046b5f514595e2c0f33d63", + "shared": "684cc83af806bcd9cd251e1858f3c10f0166e0a0cd2be154339a886b13e7c76f", + "result": "valid" + }, + { + "tcId": 236, + "comment": "special case for z_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d445e1df0083bb6b8e886e6632251807171d4e88c41816fc684373c09d7e5d6e", + "private": "78a67909757248665f79371eb014825ab6bd4af3571f140389c636e004bcf46b", + "shared": "e426e4a3c54d3e77f4f157301e0ac7d9e12337a2b58df16780041cf6d6198c5a", + "result": "valid" + }, + { + "tcId": 237, + "comment": "special case for z_2 in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f26aa6151a4b22390176f6233e742f40f2ecd5137166fb2e1ec9b2f2454ac277", + "private": "286a302d5b076d2aba7c2a4daf9e7cc9d8539b7c0391307db65a2f4220d30f70", + "shared": "862df92e25277bd94f9af2e1dda51f905a6e2a3f6068a92fabfc6c53da21ec11", + "result": "acceptable" + }, + { + "tcId": 238, + "comment": "special case for DA - CB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2b02db3c82477fe21aa7a94d85df379f571c8449b43cbd0605d0acc53c472f05", + "private": "a838b70d17161cb38222f7bc69a3c8576032d580275b3b7d63fba08908cb4879", + "shared": "3f438dbf03947995c99fd4cb366ca7e00e8cfbce64c3039c26d9fad00fa49c70", + "result": "valid" + }, + { + "tcId": 239, + "comment": "special case for DA - CB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d71dd7db122330c9bbaab5da6cf1f6e1c25345ee6a66b17512b1804ace287359", + "private": "b0733b4203267ab3c94c506acadb949a76cc600486fcd601478fcdef79c29d6c", + "shared": "95f3f1849b0a070184e6077c92ae36ba3324bf1441168b89bb4b9167edd67308", + "result": "acceptable" + }, + { + "tcId": 240, + "comment": "special case for BB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "737bc07de0729bbcfbee3a08e696f97f3770577e4b01ec108f59caf46406d205", + "private": "d844a36b58aefdb08b981796029a2766101884b348f70eed947c2541064caf6a", + "shared": "6a969af6d236aba08fa83160f699e9ed76fb6355f0662f03dbc5915a3c23063e", + "result": "acceptable" + }, + { + "tcId": 241, + "comment": "special case for BB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "9758061a7b3e2c02fb5c20875ae6b55b11fb6795990a0f4fdcd1147be5521607", + "private": "a0b7d312d9b832e124d1bc8cb21db545440e3cf14e7473ee9ccbe9b682f2156c", + "shared": "ab39db4aa29ac4017c7446f1ad0c7daa9a37f1b6b4f2e9d2902ccefb84839d28", + "result": "valid" + }, + { + "tcId": 242, + "comment": "special case for BB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "37cd65d33036205f3449e8655a50d4b0c86fec02100b4f2db7da92dcf5e3aa0a", + "private": "787f1ddd78cc6473d3e63949409ad3f35bfe0ce0738f255dee682f2bfbc80f7f", + "shared": "13de41659e3e308d6e26c94282fcc3e0364ddf0809ddee6c8e7abb5091b02b00", + "result": "acceptable" + }, + { + "tcId": 243, + "comment": "special case for BB in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a9b6e8081460383adc587c8f91a02c59a7a35576ca62436ccd1b5fef1b92545d", + "private": "4080ae60a85c1fa95aad9beabd98b405e7f28141bf08f2c9a4fdbde1c5680265", + "shared": "69ed8a0a27812ae6741474bd5c6a4e683a126649f7245aa0f91a3a384bcde25a", + "result": "acceptable" + }, + { + "tcId": 244, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "fd1a2cd17a93f850deb8c45a2d34539232dfd8a558304209781c6cb58229870e", + "private": "08f9f4a4fac4db413315f74a59818b2452fc7b7685592e26556775f9b86d907f", + "shared": "010218bd67b1b92fee3e7fa4578c13617d73195de10279747e53ba01a254525a", + "result": "valid" + }, + { + "tcId": 245, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "b88119e5ae6d9e6b912d52524739e612ef19ab7e5dd3d946cb9bc003c378f81f", + "private": "1888cfae3085867657b09435c42b74cc762457839451a3659db218d4214fdd63", + "shared": "e6b298de9cb6358fbbb00f11890f5714a3858e8f05a2a8d1cf39fe78cc55dd4e", + "result": "valid" + }, + { + "tcId": 246, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7b70e29dce0479cde4a36c7f9786582f104bc0788f046b48af495e67bdb88f36", + "private": "789ce13ed007818d7a5181e629eed944a20a058cfe39669c9831bfa5215a1269", + "shared": "967bbe298494b4a5f95853cfde9dc85970b2a4b5dd2c92782901e853957f5809", + "result": "valid" + }, + { + "tcId": 247, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "2a209e2ace0e3d6973ffbf7403f9857ff97a5fdcd27f2c7098b444fc3c166738", + "private": "00022b43775ab2f4b91bc1cb54c97f78026289eaaf02abeed04ca84f736c686c", + "shared": "9f66848681d534e52b659946ea2c92d2fabed43fe6e69032c11153db43dca75b", + "result": "acceptable" + }, + { + "tcId": 248, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f50709aca7f314e8d05b5ff97a427e427bd5e85c4e86712125076a771be21448", + "private": "8097a52fc562e8a516682f5363cc5e7c88e9c78e308df0deef40497b35cc127d", + "shared": "ea7572e27a9120de1f13b85710ba69a3471b7b3f5d12bc430c12c4bbf8aa3957", + "result": "valid" + }, + { + "tcId": 249, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0f13955978b93d7b9f9a2e70d96df922850a8ffd8412e236fb074aef99d37d54", + "private": "4028802030d8a8221a7160eebbf1846116c1c253abc467d6e43cb850f1459860", + "shared": "e23d63a46be67c7443c07b9371ff6a06afcd7a5794bf2537926074b88190307a", + "result": "valid" + }, + { + "tcId": 250, + "comment": "special case for E in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "18ffe992a729ce70c3b7cdc55bab55f2210d279134b3082a9f682d3a0b131273", + "private": "d8515d45c7ab2b9529816543150068b8e4bb614cf2b68a8a99363975af503d74", + "shared": "33ccaf24e1e26290ed7e462093e9f77607ef52a0626b2cd2511c41cd24c13849", + "result": "valid" + }, + { + "tcId": 251, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c3ba28057728d0533965ec34979fe7bd93cf6cb644e8da038baa87997b8dc20e", + "private": "d8815bd144518fa526befdd373f5f9cff254d5d3c4660e8a90ef2a22c6876a74", + "shared": "74f95b4700f0185f33c5b5528ed5012a3363f8bbd6f6a840aa1f0f3bdb7c9650", + "result": "acceptable" + }, + { + "tcId": 252, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4eb095a86d1e781bb182233075ebf1db109d57135bf91d54fdb18eb371427640", + "private": "a82d996093eefdaf283f4049bba4f5af6ecc2e64894f325ee1f9ca1e156d0567", + "shared": "e9677b854851c41cc489e03981ae78690be6cbf0054ea9834759de3e27bcf03e", + "result": "valid" + }, + { + "tcId": 253, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "83f67d7c92b11c8fb072484642a01f43deb022b54d94a4015e39849a2e2e9555", + "private": "c02609df3d5436c123dcd7ee11f23f1da321666c09f379d37914203340510861", + "shared": "f148716ebe7269a7076f0cf1f22b6978d3c7e3607b0bcc87a8c7a85b9fd20c2f", + "result": "acceptable" + }, + { + "tcId": 254, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "20cc75d376d8453b9d049c84f58eafcf61126c08a03661e735f0a8be228fd466", + "private": "a0e3b78c0f3be2a760b2c916f244df219624fdda2e9e31b15328f4a77690296a", + "shared": "1d5c123e88e9dc7a3b16ec90b60578dfca7e11eab9b88c6eca7bc33d91fde83b", + "result": "valid" + }, + { + "tcId": 255, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ef31b43d19c0a5434deb56129c16298a394a7032a2e52cb997476bdeca325b73", + "private": "701f130a290584cb28c7d6539506a1a054f926a17ef7c568ae43047c05e10f60", + "shared": "2fc065ba8f5040a0a659f6f7330554bd1b9d7c893b91e316e0af90c37af4f135", + "result": "valid" + }, + { + "tcId": 256, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d8c8e2c6f33a98525df3767d1d04430dab0bda41f1f904c95bc61cc122caca74", + "private": "d0e67f68183a4c1aed9c56864b36278bb7bb75d57a78321bc7c24ff61636607a", + "shared": "ef7612c156078dae3a81e50ef33951cab661fb07731d8f419bc0105c4d6d6050", + "result": "acceptable" + }, + { + "tcId": 257, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1833619516b80db0c05b225509e6698df028d83b66ed6bac6f0f6308970d2c7d", + "private": "88eb7775dacc32b045ceb35f261b3616315efa98b780e08c79d544edadb5467d", + "shared": "a3cf3d81ec56896a68fca0da6335171d0c622568738c0db26fe117033726a049", + "result": "acceptable" + }, + { + "tcId": 258, + "comment": "special case for AA in multiplication by 3", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "e2e989aad2397fc34b6cbe2db27d5ab69b28048383c91d9e8226d548253fab7e", + "private": "7055b1c0576e7ab6c89fcc1ce49e79c8c371bf9fc2b22b8f8396a9b64c5ae26d", + "shared": "e7f45823a45b6a46192b37d73e8609b5bda68cd7cfbdccaa49082080993e640f", + "result": "valid" + }, + { + "tcId": 259, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b9bd793624d6a7e808486110058853edb25e136bd4d6a795d6d2ef53b25e3804", + "private": "906a9bfcfd71014d18967680d4509eaa41c666424af98bf9ff7ff49eb1baba41", + "shared": "7c6148134c9e8b2ba5daeca41e6a1f3a82d8f75d0b292b23c40fe7f5ce0a2b7a", + "result": "acceptable" + }, + { + "tcId": 260, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e3f444e208da9043f3f74c20e28d7f404bb687a346709abcd555156f88607820", + "private": "28392b1b035a8465aa22aabb571061c6effeed40cc2530b628e4fd40395ae04a", + "shared": "ea5e772bac4693ce69ea3ac761011fa7674037653a433c7f05456e7291cd3c4e", + "result": "acceptable" + }, + { + "tcId": 261, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "87b43f90f76d12fb3a469fa8687c27e369d4a82f95cf95e8dc3970de8f86d92b", + "private": "78cbb35204cc88676c14e0ff18171392e998411b23d905d4c4dceab70511f442", + "shared": "81c395aed5cc5f5e2a206a8a4cacecd501df5b81e49433835ad8a3779edffb30", + "result": "acceptable" + }, + { + "tcId": 262, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "86441ea06c5cd2a34c6b51261e93a2f30ea7db0f74e14c42f0fc443c6735973c", + "private": "a8225b49ef7b7330e3de787cbc40479644db7ab126370295c94189673430d745", + "shared": "513eba5870dc5187e2552fe3ba8292b516d2af9ecb9a9bdc51eac2ce2de40112", + "result": "acceptable" + }, + { + "tcId": 263, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4624aa4ae9d12725bf92b85f93e3e8cea16b7bd83fda0eb18fab2dbe0e8bf742", + "private": "0841e1a5c7420b94b6cc6991316ebdd608626339c09d0f67b24088588b9d0d49", + "shared": "983b7e236ffaddb4b759b7353fe87846f59fb6f28a3ed65c256176b6609b7c6e", + "result": "acceptable" + }, + { + "tcId": 264, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a625a5b7a04cea462d123b485c39ea44a8079aa223c59e9ca97abcd30b500e4b", + "private": "08ecf76e31a23039ea8a15ee474b6251a9d725bff1a5751eb5ecde9d7d4e2f49", + "shared": "c941369b085c7465d50d23ceaf6717ab06e24638f217a7b8055ce8ebd3ca1225", + "result": "valid" + }, + { + "tcId": 265, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8a5f2063f259f3317ae3e0b459f82c4677666e49a2eb9bf0369aee663631265b", + "private": "6038fb0a830d1001ca8ea74a613ea98f6ab8512644e55e8d45a29071bd4bef45", + "shared": "a3f7e169db44d0d179c242e66347364ab92744dc6ad80e4775aef7f4ff9d5f34", + "result": "acceptable" + }, + { + "tcId": 266, + "comment": "special case for D in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "54cfb6ad0d03e3115acafee12606397f2bb46a8c5f326a255c494118aead3b62", + "private": "c04cf129f0b33332e2654f8e45225c042d7fa6cbc793c88bd4c731985289b045", + "shared": "401aabfbb73fe6694c446ecfffb43006427a9d4756e049a1ffc79578d62f1660", + "result": "acceptable" + }, + { + "tcId": 267, + "comment": "special case for E in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0ee3bee8cb3a0afcec22fa2233706e8ec29ccf1af212c0a674745ebba34f9d08", + "private": "3806b036c92d7bc0771998d24dbda2945b601d42449bd3ec4bbf3757d01b894d", + "shared": "20322dd024fb5a40f327cf7c00da203734c2a279b9666a9ff7d8527c927b675e", + "result": "valid" + }, + { + "tcId": 268, + "comment": "special case for E in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "797ec7512afbf0ad918d0e4947903be95234f3abf36750a8f854888d117b774e", + "private": "380d9056b5a2f4b3dffb30e6ceb722ac4684245f1befafb5661bc8c7a9ad4c43", + "shared": "46152d59c2d2f3ecf03ce652d2b6978d401d5ede4570a6c911771bdcfb37cd41", + "result": "valid" + }, + { + "tcId": 269, + "comment": "special case for E in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d570c7810f69e502b355253afa7c667bfa5060d90dc86e358ab445f6381e415d", + "private": "384929a42c8d8df146db9508e2f21a4e8cd4d99c1b1338df17a457e88afb0043", + "shared": "37567f7ec0449c7b823cf7b0e219e9dd880e56a1464d0417a9e67eff42332866", + "result": "valid" + }, + { + "tcId": 270, + "comment": "special case for E in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2c611cb94448f1c7822425a4cf5356236b90a555b1ed4747820ba7f739c8f57d", + "private": "48a986825b2680e2f2547ba75a9599b04ed57f8ed18d98e7099c544efbdf284b", + "shared": "fbf6587ec181116cf1ace7dcd548029d69c130e50fcf6ad5dfcd25c23ee9f939", + "result": "valid" + }, + { + "tcId": 271, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e559c417da7fd5851352f508b90031d49b5d2d0aac88a9c8b5fb6e80165ac10b", + "private": "98452ad7df4e26bc4b3d403f9ebf72bb2d7b6b7d5860dbf6fb9a4f78dc02704a", + "shared": "c7c6f6d7ce1e4f54c727e5900686c34e6a6953254bd470bbbf0c7c18bbddad73", + "result": "acceptable" + }, + { + "tcId": 272, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "746d97e7774292a3d703f604e79d8764c99a6a2fe280eaa9811115f5e038f21a", + "private": "a8dbc9be5034ed7fe7f469264f2135e9c67cd30f525570d2d841e4bdeac52349", + "shared": "cf7d2a66ea4dfed94469b2d343533ff302a576f8402ed2187904437038e54665", + "result": "acceptable" + }, + { + "tcId": 273, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1f354aa8ffc4eae2b40dad2ebf830db3feb07e2a1a2da39e55df87c8c613de1d", + "private": "f8d26878dff25ced02d3b27ce74002695bb879b3c4328930934315ecae842b47", + "shared": "b204d3bbcbdc624f9f1a743fa3daa8f4c8785ed088d37d08cd13c601170a461b", + "result": "valid" + }, + { + "tcId": 274, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9c3f0023e1a4832586af2483bbec64ce9f06f3ea806d4019a5e4abb1b5627029", + "private": "d0f5e9c43c95b1ffc36f832b943601d5e17647f7d78e2e7710ace63ff274d447", + "shared": "b9f21465615f39dddcc37520ce9b956f7de9883ac93a870d74e388b8e1775463", + "result": "acceptable" + }, + { + "tcId": 275, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d05656aa014d476022dfc55e8d3b4884ed0bdf85209be8b55351394d52be684b", + "private": "700679e8c24df828f2e5212a3263d5e93ea61679988298bab3b480f46f961a48", + "shared": "20f1fc613874495f20562c10b7a8be47bfc12c168d829d6321aa2de17060e40d", + "result": "valid" + }, + { + "tcId": 276, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c4a19b8686e18c29359aa548427f06a368d55a8737483d4893523adac6795a4c", + "private": "d0d077c9461f747e5660be85cc620428b4cefe805de0fd254adaa465ea5e784f", + "shared": "652b18ffd41cfb7d1f0b6dc79baa3b2a392ef1617f5cf6259b5b4ff065916a16", + "result": "acceptable" + }, + { + "tcId": 277, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4989de79853ff35be8c9f92fc94674feef38a0e65788471c521f8e259adf015d", + "private": "00711ac08ef88c3d43a3cbda67b6fe5f34f54723dbe6d725c8a3569070ab9a4e", + "shared": "679825c259392d86f8edb15328d4faf52300779d979a503a76e27be3d7a85e03", + "result": "valid" + }, + { + "tcId": 278, + "comment": "special case for B in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a981483cb0ea4385ffbb552826c3dd110d4ae89ff52ed0cd6018f99d3387987b", + "private": "989a75b40451139ec36ca6aa043765c61a18be323a5987fcb025c2dad8d4bd40", + "shared": "9cadc14ac153fa383ef66d1833f589100dff90523272e32b06e2c6f1f4424040", + "result": "valid" + }, + { + "tcId": 279, + "comment": "special case for BB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1df3dfdab74ff38177dac294b2da2f49a348bc3b3bc6ce9312bea5ef3ecdd30b", + "private": "90c3cfedd919a2ccd51fb455649e3ad2da1ef0ff619b59a7f9c55a68a8219645", + "shared": "bcc95fb4890ed311f3fb4f44c2b60866cdddec97db820a7f79f475337e16284a", + "result": "acceptable" + }, + { + "tcId": 280, + "comment": "special case for BB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "fc6b718ba8b47d24b1cfd6b5d0dd8b20fd920960fabc302dbe4f93bd2a06e933", + "private": "e8fef5c9b60f84984e8836d535acb372096ba8159824a0b49a17eccda843bd41", + "shared": "06f1b495b04a0010845c9d39b13bf2784ade860d9632c8847618c0b34297c249", + "result": "valid" + }, + { + "tcId": 281, + "comment": "special case for BB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b279b6c065f95c7040f148bcb4a3d310e34bdb005931a879be469573deedd041", + "private": "c0e05bde7727db4e352b5e7f035327b4d86a42d513ca116e22d64a4ede56434a", + "shared": "cce7bb644df94501421db49d15e821c7b0aaabecdf8837ab989b1f23bac08f35", + "result": "acceptable" + }, + { + "tcId": 282, + "comment": "special case for BB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "98e2cd4c10554e41b0a3e41082c8b6b61b55447d26c0aa97f9a06baeeb54b55b", + "private": "d87308bf753573f596ac8330b204014b2152dbdfc9881a0d9975058582bdf646", + "shared": "71fdd3405c30805701ae4dfad98c493aecfcf2e3b563e7068373c1b19137c268", + "result": "valid" + }, + { + "tcId": 283, + "comment": "special case for BB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "872897f1bd1885da08b9d03e46811044fbb04186ba30c806f38b94ebdc27186a", + "private": "d80059a8a387e16f6ded6e7e980e806d1f78b470bb61103d0ca70623ccee8b4f", + "shared": "bf280aeecb74ab34e1310aa6fe8dc972f94dc40c7f88b72137ccfe34ed343c13", + "result": "acceptable" + }, + { + "tcId": 284, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c08f72760d9cb4a542aad6e2af777920c44563bd90356168c3608c6b9af2ef0f", + "private": "b0a4fe63515169bd82639b515ff7e5c4ac85bba0a53bbaca80477eb3b4250d44", + "shared": "72566a91ccd2bcf38cf639e4a5fcb296f0b67de192c6091242a62fae467fb635", + "result": "acceptable" + }, + { + "tcId": 285, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4f03849c24d584534d74302220cfdc90e1bc360bb5e297c0fd0fd5f8d799e416", + "private": "984256b12ef154ff6c2e1d030826164cba3614e3df7688d82b59e16201c9114d", + "shared": "24acb4afa63919621df795206c3929b599ec9d253693895d51a0555072e89a34", + "result": "valid" + }, + { + "tcId": 286, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4959771a931e242d5713d5cb76f33310c6a283df16645604289553809cda6518", + "private": "6847141d5d4377af96a2a647c642ee81600fe48d3467e3a70f3ee312bb621742", + "shared": "5ba2112a41b5bb381f202446fa9f23c54d2de149f9ad233753417263840ea432", + "result": "acceptable" + }, + { + "tcId": 287, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f6fe690cf547049635bb3a7785537b4379c9ee06b46120493b8bdb152e09c81d", + "private": "e85f1164e2ab6faf62667c74b03ce529b49a0e2041b1ac0fa242e522d2b7694c", + "shared": "a87c9fdf40c409b9edab481b2cc69687ee1ab92e340c3db0107d40b5de6e7a20", + "result": "acceptable" + }, + { + "tcId": 288, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b468681a1275850c11d37ec736af939a75a7098514e04cfc1c6ca78239a88426", + "private": "281e1bbfa711de69921a64c5d2183c338db5504606ce2b6b4ce1cdd54b41e14a", + "shared": "3be98798f01e71639f3cb8fd4a17bf273e10c67f8974dd9802eed59d847d4020", + "result": "acceptable" + }, + { + "tcId": 289, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2d71e8457099e3f445f9e2a14f18b0f5914bb35f482f9c069b64bf63710d4228", + "private": "20aacf1902b3cd609d7ee15cc96453cc22e2899d7d17852680f2a728bac6dc4a", + "shared": "338c9917dbf11a0cabe8ad4a65959229bc00f99c211e752b20b8b49b87756d0b", + "result": "valid" + }, + { + "tcId": 290, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "fa8f24e944de5d003746d4630350c0f4f6175a3269c19184824105398fbdd329", + "private": "009e8e9fa993804dce94cecb96b1de2568245a97059e4d7ae116ecdb1badd141", + "shared": "56e2bfc7f6ab7da8fc734afc515e57d0794d002434f9bc8e18bd0b72c0df3c4a", + "result": "acceptable" + }, + { + "tcId": 291, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ae4e37ef53c79e25e8275a60f2fc1dfc277ebc5d3b88428c6432c3f98494212c", + "private": "f01574643f231ffac055bd235ee74dd416b94c8e55a2ab2b4d13a8b788d90148", + "shared": "17fa1276d9fd5025172736449a1c0ae33512e5037014a18db5903e47bb3bc950", + "result": "acceptable" + }, + { + "tcId": 292, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "95e56a830792478f7c42504043a9cab8e2eebff5fd90983709e29e03c0a41b64", + "private": "3800a42659954281ca266d7cf1ea9db6d79891a406a70f9e84c3570a6a12d24e", + "shared": "167a3b2fdce9413c89ee892daf9f839a2eea80ea8044924035db1724a5b0217c", + "result": "valid" + }, + { + "tcId": 293, + "comment": "special case for x_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "5f16aa7ccabf4da6b686bd28c7460e106bb1b97a823792527765c29a9ad8fc71", + "private": "70a826b186962218dbafca113319daefb5ddf3cf14e15fe3faadc4c0a2e46648", + "shared": "30a4ba793f2dffe1700c61428b4d84b5fcd0aa99a23b903f84a48eca5cc9fb0a", + "result": "acceptable" + }, + { + "tcId": 294, + "comment": "special case for DA + CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "47fb78111805a11982a3d6c5d83e8e189e7fcc462c9abf805d3625be7a6eac11", + "private": "a85a5eda0a269500b3ab0b58495fc254c2691028ac533494b5f86d44e9dc654c", + "shared": "2bf9ab750bd58ff6f877b783eda45a71a65cc9b7c037fcfef4cb5f4c8842f529", + "result": "valid" + }, + { + "tcId": 295, + "comment": "special case for DA + CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "03b8ca5efd1777d6d625a945db52b81f11214daf015d09fdc9df7d47b9850e31", + "private": "183f28ec867624ef5eca4827ed0714a5525ef21d5e35038b24d307a3391a2846", + "shared": "35e9289234bd5e531da65d161a065a14f785076088d741c9a2d886efd7d17921", + "result": "valid" + }, + { + "tcId": 296, + "comment": "special case for DA + CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4eca5f8731b0fa0c106acf578b83a350fa8173a290f1eba803956de34eeb7671", + "private": "888c6444ff5eb482b2b10bd4e8a01bdccb65f32934d8026106f16a91349f484c", + "shared": "833afb867054b8b9ac70d6013c163e8b7676fd45ae49a1325f3acb75975d8c13", + "result": "acceptable" + }, + { + "tcId": 297, + "comment": "special case for A in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a5562b4ba86b464dff4c2cfae85b384be211771efe8a9697e51d84de47f1eb14", + "private": "c8a85d140ba150f5c6a8d3cb363bcbcb75365e51c61640e974a0725b5e9d5940", + "shared": "8a914760129575c8ab3270d04b0465fc2f327acaf1676463113803bbb2ec8021", + "result": "valid" + }, + { + "tcId": 298, + "comment": "special case for A in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "88ae1631cd08ab54c24a31e1fec860391fe29bc50db23eb66709362ec4264929", + "private": "90a3aeb1417c3d61c1efef1ac052218fb55d3a59c4fe930b5a33cc5183b48547", + "shared": "c1988b6e1f020151ec913b4fb2695bae2c21cc553d0f91cf0c668623a3e5a43d", + "result": "acceptable" + }, + { + "tcId": 299, + "comment": "special case for A in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cbc4d55d5bfddd0bc5c5edbe3a04836b2c701d25195b26221cbea19311e55a3d", + "private": "b858d7414bd9ab9a3ebea79064ab87bc050e74407f4d4748f62fa4d9d203b640", + "shared": "bb24817bd9fff423dc0972908e2c03fddf4dbe100016b459f28fe9594adb3714", + "result": "valid" + }, + { + "tcId": 300, + "comment": "special case for A in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d66a2f9f7577e2df4a56cb51962b3056ff5cc0494c60f39511782e79923edd41", + "private": "f825edf1f79eddd715a72b3ac267d6b2e97e18bb13bcafdac5940370b85ba64b", + "shared": "b3b4513f8a3102e1ae782fbc69888177f2c24c569303a5d01ab1c3c5e285524a", + "result": "acceptable" + }, + { + "tcId": 301, + "comment": "special case for DA - CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "de0fed2fab6e01492675bc75cbe45d7b45b0306cec8dc67611699811c9aaef16", + "private": "b0a710b470e324bb56a7d8ff8788d05eb327616129b84972482425ea4ad4f34b", + "shared": "471ba91a99634f9acf34fd7fd58f72682be97ee1c821486d62ba4e448cbc0417", + "result": "valid" + }, + { + "tcId": 302, + "comment": "special case for DA - CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "6418d49fe440a755c9ff1a3582d35dc9b44c818498f15782c95284fe868a914c", + "private": "b898f0329794747d33269a3989b67e43a7ab5a55fa1210b0e5dba193f4fa094e", + "shared": "cdb3ca02d5fdb536dbc7395bab12bdcfd55b1ae771a4176dedb55eb4d755c752", + "result": "acceptable" + }, + { + "tcId": 303, + "comment": "special case for DA - CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a89bcfa236bbccf07c434b59f8655fb085b6cbe5ed6376281df813afba22b752", + "private": "a0528ed9a8ec22ebe9cc2e32fafc3f467500a9a22f5377382df6604edcdf4f44", + "shared": "cd3245403fd9edfcf91c9581ebb2eb7c77ad6837fca372479e78de9faf60a34a", + "result": "valid" + }, + { + "tcId": 304, + "comment": "special case for DA - CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cdb1f95f6eacc24b6d029c6ed976666dc51794db8e4aa966ba850fd7f5048965", + "private": "f06888bde75d689d056874f6436000497d22d8ad9b95a1c67de1dda4ada3164d", + "shared": "ab7c47ecb0c0167156f44f66a527264b958fc992c21ce98cef3ae214d66bd82d", + "result": "valid" + }, + { + "tcId": 305, + "comment": "special case for DA - CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "9491a82744f1cb6105b76b0442e54e605ac67f47a1b2b3b552d486f75bd98e6a", + "private": "e034fcaa3ae40603f9b22af159fd67ef009380946de92cb1d83cc489e8b35041", + "shared": "1bfa264a7c7229147a20dd021211891e61f5d8c76cd83f0be24bc70e466a815b", + "result": "valid" + }, + { + "tcId": 306, + "comment": "special case for C in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4d19e156e084fe582a0eb79b2f12b61d0b03f3f229227e798a933eea5a1b6129", + "private": "702a7448c0ed58e1f4e0e332d096a36360beca2f6955c815bc120b3a691d7742", + "shared": "c46057fcf63088b3a80e0be5ce24c8026dfadd341b5d8215b8afcb2a5a02bb2b", + "result": "acceptable" + }, + { + "tcId": 307, + "comment": "special case for C in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "cc4729c4eae292e431ec3a5cf5020e19f9bea50ef3218d9a790034526c3ee14a", + "private": "50025cb508ad4faa06fafd0f4a33b747ccf1b3573885d3426500d51b56300144", + "shared": "d4361e26127adfbe37c2ed8f42cce4ebab8ab74ed9e74f14c3435d612c1a992a", + "result": "acceptable" + }, + { + "tcId": 308, + "comment": "special case for C in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4a474249af8f771f0cfb1116f24fda4c42f4136d2afb766d1b291c73c6668d5a", + "private": "7082fc53299a4d30e5d0c383c035935b1eeebd9408fe4d04b93eec24be52eb47", + "shared": "80dfae7a28bb13d9e51ff199267cec2a19dfc8b6f4974e3446b2f62fe9b62470", + "result": "valid" + }, + { + "tcId": 309, + "comment": "special case for C in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0f2a5cbbe503139531ac0529183da8e624d25286f6e35d1407ab1f4d76ebc260", + "private": "98ff7e711d65cc7fd9d0ac12dfe8b894e0a93602ca9e75bf0eabbf0bfe670148", + "shared": "7a5c373065e339b26ee537cff1cf4597cfcb4bf2dc7c4bcfec9884443281c273", + "result": "valid" + }, + { + "tcId": 310, + "comment": "special case for z_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2fe11d723dba63559e1b96147893cb7ec862711806316daa86cd4da769d4b22d", + "private": "b080f4ac1e758bbfbfa888a78cb8d624d97b8688002b2017e35f52f3d7c79649", + "shared": "c5edcc5d447071c08dfa8281414ae6a02de753e2f7bb80af5f6253e56db43422", + "result": "valid" + }, + { + "tcId": 311, + "comment": "special case for z_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "98e1211dcf6651fa9f2d00eb083ae5855869a2a53e835f2e03b30c0a19ba8051", + "private": "e815bf9a967e1208af8e74ce9af6d113dab17c01c90f1ae2bc25e3e2f9e3a44a", + "shared": "263a38fe538b50e8e988bf07ae86f33d49886b14c7143efd1d2025c840e36a25", + "result": "valid" + }, + { + "tcId": 312, + "comment": "special case for z_2 in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2f1b938b81a4c90e1251135ad7fabe835f6a8bc5e22d4b2ab119f6f677877677", + "private": "4051b01cdf90af38f0a96ffb83f8d4133abe4fb035b6fe6f65276447caa7314f", + "shared": "340acf2801de71c18f4c79cfea372bc354e4c8a5eb5c2cce8b45d885df162f45", + "result": "valid" + }, + { + "tcId": 313, + "comment": "special case for CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "340b9f613550d14e3c6256caf029b31cad3fe6db588294e2d3af37605a68d837", + "private": "98c092363184e58ad6ce510bd32b309c9d5a46f8d9ee6f64a69d8180bbc6cb45", + "shared": "9efe5cd71102d899a333a45ea6d2c089604b926db8c2645ce5ff21492f27a314", + "result": "acceptable" + }, + { + "tcId": 314, + "comment": "special case for CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "edfbd6f09aa32435440b0ca8ba436308319613f8f2d501133c526c3ff55c7b3d", + "private": "686e51c00116d1c191aa9d5823b96e5956102e8fe75f5cf2376d99989f6f4342", + "shared": "196182095bcd2ef46b18f64c63607e0ab162a0869e6265ac8ae35e358c3d8a63", + "result": "acceptable" + }, + { + "tcId": 315, + "comment": "special case for CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9b0538cd618b0a4de09e45420f84d54d74514fbb1a31c1a4aa1e93306f20723f", + "private": "208af2c9442b36b521fc3a1ecefe342aac308bd6e6296ee091c196dc02e7ae40", + "shared": "a3c6b75168211e8e0a49ca815bfe3f469f29864dc8166152b456e7074afa9b5b", + "result": "acceptable" + }, + { + "tcId": 316, + "comment": "special case for CB in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ae8cf2fcdde710c2c1184524bc32430874dfa08c125f61d6919daf8e66db415a", + "private": "c0d861a6d5ff91f91e3bd05934161ff0ab0f3ce7e4a2b5b4fcb31ae34b46664f", + "shared": "deaae6c9952844a3a1d01688e7105b0bbeadc160763c2002b6d0bcf35c22d123", + "result": "valid" + }, + { + "tcId": 317, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "2a59f478402d2829cd3b62e9f7cc01445e8e73a42cb11af00b6b9a9f0e44cb3b", + "private": "70785cad160972b711318659b47b574f6941ef6da1ea06508b2650f57ec9e54a", + "shared": "c204bd15f01a11a2efdabe2e902b7cd0aa079316f60e911b3ee5d46262e98631", + "result": "valid" + }, + { + "tcId": 318, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "836c8e45dd890e658c33e69b6f578a5a774c48b435bc3b91ac693df94a055857", + "private": "60afc8eb1f87df4b55287f3c4698c5f8b997b28a73c573fc273e9c467fb7e44c", + "shared": "c5457487e90932f57b94af2e8750403e09c9ac727e2bd213590462b6937b0753", + "result": "acceptable" + }, + { + "tcId": 319, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "59519ead7995a6df89bb54c840d61a8481881098b8a4f83c6a2f6ba800338257", + "private": "a83c11b2834136b9aaf0152d90e76e3c27177693a2834e8beda0a3571bce6947", + "shared": "4ed6f8d62932541c6bea16e03835f1f758a5c41722b5c9989c9c7cc08e34e37b", + "result": "valid" + }, + { + "tcId": 320, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "32f34da84ab4bfca369c4b884691becf54be7fbed16449dc86969da7ea9abf62", + "private": "b80d8795735806579e71759894939d758853592127efe84fc82eb7cdee45014f", + "shared": "521a5b8149a132d155e6b4ed113900506cfc2f76d2a3e14196d69eb85db3c952", + "result": "acceptable" + }, + { + "tcId": 321, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "82ae48dcf59bc5e469f9a11b18a32d4753ac818692dfae27d675411a2272b363", + "private": "e08ffa45efbe1f96584c76254554adb9177b58ed09609a6ce499e5bd22d35c45", + "shared": "e831d6cee95ca1b4c96bb89457562fff36cb4d08b81da89b810b425ecdbafd78", + "result": "valid" + }, + { + "tcId": 322, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "b33bd3ad14b66896f971cbdf27785fc3aa3cfb39adc6c29257d22ea4df8cbf63", + "private": "688e1bbb5114f34e8531c278b2d9714ba07c32a7aea6e627135bd1fc65238045", + "shared": "350e3ab9d0dbff78f3f2157428beba189333be274827c10d59673f21c0c48a24", + "result": "valid" + }, + { + "tcId": 323, + "comment": "special case for AA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "18e58df6bfbe184b0e3c7c4bf2a051ed055b793501c0d4fc47bc8a95c4deec7c", + "private": "8036a4e2e93e9ed82d99d71a522aac9289bd9905fe41d01d08a499376a258442", + "shared": "ade71d6460287fe808e947560e67a9d6ff2f96eaa1355d2e9fbbe549e883381b", + "result": "acceptable" + }, + { + "tcId": 324, + "comment": "special case for DA in multiplication by 4", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "772e31e776e8d4f23b7af2037af28a37e68f61e740b3904f4ec4c90157be1478", + "private": "901b20f0cda74076c3d4bf4e02653cd406ed480c355159e22ca44b984f10764f", + "shared": "91a9bec28cf18c7094e2d80d2764df59ada0cb1946be422864bd7ad0e533b663", + "result": "valid" + }, + { + "tcId": 325, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a8d55d5c1137e9bb626557f9d6eea8d3120e9364f8bcd9b67934260b1a091801", + "private": "d83eb7affd1bcc1ec0b4823cee5cf0b15b5f57085aa2708ed437a2925329b550", + "shared": "6c1b8e240edfa5db2abb3dc12bcf9e8ac9ca10dd3507083746f6f36dc035d755", + "result": "valid" + }, + { + "tcId": 326, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "33c94be58b0f0e6cf363e1b12a2ebfb93040715be91518f21df2953eeab5fb01", + "private": "989eee317b9c254dc023f9e35eff0224bc2e0bc871996b946a96970e7506a85e", + "shared": "d4c3b3467714f2d105904a84cc7e81d7f291304e908041682d8906a683c12125", + "result": "acceptable" + }, + { + "tcId": 327, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a218ae9624b07ce05178b9d0cc1b71dee21f27852a2ceb18610b4052b244f00f", + "private": "b8355455d358f2dd7c5707b2c6973c9c27b99e7d8ac1650c791e5fdbcbea4957", + "shared": "1ebe6ca711a649ae487b332747e3dc0306340560cab6bc6029e44f6a7e0ee41c", + "result": "acceptable" + }, + { + "tcId": 328, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d7067faeafd3e966e57525f930b3317c9e8b9c9a9ae946e76c1e4602a59a7e33", + "private": "8065567ef082b16c20853487f54893012ba4762224e5c59f250dfbf82581e85a", + "shared": "03e7a777e648bdc612189f3cd42d34e35736d3e52e6edc8ac873a58e244a6073", + "result": "acceptable" + }, + { + "tcId": 329, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8df9682cbe8802478a8531377e752cdde54738d528d639bea9eaf47702f8bf3b", + "private": "00b51448139a61fe6c5fbf9395877d53d820ef59da3be856458b5eb90985ba53", + "shared": "308ef99dae1064a444fa90775b5dd5b1952d7224a0e5ae031df432640f416208", + "result": "acceptable" + }, + { + "tcId": 330, + "comment": "special case for z_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7d92706868aa09538638d633c255f333b9da03bc74b49b35941c57820cd3fd47", + "private": "e8eb9f6f62f93dbc325b833aa763a90f13f0acb2c2c4b8b33decd471ce70c45f", + "shared": "f33e2e86443a2c68823b72a2b59d6a028e0a8e283cfe29fea4f7aa22bd1afe72", + "result": "valid" + }, + { + "tcId": 331, + "comment": "special case for E in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "dfb1ffc176aff84db30182d2378f83728f83dd1b33d79856f3da5459cf9df907", + "private": "68a1a7ccc50bab4b01e55e18cbd464aff43131fb0741e68d53cdebfc54f33051", + "shared": "7b535fc31c6c2a3803d8bd45410a1781bd90a09205da28c9df120df23a9fa32d", + "result": "valid" + }, + { + "tcId": 332, + "comment": "special case for E in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "12e81e838b21eac96dc130432571216d7a9b4a817f1938721d2267dd150ebf20", + "private": "e075bcfc165a471b2f76c3003fb0172c82f707137de2fa7082e43a87a255935c", + "shared": "ca23a781da0911e4115a29a9f56447157c23bee187b0c17369c4f7730d781718", + "result": "valid" + }, + { + "tcId": 333, + "comment": "special case for E in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "832a46aec02240d716fe22dea94ad566a3fafbeedcce35c83e41e58076c99749", + "private": "c0e19634dbf6460e1486930c46e8556b3c16d6de959904600549bb3e08603455", + "shared": "cd0686b32ea4cddb8e13ff20a78d380749a5d4f6a3dc55d72f4813d949a0ea57", + "result": "acceptable" + }, + { + "tcId": 334, + "comment": "special case for E in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8c8033432bcc12d479f67d6d876b1c8e89f16a234b9b093322effa9dee94554d", + "private": "b84caa18acc3db37225d32cab4f60e6fba4acab1277e20425d30f94cab2e2c55", + "shared": "a950aa57bb2beb9ed5d3228c7ef448dab69552f3d3b1e466accf41bfb6d5b874", + "result": "valid" + }, + { + "tcId": 335, + "comment": "special case for E in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "6df799bba6cdf5f46a57ab227f93fba491dad296a2fdb7e491921d610cce8f5e", + "private": "2896818cddf572521943e9f0c5e845f530b740427588a0f6de2504bd5bf40c53", + "shared": "54f5ae57e676d08c8f8a3cf891e36ddaab751093f92f409060c57e745941700e", + "result": "acceptable" + }, + { + "tcId": 336, + "comment": "special case for AA in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0c8090e1cfe7f761cfdf08d944d4aeb7a509a07a6101645b9a4c7c9e9c3d4609", + "private": "a01f0cad98cf2905b812d3530531bb3ac899391abd1eaf4a3ebed96ac6126f58", + "shared": "2d49b09f81f3f6fab2c67e32f1bcead2ad09ac9e0d642b0873becfb64de2ab23", + "result": "valid" + }, + { + "tcId": 337, + "comment": "special case for AA in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "08352936c8afd8543ac95f24bce9a07e3e3235763ea512a584298967b83c070a", + "private": "106b36344cc4a5a389d8168137786806ff03cd4a00f8636bb7e758d456151d59", + "shared": "a199368e683c3036a48f4c5f32b32a547dd39f3d1007ca0a0bebcad0a8ac6f5c", + "result": "valid" + }, + { + "tcId": 338, + "comment": "special case for AA in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "73bdeef8cc044f5ad8d6a241273e1995e0007dc9e6579046df86aa6cd97f5d2a", + "private": "88f9a0d2354adfcbab2d12a0e09b3c7719c944384edfbaa27fe0731cb9c6fc5a", + "shared": "5aa750de4207869ec7fddab34c639559b1eb27ef244aaf2a702c84963b6d6e7c", + "result": "acceptable" + }, + { + "tcId": 339, + "comment": "special case for AA in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7fdd399b6ef4a3f5cade62e74113b29c27db15203f9b8e398d2c6f230051cd2b", + "private": "0811f2e560a205e96e28bc312bcad45fe8befefb7f6da5faa035311eed80b251", + "shared": "a6947ee089ff28ce3644ea4c6eb33dbb20c7974fb8d853f4e146e2466177502d", + "result": "valid" + }, + { + "tcId": 340, + "comment": "special case for DA - CB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f0173a96273c646fb63d13b0c686b89e37676fcc7178faf4a6f4601f3068150d", + "private": "40ad984066a69080fb4a315878e736096cc577dae4c42c40d893d8c2173b785a", + "shared": "230b6aa1f24df90a60839179ba5e9de673cff11cab59e8020b20626c22090b0a", + "result": "valid" + }, + { + "tcId": 341, + "comment": "special case for DA - CB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "255bbe7230cd2bee90d283f418a474ab30146ce5e801a0f5ed60ee8def3e6558", + "private": "48b10cd45639bbbf83a0b28f0dd3ad0b7b00caf48d05534480556a8278116d59", + "shared": "2299e384958bedd2c3d367759155136d1ff76e4434dc1d9e8212cdca52ea8421", + "result": "valid" + }, + { + "tcId": 342, + "comment": "special case for DA - CB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "21accf97b7fee173001ccfcab21637c175ef5186ff0002502b3d52fa8c51e766", + "private": "e8fad77946e0de4cf4236798490b838948b82cfb29f8e7686001b11e8d961657", + "shared": "97fca065acd3b943c654997c0f125767f9abc4b7c9d8b7246942f12be65d9231", + "result": "valid" + }, + { + "tcId": 343, + "comment": "special case for BB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "5b40777e80ff6efe378b5e81959ccdcbb4ca04b9d77edc6b3006deb99926fa22", + "private": "d07babed90b27c4eacafdc871703bd036b720a82b5c094dceb4749eeaeb81052", + "shared": "f482531e523d058d6e3fe3a427fc40dbce6dd6f18defbc097bfd7d0cdd2f710d", + "result": "valid" + }, + { + "tcId": 344, + "comment": "special case for BB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "48d952a2924ff167f037707469ec715da72bb65f49aaf4dce7ec5a17039ddb42", + "private": "68a3049aef8c069b906cf743286d3952a888bf2b9b93bc8775fb5adde06e9f53", + "shared": "de88af905d37417d8331105345dabaab9fd2d3cb1ee902911c1c8eae2991d911", + "result": "acceptable" + }, + { + "tcId": 345, + "comment": "special case for BB in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a5ef265ccbc5c54021d34f82364a4624030f5b9d5ff7e63d7a379e533de5e742", + "private": "18d8c3d2a4e366185a85c38698d937e13bbbafdbdab1a0a83dbbe89badf70756", + "shared": "075d18ccc984761b70752279e7f6a757208f6c11e29480c32b40aba128a4d52b", + "result": "valid" + }, + { + "tcId": 346, + "comment": "special case for x_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9051e55a4050ef4dce0b0c40811f16371e8b16932541da37f069406d848ea424", + "private": "18efcd5fe345be4985316695391d2c952eee13b0e1ee7584721fbe8b19d4fc5f", + "shared": "212dbf9bc89b6873a60dfc8731a10be11ab2dca4b172142e6c9f06614cd72852", + "result": "acceptable" + }, + { + "tcId": 347, + "comment": "special case for x_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "419adb8b1f2f87de016b0c78d1029a210492eb8cadd164b12cd65b1d57bf3634", + "private": "28ec7c693e222c72ac0815f1fd36661357e0a8da7bc996daeeeafcd21c013451", + "shared": "379f9221abebf3582681a0e857f3da578a1b0121982b96f14b94de5dc8b24528", + "result": "valid" + }, + { + "tcId": 348, + "comment": "special case for x_2 in multiplication by 5", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "13e00dae3b1ccc97ccd649088c4a7f32ca9976214d645667bd082039bbd9ab7a", + "private": "78b35e7ae549308b6414bb610196c04f2af79d4266c86e8a9ce0c02bbdb88d59", + "shared": "cff2596b7afe36f4cab9c70133d7aa0f9914f9abc6c3b9895472e2a5894a8037", + "result": "valid" + }, + { + "tcId": 349, + "comment": "special case for C in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "441c487a48f0a4989d931cd77a6142a0a13d1aabad82623ba8d94b5c374f4f08", + "private": "f0de9c5f8a9372f30c41ca47a55743ce697d46e32e7a9ae26d32503fd5222767", + "shared": "d47c46b4329bedcbc1986b3c6d2aa9bcd027d6b68925175d35bbb536b3440801", + "result": "valid" + }, + { + "tcId": 350, + "comment": "special case for C in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0e67ee5c6b65aa802259810b2605f8d7accf9b49bf14cb4a536928e883172915", + "private": "686be5a12b310420f9bfb209381fd459a5ccd55c752b88337ebe89e1921ae765", + "shared": "1d730158da880533dbf1e6c64a8e99f9169611660969b0a84fb42dd8dc2efa3d", + "result": "acceptable" + }, + { + "tcId": 351, + "comment": "special case for C in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "dc9d7ef1cb49c191e258663a94e731b9c066c11a17d8b5fdea1987f5d9a00568", + "private": "a0c0337c5bec5ca24dea2f1d701498ae2bad87b8269ac23be113929fe4eb1963", + "shared": "07732529a628badeb8d74946775ba457c700bf8390f46bc523fb64e471c86a7e", + "result": "valid" + }, + { + "tcId": 352, + "comment": "special case for C in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "556b3ee7cd0d37979056ecc1f56a5677a4935be6e49ce28e394f8bfb73d13b6a", + "private": "b8824cfce5550b5e17b12f74e28459cab34eb49895cc36bf645a0cf00e3d2d67", + "shared": "9e3aae35fa1cc80a359878e212180294ff6608dcb4929e91901abbf976f39c16", + "result": "valid" + }, + { + "tcId": 353, + "comment": "special case for C in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1211be5809605b54f5727d233c783a2a199a3db24ed4499d7b48c7603e4ad371", + "private": "e02dba7335af8fb9168de2fcd310c2e2df4a3e25263e0ab9ada87bfb8258a66b", + "shared": "880f6dc73220307a597670f3282fc366aa66f04a0a9ca30d895fdde337afe825", + "result": "valid" + }, + { + "tcId": 354, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "505e7851e2352e311ca9536a1fe6c0d95d648197374ce08e4b8a0fbddf62910b", + "private": "30ce71f856ceb874fe580039ca67e896e6d08207a73cd55db7059127c1342b67", + "shared": "ea62b0eda2d7b249a42417675a2b82b1e6c0d69a4e7cef336448844d2f432251", + "result": "valid" + }, + { + "tcId": 355, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ddf4e90503dd82610c3a034b925a880b72dbde30c626009202b358c6eb00f418", + "private": "e881f46d4141ea69a671649b93b63e97dc67c12521d445862f087b2626fa2b6f", + "shared": "302c4f83b5c5bf30c1e3afd9f643f65bfe56ca1628ee042b1ab7393bafe36c06", + "result": "valid" + }, + { + "tcId": 356, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0e9c4431999ef1ce177e900d37ec6ae665e387e2d4fa27cba8e7baebc65c6520", + "private": "e879752683cd73a834251c65749135e06eb9064d3ae35095d88cde14a02ba366", + "shared": "8ff2ac65c85ee2fe9452fce460f8c87f9570d769cadddc87fe93ef8b7657c726", + "result": "acceptable" + }, + { + "tcId": 357, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "5761d6c08624104d4117ff17c75e9211a591c9ca9aecca3a665a7ed844195225", + "private": "20576ab456da26c18da5fbf06ec4d16564e111bfae2a92b9f6e1927c15770a62", + "shared": "97c91a23c3e4f3ff727d188a352b67ad490b62381566fb3e111cb67aa9e3435c", + "result": "acceptable" + }, + { + "tcId": 358, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "e92d45b3ec56531266303c5113c46310c41650001065b4d87b02b382fc82662e", + "private": "a8467418b924c2c003c56e1610a35469356360c29d52aa557a2bb30fb8a9a464", + "shared": "24346bb133dd9ae3ff02d2f50510b3a92d9030834d60e5af08b0eebbf1d4dd6f", + "result": "valid" + }, + { + "tcId": 359, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f38b63459d05e422ad024c2dcea5029a0a7a6b6c4c1d2093ce556aab331e2540", + "private": "f0f5e162923d7c299388bed781199417ade097475515162d9590976a196fb16f", + "shared": "b3453c9c82a2d1d956156de2399cb70dd4e1ec53aea967e035753c1cdae13c39", + "result": "valid" + }, + { + "tcId": 360, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a7ded0eea45a400b8f5637154d42974aa98c92962314d822ef88b01383a9da4d", + "private": "608fcf787fe789644a09bcab958f0737aa81a9e29d505f51035c78e374b9e46b", + "shared": "ebeb0c7b7a4165cd02a278f3a222c236eed83266b806d13494c1c3f98a2f3425", + "result": "valid" + }, + { + "tcId": 361, + "comment": "special case for CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7b0ecb4c72ee147789d74813ced3ebe40f45c3da526ed1272952e453e43b796d", + "private": "58a3396d291eb23571b52d98a31549e514e501e8d0958ad9f25fe5a76c503e69", + "shared": "9213a53f22ff0cb5eca87b27b193c773bfdf4c01a193a11f37c157474e15cb07", + "result": "valid" + }, + { + "tcId": 362, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a244413ddc3a205d038d64266833eea1efba51ba62c9c6cdcdbe943be52bb00c", + "private": "d805a7014755dd656f98d2b331f2d2d4912725ef3d03752f26f74dc1ad61666a", + "shared": "66484a4120e0eb0c7e0505e1d2c5d15de9b52b72e094c9bac88634200c557267", + "result": "acceptable" + }, + { + "tcId": 363, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ec3c8b0c10b1fa65dbbd17cf1ba5f86381284765709b07c5f0428e3d5bcd3920", + "private": "40cb1fe06b08f068f7080ba07c695eda91a2bebeadd4db95c97dd7c91af2566d", + "shared": "384f2221618e71d456b1551651efdb708a161d7f89f5604b27eb872d4aa93276", + "result": "valid" + }, + { + "tcId": 364, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "6330d3e28a8b6126ace165a9dfccc6e4bd40dbc9768cfb16330cb7f27f906230", + "private": "8021464c64c9d6d3c0c852f6972d11969b04c9e066562fa7f0d5fa0d98ebad62", + "shared": "8daf5f4b84730144ea8a53ce39cc907e39a89ed09f0202e7be0d3bda38da663b", + "result": "acceptable" + }, + { + "tcId": 365, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8678aa29cbc06e78b218d22a3e66c38ec0da8fdb0f2570c585c62517c9704f37", + "private": "707a2d710b32f55c6eba34898020a2fb981d61b1e822fca84c47d9321e279268", + "shared": "da8b7eba6f72c3f3ef33d8982093492e06be39bb0db29c465d95a8e52ef64341", + "result": "acceptable" + }, + { + "tcId": 366, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "303289c2b1079ea59412faccfeba8c113d2299b9dcfedeabc42697b0829c4658", + "private": "204a43dea79d779577581b8c2a51be66e1effce96425b7422b9ca65bdf1a4867", + "shared": "0419a71a08d3fdd574cbc932e8f1605933ddcdd9774f5614269b7ed850c8650e", + "result": "acceptable" + }, + { + "tcId": 367, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "3e6e16e02d44ebd94680832e065aeddcbb74af64fbb7c6d8367e7605be13ff5b", + "private": "58e4741735d2589322151947a1ce2f5829908626886941cb1631d25a8a684169", + "shared": "9f2fcd0c756288c1716ecd1f2a74864b93a7717bfaf5248858dcb6fdbea12864", + "result": "valid" + }, + { + "tcId": 368, + "comment": "special case for x_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a7c1716a41ed23a8870438714ff9745fb0e46f7a5baeb37c9a2d83fe477d146c", + "private": "d0af3428ea5205f6bf8d4f1b4e4903cd76f04236a1c0b3ecfdcaf28b21348e63", + "shared": "261ab6267c35a9755359e957473870522b7f923fe839f2b155408649cc5e8004", + "result": "valid" + }, + { + "tcId": 369, + "comment": "special case for DA - CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "dad981552c57541c57ef395ed770ce5edc48f8015461b2ba7aa831ec593ceb15", + "private": "c0ea97e442e5dc1c8142bfab7089ecb9bb9c5ae372f9907c2825e678defae567", + "shared": "9093bfa3ed3491d0891f02ae466e5e13c980df229db7404c5b9d34e4ed21c653", + "result": "valid" + }, + { + "tcId": 370, + "comment": "special case for DA - CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c588dfe6e733d90581cbe112079749d8eb30ab8631134ec29abfb98b32e76522", + "private": "b0333f09ac1eaacd3cd617eb8832e9de488b458b735cb4b5345f517130c25d6b", + "shared": "6e88bb6bf75596bbe5f1fbe91e365a527a156f4f1b57c13ac1e3e6db93191239", + "result": "acceptable" + }, + { + "tcId": 371, + "comment": "special case for DA - CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0670116a435e8d9b7a12ffc4322fd6b149d0b1dc799b5c0957d9d6e42546e824", + "private": "10719099dc63bcc282ef525845c108897ac9fae9590b593e0d505d1cf167c061", + "shared": "e6de74d2c5cea54094d7a70af03c768afe05d52a038bb72d56dcacf0ba502d74", + "result": "valid" + }, + { + "tcId": 372, + "comment": "special case for DA - CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8b200dd226c5c0f7e116e5388ba162438caf1dddf4edc3b6ba838c21b5929737", + "private": "10e20e4fda57084ca90f7ad572a78aa8e6575c659cd01f30c43c58040c20e860", + "shared": "78c9c3aff9416a538ce3ea8fa553244528d1fbecbcf91695a33ca464ef76b85a", + "result": "valid" + }, + { + "tcId": 373, + "comment": "special case for DA - CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "419a076b179f79720096eaabaf03477e8f89d61f885c8d7f58f6eaa4fa77df5f", + "private": "a8312df473adfec7171e1635f5bad44f0753a88a6b3174ec5ae762703ae25e60", + "shared": "c1a96ccba08bdd82d0fc12e8cde4cc1f25cfd5276dce7f18e407ed0e4a898466", + "result": "acceptable" + }, + { + "tcId": 374, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "aa34d772e9ace43c4d92f4f85596ab9ccd8c36c4f4cbddc819afe2a33cb8b216", + "private": "109697f400210f9a92de80a8bed264097199bc240e22767b54d8bb22050b7a61", + "shared": "2533b845bb83e3d48cffa8dbd1edd5d601778662d5da03759152a5e0a84b357d", + "result": "valid" + }, + { + "tcId": 375, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1f06cfe464ccc0e27a5ec5f9edd9bc7bc822ad2ff5068ca5c963d20edd1a2d22", + "private": "d036308a53c11bebcb02e83688ad74fec43f8462ef4d806272676637d99b3765", + "shared": "eb40a3974b1b0310b1597d1f1f4101c08dca727455a9d8224cd061a7aa3cb628", + "result": "acceptable" + }, + { + "tcId": 376, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "9d4b2ed7817132af5830e899627ea97dc39bd3772e82f2d05769a918273dc02e", + "private": "786e5a5ff37405c769d0d3788c3c1b05a62a8442c385570e4438bc5f2eaacd67", + "shared": "9509757e289553cfa2cc71313473c3ff1eebce484ee237eae554fda3d3d22f0e", + "result": "valid" + }, + { + "tcId": 377, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4e056b317a31dd96f8ec14b48474af587d195efcc2a70f01f052ef882d7b3a45", + "private": "c01f66cb094289d728421dd46c6f9718412e1c546dad70e586851be4da58bf67", + "shared": "bad9f7b27dac64b0fc980a41f1cefa50c5ca40c714296c0c4042095c2db60e11", + "result": "valid" + }, + { + "tcId": 378, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "72c60535e9c423f302d6a10796d954d778032cd4dbd40ca0f359e204d67b6f4c", + "private": "3877d9ce25cededeb572604f2d123df685690c26e181f777ed33302b82082966", + "shared": "51c359768ab0219003af193e2bdb8e5cc9f8e176b8db49e597afca3e7125e370", + "result": "valid" + }, + { + "tcId": 379, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "5856358ed420047cd084f17ae696bad79a4d26c6d5bb79bfb82bbc6332442d51", + "private": "50b84618d073c4618f9aa69a3b8518da76dbb2127286214fb43a2b44503b9969", + "shared": "fa9fb0df4cfbacd0fbf3262d3a1bf8d7aacb45f73bf94671775e509c8043df7d", + "result": "valid" + }, + { + "tcId": 380, + "comment": "special case for DA + CB in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c31e37b04332abca8315f317171566aef38111f622d8bffa29c23c0151cdad6e", + "private": "109acfa638e112f6bbec21e352a74e8fc9b7ffe5d9dc28634eeb516e59830a63", + "shared": "91ac72b0ed8d7fc4c8846b8a2530d9fb8f0532064880c00dab100c977697db28", + "result": "acceptable" + }, + { + "tcId": 381, + "comment": "special case for z_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b775e016b32a97f49971121906763f3a0b41689092b9583b6710cf7dee03a61c", + "private": "685c0784aa6d194c1b859bda44c4e27cd1dfdf34776e498dd03d09f87ae68a65", + "shared": "11393bb548813e04fb54133edbe0626458e80981885e1fe5f3377e8ebe9afa52", + "result": "acceptable" + }, + { + "tcId": 382, + "comment": "special case for z_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f8bd0e7cf6ec6186f205ab03ab72c8f6b3cde8f6ad9b166916a04d43d1d6d546", + "private": "18e9a05a20436cf0dbc3d5b92dac8d996e62ea11fbb3445f29195fc75a8beb69", + "shared": "0a83a224fbfcbc5d0f07f6dd8ebb2e9bbee8134f0fab268002ce837f5495d833", + "result": "acceptable" + }, + { + "tcId": 383, + "comment": "special case for z_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8dfee48ad8b367488ea4dafcf7086e305356a80901f87c720149a5f522337453", + "private": "00e099eb23125dab5ec35a419d455d0ba8c01da160f9354e9fb21e6a55d55c64", + "shared": "45dc39831f3471d7466bbe29c8142b1a6d6b00c47fea021be2ffc452d9046806", + "result": "valid" + }, + { + "tcId": 384, + "comment": "special case for z_2 in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8f68bfc57d792c322ebb27f44a37c1c93e7eb15c5d5fcedffc1de850487b3372", + "private": "b0ca251e0dbae7324a6ca0c2c8d6a888edd12d1447d400a47bcba004b648716e", + "shared": "a29005c6b9dbf1707dc2adce4506b55831e8675b7d2d54b0c1037741e3bc611b", + "result": "valid" + }, + { + "tcId": 385, + "comment": "special case for D in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ff0f15adeab334afeda3916785ddd38d252dce9876c2357b643b5dc2c06a3b1d", + "private": "a8b64b8ed397773b8290425ca5c2f7c3e50fac7a4781bd4a54c133781c9a1360", + "shared": "9f04e42c1b2f311d87e1470a4708bba25ac6ffd3f7b486f9b6b502ecbb2c004e", + "result": "valid" + }, + { + "tcId": 386, + "comment": "special case for D in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1076fdc827f2550ee95ff9a15d044aedfac65b5e9ba809f62438ccea54637a29", + "private": "d0cd0db51ff232afa0919d3106fcb3a8ae581ef12d09c877aa6f31ef74eed068", + "shared": "688000bd60af375b4eeac4a7d0e0782c0e6188eabdc608b732f49b4d6ccab44f", + "result": "valid" + }, + { + "tcId": 387, + "comment": "special case for D in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ed1c82082b74cc2aaebf3dc772ba09557c0fc14139a8814fc5f9370bb8e98858", + "private": "204a3b5652854ff48e25cd385cabe6360f64ce44fea5621db1fa2f6e219f3063", + "shared": "e0a82f313046024b3cea93b98e2f8ecf228cbfab8ae10b10292c32feccff1603", + "result": "acceptable" + }, + { + "tcId": 388, + "comment": "special case for D in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "12e1589a34094af5f121c9bd3c1119f2b1f05264c573f667a748683c5633a47e", + "private": "88109b1d0e7bace44d41a15d5bcbcd36968c5b8b47c0a2c606b57c4a68cc5f66", + "shared": "1fcc50333eb90706935f25b02f437bfd22b6b16cc375afff8a1aa7432fb86251", + "result": "acceptable" + }, + { + "tcId": 389, + "comment": "special case for DA in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "151f54a8a899711757b3b118fc5501779d621d25227af53d0af00b7583ba8824", + "private": "5082e497c42979cdbfdd1b3b0653cfea6f2ceb7d07639ebf3541866bb60edb62", + "shared": "fac30a74f4ca99f6cf233065e9acd826690cab364bf69320b58095783ed76e11", + "result": "valid" + }, + { + "tcId": 390, + "comment": "special case for DA in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a819c667ed466bd9a69ea0b38642ee8e53f40a50377b051eb590142dd27e3431", + "private": "f85a8db44f9e56b11729f51682a9769fc504f93597cbe39444616b224532106e", + "shared": "17f6543c4727e7f129ee82477655577635c125a20c3dc8ba206ca3cc4854ca6c", + "result": "acceptable" + }, + { + "tcId": 391, + "comment": "special case for DA in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "40b053d056668982a1f550be95e16348e303945f53a3ac64491a9a56d4095b71", + "private": "505a076641fac398fc7d8c629937f42db559db5e12052ad366d46d7b20e95769", + "shared": "889a8d611e0a7da71475e7c93a2d7f6f7228c787a00ee5cf55474adc376ff762", + "result": "valid" + }, + { + "tcId": 392, + "comment": "special case for DA in multiplication by 6", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e7dd0549a765bbef34be2e8da18a1bc1b989a8b0614d358ebf38c12a9ca64079", + "private": "e8db2bf1af5b8907420789c56e71414706aef0d9f6ffaed0c249c3b7ab14bf65", + "shared": "37232fb397af27f5fb5ca493284ff1c5d25786b0d716c73b33aca8d42265f318", + "result": "acceptable" + }, + { + "tcId": 393, + "comment": "special case for z_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1ee1b9a74604ac31c3db83280170e3811504fcc78c7626b5b2c07a99d80daa0a", + "private": "c006ab1762720882017d106b9a4675fdd47005657155c90ca61d4cbf7cc4f973", + "shared": "a1b30418436ba1908804ffcce1be2cdcf50c61a8e3938d95c790abdb786b8022", + "result": "valid" + }, + { + "tcId": 394, + "comment": "special case for z_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f226c2d6bd7831eda1b51ee5aec29443a507ef9f7a04e2340f349dbf14933844", + "private": "d071807d607953da432d8574d5f3f420676dafdbc6a285a36e1d737624d77c75", + "shared": "a5976fda89954a81e442107f9e416a2b4b481bbd4654ebc0c7b57a78b45b4979", + "result": "acceptable" + }, + { + "tcId": 395, + "comment": "special case for z_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c5197312de3a7a3ee11b29873bae3fc8c85109c66784804f89435db210fcc24b", + "private": "304b526f6fe994731980c0975529bca4d061017fbec56f6070d42678d3e11177", + "shared": "55b5b5eb38b127617ffe00056d84d35a5071d18783e3a82b5f4e131b1538b150", + "result": "acceptable" + }, + { + "tcId": 396, + "comment": "special case for z_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "590ed0b879319c38a19962a5d216ff2bfaf33555518877969c20c054cbe43e56", + "private": "982ddf2c035789379b8a58917d5c3c6c061b503b19a0028e01894c2eb371d079", + "shared": "0080e5b9985a960a832133812a7ab9951c6b2c75894deb3e35509190a6bdf457", + "result": "acceptable" + }, + { + "tcId": 397, + "comment": "special case for z_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7c5f0143a6682f60ccad16f21150c7bb5bc6f807254d08b353fc96ce07bceb6f", + "private": "78cc3ec0687e3e53d9cec56b79d11bf049d173f127f5b40fae122a6d0016cd76", + "shared": "5241222226638c4bbbc98792cdbd74882ca2e08aa2edf313070425031009e925", + "result": "valid" + }, + { + "tcId": 398, + "comment": "special case for BB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "010850a0974d3e89c029d252b46f739548294c0f9a23183863f9455b9559c211", + "private": "c86fc76650cf3b58837aa0f0633560415241c6c4f8f293ba0222b7d6a3875773", + "shared": "63788190b10d7451f5fc2b82c421151db4f3e22782e392da6d8d3aba2c344306", + "result": "valid" + }, + { + "tcId": 399, + "comment": "special case for BB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ad1dd82c23d6a0d5fe0f2a4561d1c16733a3e1e6afa6d902dd077dc43a961628", + "private": "888d51c0a2230369e5b65a814b3213dde2e62f2eb95d0971486b733e4f90c174", + "shared": "e4b40974a166ac49ed831715c071c751752744b891465e6c45001855aacdc362", + "result": "valid" + }, + { + "tcId": 400, + "comment": "special case for BB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d0c0d6393c41f4d7e0d5e850b7716f401eda1e028a4ed4a05bea8bf81acfd930", + "private": "68bed425d534315584d80f79da6eab9b7e6036b51fe62e1ad933e266640b4673", + "shared": "514a4cd0676f1c3101c8c45c17ad416bd33e20a405544fc1a60449abb22fa104", + "result": "valid" + }, + { + "tcId": 401, + "comment": "special case for E in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0f460100d88a1d316dff02d1b22ffb2e42d99d0b92474fc3ec7d62567d0cf112", + "private": "98ff2856ef44b4fa14d86782ea793828bdf6f1ef9b669cac1aae338a7bb69376", + "shared": "ed83e810ce5ff0868f8589623bb13478dec1c22326c92765ae5e48c84bbabb24", + "result": "acceptable" + }, + { + "tcId": 402, + "comment": "special case for E in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "13756a411ff3ae0c39222dde0810f08c432463162d81ef061071249a48439e15", + "private": "b0cdbfdd98bd988d7c6a530455c51c57dd33fd2c7aee3961971bd3a31388fc71", + "shared": "ff94862117d3c6edc9dd5f4852fa8a589452b924ca8a75cb23b3d68dfed88c4b", + "result": "valid" + }, + { + "tcId": 403, + "comment": "special case for E in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8fc1fae969a6185404db22749ef6d225de86773a4d1bf3857eb8fbbd829a1b47", + "private": "e0677644ed4935f01e052e9967302d0fb78ff22bb92fbae0605f3ee54e2f6878", + "shared": "1c94868bc8acb3137498209b2812feb53501389f5aa37fecbfd5cb54e1358e0e", + "result": "valid" + }, + { + "tcId": 404, + "comment": "special case for E in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7bab0891ecb9e72a15771f0a4fff90547024206339c340b1a2fdb53bcfb86b59", + "private": "887b61553843ca99ad1ca92253a6fe082b82494752513fd53ff6530f54c40572", + "shared": "adbf3b439b16dbc653578f53374ed3a86f9c0bf1f736573349773bc3b8d60734", + "result": "valid" + }, + { + "tcId": 405, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "102e95eadca7c3c28e5d52336c857bad99ea246f299b06334f401276f49ca814", + "private": "00615e4697014fc12484ef53a1440206410a8df78caa0bfff82161db83fea574", + "shared": "3952efb93573ae9ce2162d10e4b8c46435859f3f2778db89f72bc579e695cb51", + "result": "acceptable" + }, + { + "tcId": 406, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "3548c16bf31afdcd445ad9bef0e60d7bd6195aa591ca8c82813cd7d446226720", + "private": "58175113550faad56458fb375a6cb3f05df2f6ff3c4ee09d4a6ba643e022d17a", + "shared": "96128f929fc03c1269d429f609a1a8acac7a758e3446a125ecf4a359a0e37b73", + "result": "acceptable" + }, + { + "tcId": 407, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ba74e766d44855ec93bd441aa41058a4c4ad2be63c639a3f9a87bde51eeaba20", + "private": "009738e1e6efef9e2cad8b416fe90a098eb5cb0199f2df5218166c7b181ea079", + "shared": "fec3e94cb5f316625b090c2c820828ce0f3ee431e8d6e12abccc7ef2bd0be81a", + "result": "valid" + }, + { + "tcId": 408, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "9a5a1d37e5010c356aa80afb347c3d613542ddfa0be7abb8e8cdcd6674411449", + "private": "c82019159be792747a39f388ea48a8c568594e3383273e51100721b376e8ba73", + "shared": "96903bac9dc60b6178d734890c25db4bed9ea4dbcf6fcbcdc90e6f5694c8b21c", + "result": "valid" + }, + { + "tcId": 409, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "630847e28274dbae5491210303c85a359074ee742957b0fc3c9ff55d9e019a50", + "private": "10ac9f8383262ef280faac1e4da15a7de4f2cb74af33b50e0d82dcb85d8bcb70", + "shared": "50050d0ab1ddd2dd90c460ab8f09e1f80e37cae57d4231adae10c10a4a2b003e", + "result": "valid" + }, + { + "tcId": 410, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "11749b00a45067af2c7e7d50f8d178d5a9fedb8f1b69b239763885bc611b136c", + "private": "b84c098382f6e37d510cc33e62ddc664e02c8bb6ed9ed0e5fa78cc099a26fe73", + "shared": "9170c4c628d5fcfd0ec719cf6e1796dab0a69e46d6379fffa247d444a0056041", + "result": "valid" + }, + { + "tcId": 411, + "comment": "special case for AA in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "df1021d8f95950afde77c86ba5ee2f5876ef778376a7fdc7efb8dff0e4836e7b", + "private": "78cde8930a1d81aef6601f71409728854987578b0f8349588c04adbe2c1f6e74", + "shared": "d7d2a82953f680cee0c81c4d00fe628ac530ce682eb7fb3b0af24f804a58ef5c", + "result": "valid" + }, + { + "tcId": 412, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "2743ba408d5f68c65324a485086a004b6bbf784cc9e8b1a7dbeb8c4b9414b018", + "private": "b0fe7b06b9950600b3a7ce1d7bb2a1d984194cc9d6c8964504c364dd5c875b74", + "shared": "a6b97da989dccf730f122d455152328051c8ed9abc1815c19eec6501d6cfc77c", + "result": "acceptable" + }, + { + "tcId": 413, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "cc275a2cdd9125e52f20ce2abad41f920afa5a643fb7f276ef416f761d689f1e", + "private": "f0c9c3984854d5bd599d3819738a023eb795e93586dc0e5e29b1c870c612d178", + "shared": "b210e368729501d9f9b6ebefbebae38f195f91eaf2a5a3a49288bb615ff2216c", + "result": "valid" + }, + { + "tcId": 414, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "4929543101ee7ae239059cd134c35d400e50d0821441351d0fa6c3d54efb342e", + "private": "906c2f12be89702db26fa7ee905ce36525d2dee4e96a879ca07da097a6aa5075", + "shared": "b9e3796c58701ded4237c52994501cee14e18f2fb02b781a8400923484bd4a6c", + "result": "valid" + }, + { + "tcId": 415, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "1324e0368597b3181555bb5b2cc7b7ebba46931aeabb6f05ababd4240f0fb933", + "private": "f026031ea373e1d16e6e7e0357bc96bc093f4b6bb76a738cbb54fe6cfd2ea271", + "shared": "6dcdf8e86903b0caded124d8a7da18e623430ca869aaf267d31029d93de99e66", + "result": "acceptable" + }, + { + "tcId": 416, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c7f3842297d6941cac63d6f1bdaea0709437c82dbc9161fc1bae6c79d668eb44", + "private": "703f4ac8667d77f9536045cf748f18d42345e39ccab10c18dde0f5170d307f73", + "shared": "385ddbf2505ebf537bf5e976b61a4b69d190ae965b7e4a81ae4e1c16b7148748", + "result": "acceptable" + }, + { + "tcId": 417, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1e4660ba865fb8085afd4692885d74237fa3bca5af4b84ba3de400f16a5ac45c", + "private": "c8a96ae4e77271a0680dd24fcb09f9c5d3ee8316536eec7cc2276597e50fe37f", + "shared": "0fbaea73f9518795e026c1fc1079c3738aeb9ee9c8dc9761d65bbf8f94e30154", + "result": "valid" + }, + { + "tcId": 418, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "2488bb6fadb79d46585ff01c160c5b4172799d92bd168edceb65cededc492762", + "private": "d0dde8eda38c3783442864c0cb46a0e9832dcf784c21268a21bed2cace87cd70", + "shared": "510c64151e5d0737fc324bd15fb5d3966908751cd1a06954b556196655ee5540", + "result": "acceptable" + }, + { + "tcId": 419, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a0c1087811af1491171bc51691b8ca84716af36c4baa764ec536280cc1983d6d", + "private": "c09cd47e1ce53604f14e4e13426c8f08962f556bcd81f8d75375b1507c6fda78", + "shared": "23ef825e1c8e6e64428001a7463e32a9701c81cf78203e6ae753740c91570e6b", + "result": "acceptable" + }, + { + "tcId": 420, + "comment": "special case for x_2 in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "cc5c97934607d8b981bce1d6a232bb3aecc3001f698ae1ae84938fbf2861077b", + "private": "e09a5f74f318f02303857aa0208d76913d9e240a80549d12013118bad620597f", + "shared": "0e55a7ec1a2ddbea1ac5981200812232f7f4c3a60ee3c9ab09f2163bd13da329", + "result": "acceptable" + }, + { + "tcId": 421, + "comment": "special case for DA - CB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "238de7fcc8a3f194c3554c328efb1215d0640ac674b61a98ef934ec004cfd73b", + "private": "706cee5f9b357c03b2f1913294f6e4f0ca5a190a87d30268327d0cb6bdd5bc79", + "shared": "0681036a0d27583ba6f2be7630613171a33fb8a6c8991c53b379999f0f15923b", + "result": "acceptable" + }, + { + "tcId": 422, + "comment": "special case for DA - CB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ac9fd80a45da109fa2329390e5a951cfc03065d7bb4a7855826ccb22c3bfeb3d", + "private": "40e300cb1ff260574f85b3f04aac478464a86e6203b3d4656418f4305157877b", + "shared": "67b88774f19bd1081d6f23656a135803e34ae1cdcae10818124a78569c299f42", + "result": "valid" + }, + { + "tcId": 423, + "comment": "special case for DA - CB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a45ab1dc2fa2c50718fb4985d9791401e8d2d34ffe3cd93cffb4e870cce5e855", + "private": "882f78b4558b7faa835904c9235e32f300fc8b5ef0a718406a5c8520ca54d071", + "shared": "a512e864bd898a5ba6551adcebd836c6a78e7871728e1b8ee528d483af276104", + "result": "valid" + }, + { + "tcId": 424, + "comment": "special case for DA - CB in multiplication by 7", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1761d3d50ba46b446655aa6a8d9b8b75aa5bb24a7953208d5b69fcc38f18ec7a", + "private": "d8649b735590a17d0fc4c378fbf4c2f7d6600569b2e84cbe0ff7bcdbac0b5f71", + "shared": "518b778cf5e976c60235abcf6211a18bad2a8e693ab261074c7fab43dbb5da27", + "result": "valid" + }, + { + "tcId": 425, + "comment": "special case for D in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "dc99ad0031463e4537c01e16629966d1b962c0b4e4872f067ca3c26ccc957001", + "private": "a8edec59ae6ba23813ec54d66df152e0626762b97d4b0c20e0dd8a5695d86e47", + "shared": "6cfa935f24b031ff261a7cd3526660fd6b396c5c30e299575f6a322281191e03", + "result": "acceptable" + }, + { + "tcId": 426, + "comment": "special case for D in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "b32750fd80d2d7c62c6b8e39670654baea5719a3e072e99507fd5bcb23898264", + "private": "1098723ffe567ea6dcc8d04ecc01efafeea0aee44e1c733be8b1e5d97c8b8041", + "shared": "c623e2d2083f18110a525f2b66d89ed82d313b6a2dd082f6b7a6e733134f5a06", + "result": "valid" + }, + { + "tcId": 427, + "comment": "special case for D in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e7b3205777b375f1b1515a50a16a6067953ff221e12b4f416d74fb28c1c85865", + "private": "a0f20df98b49218ac832f26fa8c218a0d6872eb7aea07c1d43c9ff699b465b47", + "shared": "388ea421650a8d837bad8904018195e99ef494c2d170b93ee721a67d2c108729", + "result": "acceptable" + }, + { + "tcId": 428, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "21cc338d7869e5863349cc739c8a6946cfc797cb82fbf62dcd2154844b106003", + "private": "30473a77a98374f67d5bd43df231ce142916aea0d271e72333fa47dc441a0247", + "shared": "b9e5728b37435b1d339988f93267d59f3bd1c517851c5a258e74cb64aea73d2d", + "result": "valid" + }, + { + "tcId": 429, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c34217c02072d7e2bca0454525030780cfb60215d7ca82dbec8f4a59034c5f43", + "private": "d8657be3a30fc85fb2f3a68e92ace1b31b26e76e6bdb6727aea507cb7c10dc45", + "shared": "20b67b205e22ce87fd44a8e8fd10a6d8890b9270b60e1c6a68b4aa78e6e37961", + "result": "valid" + }, + { + "tcId": 430, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8abb8cfd60c6f8a4d84d0750d3b40a4f846b30edf2052fef7df84142cd0d9e47", + "private": "882f5578ae4a13d8f5af473bdde1709bf2e059df809ee05b505f34de857c3447", + "shared": "5faba645fc21f9421ebd35c69bdb1d85b46f95e3746ff7f4886bc280a9ab2522", + "result": "acceptable" + }, + { + "tcId": 431, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "9fd7b49a08f206688d72db737df8e517aa7b764f5de7c9a2b1c3fcbaa985f64c", + "private": "98294db7cbf4958bfb3ed21d5d5c91e13cc8dc27b3c716c86f7167a4819f8741", + "shared": "9cb8a0f4ad86a27b96ca61242eab198db2767d3862dd323e41368fcdcc5fab68", + "result": "acceptable" + }, + { + "tcId": 432, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c4fefac7acd448e8fd4d6ac4f5dd1bc21f2c67d638444060918fb344aa77e757", + "private": "789bc4047ad81b9b6656eef298b766e8763a2f8ea64e374a603dc1fdf2eee146", + "shared": "4b42fcf84b51b2b82f1f70b3cf49bd9dc6ab2672920a8de37e81ba7e99acf734", + "result": "acceptable" + }, + { + "tcId": 433, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a8341deecc0be6db11401ef7f884ac3ade35650cc21f14b5cdb0a5cf0ee6b15a", + "private": "801ffe4e0f6eeb8a50c8fe79663ff585f9d6aebcfbf4b7edc676c693900cb141", + "shared": "e55fc931669bd02d1c64689eda62648212b1078c43b5caf97cf9763ff87a3455", + "result": "valid" + }, + { + "tcId": 434, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "55a0e6631a52f29fb90a1777ccbc69ff94547459d541f72e8316e4d616535a67", + "private": "e04e412383a63b338b70e1be5fd75995350321dee428aa4f3ba62a50a3b0de44", + "shared": "87f7976a17f3e03a7f1eb74e6db950b8c0994f40b7903495599d227725809e01", + "result": "valid" + }, + { + "tcId": 435, + "comment": "special case for DA + CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "7976d520f1a2512d564af41c68313f5351b0156d5118be4817f192798ae9777d", + "private": "382dbe9f10158bfbb7d1d79a35a7809214899a6b8572b35b55875d79bd2f1640", + "shared": "3bb3e30105a71901b115065e39bdb3e053d387b39027b12c92cdf4c638adf00d", + "result": "acceptable" + }, + { + "tcId": 436, + "comment": "special case for AA in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "a26a722f7ba71ccfc96ed8e108d7c9f842d17f92051ee7d429ea7fa7908ab907", + "private": "60c9af7f4d03136a6034ae52deadfd9d4f274ad8122812eb92a53169c8354141", + "shared": "f5cb3a1b76185a29a6360b2142feebb11f3d08f4fd8d73df3a5228624a521c02", + "result": "valid" + }, + { + "tcId": 437, + "comment": "special case for AA in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ca3a2d96f5dda482b002324cbbdcf1dacc9815eab797c7151c3a88c75cded621", + "private": "283fae8bd8b294de2848056449751965abb5c7fa86ba4c2c5cdc3bb524dad140", + "shared": "b0b47868e70465ee2dd737f1ba5a6399e09cd813d72da7585ab45c946cc28d4d", + "result": "valid" + }, + { + "tcId": 438, + "comment": "special case for AA in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "eebd858850b56febb707f27a7aad5ff5ab4b0e0c73b9c86ec4ca0f42e7f38e75", + "private": "401539703ca4980db4ba42c59fc29e83b4189f2ddea53ba54ca966c06898a640", + "shared": "581e4b12b0f39a7cc42dee4513ecfdd20b595f905f17ad8c1fbf1b5cb2068b31", + "result": "acceptable" + }, + { + "tcId": 439, + "comment": "special case for z_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c800bf799783275eb93312b43dc032ccdfb00a4b77c8b3772cd2fec8db7e4a09", + "private": "c8eb056286e098e6b2c79e42f007ebc6ab3705346cdbdace949b5de1e8c36743", + "shared": "6bf264532fc70a6a7e459f4579eca6b84f8f76ab85c3264b20bca725a6eb6c40", + "result": "valid" + }, + { + "tcId": 440, + "comment": "special case for z_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "7bbc504e04d134eedc13f06dfdfc69c518257a3f374040a49a8d21dac109110c", + "private": "487882956c49c69fd0e2d7277a24fb1dbe4b0365b36a13f63440248bca2fbb42", + "shared": "690305c9e192cd8a513f705b3f101ecdf3db1ea15a09c4a1bce3a8cdc3a1a93f", + "result": "valid" + }, + { + "tcId": 441, + "comment": "special case for z_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "132533db62aff4fa06e96314383bf58ebdec5183a19f2e4cb17552ae19a3366e", + "private": "9876010f4d64c77ffc4d7dccd72b9ac82078deb883609650b8cff8a686719d46", + "shared": "c58591b33e490e4766ff7addff570ce4e89a98338015a55df3d2f232aea3fc4f", + "result": "valid" + }, + { + "tcId": 442, + "comment": "special case for B in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ceb90c56508cf330c7f25bab42b05b5612a8310690107ac63a404c0ade788009", + "private": "a8a5d4f7894a519537babfac736de36054f508dae434b4fe63cd5633846a2647", + "shared": "3d145851b6ff2b92b5807ed1df21eb50c9f24c4474d4721db3abb7356df7b764", + "result": "valid" + }, + { + "tcId": 443, + "comment": "special case for B in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "66a09767a0d83bb18d404e1200375a745d1f1f749d5dc6f84a205efa6a11bc65", + "private": "f83e4647e82c560aa082c59641e13bf366be8f24dc01d14801e67841160bed47", + "shared": "1401829aac4e64bcfa297a7effc60477090d3627a64a35b872ae055d2091785f", + "result": "acceptable" + }, + { + "tcId": 444, + "comment": "special case for B in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "39d431316307c85747bd2bcf4f9e0f8892ee45df15f7806ce65147d97f503478", + "private": "58c6b94bce9b15f64946c2aa6a4e383b0b2d4365b7997eb2310ac4eef1803145", + "shared": "a0ebe6908c5472f937769b9aeb313224437fc5d73f4f866fe7ef41f30e359e09", + "result": "valid" + }, + { + "tcId": 445, + "comment": "special case for C in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "84c92d8ecf3d0cb22dde7d721f04140c2d9c179cc813ce6cf8db2dce6168880d", + "private": "786a97207adbd4b0d6bfc9f49b18660ad3606c12e325044b8690b4fa07874641", + "shared": "07538f1b6583041c4949fafae3349d62f9dd302d3d86857af0dedc0d5ad6741f", + "result": "acceptable" + }, + { + "tcId": 446, + "comment": "special case for C in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a9cedb9e942a47221e4296953220d10007db327d2acb68da6ef3a4f877b8ef1e", + "private": "282310210e575a59393cf19bbe6e24752dc247706f1e0031e5d39b2de4fff745", + "shared": "1223505fbb534c1bc6108e6b98b4f0af29e11158c02d333d6559beecd6d3e558", + "result": "acceptable" + }, + { + "tcId": 447, + "comment": "special case for C in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "64e1c0c5f59405bbc6c7db41a3485cc9f91c183b0f2b7e1894a7abd8fbbeeb23", + "private": "c8bf2fd4c40d00f1465aada682b12fa92dec10343484ab62b8871337de1d3345", + "shared": "ee031868165f456f75907bf39742b820e0f8e6df9f9768d757d408e1cc92ff7b", + "result": "acceptable" + }, + { + "tcId": 448, + "comment": "special case for C in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "a68d2f55e60eac7983926310f4fae13f95b2bbf140be5ea91751884d900ab44d", + "private": "c06a4a4b70f613136f18c0f88e2245086c3d1a52717210a21ac9d63682f2e740", + "shared": "c954fa7b042c32943e03191e367d54be0085fa8950ef2bec99620df79ecbea4b", + "result": "acceptable" + }, + { + "tcId": 449, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "6d3cd623f26a7453fa05a01ae758ba84d3c58d93d60ce32735a15e0d053d5b12", + "private": "20596e1dc56596823d37698dfa699c79874aaefde797f863ef92135980fb2043", + "shared": "7c3219b3c1fae1f95590ac843efd2084a1f4bd3efa2f592f022032db64ebcd77", + "result": "valid" + }, + { + "tcId": 450, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8f195547346b3d53b7ea4f742b22f1ef7b3cc01a7d3dcd19aa7c5b03f31bd214", + "private": "38141518e8e5efa1d031c6c4d95480239f6c30b8ccd8c751a9e04bd3aec17342", + "shared": "a31f6b249d64a87c4aed329c6c05c3f2240b3ca938ccdc920ba8016c1aeaeb45", + "result": "acceptable" + }, + { + "tcId": 451, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ffc4fe2c2127a309c739565651e9812f834a86dbadbb78776977f786ecdb0217", + "private": "207147f2b68fef1efc10a04f988f0eb18b273b0b5ed17aa7af32c90480e19b43", + "shared": "4cff9f53ce82064882329a18ea4e4d0bc6d80a631c87c9e6fdc918f9c1bda34a", + "result": "acceptable" + }, + { + "tcId": 452, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "8475babeeab9980d426abd5323dfb335b219e129bddae4d6cebcda50754a6825", + "private": "488084537b840f9c93ca57b3ee80491418d44221113e03f56355302604d03547", + "shared": "248d3d1a49b7d173eb080ab716ac8fde6bd1c3ed8e7fd5b448af21bcdc2c1616", + "result": "acceptable" + }, + { + "tcId": 453, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "81f90a2f6633d30c2b72a25795d2a49463a80b6b0edc5aa68bae4bf738185539", + "private": "28cfc1d03f5c7428ff3e20b137268b33ccc74db03582d2127c566df4ac99f441", + "shared": "66c6e70cf630be90a2c88fcde7f58cff3868660fa96406e8df4ac677dbd85f50", + "result": "valid" + }, + { + "tcId": 454, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "41626e33b3c8f48bd19e49ded307f2b63bde705c4f3cdf9d4f92bf37c48cba42", + "private": "c8e37d10f3d03db3f43e467bddf98f595cb529ad253c20d491282d1400b9e740", + "shared": "06283fcf69dc83e99d92e5336f499a1d8fa75ed2c819b5ae6ea8094454324b27", + "result": "valid" + }, + { + "tcId": 455, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ebb32f781c0e89b252e611f9d8f79f8567874c966598314b2f16aa44cfc07843", + "private": "00237e91406a7b4db61e780c5976fbb926cdace2fbdfdbcfce65e6dbe7782a42", + "shared": "7d2affb43355f5db1294daff55f59b1f17e7d25bca20746f12484d78e5015517", + "result": "valid" + }, + { + "tcId": 456, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "fa75e6f08ca815b4e42af24a8e057c9e00e828e33d12c0e94d1012a758336744", + "private": "489c4184a23a8f5eec68a31b41aa2c0392cd6fb123f10acdb4de75292b4b9a43", + "shared": "ef8e78cab091d667888489fd3a2ec93fb633427d02eb77b328d556f2b2b0e266", + "result": "valid" + }, + { + "tcId": 457, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4d96320cdb0ca52655e91118c33f93afe4ae69e9e513ff4506750b8ea784ce46", + "private": "c05957fbc3a0e2c22a2aef627651ca1e99307b82a0c6170f7950a334f3004941", + "shared": "c8d85bfa74b4b26461297b350c975183fea9d33ba29c3a4934509c2ecda58a79", + "result": "acceptable" + }, + { + "tcId": 458, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "c0ef1b7c20237db370501f24274e4eba91998ae4545f937007e1c4a2eab63365", + "private": "60111c6629f73635985be964b845f87a88ae5652d45bb1451ce8cfd2ea45fe41", + "shared": "22557e0d8741ed2a63afd5e313aa1579fc0c88c7772e23a676c94b60c89df577", + "result": "acceptable" + }, + { + "tcId": 459, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d534d8ff4d56a73ef7615e94523b17e35edb3d0fb87e98c68536f63f114a8d6c", + "private": "58785889a216d15456582d4e1e3de9e9ca4a432954416d81caf52b2b434c1746", + "shared": "54d7fc17bad00296ba50b0f3d5bf8fb83f82d571952a5fdb5a494120cc61446b", + "result": "valid" + }, + { + "tcId": 460, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "733a711ba01b6e9b64a0be4cdca8c7cf3c66df2435d5248fb4413fec6ee03f70", + "private": "60bef38a3890ec1ed05c299fceb77db5ead4b88d9e931b0f21d664f77df9b544", + "shared": "db6851b12585bc11be9362c96a545c6f2ba55f04009792463b96a38cb9b3f07c", + "result": "valid" + }, + { + "tcId": 461, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "35738dd539d60f69cd1a1cffc8a42b6af68fe7de45392d02831e2a77500ea278", + "private": "5854ee566878ef8b7ebaf5a058306f250edf0c84fd52af2d74b7ce3c1edda746", + "shared": "f6d1a664257fa5de3d4d57f04eda2976bf1e35cc3ac513e1ee84d57d2135ed13", + "result": "acceptable" + }, + { + "tcId": 462, + "comment": "special case for x_2 in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ce932b5af4be4721f96f7b79ba1c43b20687d4af49c37b58dc894279e04bb578", + "private": "985b551261fce38ddc8ff3add32f5c26811d271b9a1794e249dd76a38df28446", + "shared": "f8f7625ac5bde63f753a9bb4aefbfb9c4647207708af9d774ef08ff1b1e5a354", + "result": "acceptable" + }, + { + "tcId": 463, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e3655448339e4850806eb58abba0c89185511ea72c37c49e9583ee6dd235d213", + "private": "8815052344dcad97efd1341e9072a808cf999e46e52cf04e0cfbcd9901e18d43", + "shared": "5e10dfbff4443efcae2ccc78c289a41460d5a82f79df726b8824ccbef7146d40", + "result": "acceptable" + }, + { + "tcId": 464, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4d16965b1637e9d7ae8feb499ed0553962a9aa0022d1620c928072f6501bc41b", + "private": "b8e032e9e5ffbaa004390f3a0b900bc7cf5d11238b7ec964afc4bda2aa6c3444", + "shared": "19d7b44c1847c44e8f37a22ab69c180fd9d787f204123013e1b16800b9cd0f57", + "result": "acceptable" + }, + { + "tcId": 465, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c6b9e6288737ad40452cec1022871d90af1642d10bd0a97792b1a9c8998e2220", + "private": "7012852211f6536fca79937e7e316c9149b0e20ea03f951e1bb072895ca0e044", + "shared": "db990d979f4f22f766e7826d93554e771b361de461274d6c37baadeb8ef7be4e", + "result": "valid" + }, + { + "tcId": 466, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d566fab505ac4c7a3dc3b9403ef121392cbbe21216e5bcb8eab2dc9408986e34", + "private": "d039c1b9ec4763e0ad8a0ef2b0870297d0f8b487e660595a484105d180e14a47", + "shared": "6d7fc5d4a8f534b1bc0fa5e078104234675c02664736957abdb27df6faf07c00", + "result": "acceptable" + }, + { + "tcId": 467, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "468d35ecfb6d9b7272523276cc5e13760519667f0e1e3888da4c56955fe91151", + "private": "58efcbc8777c1b54f09c61a216efd427292eb12312dbb3b32bd45254a6683e47", + "shared": "539c8d629ab51c2f3ea7278fd5f1c31b6c150a82fe3f786b93ffa159fd6d9316", + "result": "valid" + }, + { + "tcId": 468, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "1929538743977dfea20bf4927ddabb2f3bb15cac2461054508849718854b5568", + "private": "c8d73446026cd0ea795773c2eb7b16348cd5f228e352dbc77328c2d8b9cde240", + "shared": "dee3fd19c8f296415448b21af44385ec46727bbe67d4839b93efe2f680e76d34", + "result": "valid" + }, + { + "tcId": 469, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "2d7ab4c6f59865355ee8e9de57db19aadf7708b7c1d1a818487c340623badc6d", + "private": "98b559523bc778b0418af53c0c32f6ff5cf771ff5df8ae7cbf7c3b72aedb5b43", + "shared": "2a0340aaafa05d00529c09057ed0145f34d2de66a3e149cf084ea97168914f39", + "result": "acceptable" + }, + { + "tcId": 470, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "43839f4a6aa206c82c5a73f49d8c9e573826b3ba7235d312987c17aebee62776", + "private": "589815027caf82714e96c9f91bace66ec4ba3e92df3fa14b9b8fe503556e4543", + "shared": "00313717d33e3b41a0865986157582e053502a172b88d01bb7b10831a9fc4e6c", + "result": "valid" + }, + { + "tcId": 471, + "comment": "special case for E in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "3c321e7f0b9e555bc264a2cea617e6b2b562ebab21fe0c226c3e487b7df9a27d", + "private": "80715f67270c99789855ceaea99b9957ccda33326f76bb4474ab52ab1ec37041", + "shared": "9b6be9e6f2fdb5d3321842225d3e91d14828cc53ba6654dabe190b0c3edeb309", + "result": "valid" + }, + { + "tcId": 472, + "comment": "special case for DA - CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "42e5a6b8e9654bb4ad624af3f491877977513cc8775c8fb312ad19dbf3903a28", + "private": "101b990bd83d684126ff047d930c27d086a588dd19683d2629f0e34f4374ab41", + "shared": "223f1eb552308373026d11c954684ce6db870b638b190b9443e50aae219f4e3e", + "result": "acceptable" + }, + { + "tcId": 473, + "comment": "special case for DA - CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "0a51dd90ab985f6deaf72f16c45014da26df848697f6582d75688f5223342b51", + "private": "200089b712d9a2050597779d463712fcd223e3d67879c0fb7606f8f5f0efee40", + "shared": "fb95ce4a3c1f325638b7d47f4216d39a7c6c5da9a01caa297c37b62816555b2a", + "result": "acceptable" + }, + { + "tcId": 474, + "comment": "special case for DA - CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8842317357bde825ef438a1c53906fb8b04ea360f7ef338c78e668586047936a", + "private": "f04f87f4e623af4c31ceca0bb87fac2d5b12517b5a7284902ad75838e65f1e41", + "shared": "488b8341c9cb1bbf124510b9f8dae4faf2e0dca9b84e00e952a63b5aa328a860", + "result": "valid" + }, + { + "tcId": 475, + "comment": "special case for DA - CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c71d92d3c92dbfaed755fb32797b667cc86b0e79362498e2aca38c689713b16e", + "private": "383cbd5a3dd0901d09a3cac3d3a77a979cecf15e206a553e4ca3f24b90783945", + "shared": "1129eae97bf75f7314f2e1b403b18737ad830c80429e2ba0d4866b362399855f", + "result": "valid" + }, + { + "tcId": 476, + "comment": "special case for DA - CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "3a21d1cf7b3744d1ad26197335844982c2a0c6a5aa835492bd03c401a4fe6778", + "private": "701df09e57b98aec375745df147b72949a6b2bb2ca3a34881512ee31e790ad42", + "shared": "072f51d94727f392d59dc7caff1f4460452352ec39c32a1c9f071e388833da56", + "result": "valid" + }, + { + "tcId": 477, + "comment": "special case for CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "d128ea3e13325ed6ebd6533a9fd3045a55f25ad8b67def30912843504c1aab29", + "private": "b0ffa5f4922bb117ad75ff43acac62331efaa45536fe88306e4a4cb58db73a47", + "shared": "30512142d3e3a4cad6726d9d35f2e043fca9dfb750884ae22b2547c840f3587b", + "result": "acceptable" + }, + { + "tcId": 478, + "comment": "special case for CB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e079c8f8423165c7e0a2c48b4abe90aece4e6d903d7a5a1625fad0410cd55b32", + "private": "685e3271d2015741756612a930e858b930acf2018145f382c83d8cced2e22044", + "shared": "5b81b3761a66d199e8ef99d2494bd57a0229d4564a7f6d6055f22aa48681bd3a", + "result": "acceptable" + }, + { + "tcId": 479, + "comment": "special case for BB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "65922a06e9be4e8a5e8aceb1a4e08fe90f01e10ef2dd27315427cedfcf95ec32", + "private": "f8e161d69297e017d7c51b1b1ff3ba703d4c4cf8fc2b8ff47f74c3ff8c7d3541", + "shared": "038de7fdb9cc0030f5c11dda00589f0a95f65658815b06ed013553a02b6c5017", + "result": "valid" + }, + { + "tcId": 480, + "comment": "special case for BB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d36a240e972dc16e9b97a997ada337f02760d05c46d7f8d7b4e9ea9a635c7c64", + "private": "105d7589f8abef0acf0940da84a69e8f2f306fa73c9afd27342287c1dba80044", + "shared": "22b0dea3b3b7ca55eceeaae6443426548c7c15cc7ddf31780318d1c23879c16a", + "result": "valid" + }, + { + "tcId": 481, + "comment": "special case for BB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "4f5b8b9892b8a46df08d76a4745b1c58d4e7a394905435875688ca11f1e9d86a", + "private": "1893d4388b0e90f0b50208aa8f0cc24f576d03641baf1c3eddb2a3efa69c9d40", + "shared": "a25e1306684ad7870a31f0404566e8d28f2d83d4b9497822c57f8781b18fec20", + "result": "acceptable" + }, + { + "tcId": 482, + "comment": "special case for BB in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "aa2f02628269139a7a8a16fde95c9bad7da7ffbd5439c396a7d77b6c3213e67f", + "private": "0065171301bf6b90fb16efa35509161f1bd6b3b93130d490af9fe224dd155f45", + "shared": "bb4431bea7a5871c1be27a2674094627eaaa4425c99cd3fa41bd7e13cbd7bf7e", + "result": "acceptable" + }, + { + "tcId": 483, + "comment": "special case for A in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d995cb287e9a9c5791f3cae3d494a5b516a1e26cbc930f43e73c8b70b69d783b", + "private": "10c81a4e78d82145b266e1d74b3869bf1c27427803ebb11c92ff8073d1e4cc46", + "shared": "330f5d0b5bccc90f7694dfdd9c6449a62d93af8840eaf571e3e0610e0198b03f", + "result": "valid" + }, + { + "tcId": 484, + "comment": "special case for A in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "479afb1e73dc77c3743e51e9ec0bcc61ce66ed084dc10bfa2794b4c3e4953769", + "private": "48b98b4a99eadd73012c07fe5c4a0b9590ac55e821353b41d5f665e17188bc41", + "shared": "bdef00caa514b2f8ab1fb2241e83787a02601ecdff6cf166c4210f8c1ade4211", + "result": "acceptable" + }, + { + "tcId": 485, + "comment": "special case for DA in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "378eda41470b0f238a200f80809ad562ca41e62411a61feb7f7e9b752b554642", + "private": "1897678e38222a61fe105dc6643c1eb5940e8dbc73ed6c00f25a34328f43a641", + "shared": "bfd5b5acd2d89f213a26caf54062f9a24e6f6fd8ddd0cd2e5e47b7fea4a9c537", + "result": "acceptable" + }, + { + "tcId": 486, + "comment": "special case for DA in multiplication by 8", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "0cad7545ade2fd93fcae007c97648348f26d85829bdb7223a63eccb84e56d475", + "private": "a898af8138e11ae45bbcefa737182a571885f92d515c32056c7cb0d7deac4741", + "shared": "c8085877800c175e949cdd88e196eb9c4841da2ac446dfed9085bda5bbec265d", + "result": "valid" + }, + { + "tcId": 487, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "60f27ed0a27804ced237cf3c1cc776650fb320bae6d5acb564e97b56cba25210", + "private": "b0bfef6ec095b5a1f93917d32f16a21d0462c1fde17446f5a590232d9c895f4a", + "shared": "4c300895827382a9d1079028bd6f694a7a12ddac9c76abac6fdf5d29457a3310", + "result": "valid" + }, + { + "tcId": 488, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "f93a73270ac19194b8e4ffd02be4b1438525f84a76224688ea89a9dd6a1bd623", + "private": "60497d4464ed8823c50fbc6b68620826c4f629c1d9193058df6bf857c6aecc4b", + "shared": "7285fbb3f76340a979ab6e288727a2113332cf933809b018b8739a796a09d00b", + "result": "acceptable" + }, + { + "tcId": 489, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "cf80c30fcbfd535666ca1da499e2e99cc537063e2de19458fcf92f5ee34acf47", + "private": "08c6cbe03792a3829f06e8ad54c55db113236ac0dcc9ab6a9a6b10eed1041b48", + "shared": "dabc3bd49f19cf7071802e43c863ed0b1d93a841588098b98a0c581bf4fe0a11", + "result": "acceptable" + }, + { + "tcId": 490, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "698effe0ad42e15ee1f46fde6fc5074ffda183bcf1b2db8647f561ddd191dd60", + "private": "50044da3315dd082e9dfb6a1994aabb331f53e0d1c12633383b2a3c8678cfe4c", + "shared": "a61a3b150b4770532373676298c9a5da28adcc4365b06fe07c959ca80e477a57", + "result": "valid" + }, + { + "tcId": 491, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "bd1565b4a3f8515dff577be6dcb414511d3d4ec2de15e0bd45b28e9cc4caef60", + "private": "285640da7a48252e35ddce60c14addb73097fbc9ac2f87c8d2772ce89aa6be4d", + "shared": "916ab4f3bfc8321e1087d9c5444f8f7a43e9ca6d29e7ba98a19dc05fff34ed4c", + "result": "valid" + }, + { + "tcId": 492, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "b8649e13843f80cf5702398e4a9a8c378f29da96dfd6579f1eb4f7ea34df6765", + "private": "783271c21199ba2e94ead92cd9dd79f70aab378b59497455d327a5907dafcb4a", + "shared": "844a5dd5139554ca7b41cbe6a4796193912e7aa4e201cc68944ce2a55774a10f", + "result": "acceptable" + }, + { + "tcId": 493, + "comment": "special case for AA in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "c396938737abdf791e09a97eba577c437d9b67c2dae94e13eab7296ec0fc737e", + "private": "d0676a0b9a046c62d5b2e740d9cc43fa37965dea93c23254f7bf569f2bebaa4a", + "shared": "10780333b2a6170136265bb5ebc6c818817f2e48ae372528c8f34433fdd6215a", + "result": "valid" + }, + { + "tcId": 494, + "comment": "special case for DA - CB in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "557b825012d98f065bb95a2ab9b2d2d8b83fd2037912508c263f86d7e36c4f24", + "private": "608c84d2b76fccda579e974db3d3b2ce39a6bc0dad440599db22411b60467849", + "shared": "5ce84842dbae8b795b3d545343558045508f271383bfb3dd3943f4101398c864", + "result": "acceptable" + }, + { + "tcId": 495, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ae98296d4a2fbcbb40b472f4063231608bb1465c226c8a4a2dff29afd915882a", + "private": "80f233936a8821936d39114c84d929e79760b27680779e5009e1709410dd8e4f", + "shared": "4f11aa0c313195f96f25cadcbf49f06a932d8b051879ea537d1c6dfee7f36d35", + "result": "valid" + }, + { + "tcId": 496, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8b9d249829fbe81333d85050da88998f63fac665679e27dbbe21b745dd14e145", + "private": "c8d80b1a34f21194f047a6f0328bb947e2e7aff6a043553aa07f2abf99aaf048", + "shared": "1d619070bf5626064be10025e74e336c81ef3166b743f99c751fb90587c31d7e", + "result": "valid" + }, + { + "tcId": 497, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "61896093e2697c78230afdda12639cbe4342827b8d2b093281f148eb60b9034b", + "private": "9021477b452361580059364c6f94f4981ee94ea3f9b7d37439bc82ae45816f4d", + "shared": "532e797861db56b9d5db8825fb72f8629c2422f8abea721ad2d7b9e77a95b576", + "result": "valid" + }, + { + "tcId": 498, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ccc1dc186229dba9a9360a0f7ff00247a3732625acaacd18ea13a9a8b40fac4f", + "private": "6079dae04c40a59ea4e0c8c17092e4c85ea9133d143307363487836df4e30349", + "shared": "4f678b64fd1f85cbbd5f7e7f3c8ac95ec7500e102e9006d6d42f48fb2473ab02", + "result": "acceptable" + }, + { + "tcId": 499, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "69e368c0b7e78eb9f3a53bf458f6e79dc4883bf9458f04a8c12c4ddd94d62151", + "private": "281db6a5ac9a47d4a7b2b91a87f6536ce62d4e5129b8d647b97f9c504014894c", + "shared": "e069fd06702f10f33adb8cf0766880634865b510e2da409241fb5f178050514a", + "result": "valid" + }, + { + "tcId": 500, + "comment": "special case for z_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "f21f9badd98dd8a103cc2ab5484fac6c2bfdd2671ee6e674134a86b89cee9160", + "private": "d830f3c4785829a0f945857e0e85e0ae723702b57783b933cd2a2ad05484fe49", + "shared": "fee218eb1f92864486e83c1731f04bb8c7e6d7143e3915bcbf80fe03ff69dc77", + "result": "valid" + }, + { + "tcId": 501, + "comment": "special case for E in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "e853062b2d6f38d021d645163ea208d0e193a479f11f99971b98e21188fd0b2c", + "private": "10230bd0721f4c8c4b921881dd88c603af501ee80e2102f8acc30cf8b2acd349", + "shared": "64bdfa0207a174ca17eeba8df74d79b25f54510e6174923034a4d6ee0c167e7b", + "result": "acceptable" + }, + { + "tcId": 502, + "comment": "special case for E in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "362eb92dab9fb29f7ed0e03843dcc15797928c2b4e51ec260204179c1c12945f", + "private": "f0a34d6d76896e17cb8f66feda23115ffb96f246b823bb63dec08335787de74c", + "shared": "d7f4583ee4fe86af3a3f1dfcb295ba3a3e37bced7b9c6f000a95336530318902", + "result": "valid" + }, + { + "tcId": 503, + "comment": "special case for E in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "ff543f1e81996e88631f030ceba7e603b13033efd205e68bd36b28468134aa73", + "private": "9073c1d0a173c7ff02dc966a165993d9c4c9357514f7a6bb7aaa4b0827718948", + "shared": "c1b5e5f4401c98fa14eba8aafae30a641bfd8fb132be03413f3bf29290d49e0b", + "result": "acceptable" + }, + { + "tcId": 504, + "comment": "special case for x_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "90ef70844ead1613f69df7d78c057813f866c0d95e6d22caee4a012b9c1c4b33", + "private": "b0c1822566e016c12ae35ec035edd09af3cb7a48f55c9028e05e1178a8c3824e", + "shared": "9369ebb3d2b744341cba77302719a4b2d63aff612872f86d9877a76bc919ca1c", + "result": "valid" + }, + { + "tcId": 505, + "comment": "special case for x_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "88c1ae575ad073dda66c6eacb7b7f436e1f8ad72a0db5c04e5660b7b719e4c4b", + "private": "e06fe64e2117796f997bbcd3bcad3067cf1291640a3a643fb359809a4016834d", + "shared": "335394be9c154901c0b4063300001804b1cd01b27fa562e44f3302168837166e", + "result": "acceptable" + }, + { + "tcId": 506, + "comment": "special case for x_2 in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication", + "Twist" + ], + "public": "dcffc4c1e1fba5fda9d5c98421d99c257afa90921bc212a046d90f6683e8a467", + "private": "707ee81f113a244c9d87608b12158c50f9ac1f2c8948d170ad16ab0ad866d74b", + "shared": "7ecdd54c5e15f7b4061be2c30b5a4884a0256581f87df60d579a3345653eb641", + "result": "acceptable" + }, + { + "tcId": 507, + "comment": "special case for BB in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "6c0044cd10578c5aff1ff4917b041b76c9a9ae23664eb8cf978bd7aa192cf249", + "private": "7089654baacbb65bd00cd8cb9de4680e748075e8842ca69d448fb50fea85e74e", + "shared": "0d8c21fa800ee63ce5e473d4c2975495062d8afa655091122cb41799d374594f", + "result": "valid" + }, + { + "tcId": 508, + "comment": "special case for BB in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "d9089de902e143dcd9107e5a3393a3f7fe05d926c357b47e307a236cb590fd64", + "private": "8089784c52cd67e4536e568218c7b7033b28413f942fca24ed69e43496efa14b", + "shared": "db6fec44bf118316a6bdfbae9af447baede4d82daa16bed596ea6f05d4a51400", + "result": "valid" + }, + { + "tcId": 509, + "comment": "special case for BB in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "8c4a26aa319c2cc4a4158c2bc69a0d5b340b60628a14cf31bb0ae5ddc38ae866", + "private": "00e73e4e013148b9f05273bad626bb126a40ec4558f5425096b48947e0a9de4a", + "shared": "ecc1204bc753c4cec4c9059fd7b504944ebf995ab1b1d49f0b3b325353be3a15", + "result": "valid" + }, + { + "tcId": 510, + "comment": "special case for BB in multiplication by 9", + "flags": [ + "EdgeCaseMultiplication" + ], + "public": "ce7295d1227c9062aab9cf02fc5671fb81632e725367f131d4122824a6132d68", + "private": "78ed4c9bf9f44db8d93388985191ecf59226b9c1205fe7e762c327581c75884e", + "shared": "3740de297ff0122067951e8985247123440e0f27171da99e263d5b4450f59f3d", + "result": "valid" + }, + { + "tcId": 511, + "comment": "private key == -1 (mod order)", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "6c05871352a451dbe182ed5e6ba554f2034456ffe041a054ff9cc56b8e946376", + "private": "a023cdd083ef5bb82f10d62e59e15a6800000000000000000000000000000050", + "shared": "6c05871352a451dbe182ed5e6ba554f2034456ffe041a054ff9cc56b8e946376", + "result": "valid" + }, + { + "tcId": 512, + "comment": "private key == 1 (mod order) on twist", + "flags": [ + "Twist" + ], + "public": "2eae5ec3dd494e9f2d37d258f873a8e6e9d0dbd1e383ef64d98bb91b3e0be035", + "private": "58083dd261ad91eff952322ec824c682ffffffffffffffffffffffffffffff5f", + "shared": "2eae5ec3dd494e9f2d37d258f873a8e6e9d0dbd1e383ef64d98bb91b3e0be035", + "result": "acceptable" + }, + { + "tcId": 513, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "3e3e7708ef72a6dd78d858025089765b1c30a19715ac19e8d917067d208e0666", + "private": "4855555555555555555555555555555555555555555555555555555555555555", + "shared": "63ef7d1c586476ec78bb7f747e321e01102166bf967a9ea9ba9741f49d439510", + "result": "valid" + }, + { + "tcId": 514, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "9f40bb30f68ab67b1c4b8b664982fdab04ff385cd850deac732f7fb705e6013a", + "private": "4855555555555555555555555555555555555555555555555555555555555555", + "shared": "8b98ef4d6bf30df7f88e58d51505d37ed6845a969fe598747c033dcd08014065", + "result": "valid" + }, + { + "tcId": 515, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "be3b3edeffaf83c54ae526379b23dd79f1cb41446e3687fef347eb9b5f0dc308", + "private": "4855555555555555555555555555555555555555555555555555555555555555", + "shared": "cfa83e098829fe82fd4c14355f70829015219942c01e2b85bdd9ac4889ec2921", + "result": "valid" + }, + { + "tcId": 516, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "3e3e7708ef72a6dd78d858025089765b1c30a19715ac19e8d917067d208e0666", + "private": "b8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6a", + "shared": "4782036d6b136ca44a2fd7674d8afb0169943230ac8eab5160a212376c06d778", + "result": "valid" + }, + { + "tcId": 517, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "9f40bb30f68ab67b1c4b8b664982fdab04ff385cd850deac732f7fb705e6013a", + "private": "b8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6a", + "shared": "65fc1e7453a3f8c7ebcd577ade4b8efe1035efc181ab3bdb2fcc7484cbcf1e4e", + "result": "valid" + }, + { + "tcId": 518, + "comment": "special case private key", + "flags": [ + "EdgeCasePrivateKey" + ], + "public": "be3b3edeffaf83c54ae526379b23dd79f1cb41446e3687fef347eb9b5f0dc308", + "private": "b8aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa6a", + "shared": "e3c649beae7cc4a0698d519a0a61932ee5493cbb590dbe14db0274cc8611f914", + "result": "valid" + } + ] + } + ] +} diff --git a/tests/Titanium.Tls.Tests/HandshakeCodecTests.cs b/tests/Titanium.Tls.Tests/HandshakeCodecTests.cs new file mode 100644 index 000000000..e74081010 --- /dev/null +++ b/tests/Titanium.Tls.Tests/HandshakeCodecTests.cs @@ -0,0 +1,539 @@ +using System; +using System.Buffers; +using System.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class HandshakeCodecTests +{ + [TestMethod] + public void ReaderAndWriterRoundTripBackPatchedLengths() + { + byte[] buffer = new byte[32]; + TlsWriter writer = TlsWriter.Over(buffer); + Assert.IsTrue(writer.TryWriteUInt8(0x16)); + Assert.IsTrue(writer.TryReserveLength(3, out int at)); + Assert.IsTrue(writer.TryWriteUInt16(0x0303)); + Assert.IsTrue(writer.TryWriteVector8([0x01, 0x02])); + Assert.IsTrue(writer.TryPatchLength(at, 3)); + ArrayBufferWriter flushed = new(); + Assert.IsTrue(writer.TryFlush(flushed)); + TlsReader reader = new(flushed.WrittenSpan); + Assert.IsTrue(reader.TryReadUInt8(out byte kind) && kind == 0x16); + Assert.IsTrue(reader.TryReadUInt24(out int length) && length == 5); + Assert.IsTrue(reader.TryReadUInt16(out ushort version) && version == 0x0303); + Assert.IsTrue(reader.TryReadVector8(out ReadOnlySpan body) && body.SequenceEqual(new byte[] { 0x01, 0x02 })); + Assert.AreEqual(0, reader.Remaining); + } + + [TestMethod] + public void EveryHandshakeMessageRoundTrips() + { + AssertRoundTrip(BuildClientHello(includeExtensions: true), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadClientHello(message, out ClientHelloView view, out _)); + Assert.IsTrue(view.TryWrite(copy, out int written)); + return written; + }); + AssertRoundTrip(BuildServerHello(helloRetry: false), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadServerHello(message, out ServerHelloView view, out _)); + Assert.IsFalse(view.IsHelloRetryRequest); + Assert.IsTrue(view.TryWrite(copy, out int written)); + return written; + }); + AssertRoundTrip(BuildServerHello(helloRetry: true), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadServerHello(message, out ServerHelloView view, out _)); + Assert.IsTrue(view.IsHelloRetryRequest); + Assert.IsTrue(view.TryWrite(copy, out int written)); + return written; + }); + byte[] extensions = [0x00, 0x10, 0x00, 0x00]; + AssertRoundTrip(BuildSingleVector(HandshakeType.EncryptedExtensions, 2, extensions), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadEncryptedExtensions(message, out ReadOnlySpan parsed, out _)); + Assert.IsTrue(HandshakeMessages.TryWriteEncryptedExtensions(copy, parsed, out int written)); + return written; + }); + AssertRoundTrip(BuildCertificate(), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadCertificate(message, out CertificateView view, out _)); + Assert.IsTrue(view.TryWrite(copy, out int written)); + return written; + }); + Assert.IsTrue(HandshakeMessages.TryReadCertificateRequest(BuildCertificateRequest(), out _, out _, out HandshakeAlert requestAlert)); + Assert.AreEqual(default, requestAlert); + Assert.IsTrue(HandshakeMessages.TryReadCertificateVerify(BuildCertificateVerify(), out ushort scheme, out ReadOnlySpan signature, out _)); + Assert.AreEqual(0x0807, scheme); + Assert.AreEqual(2, signature.Length); + Assert.IsTrue(HandshakeMessages.TryReadFinished(BuildFinished(32), out ReadOnlySpan finished, out _)); + Assert.AreEqual(32, finished.Length); + Assert.IsTrue(HandshakeMessages.TryReadNewSessionTicket(BuildTicket(), out _, out _, out _, out ReadOnlySpan ticket, out _, out _)); + Assert.AreEqual(1, ticket.Length); + Assert.IsTrue(HandshakeMessages.TryReadKeyUpdate(BuildKeyUpdate(1), out byte request, out _)); + Assert.AreEqual(1, request); + Assert.IsTrue(HandshakeMessages.TryReadEndOfEarlyData(BuildEndOfEarlyData(), out _)); + Assert.IsTrue(HandshakeMessages.TryReadCompressedCertificate(BuildCompressedCertificate(), out ushort algorithm, out int uncompressed, out _, out _)); + Assert.AreEqual(1, algorithm); + Assert.AreEqual(4, uncompressed); + Assert.IsTrue(HandshakeMessages.TryReadMessageHash(BuildMessageHash(), out ReadOnlySpan hash, out _)); + Assert.AreEqual(32, hash.Length); + } + + [TestMethod] + public void Rfc8448ServerFlightYieldsTheExpectedTypes() + { + byte[] flight = HexVectors.Parse(File.ReadAllText(FindFixture("rfc8448-server-handshake.hex"))); + HandshakeReassembler reassembler = new(); + Assert.IsTrue(reassembler.TryAppend(flight, out _)); + byte[] body = new byte[flight.Length]; + byte[] message = new byte[flight.Length]; + HandshakeType[] expected = [HandshakeType.EncryptedExtensions, HandshakeType.Certificate, HandshakeType.CertificateVerify, HandshakeType.Finished]; + for (int i = 0; i < expected.Length; i++) + { + Assert.IsTrue(reassembler.TryTake(body, out HandshakeType type, out int length, out bool needMore, out HandshakeAlert alert), expected[i].ToString()); + Assert.IsFalse(needMore); + Assert.AreEqual(default, alert); + Assert.AreEqual(expected[i], type); + message[0] = (byte)type; + message[1] = (byte)(length >> 16); + message[2] = (byte)(length >> 8); + message[3] = (byte)length; + body.AsSpan(0, length).CopyTo(message.AsSpan(4)); + ReadOnlySpan framed = message.AsSpan(0, length + 4); + bool read = Reads(type, framed, out HandshakeAlert readAlert); + Assert.IsTrue(read, type + " " + readAlert + " " + Convert.ToHexString(framed)); + } + } + + [TestMethod] + public void ChromeClientHelloParsesAndReserializes() + { + string path = FindFixture(Path.Combine("captures", "chrome", "158.0.8127.89", "tcp", "hello-001.bin")); + byte[] record = File.ReadAllBytes(path); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(record, out ReadOnlySpan payload, out bool incomplete, out HandshakeAlert alert)); + Assert.IsFalse(incomplete); + Assert.AreEqual(default, alert); + Assert.IsTrue(HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out alert), alert.ToString()); + Assert.IsTrue(ContainsExtension(hello.Extensions, ExtensionType.KeyShare)); + Assert.IsTrue(ContainsExtension(hello.Extensions, ExtensionType.EncryptedClientHello)); + byte[] copy = new byte[payload.Length]; + Assert.IsTrue(hello.TryWrite(copy, out int written)); + Assert.IsTrue(payload.SequenceEqual(copy.AsSpan(0, written))); + } + + [TestMethod] + public void MultiByteLengthsRoundTrip() + { + byte[] buffer = new byte[16]; + TlsWriter writer = TlsWriter.Over(buffer); + Assert.IsTrue(writer.TryWriteUInt24(0x010203)); + Assert.IsTrue(writer.TryWriteUInt32(0x01020304)); + Assert.IsTrue(buffer.AsSpan(0, 7).SequenceEqual(new byte[] { 0x01, 0x02, 0x03, 0x01, 0x02, 0x03, 0x04 })); + + TlsReader reader = new(new byte[] { 0x01, 0x02, 0x03, 0x04 }); + Assert.IsTrue(reader.TryReadUInt32(out uint value)); + Assert.AreEqual(0x01020304u, value); + + byte[] framed = new byte[4 + 0x010203]; + framed[0] = (byte)HandshakeType.Certificate; + framed[1] = 0x01; + framed[2] = 0x02; + framed[3] = 0x03; + framed[4] = 0xAB; + Assert.IsTrue(HandshakeFraming.TryReadHeader(framed, out HandshakeType type, out int headerLength)); + Assert.AreEqual(HandshakeType.Certificate, type); + Assert.AreEqual(0x010203, headerLength); + HandshakeReassembler reassembler = new(); + Assert.IsTrue(reassembler.TryAppend(framed, out HandshakeAlert alert)); + Assert.AreEqual(default, alert); + byte[] body = new byte[0x010203]; + Assert.IsTrue(reassembler.TryTake(body, out type, out int bodyLength, out bool needMore, out alert)); + Assert.IsFalse(needMore); + Assert.AreEqual(default, alert); + Assert.AreEqual(HandshakeType.Certificate, type); + Assert.AreEqual(0x010203, bodyLength); + Assert.AreEqual(0xAB, body[0]); + } + + [TestMethod] + public void LengthAtTheCapIsDistinctFromOnePastIt() + { + int maxRecord = TlsRecordProtector.MaxCiphertext; + byte[] record = new byte[5]; + record[0] = 22; + record[1] = 3; + record[2] = 3; + record[3] = (byte)(maxRecord >> 8); + record[4] = (byte)maxRecord; + Assert.IsFalse(HandshakeFraming.TryUnwrapHandshakeRecord(record, out _, out bool incomplete, out HandshakeAlert alert)); + Assert.IsTrue(incomplete); + Assert.AreEqual(default, alert); + + int over = HandshakeFraming.DefaultMaxMessageBytes + 256; + byte[] header = + [ + (byte)HandshakeType.Certificate, + (byte)(over >> 16), + (byte)(over >> 8), + (byte)over, + ]; + HandshakeReassembler reassembler = new(); + Assert.IsFalse(reassembler.TryAppend(header, out alert)); + Assert.AreEqual(HandshakeAlert.DecodeError, alert); + } + + [TestMethod] + public void ClientHelloCorpusDoesNotThrow() + { + string directory = FindFixture(Path.Combine("..", "..", "fuzz", "corpus", "client-hello")); + foreach (string file in Directory.GetFiles(directory, "*.hex")) + { + byte[] record = HexVectors.Parse(File.ReadAllText(file)); + bool unwrapped = HandshakeFraming.TryUnwrapHandshakeRecord(record, out ReadOnlySpan payload, out bool incomplete, out HandshakeAlert alert); + string name = Path.GetFileName(file); + if (name.StartsWith("not-tls", StringComparison.Ordinal) || name.StartsWith("record-length", StringComparison.Ordinal)) + { + Assert.IsFalse(unwrapped, name); + Assert.IsFalse(incomplete, name); + continue; + } + + if (name.StartsWith("truncated", StringComparison.Ordinal)) + { + Assert.IsFalse(unwrapped, name); + Assert.IsTrue(incomplete, name); + continue; + } + + Assert.IsTrue(unwrapped, name + " " + alert); + bool parsed = HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out alert); + if (name is "extensions-length-overflow.hex" or "session-id-length-overflow.hex" or "handshake-length-huge.hex" or "handshake-length-zero.hex") + { + Assert.IsFalse(parsed, name); + } + else if (name == "sni-valid.hex") + { + Assert.IsTrue(parsed, alert.ToString()); + Assert.IsTrue(TryHost(hello.Extensions, out ReadOnlySpan host)); + Assert.IsTrue(host.SequenceEqual("a.example"u8)); + } + else if (name == "no-extensions.hex") + { + Assert.IsTrue(parsed, alert.ToString()); + Assert.IsFalse(hello.HasExtensions); + } + else + { + _ = parsed; + } + } + } + + [TestMethod] + public void NegativeCodecCasesFailWithTheMappedAlert() + { + Assert.IsFalse(HandshakeMessages.TryReadClientHello(BuildDuplicateExtension(), out _, out HandshakeAlert duplicate)); + Assert.AreEqual(HandshakeAlert.IllegalParameter, duplicate); + Assert.IsFalse(HandshakeMessages.TryReadClientHello(BuildPreSharedKeyNotLast(), out _, out HandshakeAlert order)); + Assert.AreEqual(HandshakeAlert.IllegalParameter, order); + Assert.IsFalse(HandshakeMessages.TryReadClientHello(BuildEmptyCipherVector(), out _, out HandshakeAlert empty)); + Assert.AreEqual(HandshakeAlert.DecodeError, empty); + Assert.IsFalse(HandshakeMessages.TryReadClientHello(PatchExtensions(BuildClientHello(includeExtensions: false), [0x00, 0x30, 0x00, 0x00]), out _, out HandshakeAlert oidFilters)); + Assert.AreEqual(HandshakeAlert.IllegalParameter, oidFilters); + AssertRoundTrip(PatchExtensions(BuildClientHello(includeExtensions: false), []), static (message, copy) => + { + Assert.IsTrue(HandshakeMessages.TryReadClientHello(message, out ClientHelloView view, out _)); + Assert.IsTrue(view.HasExtensions); + Assert.AreEqual(0, view.Extensions.Length); + Assert.IsTrue(view.TryWrite(copy, out int written)); + return written; + }); + Assert.IsFalse(HandshakeMessages.TryReadClientHello(BuildClientHello(includeExtensions: true)[..10], out _, out HandshakeAlert mismatch)); + Assert.AreEqual(HandshakeAlert.DecodeError, mismatch); + HandshakeReassembler reassembler = new(); + byte[] hello = BuildClientHello(includeExtensions: false); + Assert.IsTrue(reassembler.TryAppend(hello.AsSpan(0, 6), out _)); + byte[] body = new byte[64]; + Assert.IsTrue(reassembler.TryTake(body, out _, out _, out bool needMore, out _)); + Assert.IsTrue(needMore); + Assert.IsTrue(reassembler.TryAppend(hello.AsSpan(6), out _)); + Assert.IsTrue(reassembler.TryTake(body, out HandshakeType type, out int length, out needMore, out _)); + Assert.IsFalse(needMore); + Assert.AreEqual(HandshakeType.ClientHello, type); + Assert.AreEqual(hello.Length - 4, length); + } + + [TestMethod] + public void ClientHelloParseAllocatesNothing() + { + byte[] hello = BuildClientHello(includeExtensions: true); + AllocationGate.AssertNone(() => + { + Assert.IsTrue(HandshakeMessages.TryReadClientHello(hello, out _, out _)); + }); + } + + private static bool Reads(HandshakeType type, ReadOnlySpan message, out HandshakeAlert alert) + { + if (type == HandshakeType.EncryptedExtensions) + { + return HandshakeMessages.TryReadEncryptedExtensions(message, out _, out alert); + } + + if (type == HandshakeType.Certificate) + { + return HandshakeMessages.TryReadCertificate(message, out _, out alert); + } + + if (type == HandshakeType.CertificateVerify) + { + return HandshakeMessages.TryReadCertificateVerify(message, out _, out _, out alert); + } + + if (type == HandshakeType.Finished) + { + return HandshakeMessages.TryReadFinished(message, out _, out alert); + } + + alert = default; + return false; + } + + private static bool ContainsExtension(ReadOnlySpan extensions, ushort type) + { + TlsReader reader = new(extensions); + while (reader.TryReadUInt16(out ushort found) && reader.TryReadVector16(out _)) + { + if (found == type) + { + return true; + } + } + + return false; + } + + private static bool TryHost(ReadOnlySpan extensions, out ReadOnlySpan host) + { + host = default; + TlsReader reader = new(extensions); + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (type == ExtensionType.ServerName && HandshakeMessages.TryReadHostName(body, out host)) + { + return true; + } + } + + return false; + } + + private static void AssertRoundTrip(byte[] message, Func, Span, int> rewrite) + { + byte[] copy = new byte[message.Length]; + int written = rewrite(message, copy); + Assert.IsTrue(message.AsSpan().SequenceEqual(copy.AsSpan(0, written))); + } + + private static byte[] BuildClientHello(bool includeExtensions) + { + byte[] buffer = new byte[128]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.ClientHello); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt16(0x0303); + writer.TryWrite(new byte[32]); + writer.TryWriteVector8([]); + writer.TryWriteVector16([0x13, 0x01]); + writer.TryWriteVector8([0x00]); + if (includeExtensions) + { + writer.TryWriteVector16([0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x00, 0x00, 0x00]); + } + + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildEmptyCipherVector() + { + byte[] buffer = new byte[64]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.ClientHello); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt16(0x0303); + writer.TryWrite(new byte[32]); + writer.TryWriteVector8([]); + writer.TryWriteVector16([]); + writer.TryWriteVector8([0x00]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildServerHello(bool helloRetry) + { + byte[] random = new byte[32]; + if (helloRetry) + { + random = Convert.FromHexString("CF21AD74E59A6111BE1D8C021E65B891C2A211167ABB8C5E079E09E2C8A8339C"); + } + + byte[] buffer = new byte[128]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.ServerHello); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt16(0x0303); + writer.TryWrite(random); + writer.TryWriteVector8([]); + writer.TryWriteUInt16(0x1301); + writer.TryWriteUInt8(0); + writer.TryWriteVector16([0x00, 0x2b, 0x00, 0x02, 0x03, 0x04]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildCertificate() + { + byte[] buffer = new byte[32]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.Certificate); + writer.TryReserveLength(3, out int at); + writer.TryWriteVector8([]); + writer.TryWriteVector24([0x00, 0x00, 0x01, 0x30, 0x00, 0x00]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildCertificateRequest() + { + return BuildSingleVector(HandshakeType.CertificateRequest, 1, [0x00, 0x0d, 0x00, 0x00]); + } + + private static byte[] BuildCertificateVerify() + { + byte[] buffer = new byte[16]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.CertificateVerify); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt16(0x0807); + writer.TryWriteVector16([0xaa, 0xbb]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildFinished(int size) + { + byte[] buffer = new byte[size + 4]; + buffer[0] = (byte)HandshakeType.Finished; + buffer[3] = (byte)size; + return buffer; + } + + private static byte[] BuildTicket() + { + byte[] buffer = new byte[32]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.NewSessionTicket); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt32(1); + writer.TryWriteUInt32(2); + writer.TryWriteVector8([]); + writer.TryWriteVector16([0xaa]); + writer.TryWriteVector16([]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildKeyUpdate(byte request) + { + return [(byte)HandshakeType.KeyUpdate, 0, 0, 1, request]; + } + + private static byte[] BuildEndOfEarlyData() + { + return [(byte)HandshakeType.EndOfEarlyData, 0, 0, 0]; + } + + private static byte[] BuildCompressedCertificate() + { + byte[] buffer = new byte[16]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)HandshakeType.CompressedCertificate); + writer.TryReserveLength(3, out int at); + writer.TryWriteUInt16(1); + writer.TryWriteUInt24(4); + writer.TryWriteVector24([0x01]); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildMessageHash() + { + byte[] buffer = new byte[36]; + buffer[0] = (byte)HandshakeType.MessageHash; + buffer[3] = 32; + return buffer; + } + + private static byte[] BuildSingleVector(HandshakeType type, int width, byte[] body) + { + byte[] buffer = new byte[body.Length + 8]; + TlsWriter writer = TlsWriter.Over(buffer); + writer.TryWriteUInt8((byte)type); + writer.TryReserveLength(3, out int at); + if (width == 1) + { + writer.TryWriteVector8([]); + } + + writer.TryWriteVector16(body); + writer.TryPatchLength(at, 3); + return buffer[..writer.Written]; + } + + private static byte[] BuildDuplicateExtension() + { + return PatchExtensions(BuildClientHello(includeExtensions: false), [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]); + } + + private static byte[] BuildPreSharedKeyNotLast() + { + return PatchExtensions(BuildClientHello(includeExtensions: false), [0x00, 0x29, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00]); + } + + private static byte[] PatchExtensions(byte[] bareHello, byte[] extensions) + { + byte[] buffer = new byte[bareHello.Length + extensions.Length + 2]; + bareHello.AsSpan(0, bareHello.Length).CopyTo(buffer); + int body = ((buffer[1] << 16) | (buffer[2] << 8) | buffer[3]) + 2 + extensions.Length; + buffer[1] = (byte)(body >> 16); + buffer[2] = (byte)(body >> 8); + buffer[3] = (byte)body; + buffer[bareHello.Length] = (byte)(extensions.Length >> 8); + buffer[bareHello.Length + 1] = (byte)extensions.Length; + extensions.CopyTo(buffer.AsSpan(bareHello.Length + 2)); + return buffer[..(bareHello.Length + 2 + extensions.Length)]; + } + + private static string FindFixture(string name) + { + DirectoryInfo? directory = new(AppContext.BaseDirectory); + while (directory is not null) + { + string candidate = Path.Combine(directory.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", name); + if (File.Exists(candidate) || Directory.Exists(candidate)) + { + return candidate; + } + + directory = directory.Parent; + } + + throw new FileNotFoundException(name); + } +} diff --git a/tests/Titanium.Tls.Tests/HandshakeOracleTests.cs b/tests/Titanium.Tls.Tests/HandshakeOracleTests.cs new file mode 100644 index 000000000..ad6954e6e --- /dev/null +++ b/tests/Titanium.Tls.Tests/HandshakeOracleTests.cs @@ -0,0 +1,297 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +[DoNotParallelize] +public sealed class HandshakeOracleTests +{ + [TestMethod] + [Timeout(120000)] + public void MutatedClientHelloAgreesWithOpenSsl() + { + if (!OpenSslOracle.Require(new Version(3, 5))) + { + Assert.Inconclusive("OpenSSL 3.5 or newer was not found."); + } + + string openssl = OpenSslOracle.Find() ?? throw new InvalidOperationException("OpenSSL was not found."); + string directory = Path.Combine(Path.GetTempPath(), "twp-oracle-" + Guid.NewGuid().ToString("n")); + Directory.CreateDirectory(directory); + string certificate = Path.Combine(directory, "server.pem"); + string key = Path.Combine(directory, "server.key"); + WriteCertificate(certificate, key); + byte[] hello = ClientHello(); + (string Name, byte[] Bytes)[] rows = + [ + ("intact", hello), + ("truncated", hello[..8]), + ("empty-record", EmptyRecord()), + ("thirty-three-empty-records", Repeat(EmptyRecord(), 33)), + ("handshake-type", Change(hello, 5, 11)), + ("tls12-only", Versions(hello, 0x03, 0x03)), + ("duplicate-extension", DuplicateFirstExtension(hello)), + ("extension-length", StretchExtension(hello)), + ]; + var mismatches = new StringBuilder(); + try + { + foreach ((string name, byte[] bytes) in rows) + { + byte managed = ProbeManaged(bytes); + byte peer = ProbeOpenSsl(openssl, certificate, key, bytes); + if (managed != peer) + { + mismatches.Append(name).Append(" managed=").Append(managed).Append(" openssl=").Append(peer).AppendLine(); + } + } + } + finally + { + try + { + Directory.Delete(directory, recursive: true); + } + catch (IOException) + { + } + } + + if (mismatches.Length > 0) + { + Assert.Fail(mismatches.ToString()); + } + } + + private static byte ProbeManaged(byte[] hello) + { + using var engine = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + engine.Advance(hello, out _, output); + return engine.State == TlsEngineState.Closed ? engine.LastLocalAlert : (byte)0; + } + + private static byte ProbeOpenSsl(string openssl, string certificate, string key, byte[] hello) + { + int port = FreePort(); + var start = new ProcessStartInfo + { + FileName = openssl, + Arguments = "s_server -tls1_3 -quiet -num_tickets 0 -naccept 1 -accept 127.0.0.1:" + port + " -cert \"" + certificate + "\" -key \"" + key + "\"", + UseShellExecute = false, + RedirectStandardInput = true, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + }; + using Process process = Process.Start(start) ?? throw new InvalidOperationException("OpenSSL did not start."); + try + { + using var tcp = new TcpClient(); + Connect(tcp, port, process); + NetworkStream stream = tcp.GetStream(); + stream.Write(hello); + stream.Flush(); + var header = new byte[5]; + int read = Read(stream, header, 2000, out bool timedOut); + if (read < 5) + { + return timedOut && !process.HasExited ? (byte)0 : (byte)0xFE; + } + + if (header[0] == 21) + { + var body = new byte[2]; + if (Read(stream, body, 2000, out _) < 2) + { + return 0xFE; + } + + return body[1]; + } + + return header[0] == 22 ? (byte)0 : (byte)0xFD; + } + finally + { + if (!process.HasExited) + { + process.Kill(entireProcessTree: true); + process.WaitForExit(2000); + } + } + } + + private static byte[] ClientHello() + { + using var engine = new TlsEngine(TlsRole.Client, serverName: "localhost"); + var output = new TlsOutput(); + engine.Advance(ReadOnlySpan.Empty, out _, output); + return output.Bytes.ToArray(); + } + + private static byte[] EmptyRecord() => [23, 3, 3, 0, 0]; + + private static byte[] Repeat(byte[] unit, int count) + { + var buffer = new byte[unit.Length * count]; + for (int i = 0; i < count; i++) + { + unit.CopyTo(buffer.AsSpan(i * unit.Length)); + } + + return buffer; + } + + private static byte[] Change(byte[] source, int index, byte value) + { + byte[] copy = [.. source]; + copy[index] = value; + return copy; + } + + private static byte[] Versions(byte[] source, byte major, byte minor) + { + byte[] copy = [.. source]; + int found = copy.AsSpan().IndexOf(new byte[] { 0x00, 0x2b, 0x00, 0x03, 0x02, 0x03, 0x04 }); + if (found < 0) + { + throw new InvalidOperationException("The hello has no supported_versions extension."); + } + + copy[found + 5] = major; + copy[found + 6] = minor; + return copy; + } + + private static byte[] DuplicateFirstExtension(byte[] record) + { + int cursor = 5 + 4 + 2 + 32; + cursor += 1 + record[cursor]; + int cipherLength = (record[cursor] << 8) | record[cursor + 1]; + cursor += 2 + cipherLength; + cursor += 1 + record[cursor]; + int extensionsAt = cursor; + int extensionLength = (record[cursor] << 8) | record[cursor + 1]; + int start = cursor + 2; + int firstLength = (record[start + 2] << 8) | record[start + 3]; + int first = 4 + firstLength; + var copy = new byte[record.Length + first]; + record.AsSpan(0, start + extensionLength).CopyTo(copy); + record.AsSpan(start, first).CopyTo(copy.AsSpan(start + extensionLength)); + record.AsSpan(start + extensionLength).CopyTo(copy.AsSpan(start + extensionLength + first)); + Add16(copy, 3, first); + Add24(copy, 6, first); + Add16(copy, extensionsAt, first); + return copy; + } + + private static byte[] StretchExtension(byte[] record) + { + byte[] copy = [.. record]; + int cursor = 5 + 4 + 2 + 32; + cursor += 1 + copy[cursor]; + int cipherLength = (copy[cursor] << 8) | copy[cursor + 1]; + cursor += 2 + cipherLength; + cursor += 1 + copy[cursor]; + int start = cursor + 2; + copy[start + 2] = 0x7F; + copy[start + 3] = 0xFF; + return copy; + } + + private static void Add16(byte[] buffer, int offset, int extra) + { + int value = ((buffer[offset] << 8) | buffer[offset + 1]) + extra; + buffer[offset] = (byte)(value >> 8); + buffer[offset + 1] = (byte)value; + } + + private static void Add24(byte[] buffer, int offset, int extra) + { + int value = (buffer[offset] << 16) | (buffer[offset + 1] << 8) | buffer[offset + 2]; + value += extra; + buffer[offset] = (byte)(value >> 16); + buffer[offset + 1] = (byte)(value >> 8); + buffer[offset + 2] = (byte)value; + } + + private static void Connect(TcpClient tcp, int port, Process process) + { + for (int attempt = 0; attempt < 50; attempt++) + { + if (process.HasExited) + { + throw new InvalidOperationException(process.StandardError.ReadToEnd()); + } + + try + { + tcp.Connect(IPAddress.Loopback, port); + return; + } + catch (SocketException) + { + Thread.Sleep(50); + } + } + + throw new TimeoutException(process.StandardError.ReadToEnd()); + } + + private static int Read(NetworkStream stream, byte[] buffer, int timeoutMilliseconds, out bool timedOut) + { + stream.ReadTimeout = timeoutMilliseconds; + timedOut = false; + int offset = 0; + try + { + while (offset < buffer.Length) + { + int read = stream.Read(buffer, offset, buffer.Length - offset); + if (read == 0) + { + break; + } + + offset += read; + } + } + catch (IOException ex) when (ex.InnerException is SocketException socket && socket.SocketErrorCode == SocketError.TimedOut) + { + timedOut = true; + } + catch (IOException) + { + } + + return offset; + } + + private static int FreePort() + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + return ((IPEndPoint)listener.LocalEndpoint).Port; + } + + private static void WriteCertificate(string certificatePath, string keyPath) + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(2)); + File.WriteAllText(certificatePath, new string(PemEncoding.Write("CERTIFICATE", created.RawData))); + File.WriteAllText(keyPath, new string(PemEncoding.Write("PRIVATE KEY", key.ExportPkcs8PrivateKey()))); + } +} diff --git a/tests/Titanium.Tls.Tests/HarnessTests.cs b/tests/Titanium.Tls.Tests/HarnessTests.cs new file mode 100644 index 000000000..20560b7ac --- /dev/null +++ b/tests/Titanium.Tls.Tests/HarnessTests.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class HarnessTests +{ + [TestMethod] + public void OpenSslOnThisMachineReportsAtLeast35() + { + if (!OpenSslOracle.Require(new Version(3, 5))) + { + Assert.Inconclusive("OpenSSL 3.5 or later was not found."); + } + } + + [TestMethod] + public void FixedEntropyReturnsScriptedBytesAndThenFails() + { + FixedEntropy entropy = new(new byte[] { 1, 2, 3, 4 }); + byte[] first = new byte[2]; + entropy.Fill(first); + CollectionAssert.AreEqual(new byte[] { 1, 2 }, first); + Assert.ThrowsException(() => entropy.Fill(new byte[3])); + } + + [TestMethod] + public void PublicTypeNamesDoNotCollideWithTheBcl() + { + HashSet bcl = new(StringComparer.Ordinal); + foreach (string assemblyName in new[] { "System.Net.Security", "System.Net.Quic", "System.Net.Sockets", "System.Security.Authentication" }) + { + Assembly assembly; + try + { + assembly = Assembly.Load(new AssemblyName(assemblyName)); + } + catch (FileNotFoundException) + { + continue; + } + + foreach (Type type in assembly.GetExportedTypes()) + { + bcl.Add(type.Name); + } + } + + foreach (Type type in typeof(AssemblyMarker).Assembly.GetExportedTypes()) + { + Assert.IsFalse(bcl.Contains(type.Name), type.FullName); + } + } + + [TestMethod] + public void TraceabilityRowsMatchTheTestsThatClaimThem() + { + string path = FindTraceability(); + var rows = new List(); + foreach (string line in File.ReadAllLines(path)) + { + if (!line.StartsWith('|')) + { + continue; + } + + string[] cells = line.Split('|', StringSplitOptions.TrimEntries); + if (cells.Length < 6 || cells[1] == "RFC" || cells[1].Contains("---", StringComparison.Ordinal)) + { + continue; + } + + rows.Add(cells[4]); + } + + var methods = new HashSet(StringComparer.Ordinal); + foreach (Type type in typeof(HarnessTests).Assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + methods.Add(type.Name + "." + method.Name); + } + } + + foreach (string testId in rows) + { + Assert.IsTrue(methods.Contains(testId), testId); + } + + foreach (Type type in typeof(HarnessTests).Assembly.GetTypes()) + { + foreach (MethodInfo method in type.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)) + { + foreach (RfcRequirementAttribute claim in method.GetCustomAttributes()) + { + Assert.IsTrue(rows.Contains(claim.Id), claim.Id); + } + } + } + } + + private static string FindTraceability() + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "src", "Titanium.Tls", "design", "TRACEABILITY.md"); + if (File.Exists(candidate)) + { + return candidate; + } + + dir = dir.Parent; + } + + Assert.Fail("TRACEABILITY.md was not found."); + return string.Empty; + } +} diff --git a/tests/Titanium.Tls.Tests/HexVectorTests.cs b/tests/Titanium.Tls.Tests/HexVectorTests.cs new file mode 100644 index 000000000..940117a3e --- /dev/null +++ b/tests/Titanium.Tls.Tests/HexVectorTests.cs @@ -0,0 +1,21 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public class HexVectorTests +{ + [TestMethod] + public void ParseSkipsWhitespaceCommentsAnd0xPrefixes() + { + byte[] bytes = HexVectors.Parse("0x0a 0B\n# ignored ff\ncc"); + CollectionAssert.AreEqual(new byte[] { 0x0a, 0x0b, 0xcc }, bytes); + } + + [TestMethod] + public void ParseRejectsAnOddNumberOfDigits() + { + Assert.ThrowsException(() => HexVectors.Parse("abc")); + } +} diff --git a/tests/Titanium.Tls.Tests/HkdfRfc8448Tests.cs b/tests/Titanium.Tls.Tests/HkdfRfc8448Tests.cs new file mode 100644 index 000000000..5dedb57cb --- /dev/null +++ b/tests/Titanium.Tls.Tests/HkdfRfc8448Tests.cs @@ -0,0 +1,135 @@ +using System; +using System.Security.Cryptography; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class HkdfRfc8448Tests +{ +// Generated from RFC 8448 sections 3 to 5. Do not edit by hand. +private static readonly (int Section, string Secret, string Label, string Context, string Output)[] Rfc8448ExpandLabels = +[ + (4, "005cb112fd8eb4ccc623bb88a07c64b3ede1605363fc7d0df8c7ce4ff0fb4ae6", "c hs traffic", "f736cb34fe25e701551bee6fd24c1cc7102a7daf9405cb15d97aafe16f757d03", "2faac08f851d35fea3604fcb4de82dc62c9b164a70974d0462e27f1ab278700f"), + (4, "005cb112fd8eb4ccc623bb88a07c64b3ede1605363fc7d0df8c7ce4ff0fb4ae6", "derived", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "e2f16030251df0874ba19b9aba257610bc6d531c1dd206df0ca6e84ae2a26742"), + (4, "005cb112fd8eb4ccc623bb88a07c64b3ede1605363fc7d0df8c7ce4ff0fb4ae6", "s hs traffic", "f736cb34fe25e701551bee6fd24c1cc7102a7daf9405cb15d97aafe16f757d03", "fe927ae271312e8bf0275b581c54eef020450dc4ecffaa05a1a35d27518e7803"), + (5, "1131545d0baf79ddce9b87f06945781a57dd18ef378dcd2060f8f9a569027ed8", "c ap traffic", "50f63cbf36b0dd049e7a0ba27d6455745ea2aaac54bb167f9950b2b7ce9509da", "75ecf4b972525aa0dcd057c9944d4cd5d82671d8843141d7dc2a4ff15a21dc51"), + (5, "1131545d0baf79ddce9b87f06945781a57dd18ef378dcd2060f8f9a569027ed8", "exp master", "50f63cbf36b0dd049e7a0ba27d6455745ea2aaac54bb167f9950b2b7ce9509da", "7c06d3ae106a3a374ace4837b3985cac67780a6e2c5c04b58319d584df09d223"), + (5, "1131545d0baf79ddce9b87f06945781a57dd18ef378dcd2060f8f9a569027ed8", "res master", "0e8b349158b855fdcd0c11dbbc4e83e43caa6e483c6c65df53151888e50165f4", "09170c6d472721566f9cf99b08699daff561ec8fb22d5a32c3f94ce009b69975"), + (5, "1131545d0baf79ddce9b87f06945781a57dd18ef378dcd2060f8f9a569027ed8", "s ap traffic", "50f63cbf36b0dd049e7a0ba27d6455745ea2aaac54bb167f9950b2b7ce9509da", "5c74f87df04225db0f8209c9de6429e49435fdefa7cad61864874d12f31cfc8d"), + (5, "158aa7ab8855073582b41d674b4055cabcc534728f659314861b4e08e2011566", "finished", "", "81be4131fbb9b6f4471450846f74fd1e68c5224ba7c2a8677f5c53ad226fdc13"), + (5, "158aa7ab8855073582b41d674b4055cabcc534728f659314861b4e08e2011566", "iv", "", "414d5485235e1a688793bd74"), + (5, "158aa7ab8855073582b41d674b4055cabcc534728f659314861b4e08e2011566", "key", "", "2f1f918663d590e7421149a29d94b0b6"), + (3, "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919", "c ap traffic", "9608102a0f1ccc6db6250b7b7e417b1a000eaada3daae4777a7686c9ff83df13", "9e40646ce79a7f9dc05af8889bce6552875afa0b06df0087f792ebb7c17504a5"), + (3, "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919", "exp master", "9608102a0f1ccc6db6250b7b7e417b1a000eaada3daae4777a7686c9ff83df13", "fe22f881176eda18eb8f44529e6792c50c9a3f89452f68d8ae311b4309d3cf50"), + (3, "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919", "res master", "209145a96ee8e2a122ff810047cc952684658d6049e86429426db87c54ad143d", "7df235f2031d2a051287d02b0241b0bfdaf86cc856231f2d5aba46c434ec196c"), + (3, "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919", "s ap traffic", "9608102a0f1ccc6db6250b7b7e417b1a000eaada3daae4777a7686c9ff83df13", "a11af9f05531f856ad47116b45a950328204b4f44bfb6b3a4b4f1f3fcb631643"), + (3, "1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac", "c hs traffic", "860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8", "b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21"), + (3, "1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac", "derived", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "43de77e0c77713859a944db9db2590b53190a65b3ee2e4f12dd7a0bb7ce254b4"), + (3, "1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac", "s hs traffic", "860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8", "b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38"), + (4, "2abbf2b8e381d23dbebe1dd2a7d16a8bf484cb4950d23fb7fb7fa8547062d9a1", "iv", "", "ab1aec26aa78b8fc1176b9ac"), + (4, "2abbf2b8e381d23dbebe1dd2a7d16a8bf484cb4950d23fb7fb7fa8547062d9a1", "key", "", "3cf122f301c6358ca7989553250efd72"), + (4, "2faac08f851d35fea3604fcb4de82dc62c9b164a70974d0462e27f1ab278700f", "finished", "", "5ace394c26980d581243f627d1150ae27e37fa52364e0a7f20ac686d09cd0e8e"), + (4, "2faac08f851d35fea3604fcb4de82dc62c9b164a70974d0462e27f1ab278700f", "iv", "", "eb50c16be7654abf99dd06d9"), + (4, "2faac08f851d35fea3604fcb4de82dc62c9b164a70974d0462e27f1ab278700f", "key", "", "b1530806f4adfeac83f1413032bbfa82"), + (3, "33ad0a1c607ec03b09e6cd9893680ce210adf300aa1f2660e1b22e10f170f92a", "derived", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "6f2615a108c702c5678f54fc9dbab69716c076189c48250cebeac3576c3611ba"), + (5, "3403e781e2af7b6508da28574f6e95a1abf162de83a97927c37672a4a0cef8a1", "finished", "", "e7f8bb3ea4b6c30c4710b3d09c3313658117e70b097e850368e2510ca5631f74"), + (5, "3403e781e2af7b6508da28574f6e95a1abf162de83a97927c37672a4a0cef8a1", "iv", "", "c7d395c08d62f297d13768ea"), + (5, "3403e781e2af7b6508da28574f6e95a1abf162de83a97927c37672a4a0cef8a1", "key", "", "4646bfac1712c426cd78d8a24a8a6f6b"), + (4, "3fbbe6a60deb66c30a32795aba0eff7eaa10105586e7be5c09678d63b6caab62", "iv", "", "6d475f0993c8e564610db2b9"), + (4, "3fbbe6a60deb66c30a32795aba0eff7eaa10105586e7be5c09678d63b6caab62", "key", "", "920205a5b7bf2115e6fc5c2942834f54"), + (5, "5c74f87df04225db0f8209c9de6429e49435fdefa7cad61864874d12f31cfc8d", "iv", "", "0dd631f7b71cbbc797c35fe7"), + (5, "5c74f87df04225db0f8209c9de6429e49435fdefa7cad61864874d12f31cfc8d", "key", "", "f27a5d97bd25550c4823b0f3e5d29388"), + (4, "69fe131a3bbad5d63c64eebcc30e395b9d8107726a13d074e389dbc8a4e47256", "finished", "", "5588673e72cb59c87d220caffe94f2dea9a3b1609f7d50e90a48227db9ed7eaa"), + (5, "75ecf4b972525aa0dcd057c9944d4cd5d82671d8843141d7dc2a4ff15a21dc51", "iv", "", "86e8be227c1bd2b3e39cb444"), + (5, "75ecf4b972525aa0dcd057c9944d4cd5d82671d8843141d7dc2a4ff15a21dc51", "key", "", "a7eb2a0525eb4331d58fcbf9f7ca2e9c"), + (3, "7df235f2031d2a051287d02b0241b0bfdaf86cc856231f2d5aba46c434ec196c", "resumption", "0000", "4ecd0eb6ec3b4d87f5d6028f922ca4c5851a277fd41311c9e62d2c9492e1c4f3"), + (4, "9b2188e9b2fc6d64d71dc329900e20bb41915000f678aa839cbb797cb7d8332c", "c e traffic", "08ad0fa05d7c7233b1775ba2ff9f4c5b8b59276b7f227f13a976245f5d960913", "3fbbe6a60deb66c30a32795aba0eff7eaa10105586e7be5c09678d63b6caab62"), + (4, "9b2188e9b2fc6d64d71dc329900e20bb41915000f678aa839cbb797cb7d8332c", "derived", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "5f1790bbd82c5e7d376ed2e1e52f8e6038c9346db61b43be9a52f77ef3998e80"), + (4, "9b2188e9b2fc6d64d71dc329900e20bb41915000f678aa839cbb797cb7d8332c", "e exp master", "08ad0fa05d7c7233b1775ba2ff9f4c5b8b59276b7f227f13a976245f5d960913", "b2026866610937d7423e5be90862ccf24c0e6091186d34f812089ff5be2ef7df"), + (3, "9e40646ce79a7f9dc05af8889bce6552875afa0b06df0087f792ebb7c17504a5", "iv", "", "5b78923dee08579033e523d9"), + (3, "9e40646ce79a7f9dc05af8889bce6552875afa0b06df0087f792ebb7c17504a5", "key", "", "17422dda596ed5d9acd890e3c63f5051"), + (3, "a11af9f05531f856ad47116b45a950328204b4f44bfb6b3a4b4f1f3fcb631643", "iv", "", "cf782b88dd83549aadf1e984"), + (3, "a11af9f05531f856ad47116b45a950328204b4f44bfb6b3a4b4f1f3fcb631643", "key", "", "9f02283b6c9c07efc26bb9f2ac92e356"), + (3, "b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21", "finished", "", "b80ad01015fb2f0bd65ff7d4da5d6bf83f84821d1f87fdc7d3c75b5a7b42d9c4"), + (3, "b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21", "iv", "", "5bd3c71b836e0b76bb73265f"), + (3, "b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21", "key", "", "dbfaa693d1762c5b666af5d950258d01"), + (3, "b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38", "finished", "", "008d3b66f816ea559f96b537e885c31fc068bf492c652f01f288a1d8cdc19fc8"), + (3, "b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38", "iv", "", "5d313eb2671276ee13000b30"), + (3, "b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38", "key", "", "3fce516009c21727d0f2e4e86ee403bc"), + (4, "cc21f1bf8feb7dd5fa505bd9c4b468a9984d554a993dc49e6d285598fb672691", "iv", "", "0685d6b561aab9ef1013faf9"), + (4, "cc21f1bf8feb7dd5fa505bd9c4b468a9984d554a993dc49e6d285598fb672691", "key", "", "e857c690a34c5a9129d833619684f95e"), + (5, "ce022e5e6e81e50736d773f2d3adfce8220d049bf510f0dbfac927ef4243b148", "c hs traffic", "8aa8e828ec2f8a884fec95a3139de01c15a3daa7ff5bfc3f4bfcc21b438d7bf8", "158aa7ab8855073582b41d674b4055cabcc534728f659314861b4e08e2011566"), + (5, "ce022e5e6e81e50736d773f2d3adfce8220d049bf510f0dbfac927ef4243b148", "derived", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "ad1cbcd3a0dc7053eeb3ed3a47901d16a9fc63a73c64beb567481a7dfb3a2cb3"), + (5, "ce022e5e6e81e50736d773f2d3adfce8220d049bf510f0dbfac927ef4243b148", "s hs traffic", "8aa8e828ec2f8a884fec95a3139de01c15a3daa7ff5bfc3f4bfcc21b438d7bf8", "3403e781e2af7b6508da28574f6e95a1abf162de83a97927c37672a4a0cef8a1"), + (4, "e2d32d4ed66dd37897a0e80c84107503ce58bf8aad4cb55a5002d77ecb890ece", "c ap traffic", "b0aeffc46a2cfe33114e6fd7d51f9f04b1ca3c497dab08934a774a9d9ad7dbf3", "2abbf2b8e381d23dbebe1dd2a7d16a8bf484cb4950d23fb7fb7fa8547062d9a1"), + (4, "e2d32d4ed66dd37897a0e80c84107503ce58bf8aad4cb55a5002d77ecb890ece", "exp master", "b0aeffc46a2cfe33114e6fd7d51f9f04b1ca3c497dab08934a774a9d9ad7dbf3", "3fd93d4ffddc98e64b14dd107aedf8ee4add23f4510f58a4592d0b201bee56b4"), + (4, "e2d32d4ed66dd37897a0e80c84107503ce58bf8aad4cb55a5002d77ecb890ece", "res master", "c3c122e0bd907a4a3ff6112d8fd53dbf89c773d9552e8b6b9d56d361b3a97bf6", "5e95bdf1f89005ea2e9aa0ba85e728e3c19c5fe0c699e3f5bee59faebd0b5406"), + (4, "e2d32d4ed66dd37897a0e80c84107503ce58bf8aad4cb55a5002d77ecb890ece", "s ap traffic", "b0aeffc46a2cfe33114e6fd7d51f9f04b1ca3c497dab08934a774a9d9ad7dbf3", "cc21f1bf8feb7dd5fa505bd9c4b468a9984d554a993dc49e6d285598fb672691"), + (4, "fe927ae271312e8bf0275b581c54eef020450dc4ecffaa05a1a35d27518e7803", "finished", "", "4bb74cae7a5dc8914604c0bfbe2f0c062396883922bec8a15e2a9b532a5d392c"), + (4, "fe927ae271312e8bf0275b581c54eef020450dc4ecffaa05a1a35d27518e7803", "iv", "", "9569ecdd4d0536705e9ef725"), + (4, "fe927ae271312e8bf0275b581c54eef020450dc4ecffaa05a1a35d27518e7803", "key", "", "27c6bdc0a3dcea39a47326d79bc9e4ee"), +]; +private static readonly string[] Rfc8448HrrMessages = +[ + "010000b00303b0b1c5a5aa37c5919f2ed1d5c6fff7fcb7849716945a2b8cee9258a346677b6f000006130113031302010000810000000b0009000006736572766572ff01000100000a00080006001d00170018003300260024001d0020e8e8e3f3b93a25ed97a14a7dcacb8a272c6288e585c6484d05262fcad062ad1f002b0003020304000d0020001e040305030603020308040805080604010501060102010402050206020202002d00020101001c00024001", + "020000ac0303cf21ad74e59a6111be1d8c021e65b891c2a211167abb8c5e079e09e2c8a8339c001301000084003300020017002c0074007271dcd04bb88bc3189119398a00000000eefafc76c146b823b096f8aacad365dd0030953f4edf625636e5f21bb2e23fcc654b1b5b40318d10d137abcbb87574e36e8a1f025f7dfa5d6e50781b5eda4aa15b0c8be778257d16aa3030e9e7841dd9e4c0342267e8ca0caf571fb2b7cff0f934b0002b00020304", + "010001fc0303b0b1c5a5aa37c5919f2ed1d5c6fff7fcb7849716945a2b8cee9258a346677b6f000006130113031302010001cd0000000b0009000006736572766572ff01000100000a00080006001d001700180033004700450017004104a6da7392ec591e17abfd535964b99894d13befb221b3def2ebe3830eac8f0151812677c4d6d2237e85cf01d6910cfb83954e76ba7352830534159897e8065780002b0003020304000d0020001e040305030603020308040805080604010501060102010402050206020202002c0074007271dcd04bb88bc3189119398a00000000eefafc76c146b823b096f8aacad365dd0030953f4edf625636e5f21bb2e23fcc654b1b5b40318d10d137abcbb87574e36e8a1f025f7dfa5d6e50781b5eda4aa15b0c8be778257d16aa3030e9e7841dd9e4c0342267e8ca0caf571fb2b7cff0f934b0002d00020101001c00024001001500af00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "020000770303bb341d847fd789c47c387172dc0c9bf147fccacb5043d86ca4c598d3ff571b9800130100004f003300450017004104583e054b7a66672ae020ad9d2686fcc85b5ad41a134a0f03ee72b893052bd85b4c8de6776f5b04ac07d83540eab3e3d9c547bc6528c4317d294686093a6cad7d002b00020304", +]; + + [TestMethod] + [RfcRequirement("RFC 8446", "7.1", "HkdfRfc8448Tests.ExpandLabelMatchesEveryRfc8448Section3To5Output")] + public void ExpandLabelMatchesEveryRfc8448Section3To5Output() + { + foreach ((int section, string secretHex, string label, string contextHex, string outputHex) in Rfc8448ExpandLabels) + { + byte[] secret = Hex(secretHex); + byte[] context = Hex(contextHex); + byte[] expected = Hex(outputHex); + byte[] output = new byte[expected.Length]; + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, Encoding.ASCII.GetBytes(label), context, output); + Assert.IsTrue(output.AsSpan().SequenceEqual(expected), "section " + section + " label " + label); + } + } + + [TestMethod] + [RfcRequirement("RFC 8446", "4.4.1", "HkdfRfc8448Tests.ReplaceWithMessageHashMatchesRfc8448Section5Transcript")] + public void ReplaceWithMessageHashMatchesRfc8448Section5Transcript() + { + using var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append(Hex(Rfc8448HrrMessages[0])); + transcript.ReplaceWithMessageHash(); + Assert.AreEqual(36, transcript.Length); + Assert.AreEqual(254, transcript.Bytes[0]); + Assert.AreEqual(0, transcript.Bytes[1]); + Assert.AreEqual(0, transcript.Bytes[2]); + Assert.AreEqual(32, transcript.Bytes[3]); + + transcript.Append(Hex(Rfc8448HrrMessages[1])); + transcript.Append(Hex(Rfc8448HrrMessages[2])); + transcript.Append(Hex(Rfc8448HrrMessages[3])); + Span hash = stackalloc byte[32]; + transcript.CurrentHash(hash); + byte[] expected = Hex("8aa8e828ec2f8a884fec95a3139de01c15a3daa7ff5bfc3f4bfcc21b438d7bf8"); + Assert.IsTrue(hash.SequenceEqual(expected)); + } + + private static byte[] Hex(string text) + { + if (text.Length == 0) + { + return []; + } + + byte[] bytes = new byte[text.Length / 2]; + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(text.Substring(i * 2, 2), 16); + } + + return bytes; + } +} \ No newline at end of file diff --git a/tests/Titanium.Tls.Tests/HkdfTests.cs b/tests/Titanium.Tls.Tests/HkdfTests.cs new file mode 100644 index 000000000..c3a9e5c86 --- /dev/null +++ b/tests/Titanium.Tls.Tests/HkdfTests.cs @@ -0,0 +1,202 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class HkdfTests +{ + [TestMethod] + public void ExpandLabelMatchesRfc8448ClientHandshakeTraffic() + { + byte[] secret = Hex("1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac"); + byte[] transcript = Hex("860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8"); + byte[] expected = Hex("b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21"); + Span output = stackalloc byte[32]; + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "c hs traffic"u8, transcript, output); + Assert.IsTrue(output.SequenceEqual(expected)); + } + + [TestMethod] + public void ExpandLabelMatchesRfc8448ServerHandshakeTraffic() + { + byte[] secret = Hex("1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac"); + byte[] transcript = Hex("860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8"); + byte[] expected = Hex("b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38"); + Span output = stackalloc byte[32]; + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "s hs traffic"u8, transcript, output); + Assert.IsTrue(output.SequenceEqual(expected)); + } + + [TestMethod] + public void DeriveSecretMatchesRfc8448DerivedFromEarly() + { + byte[] secret = Hex("33ad0a1c607ec03b09e6cd9893680ce210adf300aa1f2660e1b22e10f170f92a"); + byte[] emptyHash = Hex("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"); + byte[] expected = Hex("6f2615a108c702c5678f54fc9dbab69716c076189c48250cebeac3576c3611ba"); + Span output = stackalloc byte[32]; + TlsHkdf.DeriveSecret(HashAlgorithmName.SHA256, secret, "derived"u8, emptyHash, output); + Assert.IsTrue(output.SequenceEqual(expected)); + } + + [TestMethod] + public void TranscriptHashesAppendedMessagesAndReplacesClientHelloWithMessageHash() + { + byte[] hello = [1, 0, 0, 2, 0xAA, 0xBB]; + using var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append(hello); + Span hash = stackalloc byte[32]; + transcript.CurrentHash(hash); + Span direct = stackalloc byte[32]; + SHA256.HashData(hello, direct); + Assert.IsTrue(hash.SequenceEqual(direct)); + + Span withExtra = stackalloc byte[32]; + byte[] extra = [9, 9]; + transcript.HashWith(extra, withExtra); + byte[] combined = [1, 0, 0, 2, 0xAA, 0xBB, 9, 9]; + SHA256.HashData(combined, direct); + Assert.IsTrue(withExtra.SequenceEqual(direct)); + Assert.AreEqual(hello.Length, transcript.Length); + + transcript.ReplaceWithMessageHash(); + Assert.AreEqual(36, transcript.Length); + Assert.AreEqual(254, transcript.Bytes[0]); + Assert.AreEqual(32, transcript.Bytes[3]); + Assert.IsTrue(transcript.Bytes.Slice(4).SequenceEqual(hash)); + } + + [TestMethod] + [RfcRequirement("RFC 5869", "2", "HkdfTests.BclHkdfMatchesRfc5869Case1")] + public void BclHkdfMatchesRfc5869Case1() + { + AssertRfc5869( + "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + "000102030405060708090a0b0c", + "f0f1f2f3f4f5f6f7f8f9", + "077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5", + "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865"); + } + + [TestMethod] + public void BclHkdfMatchesRfc5869Case2() + { + AssertRfc5869( + "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f", + "606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeaf", + "b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + "06a6b88c5853361a06104c9ceb35b45cef760014904671014a193f40c15fc244", + "b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87"); + } + + [TestMethod] + public void BclHkdfMatchesRfc5869Case3() + { + AssertRfc5869( + "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + "", + "", + "19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04", + "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8"); + } + + [TestMethod] + public void ExpandLabelAcceptsTheMaximumLabelAndRejectsOverflow() + { + byte[] secret = new byte[32]; + byte[] output = new byte[32]; + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, new byte[249], ReadOnlySpan.Empty, output); + Assert.ThrowsException(() => + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, new byte[250], ReadOnlySpan.Empty, output)); + Assert.ThrowsException(() => + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "x"u8, new byte[256], output)); + } + + [TestMethod] + public void ExpandLabelMatchesHkdfExpandForMoreThanOneBlock() + { + byte[] secret = new byte[32]; + byte[] expected = new byte[80]; + byte[] actual = new byte[80]; + HKDF.Expand(HashAlgorithmName.SHA256, secret, expected, BuildInfo(80, "exporter"u8, ReadOnlySpan.Empty)); + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "exporter"u8, ReadOnlySpan.Empty, actual); + Assert.IsTrue(actual.AsSpan().SequenceEqual(expected)); + } + + [TestMethod] + public void ExpandLabelAllocatesNothingForASingleBlock() + { + byte[] secret = new byte[32]; + byte[] context = new byte[32]; + Span output = stackalloc byte[32]; + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "c hs traffic"u8, context, output); + + const int iterations = 64; + long before = GC.GetAllocatedBytesForCurrentThread(); + for (int i = 0; i < iterations; i++) + { + TlsHkdf.ExpandLabel(HashAlgorithmName.SHA256, secret, "c hs traffic"u8, context, output); + } + + long allocated = GC.GetAllocatedBytesForCurrentThread() - before; + Assert.AreEqual(0, allocated); + } + + private static byte[] BuildInfo(int length, ReadOnlySpan label, ReadOnlySpan context) + { + byte[] info = new byte[2 + 1 + 6 + label.Length + 1 + context.Length]; + info[0] = (byte)(length >> 8); + info[1] = (byte)length; + info[2] = (byte)(6 + label.Length); + "tls13 "u8.CopyTo(info.AsSpan(3)); + label.CopyTo(info.AsSpan(9)); + info[9 + label.Length] = (byte)context.Length; + context.CopyTo(info.AsSpan(10 + label.Length)); + return info; + } + + [TestMethod] + public void DropRawBytesKeepsTheRunningHashAndGrowsAgain() + { + using var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append("hello"u8); + Span before = stackalloc byte[32]; + transcript.CurrentHash(before); + transcript.DropRawBytes(); + Assert.AreEqual(0, transcript.Length); + Assert.AreEqual(0, transcript.Bytes.Length); + Span after = stackalloc byte[32]; + transcript.CurrentHash(after); + Assert.IsTrue(before.SequenceEqual(after)); + transcript.Append("more"u8); + Assert.AreEqual(4, transcript.Length); + } + + private static void AssertRfc5869(string ikmHex, string saltHex, string infoHex, string prkHex, string okmHex) + { + byte[] ikm = Hex(ikmHex); + byte[] salt = Hex(saltHex); + byte[] info = Hex(infoHex); + byte[] expectedPrk = Hex(prkHex); + byte[] expectedOkm = Hex(okmHex); + byte[] prk = new byte[32]; + TlsHkdf.Extract(HashAlgorithmName.SHA256, ikm, salt, prk); + Assert.IsTrue(prk.AsSpan().SequenceEqual(expectedPrk)); + byte[] okm = new byte[expectedOkm.Length]; + HKDF.Expand(HashAlgorithmName.SHA256, prk, okm, info); + Assert.IsTrue(okm.AsSpan().SequenceEqual(expectedOkm)); + } + + private static byte[] Hex(string text) + { + byte[] bytes = new byte[text.Length / 2]; + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(text.Substring(i * 2, 2), 16); + } + + return bytes; + } +} diff --git a/tests/Titanium.Tls.Tests/HybridKeyExchangeTests.cs b/tests/Titanium.Tls.Tests/HybridKeyExchangeTests.cs new file mode 100644 index 000000000..8dcd98100 --- /dev/null +++ b/tests/Titanium.Tls.Tests/HybridKeyExchangeTests.cs @@ -0,0 +1,203 @@ +using System; +using System.Net; +using System.Net.Sockets; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class HybridKeyExchangeTests +{ + [TestMethod] + public void ClientAndServerDeriveTheSameSecret() + { + if (!Supported()) + { + return; + } + + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519MlKem768); + using IPrivateKeyShare client = group.GenerateKeyShare(new SystemEntropy()); + byte[] clientShare = new byte[group.PublicKeyLength]; + client.WritePublicKey(clientShare); + byte[] serverShare = new byte[HybridKeyExchange.ServerShareLength]; + byte[] serverSecret = new byte[group.SharedSecretLength]; + Assert.IsTrue(group.TryEncapsulate(clientShare, new SystemEntropy(), serverShare, serverSecret, out int serverWritten, out int secretWritten)); + Assert.AreEqual(serverShare.Length, serverWritten); + Assert.AreEqual(serverSecret.Length, secretWritten); + byte[] clientSecret = new byte[group.SharedSecretLength]; + Assert.IsTrue(client.TryComputeSharedSecret(serverShare, clientSecret, out int clientWritten)); + Assert.AreEqual(clientSecret.Length, clientWritten); + Assert.IsTrue(clientSecret.AsSpan().SequenceEqual(serverSecret)); + } + + [TestMethod] + public void WrongLengthsAndADamagedEncapsulationKeyAreRejected() + { + if (!Supported()) + { + return; + } + + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519MlKem768); + using IPrivateKeyShare client = group.GenerateKeyShare(new SystemEntropy()); + byte[] clientShare = new byte[group.PublicKeyLength]; + client.WritePublicKey(clientShare); + clientShare[0] = 0xFF; + clientShare[1] = 0xFF; + byte[] serverShare = new byte[HybridKeyExchange.ServerShareLength]; + byte[] secret = new byte[group.SharedSecretLength]; + Assert.IsFalse(group.TryEncapsulate(clientShare, new SystemEntropy(), serverShare, secret, out _, out _)); + Assert.IsFalse(group.TryEncapsulate(new byte[10], new SystemEntropy(), serverShare, secret, out _, out _)); + Assert.IsFalse(client.TryComputeSharedSecret(new byte[10], secret, out _)); + } + + [TestMethod] + public void DamagedCiphertextDoesNotThrowAndChangesTheSecret() + { + if (!Supported()) + { + return; + } + + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519MlKem768); + using IPrivateKeyShare client = group.GenerateKeyShare(new SystemEntropy()); + byte[] clientShare = new byte[group.PublicKeyLength]; + client.WritePublicKey(clientShare); + byte[] serverShare = new byte[HybridKeyExchange.ServerShareLength]; + byte[] honest = new byte[group.SharedSecretLength]; + Assert.IsTrue(group.TryEncapsulate(clientShare, new SystemEntropy(), serverShare, honest, out _, out _)); + serverShare[0] ^= 0xFF; + byte[] damaged = new byte[group.SharedSecretLength]; + Assert.IsTrue(client.TryComputeSharedSecret(serverShare, damaged, out _)); + Assert.IsFalse(damaged.AsSpan().SequenceEqual(honest)); + } + + [TestMethod] + public void SymmetricGroupsDoNotEncapsulate() + { + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519); + byte[] share = new byte[32]; + byte[] secret = new byte[32]; + Assert.IsFalse(group.TryEncapsulate(share, new SystemEntropy(), share, secret, out _, out _)); + } + + [TestMethod] + public void FidelityFollowsMlKemSupport() + { + TlsFingerprintFidelity expected = MLKem.IsSupported ? TlsFingerprintFidelity.Full : TlsFingerprintFidelity.ReducedNoPostQuantum; + Assert.AreEqual(expected, TlsFingerprint.Current); + } + + [TestMethod] + public void OpenSslClientHelloUsesTheSameShareOrder() + { + if (!OpenSslOracle.Require(new Version(3, 5)) || !Supported()) + { + return; + } + + string openssl = OpenSslOracle.Find() ?? throw new InvalidOperationException("OpenSSL was not found."); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + using var process = new System.Diagnostics.Process(); + process.StartInfo.FileName = openssl; + process.StartInfo.Arguments = $"s_client -tls1_3 -connect 127.0.0.1:{port} -groups X25519MLKEM768 -brief"; + process.StartInfo.RedirectStandardError = true; + process.StartInfo.RedirectStandardOutput = true; + process.StartInfo.UseShellExecute = false; + process.Start(); + using TcpClient client = listener.AcceptTcpClient(); + using NetworkStream stream = client.GetStream(); + stream.ReadTimeout = 5000; + byte[] buffer = new byte[8192]; + int read = stream.Read(buffer); + if (!process.HasExited) + { + process.Kill(entireProcessTree: true); + } + + byte[]? share = HybridShare(buffer.AsSpan(0, read)); + Assert.IsNotNull(share); + Assert.AreEqual(HybridKeyExchange.ClientShareLength, share.Length); + using MLKem kem = MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, share.AsSpan(0, HybridKeyExchange.EncapsulationKeyLength)); + CryptographicException? rejected = null; + try + { + MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, share.AsSpan(32, HybridKeyExchange.EncapsulationKeyLength)); + } + catch (CryptographicException exception) + { + rejected = exception; + } + + Assert.IsNotNull(rejected); + } + + private static bool Supported() + { + if (MLKem.IsSupported) + { + return true; + } + + Assert.Inconclusive("ML-KEM-768 is not available on this runtime."); + return false; + } + + private static byte[]? HybridShare(ReadOnlySpan record) + { + if (record.Length < 5 || record[0] != 22) + { + return null; + } + + int length = (record[3] << 8) | record[4]; + ReadOnlySpan handshake = record.Slice(5, Math.Min(length, record.Length - 5)); + if (handshake.Length < 4 || handshake[0] != 1) + { + return null; + } + + int offset = 4 + 2 + 32; + int session = handshake[offset]; + offset += 1 + session; + int ciphers = (handshake[offset] << 8) | handshake[offset + 1]; + offset += 2 + ciphers; + int compression = handshake[offset]; + offset += 1 + compression; + int extensions = (handshake[offset] << 8) | handshake[offset + 1]; + offset += 2; + int end = offset + extensions; + while (offset + 4 <= end && offset + 4 <= handshake.Length) + { + int type = (handshake[offset] << 8) | handshake[offset + 1]; + int size = (handshake[offset + 2] << 8) | handshake[offset + 3]; + offset += 4; + if (type == 51 && offset + size <= handshake.Length) + { + ReadOnlySpan body = handshake.Slice(offset, size); + int list = (body[0] << 8) | body[1]; + int index = 2; + while (index + 4 <= 2 + list && index + 4 <= body.Length) + { + int group = (body[index] << 8) | body[index + 1]; + int keyLength = (body[index + 2] << 8) | body[index + 3]; + if (group == 0x11EC && keyLength == HybridKeyExchange.ClientShareLength) + { + return body.Slice(index + 4, keyLength).ToArray(); + } + + index += 4 + keyLength; + } + } + + offset += size; + } + + return null; + } +} diff --git a/tests/Titanium.Tls.Tests/KeyExchangeTests.cs b/tests/Titanium.Tls.Tests/KeyExchangeTests.cs new file mode 100644 index 000000000..744afbefd --- /dev/null +++ b/tests/Titanium.Tls.Tests/KeyExchangeTests.cs @@ -0,0 +1,148 @@ +using System; +using System.IO; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Org.BouncyCastle.Asn1.Sec; +using Org.BouncyCastle.Asn1.X9; +using Org.BouncyCastle.Math; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class KeyExchangeTests +{ + [TestMethod] + public void X25519ShareMatchesTheRfc7748AlicePublicKey() + { + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519); + using IPrivateKeyShare share = group.GenerateKeyShare(new FixedEntropy(Hex("77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a"))); + Span publicKey = stackalloc byte[32]; + share.WritePublicKey(publicKey); + Assert.IsTrue(publicKey.SequenceEqual(Hex("8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a"))); + } + + [TestMethod] + public void BothSidesAgreeForEachFiniteGroup() + { + Agree(NamedGroup.X25519); + Agree(NamedGroup.Secp256r1); + Agree(NamedGroup.Secp384r1); + } + + [TestMethod] + public void InvalidPeerShareIsRejected() + { + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519); + using IPrivateKeyShare share = group.GenerateKeyShare(new SystemEntropy()); + Span secret = stackalloc byte[32]; + Assert.IsFalse(share.TryComputeSharedSecret(new byte[31], secret, out _)); + Assert.IsFalse(share.TryComputeSharedSecret(new byte[32], secret, out _)); + + IKeyExchangeGroup nist = KeyExchangeGroups.Create(NamedGroup.Secp256r1); + using IPrivateKeyShare nistShare = nist.GenerateKeyShare(new SystemEntropy()); + byte[] offCurve = new byte[65]; + offCurve[0] = 0x04; + offCurve[1] = 1; + Span nistSecret = stackalloc byte[32]; + Assert.IsFalse(nistShare.TryComputeSharedSecret(offCurve, nistSecret, out _)); + offCurve[0] = 0x02; + Assert.IsFalse(nistShare.TryComputeSharedSecret(offCurve, nistSecret, out _)); + } + + [TestMethod] + public void DisposedShareRejectsFurtherUse() + { + IKeyExchangeGroup group = KeyExchangeGroups.Create(NamedGroup.X25519); + IPrivateKeyShare share = group.GenerateKeyShare(new SystemEntropy()); + share.Dispose(); + byte[] publicKey = new byte[32]; + Assert.ThrowsExactly(() => share.WritePublicKey(publicKey)); + } + + [TestMethod] + public void NistSharesMatchWycheproofEcPoints() + { + MatchWycheproof(NamedGroup.Secp256r1, "ecdh_secp256r1_ecpoint_test.json", "secp256r1"); + MatchWycheproof(NamedGroup.Secp384r1, "ecdh_secp384r1_ecpoint_test.json", "secp384r1"); + } + + private static void Agree(NamedGroup name) + { + IKeyExchangeGroup group = KeyExchangeGroups.Create(name); + using IPrivateKeyShare alice = group.GenerateKeyShare(new SystemEntropy()); + using IPrivateKeyShare bob = group.GenerateKeyShare(new SystemEntropy()); + byte[] alicePublic = new byte[group.PublicKeyLength]; + byte[] bobPublic = new byte[group.PublicKeyLength]; + alice.WritePublicKey(alicePublic); + bob.WritePublicKey(bobPublic); + byte[] aliceSecret = new byte[group.SharedSecretLength]; + byte[] bobSecret = new byte[group.SharedSecretLength]; + Assert.IsTrue(alice.TryComputeSharedSecret(bobPublic, aliceSecret, out int aliceWritten)); + Assert.IsTrue(bob.TryComputeSharedSecret(alicePublic, bobSecret, out int bobWritten)); + Assert.AreEqual(group.SharedSecretLength, aliceWritten); + Assert.AreEqual(group.SharedSecretLength, bobWritten); + Assert.IsTrue(aliceSecret.AsSpan().SequenceEqual(bobSecret)); + } + + private static void MatchWycheproof(NamedGroup name, string file, string curveName) + { + using JsonDocument document = JsonDocument.Parse(File.ReadAllText(WycheproofX25519Tests.FindFixture(file))); + X9ECParameters parameters = SecNamedCurves.GetByName(curveName); + NistKeyExchange group = (NistKeyExchange)KeyExchangeGroups.Create(name); + int valid = 0; + byte[] ignored = new byte[group.SharedSecretLength]; + foreach (JsonElement testGroup in document.RootElement.GetProperty("testGroups").EnumerateArray()) + { + foreach (JsonElement test in testGroup.GetProperty("tests").EnumerateArray()) + { + byte[] peer = Convert.FromHexString(test.GetProperty("public").GetString()!); + string result = test.GetProperty("result").GetString()!; + if (result != "valid") + { + using IPrivateKeyShare probe = group.GenerateKeyShare(new SystemEntropy()); + Assert.IsFalse(probe.TryComputeSharedSecret(peer, ignored, out _), "tcId " + test.GetProperty("tcId").GetInt32()); + continue; + } + + byte[] scalar = LeftPad(Convert.FromHexString(test.GetProperty("private").GetString()!), group.SharedSecretLength); + byte[] ownPublic = UncompressedPublic(parameters, scalar); + using IPrivateKeyShare share = group.Import(scalar, ownPublic); + byte[] secret = new byte[group.SharedSecretLength]; + Assert.IsTrue(share.TryComputeSharedSecret(peer, secret, out _), "tcId " + test.GetProperty("tcId").GetInt32()); + Assert.IsTrue(secret.AsSpan().SequenceEqual(Convert.FromHexString(test.GetProperty("shared").GetString()!)), "tcId " + test.GetProperty("tcId").GetInt32()); + valid++; + } + } + + Assert.IsTrue(valid > 0); + } + + private static byte[] UncompressedPublic(X9ECParameters parameters, byte[] scalar) + { + return parameters.G.Multiply(new BigInteger(1, scalar)).Normalize().GetEncoded(compressed: false); + } + + private static byte[] LeftPad(byte[] value, int length) + { + if (value.Length == length) + { + return value; + } + + byte[] padded = new byte[length]; + if (value.Length > length) + { + value.AsSpan(value.Length - length).CopyTo(padded); + return padded; + } + + value.CopyTo(padded.AsSpan(length - value.Length)); + return padded; + } + + private static byte[] Hex(string text) + { + return Convert.FromHexString(text); + } +} diff --git a/tests/Titanium.Tls.Tests/KeyScheduleTests.cs b/tests/Titanium.Tls.Tests/KeyScheduleTests.cs new file mode 100644 index 000000000..d2b40c0ed --- /dev/null +++ b/tests/Titanium.Tls.Tests/KeyScheduleTests.cs @@ -0,0 +1,300 @@ +using System; +using System.Security.Cryptography; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class KeyScheduleTests +{ + [TestMethod] + public void EarlyAndHandshakeSecretsMatchRfc8448Section3() + { + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(ReadOnlySpan.Empty); + Span early = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Early, early); + Assert.IsTrue(early.SequenceEqual(Hex("33ad0a1c607ec03b09e6cd9893680ce210adf300aa1f2660e1b22e10f170f92a"))); + + schedule.AdvanceToHandshake(Hex("8bd4054fb55b9d63fdfbacf9f04b9f0d35e6d63f537563efd46272900f89492d")); + Span handshake = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Handshake, handshake); + Assert.IsTrue(handshake.SequenceEqual(Hex("1dc826e93606aa6fdc0aadc12f741b01046aa6b99f691ed221a9f0ca043fbeac"))); + Assert.IsTrue(early.ToArray().Length == 32); + Span earlyAfter = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Early, earlyAfter); + Assert.IsTrue(earlyAfter.SequenceEqual(new byte[32])); + + byte[] transcript = Hex("860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8"); + Span client = stackalloc byte[32]; + Span server = stackalloc byte[32]; + schedule.HandshakeTrafficSecret(client: true, transcript, client); + schedule.HandshakeTrafficSecret(client: false, transcript, server); + Assert.IsTrue(client.SequenceEqual(Hex("b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21"))); + Assert.IsTrue(server.SequenceEqual(Hex("b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38"))); + } + + [TestMethod] + [RfcRequirement("RFC 8446", "7", "KeyScheduleTests.MasterTrafficKeysAndResumptionMatchRfc8448Section3")] + public void MasterTrafficKeysAndResumptionMatchRfc8448Section3() + { + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(ReadOnlySpan.Empty); + schedule.AdvanceToHandshake(Hex("8bd4054fb55b9d63fdfbacf9f04b9f0d35e6d63f537563efd46272900f89492d")); + byte[] hsTranscript = Hex("860c06edc07858ee8e78f0e7428c58edd6b43f2ca3e6e95f02ed063cf0e1cad8"); + Span serverHs = stackalloc byte[32]; + schedule.HandshakeTrafficSecret(client: false, hsTranscript, serverHs); + Span key = stackalloc byte[16]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, serverHs, key, iv); + AssertEqual(key, "3fce516009c21727d0f2e4e86ee403bc"); + AssertEqual(iv, "5d313eb2671276ee13000b30"); + Span finished = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, serverHs, finished); + AssertEqual(finished, "008d3b66f816ea559f96b537e885c31fc068bf492c652f01f288a1d8cdc19fc8"); + + schedule.AdvanceToMaster(); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Early)); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Handshake)); + Span master = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Master, master); + AssertEqual(master, "18df06843d13a08bf2a449844c5f8a478001bc4d4c627984d5a41da8d0402919"); + + byte[] apTranscript = Hex("9608102a0f1ccc6db6250b7b7e417b1a000eaada3daae4777a7686c9ff83df13"); + Span clientAp = stackalloc byte[32]; + Span serverAp = stackalloc byte[32]; + Span exporter = stackalloc byte[32]; + schedule.ApplicationTrafficSecret(client: true, apTranscript, clientAp); + schedule.ApplicationTrafficSecret(client: false, apTranscript, serverAp); + schedule.ExporterMaster(apTranscript, exporter); + AssertEqual(clientAp, "9e40646ce79a7f9dc05af8889bce6552875afa0b06df0087f792ebb7c17504a5"); + AssertEqual(serverAp, "a11af9f05531f856ad47116b45a950328204b4f44bfb6b3a4b4f1f3fcb631643"); + AssertEqual(exporter, "fe22f881176eda18eb8f44529e6792c50c9a3f89452f68d8ae311b4309d3cf50"); + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA256, serverAp, key, iv); + AssertEqual(key, "9f02283b6c9c07efc26bb9f2ac92e356"); + AssertEqual(iv, "cf782b88dd83549aadf1e984"); + + byte[] resTranscript = Hex("209145a96ee8e2a122ff810047cc952684658d6049e86429426db87c54ad143d"); + Span resumptionMaster = stackalloc byte[32]; + schedule.ResumptionMaster(resTranscript, resumptionMaster); + AssertEqual(resumptionMaster, "7df235f2031d2a051287d02b0241b0bfdaf86cc856231f2d5aba46c434ec196c"); + Span psk = stackalloc byte[32]; + TlsKeySchedule.ResumptionPsk(HashAlgorithmName.SHA256, resumptionMaster, [0, 0], psk); + AssertEqual(psk, "4ecd0eb6ec3b4d87f5d6028f922ca4c5851a277fd41311c9e62d2c9492e1c4f3"); + } + + [TestMethod] + public void ResumedEarlySecretsMatchRfc8448Section4() + { + byte[] psk = Hex("4ecd0eb6ec3b4d87f5d6028f922ca4c5851a277fd41311c9e62d2c9492e1c4f3"); + byte[] earlyTranscript = Hex("08ad0fa05d7c7233b1775ba2ff9f4c5b8b59276b7f227f13a976245f5d960913"); + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(psk); + Span early = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Early, early); + AssertEqual(early, "9b2188e9b2fc6d64d71dc329900e20bb41915000f678aa839cbb797cb7d8332c"); + + Span binder = stackalloc byte[32]; + Span emptyHash = stackalloc byte[32]; + SHA256.HashData(ReadOnlySpan.Empty, emptyHash); + schedule.DeriveEarly("res binder"u8, emptyHash, binder); + AssertEqual(binder, "69fe131a3bbad5d63c64eebcc30e395b9d8107726a13d074e389dbc8a4e47256"); + Span finished = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, binder, finished); + AssertEqual(finished, "5588673e72cb59c87d220caffe94f2dea9a3b1609f7d50e90a48227db9ed7eaa"); + + Span earlyTraffic = stackalloc byte[32]; + Span earlyExporter = stackalloc byte[32]; + schedule.DeriveEarly("c e traffic"u8, earlyTranscript, earlyTraffic); + schedule.DeriveEarly("e exp master"u8, earlyTranscript, earlyExporter); + AssertEqual(earlyTraffic, "3fbbe6a60deb66c30a32795aba0eff7eaa10105586e7be5c09678d63b6caab62"); + AssertEqual(earlyExporter, "b2026866610937d7423e5be90862ccf24c0e6091186d34f812089ff5be2ef7df"); + + schedule.AdvanceToHandshake(Hex("f44194756ff9ec9d25180635d66ea6824c6ab3bf179977be37f723570e7ccb2e")); + Span handshake = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Handshake, handshake); + AssertEqual(handshake, "005cb112fd8eb4ccc623bb88a07c64b3ede1605363fc7d0df8c7ce4ff0fb4ae6"); + schedule.AdvanceToMaster(); + Span master = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Master, master); + AssertEqual(master, "e2d32d4ed66dd37897a0e80c84107503ce58bf8aad4cb55a5002d77ecb890ece"); + } + + [TestMethod] + public void HelloRetryRequestSecretsMatchRfc8448Section5() + { + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(ReadOnlySpan.Empty); + schedule.AdvanceToHandshake(Hex("c142ce13ca11b5c2233652e63ad3d97844f1621fbfb9de69d547dc8fedeabeb4")); + Span handshake = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Handshake, handshake); + AssertEqual(handshake, "ce022e5e6e81e50736d773f2d3adfce8220d049bf510f0dbfac927ef4243b148"); + byte[] transcript = Hex("8aa8e828ec2f8a884fec95a3139de01c15a3daa7ff5bfc3f4bfcc21b438d7bf8"); + Span client = stackalloc byte[32]; + schedule.HandshakeTrafficSecret(client: true, transcript, client); + AssertEqual(client, "158aa7ab8855073582b41d674b4055cabcc534728f659314861b4e08e2011566"); + schedule.AdvanceToMaster(); + Span master = stackalloc byte[32]; + schedule.CopyStageSecret(KeyScheduleStage.Master, master); + AssertEqual(master, "1131545d0baf79ddce9b87f06945781a57dd18ef378dcd2060f8f9a569027ed8"); + } + + [TestMethod] + public void DisposeZeroesEveryStageSecret() + { + var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(Hex("4ecd0eb6ec3b4d87f5d6028f922ca4c5851a277fd41311c9e62d2c9492e1c4f3")); + Assert.IsFalse(schedule.IsStageZeroed(KeyScheduleStage.Early)); + schedule.Dispose(); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Early)); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Handshake)); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Master)); + } + + [TestMethod] + public void Sha384ScheduleMatchesIndependentHmac() + { + byte[] psk = new byte[48]; + byte[] dhe = new byte[32]; + byte[] transcript = new byte[48]; + Array.Fill(psk, (byte)0x11); + Array.Fill(dhe, (byte)0x22); + Array.Fill(transcript, (byte)0x33); + byte[] emptyHash = SHA384.HashData([]); + + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA384); + schedule.InitializeEarly(psk); + Span early = stackalloc byte[48]; + schedule.CopyStageSecret(KeyScheduleStage.Early, early); + Assert.IsTrue(early.SequenceEqual(ReferenceExtract(HashAlgorithmName.SHA384, psk, new byte[48]))); + + schedule.AdvanceToHandshake(dhe); + byte[] derived = ReferenceExpandLabel(HashAlgorithmName.SHA384, early.ToArray(), "derived", emptyHash, 48); + Span handshake = stackalloc byte[48]; + schedule.CopyStageSecret(KeyScheduleStage.Handshake, handshake); + Assert.IsTrue(handshake.SequenceEqual(ReferenceExtract(HashAlgorithmName.SHA384, dhe, derived))); + + Span traffic = stackalloc byte[48]; + schedule.HandshakeTrafficSecret(client: true, transcript, traffic); + Assert.IsTrue(traffic.SequenceEqual(ReferenceExpandLabel(HashAlgorithmName.SHA384, handshake.ToArray(), "c hs traffic", transcript, 48))); + + Span key = stackalloc byte[32]; + Span iv = stackalloc byte[12]; + TlsKeySchedule.DeriveTrafficKeys(HashAlgorithmName.SHA384, traffic, key, iv); + Assert.IsTrue(key.SequenceEqual(ReferenceExpandLabel(HashAlgorithmName.SHA384, traffic.ToArray(), "key", [], 32))); + Assert.IsTrue(iv.SequenceEqual(ReferenceExpandLabel(HashAlgorithmName.SHA384, traffic.ToArray(), "iv", [], 12))); + + schedule.AdvanceToMaster(); + byte[] derivedMaster = ReferenceExpandLabel(HashAlgorithmName.SHA384, handshake.ToArray(), "derived", emptyHash, 48); + Span master = stackalloc byte[48]; + schedule.CopyStageSecret(KeyScheduleStage.Master, master); + Assert.IsTrue(master.SequenceEqual(ReferenceExtract(HashAlgorithmName.SHA384, new byte[48], derivedMaster))); + } + + [TestMethod] + public void ExporterAndKeyUpdateMatchIndependentHmac() + { + byte[] exporterMaster = Hex("fe22f881176eda18eb8f44529e6792c50c9a3f89452f68d8ae311b4309d3cf50"); + byte[] label = "exp"u8.ToArray(); + byte[] context = "ctx"u8.ToArray(); + Span exported = stackalloc byte[20]; + TlsKeySchedule.ExportKeyingMaterial(HashAlgorithmName.SHA256, exporterMaster, label, context, exported); + byte[] emptyHash = SHA256.HashData([]); + byte[] derived = ReferenceExpandLabel(HashAlgorithmName.SHA256, exporterMaster, "exp", emptyHash, 32); + byte[] contextHash = SHA256.HashData(context); + Assert.IsTrue(exported.SequenceEqual(ReferenceExpandLabel(HashAlgorithmName.SHA256, derived, "exporter", contextHash, 20))); + + byte[] traffic = Hex("b3eddb126e067f35a780b3abf45e2d8f3b1a950738f52e9600746a0e27a55a21"); + Span next = stackalloc byte[32]; + TlsKeySchedule.NextTrafficSecret(HashAlgorithmName.SHA256, traffic, next); + Assert.IsTrue(next.SequenceEqual(ReferenceExpandLabel(HashAlgorithmName.SHA256, traffic, "traffic upd", [], 32))); + } + + [TestMethod] + public void CompleteZeroesTheMasterAfterTheApplicationSecrets() + { + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + schedule.InitializeEarly(ReadOnlySpan.Empty); + schedule.AdvanceToHandshake(new byte[32]); + schedule.AdvanceToMaster(); + byte[] hash = new byte[32]; + byte[] destination = new byte[32]; + schedule.ApplicationTrafficSecret(client: true, hash, destination); + schedule.ApplicationTrafficSecret(client: false, hash, destination); + schedule.ExporterMaster(hash, destination); + Assert.IsFalse(schedule.IsStageZeroed(KeyScheduleStage.Master)); + schedule.ResumptionMaster(hash, destination); + Assert.IsTrue(schedule.IsStageZeroed(KeyScheduleStage.Master)); + } + + [TestMethod] + public void OutOfOrderAdvanceThrows() + { + using var schedule = new TlsKeySchedule(HashAlgorithmName.SHA256); + Assert.ThrowsException(() => schedule.AdvanceToHandshake(new byte[32])); + schedule.InitializeEarly(ReadOnlySpan.Empty); + Assert.ThrowsException(() => schedule.AdvanceToMaster()); + } + + private static void AssertEqual(ReadOnlySpan actual, string expectedHex) + { + Assert.IsTrue(actual.SequenceEqual(Hex(expectedHex))); + } + + private static byte[] ReferenceExtract(HashAlgorithmName hash, byte[] ikm, byte[] salt) + { + using HMAC hmac = hash == HashAlgorithmName.SHA384 ? new HMACSHA384(salt) : new HMACSHA256(salt); + return hmac.ComputeHash(ikm); + } + + private static byte[] ReferenceExpandLabel(HashAlgorithmName hash, byte[] secret, string label, byte[] context, int length) + { + byte[] prefix = "tls13 "u8.ToArray(); + byte[] labelBytes = Encoding.ASCII.GetBytes(label); + byte[] info = new byte[2 + 1 + prefix.Length + labelBytes.Length + 1 + context.Length]; + info[0] = (byte)(length >> 8); + info[1] = (byte)length; + info[2] = (byte)(prefix.Length + labelBytes.Length); + prefix.CopyTo(info, 3); + labelBytes.CopyTo(info, 3 + prefix.Length); + int contextAt = 3 + prefix.Length + labelBytes.Length; + info[contextAt] = (byte)context.Length; + context.CopyTo(info, contextAt + 1); + return ReferenceExpand(hash, secret, info, length); + } + + private static byte[] ReferenceExpand(HashAlgorithmName hash, byte[] prk, byte[] info, int length) + { + int hashLength = hash == HashAlgorithmName.SHA384 ? 48 : 32; + byte[] okm = new byte[length]; + byte[] previous = []; + int offset = 0; + for (int counter = 1; offset < length; counter++) + { + using HMAC hmac = hash == HashAlgorithmName.SHA384 ? new HMACSHA384(prk) : new HMACSHA256(prk); + byte[] input = new byte[previous.Length + info.Length + 1]; + previous.CopyTo(input, 0); + info.CopyTo(input, previous.Length); + input[^1] = (byte)counter; + previous = hmac.ComputeHash(input); + int take = Math.Min(hashLength, length - offset); + previous.AsSpan(0, take).CopyTo(okm.AsSpan(offset)); + offset += take; + } + + return okm; + } + + private static byte[] Hex(string text) + { + byte[] bytes = new byte[text.Length / 2]; + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(text.Substring(i * 2, 2), 16); + } + + return bytes; + } +} diff --git a/tests/Titanium.Tls.Tests/MlKem768Tests.cs b/tests/Titanium.Tls.Tests/MlKem768Tests.cs new file mode 100644 index 000000000..a89663da8 --- /dev/null +++ b/tests/Titanium.Tls.Tests/MlKem768Tests.cs @@ -0,0 +1,212 @@ +using System; +using System.Diagnostics; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class KeccakTests +{ + [TestMethod] + public void ManagedSha3AndShakeMatchThePlatform() + { + if (!SHA3_256.IsSupported) + { + Assert.Inconclusive("SHA-3 is not available on this runtime."); + return; + } + + byte[] message = "ML-KEM"u8.ToArray(); + Span managed = stackalloc byte[64]; + Span platform = stackalloc byte[64]; + IKeccak keccak = ManagedKeccak.Instance; + keccak.Sha3_256(message, managed[..32]); + SHA3_256.HashData(message, platform[..32]); + Assert.IsTrue(managed[..32].SequenceEqual(platform[..32])); + keccak.Sha3_512(message, managed); + SHA3_512.HashData(message, platform); + Assert.IsTrue(managed.SequenceEqual(platform)); + keccak.Shake128(message, managed); + Shake128.HashData(message, platform); + Assert.IsTrue(managed.SequenceEqual(platform)); + keccak.Shake256(message, managed); + Shake256.HashData(message, platform); + Assert.IsTrue(managed.SequenceEqual(platform)); + keccak.Sha3_256(ReadOnlySpan.Empty, managed[..32]); + SHA3_256.HashData(ReadOnlySpan.Empty, platform[..32]); + Assert.IsTrue(managed[..32].SequenceEqual(platform[..32])); + } +} + +[TestClass] +public sealed class MlKem768Tests +{ + [TestMethod] + public void ZetaPowersMatchFips203AppendixA() + { + Assert.AreEqual(1, Pow(17, 0)); + Assert.AreEqual(1729, Pow(17, BitRev7(1))); + Assert.AreEqual(2580, Pow(17, BitRev7(2))); + Assert.AreEqual(3289, Pow(17, BitRev7(3))); + Assert.AreEqual(17, Pow(17, (2 * BitRev7(0)) + 1)); + Assert.AreEqual(3329 - 17, Pow(17, (2 * BitRev7(1)) + 1)); + Assert.AreEqual(1, (3303 * 128) % 3329); + } + + [TestMethod] + public void ManagedRoundTripAgreesWithItself() + { + IMlKem768 kem = ManagedMlKem768.Instance; + byte[] d = new byte[32]; + byte[] z = new byte[32]; + d[0] = 1; + z[0] = 2; + byte[] ek = new byte[ManagedMlKem768.EncapsulationKeyLength]; + byte[] dk = new byte[ManagedMlKem768.DecapsulationKeyLength]; + kem.GenerateKeyPair(ek, dk, d, z); + byte[] message = new byte[32]; + message[0] = 3; + byte[] ciphertext = new byte[ManagedMlKem768.CiphertextLength]; + byte[] secret = new byte[32]; + Assert.IsTrue(kem.TryEncapsulate(ek, message, ciphertext, secret)); + byte[] opened = new byte[32]; + Assert.IsTrue(kem.TryDecapsulate(dk, ciphertext, opened)); + Assert.IsTrue(opened.AsSpan().SequenceEqual(secret)); + ciphertext[0] ^= 0xFF; + byte[] rejected = new byte[32]; + Assert.IsTrue(kem.TryDecapsulate(dk, ciphertext, rejected)); + Assert.IsFalse(rejected.AsSpan().SequenceEqual(secret)); + } + + [TestMethod] + public void ManagedAgreesWithThePlatformInBothDirections() + { + if (!MLKem.IsSupported) + { + Assert.Inconclusive("ML-KEM is not available on this runtime."); + return; + } + + IMlKem768 managed = ManagedMlKem768.Instance; + byte[] ek = new byte[ManagedMlKem768.EncapsulationKeyLength]; + byte[] dk = new byte[ManagedMlKem768.DecapsulationKeyLength]; + managed.GenerateKeyPair(ek, dk); + using MLKem platformKey = MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, ek); + byte[] ciphertext = new byte[ManagedMlKem768.CiphertextLength]; + byte[] platformSecret = new byte[32]; + platformKey.Encapsulate(ciphertext, platformSecret); + byte[] managedSecret = new byte[32]; + Assert.IsTrue(managed.TryDecapsulate(dk, ciphertext, managedSecret)); + Assert.IsTrue(managedSecret.AsSpan().SequenceEqual(platformSecret)); + + using MLKem generated = MLKem.GenerateKey(MLKemAlgorithm.MLKem768); + generated.ExportEncapsulationKey(ek); + generated.ExportDecapsulationKey(dk); + byte[] message = new byte[32]; + RandomNumberGenerator.Fill(message); + Assert.IsTrue(managed.TryEncapsulate(ek, message, ciphertext, managedSecret)); + generated.Decapsulate(ciphertext, platformSecret); + Assert.IsTrue(platformSecret.AsSpan().SequenceEqual(managedSecret)); + ciphertext[10] ^= 0x5A; + Assert.IsTrue(managed.TryDecapsulate(dk, ciphertext, managedSecret)); + generated.Decapsulate(ciphertext, platformSecret); + Assert.IsTrue(platformSecret.AsSpan().SequenceEqual(managedSecret)); + } + + [TestMethod] + public void SeededEncapsulationAllocatesNothingAfterWarmup() + { + IMlKem768 kem = ManagedMlKem768.Instance; + byte[] ek = new byte[ManagedMlKem768.EncapsulationKeyLength]; + byte[] dk = new byte[ManagedMlKem768.DecapsulationKeyLength]; + kem.GenerateKeyPair(ek, dk); + byte[] message = new byte[32]; + byte[] ciphertext = new byte[ManagedMlKem768.CiphertextLength]; + byte[] secret = new byte[32]; + AllocationGate.AssertNone(() => Assert.IsTrue(kem.TryEncapsulate(ek, message, ciphertext, secret))); + } + + [TestMethod] + public void EncapsulationCostStaysUnderTwoMilliseconds() + { + if (!MLKem.IsSupported) + { + Assert.Inconclusive("ML-KEM is not available on this runtime."); + return; + } + + IMlKem768 managed = ManagedMlKem768.Instance; + byte[] ek = new byte[ManagedMlKem768.EncapsulationKeyLength]; + byte[] dk = new byte[ManagedMlKem768.DecapsulationKeyLength]; + managed.GenerateKeyPair(ek, dk); + byte[] message = new byte[32]; + byte[] ciphertext = new byte[ManagedMlKem768.CiphertextLength]; + byte[] secret = new byte[32]; + managed.TryEncapsulate(ek, message, ciphertext, secret); + var watch = Stopwatch.StartNew(); + const int iterations = 50; + for (int i = 0; i < iterations; i++) + { + managed.TryEncapsulate(ek, message, ciphertext, secret); + } + + watch.Stop(); + double managedUs = watch.Elapsed.TotalMicroseconds / iterations; + using MLKem platform = MLKem.ImportEncapsulationKey(MLKemAlgorithm.MLKem768, ek); + platform.Encapsulate(ciphertext, secret); + watch.Restart(); + for (int i = 0; i < iterations; i++) + { + platform.Encapsulate(ciphertext, secret); + } + + watch.Stop(); + double platformUs = watch.Elapsed.TotalMicroseconds / iterations; + Assert.IsTrue(managedUs < 2000, $"managed {managedUs:F1} µs, platform {platformUs:F1} µs"); + } + + [TestMethod] + public void MalformedKeysAreRejected() + { + IMlKem768 kem = ManagedMlKem768.Instance; + byte[] ek = new byte[ManagedMlKem768.EncapsulationKeyLength]; + byte[] dk = new byte[ManagedMlKem768.DecapsulationKeyLength]; + kem.GenerateKeyPair(ek, dk); + ek[0] = 0xFF; + ek[1] = 0xFF; + Assert.IsFalse(kem.TryEncapsulate(ek, new byte[ManagedMlKem768.CiphertextLength], new byte[32])); + dk[(3 * 384) + 1184] ^= 0xFF; + Assert.IsFalse(kem.TryDecapsulate(dk, new byte[ManagedMlKem768.CiphertextLength], new byte[32])); + } + + private static int Pow(int value, int exponent) + { + int result = 1; + while (exponent > 0) + { + if ((exponent & 1) == 1) + { + result = (int)((long)result * value % 3329); + } + + value = (int)((long)value * value % 3329); + exponent >>= 1; + } + + return result; + } + + private static int BitRev7(int value) + { + int reversed = 0; + for (int bit = 0; bit < 7; bit++) + { + reversed = (reversed << 1) | (value & 1); + value >>= 1; + } + + return reversed; + } +} diff --git a/tests/Titanium.Tls.Tests/RealPeerTests.cs b/tests/Titanium.Tls.Tests/RealPeerTests.cs new file mode 100644 index 000000000..85edac709 --- /dev/null +++ b/tests/Titanium.Tls.Tests/RealPeerTests.cs @@ -0,0 +1,64 @@ +using System; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Text; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class RealPeerTests +{ + public TestContext TestContext { get; set; } = null!; + + [TestMethod] + [TestCategory("Slow")] + [Timeout(120000)] + public void ManagedClientHandshakesWellKnownHosts() + { + if (!string.Equals(Environment.GetEnvironmentVariable("TITANIUM_REAL_PEERS"), "1", StringComparison.Ordinal)) + { + Assert.Inconclusive("Set TITANIUM_REAL_PEERS=1 to handshake the fixed host list."); + } + + string[] hosts = ["www.cloudflare.com", "www.google.com", "github.com", "www.microsoft.com", "www.wikipedia.org"]; + var report = new StringBuilder(); + int succeeded = 0; + foreach (string host in hosts) + { + string line = Handshake(host); + report.AppendLine(line); + TestContext.WriteLine(line); + if (line.Contains(" ok ", StringComparison.Ordinal)) + { + succeeded++; + } + } + + Assert.IsTrue(succeeded > 0, report.ToString()); + } + + private static string Handshake(string host) + { + using var tcp = new TcpClient(); + tcp.ReceiveTimeout = 15000; + tcp.SendTimeout = 15000; + try + { + tcp.Connect(host, 443); + using var stream = new TlsStream(tcp.GetStream()); + stream.AuthenticateAsClient(new SslClientAuthenticationOptions + { + TargetHost = host, + EnabledSslProtocols = SslProtocols.Tls13, + ApplicationProtocols = [SslApplicationProtocol.Http11], + }); + return host + " ok " + stream.NegotiatedCipherSuite + " " + stream.NegotiatedApplicationProtocol; + } + catch (Exception ex) + { + return host + " fail " + ex.GetType().Name + ": " + ex.Message; + } + } +} diff --git a/tests/Titanium.Tls.Tests/RecordProtectorTests.cs b/tests/Titanium.Tls.Tests/RecordProtectorTests.cs new file mode 100644 index 000000000..ea20fbd6c --- /dev/null +++ b/tests/Titanium.Tls.Tests/RecordProtectorTests.cs @@ -0,0 +1,217 @@ +using System; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class RecordProtectorTests +{ private const string ServerFlightPlain = "080000240022000a00140012001d00170018001901000101010201030104001c00024001000000000b0001b9000001b50001b0308201ac30820115a003020102020102300d06092a864886f70d01010b0500300e310c300a06035504031303727361301e170d3136303733303031323335395a170d3236303733303031323335395a300e310c300a0603550403130372736130819f300d06092a864886f70d010101050003818d0030818902818100b4bb498f8279303d980836399b36c6988c0c68de55e1bdb826d3901a2461eafd2de49a91d015abbc9a95137ace6c1af19eaa6af98c7ced43120998e187a80ee0ccb0524b1b018c3e0b63264d449a6d38e22a5fda430846748030530ef0461c8ca9d9efbfae8ea6d1d03e2bd193eff0ab9a8002c47428a6d35a8d88d79f7f1e3f0203010001a31a301830090603551d1304023000300b0603551d0f0404030205a0300d06092a864886f70d01010b05000381810085aad2a0e5b9276b908c65f73a7267170618a54c5f8a7b337d2df7a594365417f2eae8f8a58c8f8172f9319cf36b7fd6c55b80f21a03015156726096fd335e5e67f2dbf102702e608ccae6bec1fc63a42a99be5c3eb7107c3c54e9b9eb2bd5203b1c3b84e0a8b2f759409ba3eac9d91d402dcc0cc8f8961229ac9187b42b4de100000f000084080400805a747c5d88fa9bd2e55ab085a61015b7211f824cd484145ab3ff52f1fda8477b0b7abc90db78e2d33a5c141a078653fa6bef780c5ea248eeaaa785c4f394cab6d30bbe8d4859ee511f602957b15411ac027671459e46445c9ea58c181e818e95b8c3fb0bf3278409d3be152a3da5043e063dda65cdf5aea20d53dfacd42f74f3140000209b9b141d906337fbd2cbdce71df4deda4ab42c309572cb7fffee5454b78f0718"; + private const string ServerFlightRecord = "17030302a2d1ff334a56f5bff6594a07cc87b580233f500f45e489e7f33af35edf7869fcf40aa40aa2b8ea73f848a7ca07612ef9f945cb960b4068905123ea78b111b429ba9191cd05d2a389280f526134aadc7fc78c4b729df828b5ecf7b13bd9aefb0e57f271585b8ea9bb355c7c79020716cfb9b1183ef3ab20e37d57a6b9d7477609aee6e122a4cf51427325250c7d0e509289444c9b3a648f1d71035d2ed65b0e3cdd0cbae8bf2d0b227812cbb360987255cc744110c453baa4fcd610928d809810e4b7ed1a8fd991f06aa6248204797e36a6a73b70a2559c09ead686945ba246ab66e5edd8044b4c6de3fcf2a89441ac66272fd8fb330ef8190579b3684596c960bd596eea520a56a8d650f563aad27409960dca63d3e688611ea5e22f4415cf9538d51a200c27034272968a264ed6540c84838d89f72c24461aad6d26f59ecaba9acbbb317b66d902f4f292a36ac1b639c637ce343117b659622245317b49eeda0c6258f100d7d961ffb138647e92ea330faeea6dfa31c7a84dc3bd7e1b7a6c7178af36879018e3f252107f243d243dc7339d5684c8b0378bf30244da8c87c843f5e56eb4c5e8280a2b48052cf93b16499a66db7cca71e4599426f7d461e66f99882bd89fc50800becca62d6c74116dbd2972fda1fa80f85df881edbe5a37668936b335583b599186dc5c6918a396fa48a181d6b6fa4f9d62d513afbb992f2b992f67f8afe67f76913fa388cb5630c8ca01e0c65d11c66a1e2ac4c85977b7c7a6999bbf10dc35ae69f5515614636c0b9b68c19ed2e31c0b3b66763038ebba42f3b38edc0399f3a9f23faa63978c317fc9fa66a73f60f0504de93b5b845e275592c12335ee340bbc4fddd502784016e4b3be7ef04dda49f4b440a30cb5d2af939828fd4ae3794e44f94df5a631ede42c1719bfdabf0253fe5175be898e750edc53370d2b"; + private const string ClientFinishedPlain = "14000020a8ec436d677634ae525ac1fcebe11a039ec17694fac6e98527b642f2edd5ce61"; + private const string ClientFinishedRecord = "170303003575ec4dc238cce60b298044a71e219c56cc77b0517fe9b93c7a4bfc44d87f38f80338ac98fc46deb384bd1caeacab6867d726c40546"; + + [TestMethod] + public void UnprotectsRfc8448ServerHandshakeFlight() + { + byte[] record = Hex(ServerFlightRecord); + using var protector = new TlsRecordProtector( + TlsAeadSuite.Aes128Gcm, + Hex("3fce516009c21727d0f2e4e86ee403bc"), + Hex("5d313eb2671276ee13000b30")); + byte type = protector.Unprotect(record, out int length); + Assert.AreEqual(22, type); + Assert.IsTrue(record.AsSpan(5, length).SequenceEqual(Hex(ServerFlightPlain))); + } + + [TestMethod] + public void UnprotectsRfc8448ClientFinished() + { + byte[] record = Hex(ClientFinishedRecord); + using var protector = new TlsRecordProtector( + TlsAeadSuite.Aes128Gcm, + Hex("dbfaa693d1762c5b666af5d950258d01"), + Hex("5bd3c71b836e0b76bb73265f")); + byte type = protector.Unprotect(record, out int length); + Assert.AreEqual(22, type); + Assert.IsTrue(record.AsSpan(5, length).SequenceEqual(Hex(ClientFinishedPlain))); + } + + [TestMethod] + public void RoundTripsAesAndChaChaWithPadding() + { + RoundTrip(TlsAeadSuite.Aes128Gcm, 16); + RoundTrip(TlsAeadSuite.Aes256Gcm, 32); + RoundTrip(TlsAeadSuite.ChaCha20Poly1305, 32); + } + + [TestMethod] + [RfcRequirement("RFC 8446", "5", "RecordProtectorTests.RejectsTamperReplayOverflowAndEmptyInner")] + public void RejectsTamperReplayOverflowAndEmptyInner() + { + byte[] key = new byte[16]; + byte[] iv = new byte[12]; + key[0] = 1; + iv[0] = 2; + using var write = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv, keyUpdateAfter: 1); + byte[] plain = [1, 2, 3, 4]; + byte[] record = new byte[64]; + int written = write.Protect(22, plain, record); + Assert.IsTrue(write.KeyUpdateDue); + + byte[] opened = record[..written]; + using var read = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + byte type = read.Unprotect(opened, out int length); + Assert.AreEqual(22, type); + Assert.IsTrue(opened.AsSpan(5, length).SequenceEqual(plain)); + TlsRecordException replay = Assert.ThrowsException(() => read.Unprotect(opened, out _)); + Assert.AreEqual(TlsRecordAlert.BadRecordMac, replay.Alert); + + byte[] tampered = record[..written]; + tampered[^1] ^= 1; + using var read2 = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + TlsRecordException badMac = Assert.ThrowsException(() => read2.Unprotect(tampered, out _)); + Assert.AreEqual(TlsRecordAlert.BadRecordMac, badMac.Alert); + + byte[] atTheContentLimit = new byte[TlsRecordProtector.MaxPlaintext]; + int full = write.Protect(23, atTheContentLimit, new byte[atTheContentLimit.Length + 64]); + Assert.AreEqual(TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxPlaintext + 1 + TlsRecordProtector.TagLength, full); + byte[] largest = new byte[TlsRecordProtector.MaxPlaintext - 1]; + int largestWritten = write.Protect(23, largest, new byte[TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxPlaintext + TlsRecordProtector.TagLength]); + Assert.AreEqual(TlsRecordProtector.HeaderLength + TlsRecordProtector.MaxPlaintext + TlsRecordProtector.TagLength, largestWritten); + byte[] huge = new byte[TlsRecordProtector.MaxPlaintext + 1]; + TlsRecordException overflow = Assert.ThrowsException(() => write.Protect(23, huge, new byte[huge.Length + 64])); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, overflow.Alert); + TlsRecordException paddedPastTheLimit = Assert.ThrowsException(() => write.Protect(23, new byte[8], new byte[64], padding: int.MaxValue)); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, paddedPastTheLimit.Alert); + + int oversizeCipher = TlsRecordProtector.MaxPlaintext + 2 + TlsRecordProtector.TagLength; + byte[] oversize = new byte[TlsRecordProtector.HeaderLength + oversizeCipher]; + oversize[0] = 23; + oversize[1] = 3; + oversize[2] = 3; + oversize[3] = (byte)(oversizeCipher >> 8); + oversize[4] = (byte)oversizeCipher; + using var limit = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + RecordResult oversizeResult = limit.TryUnprotect(oversize); + Assert.IsFalse(oversizeResult.Success); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, oversizeResult.Alert); + + byte[] shortRecord = [23, 3, 3, 0, 0]; + TlsRecordException empty = Assert.ThrowsException(() => read2.Unprotect(shortRecord, out _)); + Assert.AreEqual(TlsRecordAlert.UnexpectedMessage, empty.Alert); + + Assert.IsFalse(TlsRecordProtector.TryReadInner(new byte[8], out _, out _)); + Assert.IsTrue(TlsRecordProtector.TryReadInner([9, 22, 0, 0], out byte innerType, out int innerLength)); + Assert.AreEqual(22, innerType); + Assert.AreEqual(1, innerLength); + } + + [TestMethod] + public void PlaintextHeaderRejectsOverflowAndAcceptsOneChangeCipherSpec() + { + byte[] overflow = [22, 3, 3, 0x41, 0x01]; + Assert.IsFalse(TlsPlaintextRecord.TryReadHeader(overflow, out _, out _, out _, out TlsRecordAlert alert)); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, alert); + + byte[] ccs = [20, 3, 3, 0, 1, 1]; + int accepted = 0; + Assert.IsTrue(TlsPlaintextRecord.TryAcceptChangeCipherSpec(ccs, ref accepted)); + Assert.IsFalse(TlsPlaintextRecord.TryAcceptChangeCipherSpec(ccs, ref accepted)); + } + + [TestMethod] + public void SequenceNearOverflowRejectsTheNextRecord() + { + using var write = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, new byte[16], new byte[12]); + using var read = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, new byte[16], new byte[12]); + write.SetSequence(ulong.MaxValue - 1); + read.SetSequence(ulong.MaxValue - 1); + byte[] record = new byte[64]; + int written = write.Protect(23, [1, 2, 3], record); + Assert.AreEqual(ulong.MaxValue, write.Sequence); + byte[] opened = record[..written]; + byte type = read.Unprotect(opened, out int length); + Assert.AreEqual(23, type); + Assert.AreEqual(3, length); + Assert.AreEqual(ulong.MaxValue, read.Sequence); + TlsRecordException protect = Assert.ThrowsException(() => write.Protect(23, [1], record)); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, protect.Alert); + RecordResult blocked = read.TryUnprotect(opened); + Assert.IsFalse(blocked.Success); + Assert.AreEqual(TlsRecordAlert.RecordOverflow, blocked.Alert); + } + + [TestMethod] + public void DisposeZeroesTheIv() + { + byte[] iv = new byte[12]; + iv[3] = 9; + var protector = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, new byte[16], iv); + Assert.IsFalse(protector.IvIsZeroed); + protector.Dispose(); + Assert.IsTrue(protector.IvIsZeroed); + } + + [TestMethod] + public void ProtectAddsNoAllocationBeyondTheAead() + { + byte[] key = new byte[16]; + byte[] iv = new byte[12]; + byte[] plain = new byte[32]; + using var protector = new TlsRecordProtector(TlsAeadSuite.Aes128Gcm, key, iv); + byte[] destination = new byte[128]; + protector.Protect(23, plain, destination); + using var aes = new AesGcm(key, 16); + Span nonce = stackalloc byte[12]; + Span cipher = stackalloc byte[32]; + Span tag = stackalloc byte[16]; + aes.Encrypt(nonce, plain, cipher, tag); + + const int iterations = 32; + long before = GC.GetAllocatedBytesForCurrentThread(); + for (int i = 0; i < iterations; i++) + { + aes.Encrypt(nonce, plain, cipher, tag); + } + + long aeadOnly = GC.GetAllocatedBytesForCurrentThread() - before; + before = GC.GetAllocatedBytesForCurrentThread(); + for (int i = 0; i < iterations; i++) + { + protector.Protect(23, plain, destination); + } + + long protect = GC.GetAllocatedBytesForCurrentThread() - before; + Assert.IsTrue(protect <= aeadOnly); + } + + private static void RoundTrip(TlsAeadSuite suite, int keyLength) + { + byte[] key = new byte[keyLength]; + byte[] iv = new byte[12]; + key[1] = 7; + iv[2] = 8; + byte[] plain = [10, 20, 30, 40, 50]; + using var write = new TlsRecordProtector(suite, key, iv); + using var read = new TlsRecordProtector(suite, key, iv); + byte[] record = new byte[64]; + int written = write.Protect(23, plain, record, padding: 3); + byte[] opened = record[..written]; + byte type = read.Unprotect(opened, out int length); + Assert.AreEqual(23, type); + Assert.IsTrue(opened.AsSpan(5, length).SequenceEqual(plain)); + } + + private static byte[] Hex(string text) + { + byte[] bytes = new byte[text.Length / 2]; + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(text.Substring(i * 2, 2), 16); + } + + return bytes; + } +} \ No newline at end of file diff --git a/tests/Titanium.Tls.Tests/Rfc8448CertificateTests.cs b/tests/Titanium.Tls.Tests/Rfc8448CertificateTests.cs new file mode 100644 index 000000000..5f5baf03e --- /dev/null +++ b/tests/Titanium.Tls.Tests/Rfc8448CertificateTests.cs @@ -0,0 +1,86 @@ +using System; +using System.IO; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class Rfc8448CertificateTests +{ + private const string ClientHello = "010000c00303cb34ecb1e78163ba1c38c6dacb196a6dffa21a8d9912ec18a2ef6283024dece7000006130113031302010000910000000b0009000006736572766572ff01000100000a00140012001d0017001800190100010101020103010400230000003300260024001d002099381de560e4bd43d23d8e435a7dbafeb3c06e51c13cae4d5413691e529aaf2c002b0003020304000d0020001e040305030603020308040805080604010501060102010402050206020202002d00020101001c00024001"; + private const string ServerHello = "020000560303a6af06a4121860dc5e6e60249cd34c95930c8ac5cb1434dac155772ed3e2692800130100002e00330024001d0020c9828876112095fe66762bdbf7c672e156d6cc253b833df1dd69b1b04e751f0f002b00020304"; + + [TestMethod] + public void Section3CertificateVerifyAndFinishedMatch() + { + byte[] flight = Convert.FromHexString(File.ReadAllText(FindFixture("rfc8448-server-handshake.hex")).Trim()); + int at = 0; + ReadOnlySpan extensions = Take(flight, ref at); + ReadOnlySpan certificate = Take(flight, ref at); + ReadOnlySpan verify = Take(flight, ref at); + ReadOnlySpan finished = Take(flight, ref at); + Assert.AreEqual(0, flight.Length - at); + Assert.IsTrue(HandshakeMessages.TryReadCertificateVerify(verify, out ushort scheme, out ReadOnlySpan signature, out _)); + Assert.AreEqual(0x0804, scheme); + + using var transcript = new TranscriptStore(HashAlgorithmName.SHA256); + transcript.Append(Convert.FromHexString(ClientHello)); + transcript.Append(Convert.FromHexString(ServerHello)); + transcript.Append(extensions); + transcript.Append(certificate); + Span hash = stackalloc byte[32]; + transcript.CurrentHash(hash); + int derAt = 4 + 1 + 3 + 3; + int derLength = (certificate[derAt - 3] << 16) | (certificate[derAt - 2] << 8) | certificate[derAt - 1]; + using X509Certificate2 leaf = X509CertificateLoader.LoadCertificate(certificate.Slice(derAt, derLength)); + Span content = stackalloc byte[64 + 33 + 1 + 32]; + content[..64].Fill(0x20); + "TLS 1.3, server CertificateVerify"u8.CopyTo(content[64..]); + content[64 + 33] = 0; + hash.CopyTo(content[(64 + 33 + 1)..]); + Assert.AreEqual("764D6632B3C35C3F3205E3499AC3EDBAABB88295FBA751461D3678E2E5EA0687", Convert.ToHexString(hash)); + using RSA publicKey = leaf.GetRSAPublicKey()!; + Assert.IsTrue(publicKey.VerifyData(content, signature, HashAlgorithmName.SHA256, RSASignaturePadding.Pss)); + Assert.IsTrue(publicKey.KeySize < 2048); + Assert.IsFalse(TlsCertificateVerifier.Verify(leaf, scheme, content, signature)); + + transcript.Append(verify); + transcript.CurrentHash(hash); + Span handshakeSecret = stackalloc byte[32]; + Convert.FromHexString("b67b7d690cc16c4e75e54213cb2d37b4e9c912bcded9105d42befd59d391ad38").CopyTo(handshakeSecret); + Span finishedKey = stackalloc byte[32]; + TlsKeySchedule.FinishedKey(HashAlgorithmName.SHA256, handshakeSecret, finishedKey); + Span mac = stackalloc byte[32]; + HMACSHA256.HashData(finishedKey, hash, mac); + Assert.IsTrue(mac.SequenceEqual(finished[4..])); + } + + private static ReadOnlySpan Take(byte[] flight, ref int at) + { + int length = (flight[at + 1] << 16) | (flight[at + 2] << 8) | flight[at + 3]; + int total = 4 + length; + ReadOnlySpan message = flight.AsSpan(at, total); + at += total; + return message; + } + + private static string FindFixture(string name) + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", name); + if (File.Exists(candidate)) + { + return candidate; + } + + dir = dir.Parent; + } + + Assert.Fail(name + " was not found."); + return string.Empty; + } +} diff --git a/tests/Titanium.Tls.Tests/ServerHandshakeTests.cs b/tests/Titanium.Tls.Tests/ServerHandshakeTests.cs new file mode 100644 index 000000000..d6ead5536 --- /dev/null +++ b/tests/Titanium.Tls.Tests/ServerHandshakeTests.cs @@ -0,0 +1,645 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class ServerHandshakeTests +{ + [TestMethod] + public void ClientAndServerFinishTheHandshake() + { + using var pair = HandshakePair.Run(); + Assert.AreEqual(TlsEngineState.Connected, pair.Client.State); + Assert.AreEqual(TlsEngineState.Connected, pair.Server.State); + } + + [TestMethod] + public void RejectedHelloIsHandshakeFailure() + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(false, output); + Assert.AreEqual(40, output.Bytes[6]); + Assert.AreEqual(TlsEngineState.Closed, server.State); + } + + [TestMethod] + public async Task CallbackExceptionIsInternalError() + { + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + await Task.Yield(); + server.Resume(static _ => throw new InvalidOperationException("selection failed"), output); + Assert.AreEqual(80, output.Bytes[6]); + Assert.AreEqual(TlsEngineState.Closed, server.State); + } + + [TestMethod] + public void ServerNameIsVisibleToTheCallback() + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + string? seen = null; + using X509Certificate2 certificate = Certificate(); + server.Resume(info => + { + seen = info.ServerName; + return new TlsServerSelection { Certificate = certificate }; + }, output); + Assert.AreEqual("localhost", seen); + Assert.AreEqual(TlsEngineState.WaitFinished, server.State); + } + + [TestMethod] + public void ZeroLengthRecordWhileWaitingForFinishedCloses() + { + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + using X509Certificate2 certificate = Certificate(); + server.Resume(_ => new TlsServerSelection { Certificate = certificate }, output); + Assert.AreEqual(TlsEngineState.WaitFinished, server.State); + var alert = new TlsOutput(); + byte[] empty = [23, 3, 3, 0, 0]; + server.Advance(empty, out _, alert); + output = alert; + Assert.AreEqual(TlsEngineState.Closed, server.State); + Assert.IsTrue(output.Bytes.Length > 0, "a zero-length record must produce an alert"); + } + + [TestMethod] + [Timeout(10000)] + public async Task ZeroLengthRecordOnTheSocketWritesAnAlert() + { + using X509Certificate2 certificate = Certificate(); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task serverTask = Task.Run(async () => + { + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using var stream = new TlsStream(accepted.GetStream()); + try + { + await stream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }); + return null; + } + catch (Exception error) + { + return error; + } + }); + + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + var flight = new TlsOutput(); + client.Advance([], out _, flight); + using var tcp = new TcpClient(); + tcp.Connect(IPAddress.Loopback, port); + NetworkStream raw = tcp.GetStream(); + raw.ReadTimeout = 500; + raw.Write(flight.Bytes); + var buffer = new byte[8192]; + int received = 0; + while (true) + { + try + { + int n = raw.Read(buffer, 0, buffer.Length); + if (n <= 0) + { + break; + } + + received += n; + } + catch (IOException) + { + break; + } + } + + Assert.IsTrue(received > 0, "the server must answer the ClientHello"); + raw.Write(new byte[] { 23, 3, 3, 0, 0 }); + raw.ReadTimeout = 2000; + int alertBytes; + try + { + alertBytes = raw.Read(buffer, 0, buffer.Length); + } + catch (IOException error) + { + Exception? pending = serverTask.IsCompleted ? await serverTask : null; + Assert.Fail($"no alert arrived ({pending?.GetType().Name}: {pending?.Message}): {error.Message}"); + return; + } + + Assert.IsTrue(alertBytes > 0); + Exception? serverError = await serverTask; + Assert.IsInstanceOfType(serverError); + } + + [TestMethod] + public void HelloRetryThenFinishes() + { + using X509Certificate2 certificate = Certificate(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = certificate, Groups = [NamedGroup.Secp256r1] }, output); + Assert.AreEqual(0xCF, output.Bytes[11]); + client.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual(TlsEngineState.WaitServerHelloOrHrr, client.State); + server.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual(TlsEngineState.WaitFinished, server.State); + client.Advance(output.Bytes.ToArray(), out _, output); + client.Resume(true, output); + server.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual(TlsEngineState.Connected, client.State); + Assert.AreEqual(TlsEngineState.Connected, server.State); + } + + [DataTestMethod] + [DataRow((ushort)0x001D)] + [DataRow((ushort)0x0017)] + [DataRow((ushort)0x0018)] + [DataRow((ushort)0x11EC)] + public void ChromeProfileFinishesWithTheGroupTheServerNames(ushort groupId) + { + using X509Certificate2 certificate = Certificate(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + client.FingerprintProfile = new ChromeFingerprintProfile(new SystemEntropy(), TlsFingerprintFidelity.Full); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = certificate, Groups = [(NamedGroup)groupId] }, output); + for (int i = 0; i < 4 && client.State != TlsEngineState.Connected; i++) + { + byte[] toClient = output.Bytes.ToArray(); + client.Advance(toClient, out _, output); + Assert.AreNotEqual(TlsEngineState.Closed, client.State, groupId + " closed the client: " + Convert.ToHexString(output.Bytes.ToArray())); + if (client.State == TlsEngineState.WaitCertificateDecision) + { + client.Resume(true, output); + } + + byte[] toServer = output.Bytes.ToArray(); + if (toServer.Length > 0) + { + server.Advance(toServer, out _, output); + Assert.AreNotEqual(TlsEngineState.Closed, server.State, groupId + " closed the server: " + Convert.ToHexString(output.Bytes.ToArray())); + } + } + + Assert.AreEqual(TlsEngineState.Connected, client.State, groupId.ToString()); + } + + // A Schannel server without X25519 answers the Chrome hello with a HelloRetryRequest for P-256 + // and its own cipher preference, TLS_AES_256_GCM_SHA384. RFC 8446 section 4.1.4 lets the + // retry name any suite the hello offered, and section 4.4.1 hashes the first hello with that suite. + [DataTestMethod] + [DataRow((ushort)0x1301, TlsFingerprintFidelity.ReducedNoPostQuantum)] + [DataRow((ushort)0x1302, TlsFingerprintFidelity.ReducedNoPostQuantum)] + [DataRow((ushort)0x1303, TlsFingerprintFidelity.ReducedNoPostQuantum)] + [DataRow((ushort)0x1302, TlsFingerprintFidelity.Full)] + [DataRow((ushort)0x1303, TlsFingerprintFidelity.Full)] + public void ChromeProfileFinishesAHelloRetryThatNamesTheServerCipher(ushort cipher, TlsFingerprintFidelity fidelity) + { + using X509Certificate2 certificate = Certificate(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + client.FingerprintProfile = new ChromeFingerprintProfile(new SystemEntropy(), fidelity); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection + { + Certificate = certificate, + Groups = [NamedGroup.Secp256r1], + CipherSuites = [cipher], + }, output); + Assert.AreEqual(0xCF, output.Bytes[11]); + for (int i = 0; i < 4 && client.State != TlsEngineState.Connected; i++) + { + byte[] toClient = output.Bytes.ToArray(); + client.Advance(toClient, out _, output); + Assert.AreNotEqual(TlsEngineState.Closed, client.State, cipher.ToString("x4") + " closed the client: " + Convert.ToHexString(output.Bytes.ToArray())); + if (client.State == TlsEngineState.WaitCertificateDecision) + { + client.Resume(true, output); + } + + byte[] toServer = output.Bytes.ToArray(); + if (toServer.Length > 0) + { + server.Advance(toServer, out _, output); + Assert.AreNotEqual(TlsEngineState.Closed, server.State, cipher.ToString("x4") + " closed the server: " + Convert.ToHexString(output.Bytes.ToArray())); + } + } + + Assert.AreEqual(TlsEngineState.Connected, client.State, cipher.ToString("x4")); + Assert.AreEqual(TlsEngineState.Connected, server.State, cipher.ToString("x4")); + } + + [TestMethod] + public void NoCommonCipherOrGroupFails() + { + using X509Certificate2 certificate = Certificate(); + AssertAlert(certificate, new TlsServerSelection { Certificate = certificate, CipherSuites = [0x1302] }, 40); + AssertAlert(certificate, new TlsServerSelection { Certificate = certificate, Groups = [NamedGroup.Secp384r1] }, 40); + } + + [TestMethod] + public void ClientCipherOrderIsHonoredUnlessTheServerPrefersItsOwn() + { + byte[] hello = ScriptedHello([0x1303, 0x1301], alpn: null); + using X509Certificate2 certificate = Certificate(); + byte[] clientFirst = Answer(hello, new TlsServerSelection { Certificate = certificate }); + Assert.AreEqual(0x1303, Cipher(clientFirst)); + byte[] serverFirst = Answer(hello, new TlsServerSelection { Certificate = certificate, PreferServerCipherOrder = true, CipherSuites = [0x1301, 0x1303] }); + Assert.AreEqual(0x1301, Cipher(serverFirst)); + } + + [TestMethod] + public void ApplicationProtocolMismatchCanBeRequired() + { + byte[] hello = ScriptedHello([0x1301], "h2"); + using X509Certificate2 certificate = Certificate(); + var output = new TlsOutput(); + using (var server = new TlsEngine(TlsRole.Server)) + { + server.Advance(hello, out _, output); + server.Resume(_ => new TlsServerSelection + { + Certificate = certificate, + ApplicationProtocols = ["http/1.1"], + RequireApplicationProtocol = true, + }, output); + Assert.AreEqual(120, output.Bytes[6]); + } + + using var selected = new TlsEngine(TlsRole.Server); + selected.Advance(hello, out _, output); + selected.Resume(_ => new TlsServerSelection { Certificate = certificate, ApplicationProtocols = ["h2"] }, output); + Assert.AreEqual("h2", selected.SelectedApplicationProtocol); + Assert.AreEqual(TlsEngineState.WaitFinished, selected.State); + } + + [TestMethod] + public void RsaCertificateIsAcceptedWhenPssIsOffered() + { + using var rsa = RSA.Create(2048); + var request = new CertificateRequest("CN=localhost", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + using X509Certificate2 certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = certificate }, output); + Assert.AreEqual(TlsEngineState.WaitFinished, server.State); + } + + [TestMethod] + public void RsaCertificateBelow2048Fails() + { + using var rsa = RSA.Create(1024); + var request = new CertificateRequest("CN=localhost", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1); + using X509Certificate2 certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + AssertAlert(certificate, new TlsServerSelection { Certificate = certificate }, 40); + } + + [TestMethod] + public void RequiredClientCertificateRejectsAnEmptyList() + { + using X509Certificate2 certificate = Certificate(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection + { + Certificate = certificate, + RequestClientCertificate = true, + RequireClientCertificate = true, + }, output); + client.Advance(output.Bytes.ToArray(), out _, output); + if (client.State == TlsEngineState.WaitCertificateDecision) + { + client.Resume(true, output); + } + + server.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual((byte)116, server.LastLocalAlert); + Assert.AreEqual(TlsEngineState.Closed, server.State); + } + + [TestMethod] + public void RequestedClientCertificateDoesNotResume() + { + using X509Certificate2 certificate = Certificate(); + using var tickets = new MemoryTicketProtector { UnixTimeSeconds = 1_000 }; + var cache = new MemoryTlsSessionCache(); + using HandshakePair first = Complete(certificate, tickets, cache, clientClock: 1_000, serverClock: 1_000); + Assert.AreEqual(TlsEngineState.Connected, first.Client.State); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 1_001 }; + using var server = new TlsEngine(TlsRole.Server) { UnixTimeSeconds = 1_001 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection + { + Certificate = certificate, + Tickets = tickets, + RequestClientCertificate = true, + RequireClientCertificate = true, + }, output); + Assert.IsFalse(server.IsResumption); + Assert.AreEqual(TlsEngineState.WaitClientCertificate, server.State); + } + + [TestMethod] + public void ResumptionUsesTheTicketTwiceAndRejectsABadOne() + { + using X509Certificate2 certificate = Certificate(); + using var tickets = new MemoryTicketProtector { UnixTimeSeconds = 1_000 }; + var cache = new MemoryTlsSessionCache(); + using var first = Complete(certificate, tickets, cache, clientClock: 1_000, serverClock: 1_000); + Assert.AreEqual(TlsEngineState.Connected, first.Client.State, first.Client.State + " " + first.Server.State); + Assert.IsTrue(cache.TryGet("localhost", "tls", 1_000, out _), first.Client.State + "/" + first.Server.State); + using var resumed = Complete(certificate, tickets, cache, clientClock: 1_001, serverClock: 1_001); + Assert.IsTrue(resumed.Server.IsResumption); + Assert.AreEqual(TlsEngineState.Connected, resumed.Client.State); + using var replayed = Complete(certificate, tickets, cache, clientClock: 1_002, serverClock: 1_002); + Assert.IsTrue(replayed.Server.IsResumption); + + tickets.ForceRotate(); + using var afterRotation = Complete(certificate, tickets, cache, clientClock: 1_003, serverClock: 1_003); + Assert.IsTrue(afterRotation.Server.IsResumption); + + using X509Certificate2 other = Certificate(); + using var differentCertificate = Complete(other, tickets, cache, clientClock: 1_004, serverClock: 1_004); + Assert.IsFalse(differentCertificate.Server.IsResumption); + Assert.AreEqual(TlsEngineState.Connected, differentCertificate.Client.State); + } + + [TestMethod] + public void ExpiredTamperedAndReboundTicketsFallBack() + { + using X509Certificate2 certificate = Certificate(); + using var tickets = new MemoryTicketProtector { UnixTimeSeconds = 5_000 }; + var cache = new MemoryTlsSessionCache(); + Complete(certificate, tickets, cache, clientClock: 5_000, serverClock: 5_000); + + using var expired = Complete(certificate, tickets, cache, clientClock: 5_001, serverClock: 5_000 + (7 * 60 * 60)); + Assert.IsFalse(expired.Server.IsResumption); + + Assert.IsTrue(cache.TryGet("localhost", "tls", 5_001, out TlsResumptionTicket stored)); + RejectOfferedTicket(certificate, tickets, cache, before: null, hello => hello[^1] ^= 0xFF, fallback: false); + RejectOfferedTicket(certificate, tickets, cache, before: () => stored.Ticket[3] ^= 0xFF, hello => { }, fallback: true); + } + + private static void RejectOfferedTicket(X509Certificate2 certificate, MemoryTicketProtector tickets, MemoryTlsSessionCache cache, Action? before, Action mutateHello, bool fallback) + { + before?.Invoke(); + using var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = 5_010 }; + using var server = new TlsEngine(TlsRole.Server) { UnixTimeSeconds = 5_010 }; + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] hello = output.Bytes.ToArray(); + mutateHello(hello); + server.Advance(hello, out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = certificate, Tickets = tickets }, output); + Assert.IsFalse(server.IsResumption); + Assert.AreEqual(fallback ? TlsEngineState.WaitFinished : TlsEngineState.Closed, server.State); + } + + [TestMethod] + public void TicketProtectorKeepsThePreviousKey() + { + using var tickets = new MemoryTicketProtector { UnixTimeSeconds = 10 }; + byte[] first = tickets.Protect([1, 2, 3, 4]); + tickets.ForceRotate(); + var plain = new byte[4]; + Assert.IsTrue(tickets.TryUnprotect(first, plain, out int written)); + Assert.AreEqual(4, written); + CollectionAssert.AreEqual(new byte[] { 1, 2, 3, 4 }, plain); + byte[] second = tickets.Protect([9]); + tickets.ForceRotate(); + Assert.IsFalse(tickets.TryUnprotect(first, plain, out _)); + Assert.IsTrue(tickets.TryUnprotect(second, plain, out written)); + Assert.AreEqual(1, written); + } + + private static void AssertAlert(X509Certificate2 certificate, TlsServerSelection selection, byte description) + { + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => selection, output); + Assert.AreEqual(description, output.Bytes[6]); + Assert.AreEqual(TlsEngineState.Closed, server.State); + _ = certificate; + } + + private static byte[] Answer(byte[] hello, TlsServerSelection selection) + { + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + server.Advance(hello, out _, output); + server.Resume(_ => selection, output); + return output.Bytes.ToArray(); + } + + private static int Cipher(byte[] record) + { + int session = record[43]; + int at = 5 + 4 + 2 + 32 + 1 + session; + return (record[at] << 8) | record[at + 1]; + } + + private static HandshakePair Complete(X509Certificate2 certificate, MemoryTicketProtector tickets, MemoryTlsSessionCache cache, long clientClock, long serverClock) + { + var client = new TlsEngine(TlsRole.Client, serverName: "localhost", cache: cache) { UnixTimeSeconds = clientClock }; + var server = new TlsEngine(TlsRole.Server) { UnixTimeSeconds = serverClock }; + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + server.Resume(_ => new TlsServerSelection { Certificate = certificate, Tickets = tickets }, output); + client.Advance(output.Bytes.ToArray(), out _, output); + if (client.State == TlsEngineState.WaitCertificateDecision) + { + client.Resume(true, output); + } + byte[] finished = output.Bytes.ToArray(); + server.Advance(finished, out _, output); + if (output.Bytes.Length > 0) + { + client.Advance(output.Bytes.ToArray(), out _, output); + } + + return new HandshakePair(client, server, certificate, ownCertificate: false); + } + + private static byte[] ScriptedHello(ushort[] ciphers, string? alpn) + { + var scalar = new byte[32]; + scalar[0] = 9; + var share = new byte[32]; + X25519.PublicKey(scalar, share); + var body = new System.Collections.Generic.List { 1, 0, 0, 0, 3, 3 }; + body.AddRange(new byte[32]); + body.Add(32); + body.AddRange(new byte[32]); + var cipherBytes = new byte[ciphers.Length * 2]; + for (int i = 0; i < ciphers.Length; i++) + { + cipherBytes[i * 2] = (byte)(ciphers[i] >> 8); + cipherBytes[(i * 2) + 1] = (byte)ciphers[i]; + } + + AddVector(body, cipherBytes); + body.Add(1); + body.Add(0); + int extensionsAt = body.Count; + body.Add(0); + body.Add(0); + AddExtension(body, 0x000A, [0x00, 0x04, 0x00, 0x1D, 0x00, 0x17]); + AddExtension(body, 0x000D, [0x00, 0x02, 0x04, 0x03]); + AddExtension(body, 0x002B, [0x02, 0x03, 0x04]); + var keyShare = new byte[4 + 2 + share.Length]; + keyShare[1] = (byte)(2 + 2 + share.Length); + keyShare[3] = 0x1D; + keyShare[5] = 32; + share.CopyTo(keyShare.AsSpan(6)); + AddExtension(body, 0x0033, keyShare); + if (alpn is not null) + { + byte[] name = System.Text.Encoding.ASCII.GetBytes(alpn); + var protocol = new byte[2 + 1 + name.Length]; + protocol[1] = (byte)(1 + name.Length); + protocol[2] = (byte)name.Length; + name.CopyTo(protocol.AsSpan(3)); + AddExtension(body, 0x0010, protocol); + } + + int extensionLength = body.Count - extensionsAt - 2; + body[extensionsAt] = (byte)(extensionLength >> 8); + body[extensionsAt + 1] = (byte)extensionLength; + int handshakeLength = body.Count - 4; + body[1] = (byte)(handshakeLength >> 16); + body[2] = (byte)(handshakeLength >> 8); + body[3] = (byte)handshakeLength; + var record = new byte[5 + body.Count]; + record[0] = 22; + record[1] = 3; + record[2] = 1; + record[3] = (byte)(body.Count >> 8); + record[4] = (byte)body.Count; + body.CopyTo(record, 5); + return record; + } + + private static void AddVector(System.Collections.Generic.List destination, byte[] value) + { + destination.Add((byte)(value.Length >> 8)); + destination.Add((byte)value.Length); + destination.AddRange(value); + } + + private static void AddExtension(System.Collections.Generic.List destination, ushort type, byte[] contents) + { + destination.Add((byte)(type >> 8)); + destination.Add((byte)type); + destination.Add((byte)(contents.Length >> 8)); + destination.Add((byte)contents.Length); + destination.AddRange(contents); + } + + internal static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + } +} + +internal sealed class HandshakePair : IDisposable +{ + internal HandshakePair(TlsEngine client, TlsEngine server, X509Certificate2 certificate, bool ownCertificate) + { + Client = client; + Server = server; + Certificate = certificate; + _ownCertificate = ownCertificate; + } + + private readonly bool _ownCertificate; + + internal TlsEngine Client { get; } + + internal TlsEngine Server { get; } + + internal X509Certificate2 Certificate { get; } + + internal static HandshakePair Run() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + X509Certificate2 certificate = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + var client = new TlsEngine(TlsRole.Client, serverName: "localhost"); + var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] hello = output.Bytes.ToArray(); + server.Advance(hello, out _, output); + int thread = Environment.CurrentManagedThreadId; + server.Resume(_ => new TlsServerSelection { Certificate = certificate }, output); + Assert.AreEqual(thread, Environment.CurrentManagedThreadId); + byte[] flight = output.Bytes.ToArray(); + client.Advance(flight, out _, output); + client.Resume(true, output); + byte[] finished = output.Bytes.ToArray(); + server.Advance(finished, out _, output); + return new HandshakePair(client, server, certificate, ownCertificate: true); + } + + public void Dispose() + { + Client.Dispose(); + Server.Dispose(); + if (_ownCertificate) + { + Certificate.Dispose(); + } + } +} diff --git a/tests/Titanium.Tls.Tests/SoakTests.cs b/tests/Titanium.Tls.Tests/SoakTests.cs new file mode 100644 index 000000000..a387e846d --- /dev/null +++ b/tests/Titanium.Tls.Tests/SoakTests.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Concurrent; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +[DoNotParallelize] +public sealed class SoakTests +{ + private const int InFlightCap = 200; + + [TestMethod] + [TestCategory("Slow")] + [Timeout(2700000)] + public async Task ThirtyMinutesOfHandshakesStayBounded() + { + int seconds = 1800; + string? configured = Environment.GetEnvironmentVariable("TITANIUM_SOAK_SECONDS"); + if (int.TryParse(configured, out int parsed) && parsed > 0) + { + seconds = parsed; + } + + for (int i = 0; i < 4; i++) + { + using HandshakePair warmup = HandshakePair.Run(); + Exchange(warmup); + } + + GC.Collect(); + long baseline = GC.GetTotalMemory(true); + var errors = new ConcurrentQueue(); + int inFlight = 0; + int maxInFlight = 0; + int completed = 0; + int aborted = 0; + int reset = 0; + using var gate = new SemaphoreSlim(InFlightCap); + DateTime deadline = DateTime.UtcNow.AddSeconds(seconds); + Task slow = SlowLoris(deadline, errors); + + while (DateTime.UtcNow < deadline && errors.IsEmpty) + { + await gate.WaitAsync(); + int current = Interlocked.Increment(ref inFlight); + int seen = Volatile.Read(ref maxInFlight); + while (current > seen && Interlocked.CompareExchange(ref maxInFlight, current, seen) != seen) + { + seen = Volatile.Read(ref maxInFlight); + } + + int kind = Random.Shared.Next(3); + _ = Task.Run(() => + { + try + { + if (kind == 0) + { + using HandshakePair pair = HandshakePair.Run(); + Exchange(pair); + Interlocked.Increment(ref completed); + } + else if (kind == 1) + { + AbortAfterHello(); + Interlocked.Increment(ref aborted); + } + else + { + ResetAfterHello(); + Interlocked.Increment(ref reset); + } + } + catch (Exception ex) + { + errors.Enqueue(ex.GetType().Name + ": " + ex.Message); + } + finally + { + Interlocked.Decrement(ref inFlight); + gate.Release(); + } + }); + } + + DateTime drain = DateTime.UtcNow.AddMinutes(2); + while (Volatile.Read(ref inFlight) > 0 && DateTime.UtcNow < drain) + { + await Task.Delay(50); + } + + await slow; + GC.Collect(); + long after = GC.GetTotalMemory(true); + Assert.AreEqual(0, errors.Count, errors.TryPeek(out string? first) ? first : string.Empty); + Assert.AreEqual(0, Volatile.Read(ref inFlight)); + Assert.IsTrue(Volatile.Read(ref maxInFlight) <= InFlightCap); + Assert.IsTrue(completed > 0); + Assert.IsTrue(aborted > 0); + Assert.IsTrue(reset > 0); + Assert.IsTrue(after < baseline + (32L * 1024L * 1024L), after + " against " + baseline); + } + + private static void Exchange(HandshakePair pair) + { + var plain = new byte[64]; + plain[0] = 7; + var record = new byte[128]; + var output = new TlsOutput(); + int written = pair.Client.ProtectApplication(plain, record); + pair.Server.Advance(record.AsSpan(0, written), out int consumed, output); + Assert.AreEqual(written, consumed); + var read = new byte[64]; + Assert.AreEqual(64, pair.Server.ReadPlaintext(read)); + Assert.AreEqual(7, read[0]); + } + + private static void AbortAfterHello() + { + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] hello = output.Bytes.ToArray(); + server.Advance(hello.AsSpan(0, 1), out _, output); + } + + private static void ResetAfterHello() + { + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + server.Advance(output.Bytes.ToArray(), out _, output); + Assert.AreEqual(TlsEngineState.WaitClientHelloDecision, server.State); + } + + private static async Task SlowLoris(DateTime deadline, ConcurrentQueue errors) + { + try + { + while (DateTime.UtcNow < deadline) + { + using var client = new TlsEngine(TlsRole.Client); + using var server = new TlsEngine(TlsRole.Server); + var output = new TlsOutput(); + client.Advance([], out _, output); + byte[] hello = output.Bytes.ToArray(); + for (int i = 0; i < hello.Length && DateTime.UtcNow < deadline; i++) + { + server.Advance(hello.AsSpan(i, 1), out _, output); + await Task.Delay(1000); + if (server.State == TlsEngineState.Closed) + { + break; + } + } + } + } + catch (Exception ex) + { + errors.Enqueue(ex.GetType().Name + ": " + ex.Message); + } + } +} diff --git a/tests/Titanium.Tls.Tests/StrongNameKey.snk b/tests/Titanium.Tls.Tests/StrongNameKey.snk new file mode 100644 index 000000000..bc82698b5 Binary files /dev/null and b/tests/Titanium.Tls.Tests/StrongNameKey.snk differ diff --git a/tests/Titanium.Tls.Tests/Support/AllocationGate.cs b/tests/Titanium.Tls.Tests/Support/AllocationGate.cs new file mode 100644 index 000000000..e734a7e8c --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/AllocationGate.cs @@ -0,0 +1,24 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests.Support; + +internal static class AllocationGate +{ + internal static void AssertNone(Action action, int warmup = 8, int iterations = 64) + { + for (int i = 0; i < warmup; i++) + { + action(); + } + + long before = GC.GetAllocatedBytesForCurrentThread(); + for (int i = 0; i < iterations; i++) + { + action(); + } + + long allocated = GC.GetAllocatedBytesForCurrentThread() - before; + Assert.AreEqual(0, allocated); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/ChromeHelloInvariants.cs b/tests/Titanium.Tls.Tests/Support/ChromeHelloInvariants.cs new file mode 100644 index 000000000..58802ec89 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/ChromeHelloInvariants.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests.Support; + +internal static class ChromeHelloInvariants +{ + internal static void AssertMatch(byte[] pinned, byte[] other) + { + AssertFrame(pinned); + AssertFrame(other); + foreach (ushort type in StableTypes) + { + CollectionAssert.AreEqual(Body(pinned, type), Body(other, type), type.ToString("x4")); + } + + CollectionAssert.AreEqual(Tail(CipherBytes(pinned), 2), Tail(CipherBytes(other), 2)); + CollectionAssert.AreEqual(Tail(Body(pinned, ExtensionType.SupportedGroups), 4), Tail(Body(other, ExtensionType.SupportedGroups), 4)); + CollectionAssert.AreEqual(Tail(Body(pinned, ExtensionType.SignatureAlgorithms), 4), Tail(Body(other, ExtensionType.SignatureAlgorithms), 4)); + CollectionAssert.AreEqual(Tail(Body(pinned, ExtensionType.SupportedVersions), 3), Tail(Body(other, ExtensionType.SupportedVersions), 3)); + AssertGreaseEnds(pinned); + AssertGreaseEnds(other); + AssertEchOuter(Body(pinned, ExtensionType.EncryptedClientHello)); + AssertEchOuter(Body(other, ExtensionType.EncryptedClientHello)); + AssertKeyShareLengths(Body(pinned, ExtensionType.KeyShare)); + AssertKeyShareLengths(Body(other, ExtensionType.KeyShare)); + CollectionAssert.AreEquivalent(NonGrease(ExtensionTypes(pinned)), NonGrease(ExtensionTypes(other))); + } + + private static readonly ushort[] StableTypes = + [ + ExtensionType.ServerName, + ExtensionType.ExtendedMasterSecret, + ExtensionType.ApplicationSettings, + ExtensionType.ApplicationLayerProtocolNegotiation, + ExtensionType.SessionTicket, + ExtensionType.SignedCertificateTimestamp, + ExtensionType.RenegotiationInfo, + ExtensionType.PskKeyExchangeModes, + ExtensionType.CompressCertificate, + ExtensionType.StatusRequest, + 0xCA34, + ExtensionType.EcPointFormats, + ]; + + private static void AssertFrame(byte[] record) + { + Assert.AreEqual(22, record[0]); + Assert.AreEqual(0x0301, (record[1] << 8) | record[2]); + ClientHelloView hello = JaHello.Read(record); + Assert.AreEqual(0x0303, hello.LegacyVersion); + Assert.AreEqual(32, hello.SessionId.Length); + CollectionAssert.AreEqual(new byte[] { 0 }, hello.CompressionMethods.ToArray()); + } + + private static void AssertGreaseEnds(byte[] record) + { + ushort[] types = ExtensionTypes(record); + Assert.IsTrue(Grease.IsGrease(types[0])); + Assert.IsTrue(Grease.IsGrease(types[^1])); + Assert.AreNotEqual(types[0], types[^1]); + Assert.AreEqual(0, Body(record, types[0]).Length); + Assert.AreEqual(1, Body(record, types[^1]).Length); + byte[] groups = Body(record, ExtensionType.SupportedGroups); + byte[] shares = Body(record, ExtensionType.KeyShare); + Assert.AreEqual(JaHello.ReadU16(groups, 2), JaHello.ReadU16(shares, 2)); + } + + private static void AssertEchOuter(byte[] body) + { + Assert.IsTrue(body.Length > 42); + Assert.AreEqual(0, body[0]); + Assert.AreEqual(0x0001, JaHello.ReadU16(body, 1)); + Assert.AreEqual(0x0001, JaHello.ReadU16(body, 3)); + Assert.AreEqual(32, JaHello.ReadU16(body, 6)); + int payload = JaHello.ReadU16(body, 40); + Assert.AreEqual(body.Length, 42 + payload); + Assert.IsTrue(payload is 144 or 176 or 208 or 240); + } + + private static void AssertKeyShareLengths(byte[] body) + { + int offset = 2; + Assert.IsTrue(Grease.IsGrease(JaHello.ReadU16(body, offset))); + Assert.AreEqual(1, JaHello.ReadU16(body, offset + 2)); + offset += 5; + Assert.AreEqual(0x11EC, JaHello.ReadU16(body, offset)); + Assert.AreEqual(1216, JaHello.ReadU16(body, offset + 2)); + offset += 4 + 1216; + Assert.AreEqual(0x001D, JaHello.ReadU16(body, offset)); + Assert.AreEqual(32, JaHello.ReadU16(body, offset + 2)); + Assert.AreEqual(body.Length, offset + 4 + 32); + } + + private static byte[] CipherBytes(byte[] record) => JaHello.Read(record).CipherSuites.ToArray(); + + private static byte[] Body(byte[] record, ushort wanted) + { + byte[] found = []; + JaHello.Walk(JaHello.Read(record).Extensions, (type, body) => + { + if (type == wanted) + { + found = body.ToArray(); + } + }); + return found; + } + + private static ushort[] ExtensionTypes(byte[] record) + { + var types = new List(); + JaHello.Walk(JaHello.Read(record).Extensions, (type, _) => types.Add(type)); + return types.ToArray(); + } + + private static byte[] Tail(byte[] body, int skip) => body.AsSpan(skip).ToArray(); + + private static ushort[] NonGrease(ushort[] types) + { + var kept = new List(); + foreach (ushort type in types) + { + if (!Grease.IsGrease(type)) + { + kept.Add(type); + } + } + + return kept.ToArray(); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/FixedEntropy.cs b/tests/Titanium.Tls.Tests/Support/FixedEntropy.cs new file mode 100644 index 000000000..81120d9d4 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/FixedEntropy.cs @@ -0,0 +1,26 @@ +using System; +using Titanium.Tls; + +namespace Titanium.Tls.Tests.Support; + +internal sealed class FixedEntropy : IEntropySource +{ + private readonly byte[] _script; + private int _offset; + + internal FixedEntropy(byte[] script) + { + _script = script; + } + + public void Fill(Span destination) + { + if (_offset + destination.Length > _script.Length) + { + throw new InvalidOperationException("The scripted entropy is exhausted."); + } + + _script.AsSpan(_offset, destination.Length).CopyTo(destination); + _offset += destination.Length; + } +} diff --git a/tests/Titanium.Tls.Tests/Support/HexVectors.cs b/tests/Titanium.Tls.Tests/Support/HexVectors.cs new file mode 100644 index 000000000..03c155a87 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/HexVectors.cs @@ -0,0 +1,71 @@ +using System; + +namespace Titanium.Tls.Tests.Support; + +internal static class HexVectors +{ + internal static byte[] Parse(string text) + { + var bytes = new System.Collections.Generic.List(text.Length / 2); + int value = -1; + bool comment = false; + for (int i = 0; i < text.Length; i++) + { + char c = text[i]; + if (comment) + { + if (c == '\n') + { + comment = false; + } + + continue; + } + + if (c == '#') + { + if (value >= 0) + { + throw new FormatException("Hex text has an odd number of digits."); + } + + comment = true; + continue; + } + + if (c == '0' && i + 1 < text.Length && (text[i + 1] == 'x' || text[i + 1] == 'X')) + { + i++; + continue; + } + + if (!IsHex(c)) + { + continue; + } + + int digit = c <= '9' ? c - '0' : (c & ~32) - 'A' + 10; + if (value < 0) + { + value = digit << 4; + } + else + { + bytes.Add((byte)(value | digit)); + value = -1; + } + } + + if (value >= 0) + { + throw new FormatException("Hex text has an odd number of digits."); + } + + return bytes.ToArray(); + } + + private static bool IsHex(char c) + { + return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/JaFingerprints.cs b/tests/Titanium.Tls.Tests/Support/JaFingerprints.cs new file mode 100644 index 000000000..010264e45 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/JaFingerprints.cs @@ -0,0 +1,301 @@ +using System; +using System.Collections.Generic; +using System.Security.Cryptography; +using System.Text; + +namespace Titanium.Tls.Tests.Support; + +internal static class Ja3 +{ + internal static string Fingerprint(ReadOnlySpan record) + { + return Hash(Describe(record)); + } + + internal static string Hash(string fields) + { + return Convert.ToHexString(MD5.HashData(Encoding.ASCII.GetBytes(fields))).ToLowerInvariant(); + } + + internal static string Describe(ReadOnlySpan record) + { + ClientHelloView hello = JaHello.Read(record); + var ciphers = new List(); + for (int i = 0; i + 1 < hello.CipherSuites.Length; i += 2) + { + ushort cipher = JaHello.ReadU16(hello.CipherSuites, i); + if (!Grease.IsGrease(cipher)) + { + ciphers.Add(cipher); + } + } + + var extensions = new List(); + var groups = new List(); + var points = new List(); + JaHello.Walk(hello.Extensions, (type, body) => + { + if (Grease.IsGrease(type)) + { + return; + } + + extensions.Add(type); + if (type == ExtensionType.SupportedGroups) + { + groups.AddRange(JaHello.ReadList16(body)); + } + else if (type == ExtensionType.EcPointFormats && body.Length > 0) + { + int count = body[0]; + for (int i = 0; i < count && 1 + i < body.Length; i++) + { + points.Add(body[1 + i]); + } + } + }); + return hello.LegacyVersion + "," + Join(ciphers) + "," + Join(extensions) + "," + Join(groups) + "," + Join(points); + } + + private static string Join(List values) + where T : struct + { + var text = new StringBuilder(); + for (int i = 0; i < values.Count; i++) + { + if (i > 0) + { + text.Append('-'); + } + + text.Append(values[i]); + } + + return text.ToString(); + } +} + +internal static class Ja4 +{ + internal static string Fingerprint(ReadOnlySpan record) + { + ClientHelloView hello = JaHello.Read(record); + var ciphers = new List(); + for (int i = 0; i + 1 < hello.CipherSuites.Length; i += 2) + { + ushort cipher = JaHello.ReadU16(hello.CipherSuites, i); + if (!Grease.IsGrease(cipher)) + { + ciphers.Add(cipher); + } + } + + var extensions = new List(); + var signatures = new List(); + bool sni = false; + string alpn = "00"; + int version = hello.LegacyVersion; + JaHello.Walk(hello.Extensions, (type, body) => + { + if (Grease.IsGrease(type)) + { + return; + } + + extensions.Add(type); + if (type == ExtensionType.ServerName) + { + sni = true; + } + else if (type == ExtensionType.ApplicationLayerProtocolNegotiation) + { + alpn = Alpn(body); + } + else if (type == ExtensionType.SupportedVersions) + { + version = HighestVersion(body, version); + } + else if (type == ExtensionType.SignatureAlgorithms) + { + signatures.AddRange(JaHello.ReadList16(body)); + } + }); + string versionText = version switch + { + 0x0304 => "13", + 0x0303 => "12", + 0x0302 => "11", + 0x0301 => "10", + 0x0300 => "s3", + 0x0002 => "s2", + _ => "00", + }; + return "t" + versionText + (sni ? "d" : "i") + Math.Min(ciphers.Count, 99).ToString("00") + Math.Min(extensions.Count, 99).ToString("00") + alpn + + "_" + HashCiphers(ciphers) + "_" + HashExtensions(extensions, signatures); + } + + internal static string CipherHash(string sortedCiphers) + { + return sortedCiphers.Length == 0 ? "000000000000" : Truncate(sortedCiphers); + } + + internal static string ExtensionHash(string sortedExtensionsAndSignatures) + { + return sortedExtensionsAndSignatures.Length == 0 ? "000000000000" : Truncate(sortedExtensionsAndSignatures); + } + + private static string HashCiphers(List ciphers) + { + ciphers.Sort(); + return CipherHash(HexList(ciphers)); + } + + private static string HashExtensions(List extensions, List signatures) + { + extensions.RemoveAll(type => type is ExtensionType.ServerName or ExtensionType.ApplicationLayerProtocolNegotiation); + extensions.Sort(); + if (extensions.Count == 0 && signatures.Count == 0) + { + return "000000000000"; + } + + string text = HexList(extensions); + if (signatures.Count > 0) + { + text = text.Length == 0 ? HexList(signatures) : text + "_" + HexList(signatures); + } + + return Truncate(text); + } + + private static string Truncate(string text) + { + byte[] hash = SHA256.HashData(Encoding.ASCII.GetBytes(text)); + return Convert.ToHexString(hash)[..12].ToLowerInvariant(); + } + + private static string HexList(List values) + { + var text = new StringBuilder(); + for (int i = 0; i < values.Count; i++) + { + if (i > 0) + { + text.Append(','); + } + + text.Append(values[i].ToString("x4")); + } + + return text.ToString(); + } + + private static int HighestVersion(ReadOnlySpan body, int fallback) + { + if (body.IsEmpty) + { + return fallback; + } + + int count = body[0]; + int best = 0; + for (int i = 0; i < count && 1 + (i * 2) + 1 < body.Length; i++) + { + ushort version = JaHello.ReadU16(body, 1 + (i * 2)); + if (!Grease.IsGrease(version) && version > best) + { + best = version; + } + } + + return best == 0 ? fallback : best; + } + + private static string Alpn(ReadOnlySpan body) + { + if (body.Length < 3) + { + return "00"; + } + + int list = JaHello.ReadU16(body, 0); + if (list < 1 || body.Length < 2 + list) + { + return "00"; + } + + int nameLength = body[2]; + if (nameLength == 0 || 3 + nameLength > body.Length) + { + return "00"; + } + + ReadOnlySpan name = body.Slice(3, nameLength); + if (name.Length == 1 && IsAlphaNumeric(name[0])) + { + return string.Concat((char)name[0], (char)name[0]); + } + + if (IsAlphaNumeric(name[0]) && IsAlphaNumeric(name[^1])) + { + return string.Concat((char)name[0], (char)name[^1]); + } + + string hex = Convert.ToHexString(name).ToLowerInvariant(); + return string.Concat(hex[0], hex[^1]); + } + + private static bool IsAlphaNumeric(byte value) + { + return value is (>= 0x30 and <= 0x39) or (>= 0x41 and <= 0x5A) or (>= 0x61 and <= 0x7A); + } +} + +internal static class JaHello +{ + internal static ClientHelloView Read(ReadOnlySpan record) + { + if (!HandshakeFraming.TryUnwrapHandshakeRecord(record, out ReadOnlySpan payload, out _, out _) || + !HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out _)) + { + throw new InvalidOperationException("The record is not a ClientHello."); + } + + return hello; + } + + internal static void Walk(ReadOnlySpan extensions, Action> visit) + { + var reader = new TlsReader(extensions); + while (reader.TryReadUInt16(out ushort type) && reader.TryReadVector16(out ReadOnlySpan body)) + { + visit(type, body); + } + } + + internal static List ReadList16(ReadOnlySpan body) + { + var values = new List(); + if (body.Length < 2) + { + return values; + } + + int count = ReadU16(body, 0); + for (int i = 0; i + 1 < count && 2 + i + 1 < body.Length; i += 2) + { + ushort value = ReadU16(body, 2 + i); + if (!Grease.IsGrease(value)) + { + values.Add(value); + } + } + + return values; + } + + internal static ushort ReadU16(ReadOnlySpan bytes, int offset) + { + return (ushort)((bytes[offset] << 8) | bytes[offset + 1]); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/OpenSslOracle.cs b/tests/Titanium.Tls.Tests/Support/OpenSslOracle.cs new file mode 100644 index 000000000..87cb237ed --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/OpenSslOracle.cs @@ -0,0 +1,95 @@ +using System; +using System.Diagnostics; +using System.IO; + +namespace Titanium.Tls.Tests.Support; + +internal static class OpenSslOracle +{ + internal static string? Find() + { + string? configured = Environment.GetEnvironmentVariable("TITANIUM_OPENSSL"); + if (IsExecutable(configured)) + { + return configured; + } + + string[] candidates = + [ + @"C:\Program Files\Git\usr\bin\openssl.exe", + "/opt/homebrew/bin/openssl", + "/usr/bin/openssl", + ]; + foreach (string candidate in candidates) + { + if (IsExecutable(candidate)) + { + return candidate; + } + } + + string? home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + if (!string.IsNullOrEmpty(home)) + { + string built = Path.Combine(home, "opt", "openssl-3.5.9", "bin", "openssl"); + if (IsExecutable(built)) + { + return built; + } + } + + return null; + } + + internal static bool TryReadVersion(string path, out Version version) + { + version = new Version(0, 0); + ProcessStartInfo start = new() + { + FileName = path, + Arguments = "version", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + }; + using Process process = Process.Start(start) ?? throw new InvalidOperationException("OpenSSL did not start."); + string text = process.StandardOutput.ReadToEnd(); + if (!process.WaitForExit(10000)) + { + process.Kill(); + return false; + } + + // "OpenSSL 3.5.9 29 Sep 2026" + string[] parts = text.Split(' ', StringSplitOptions.RemoveEmptyEntries); + if (parts.Length < 2 || !Version.TryParse(parts[1], out Version? parsed) || parsed is null) + { + return false; + } + + version = parsed; + return process.ExitCode == 0; + } + + internal static bool Require(Version minimum) + { + string? path = Find(); + bool required = string.Equals(Environment.GetEnvironmentVariable("TITANIUM_REQUIRE_ORACLE"), "1", StringComparison.Ordinal); + if (path is null || !TryReadVersion(path, out Version version) || version < minimum) + { + if (required) + { + throw new InvalidOperationException("OpenSSL " + minimum + " is required and was not found."); + } + + return false; + } + + return true; + } + + private static bool IsExecutable(string? path) + { + return !string.IsNullOrEmpty(path) && File.Exists(path); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/PlatformSsl.cs b/tests/Titanium.Tls.Tests/Support/PlatformSsl.cs new file mode 100644 index 000000000..07d9b1103 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/PlatformSsl.cs @@ -0,0 +1,84 @@ +using System; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests.Support; + +internal static class PlatformSsl +{ + private static readonly Lazy Tls13 = new(Probe); + + internal static void RequireTls13() + { + if (!Tls13.Value) + { + Assert.Inconclusive("SslStream on this runtime cannot enable TLS 1.3."); + } + } + + private static bool Probe() + { + using X509Certificate2 certificate = Certificate(); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task server = Task.Run(() => + { + using TcpClient accepted = listener.AcceptTcpClient(); + using var stream = new SslStream(accepted.GetStream()); + stream.AuthenticateAsServer(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + }); + }); + try + { + using var tcp = new TcpClient(IPAddress.Loopback.ToString(), port); + using var stream = new SslStream(tcp.GetStream()); + stream.AuthenticateAsClient(new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + CertificateRevocationCheckMode = X509RevocationMode.NoCheck, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }); + server.GetAwaiter().GetResult(); + return stream.SslProtocol == SslProtocols.Tls13; + } + catch (AuthenticationException exception) when (exception.InnerException is PlatformNotSupportedException) + { + return false; + } + catch (PlatformNotSupportedException) + { + return false; + } + finally + { + listener.Stop(); + try + { + server.Wait(TimeSpan.FromSeconds(2)); + } + catch (AggregateException) + { + } + } + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } +} diff --git a/tests/Titanium.Tls.Tests/Support/RfcRequirementAttribute.cs b/tests/Titanium.Tls.Tests/Support/RfcRequirementAttribute.cs new file mode 100644 index 000000000..b2215ab23 --- /dev/null +++ b/tests/Titanium.Tls.Tests/Support/RfcRequirementAttribute.cs @@ -0,0 +1,20 @@ +using System; + +namespace Titanium.Tls.Tests.Support; + +[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] +internal sealed class RfcRequirementAttribute : Attribute +{ + internal RfcRequirementAttribute(string rfc, string section, string id) + { + Rfc = rfc; + Section = section; + Id = id; + } + + internal string Rfc { get; } + + internal string Section { get; } + + internal string Id { get; } +} diff --git a/tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj b/tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj new file mode 100644 index 000000000..1055559bd --- /dev/null +++ b/tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj @@ -0,0 +1,28 @@ + + + net10.0 + enable + disable + false + true + StrongNameKey.snk + true + true + Titanium.Tls.Tests + + + + + + + + + + + + + + + + + diff --git a/tests/Titanium.Tls.Tests/TlsAlgorithmPolicyTests.cs b/tests/Titanium.Tls.Tests/TlsAlgorithmPolicyTests.cs new file mode 100644 index 000000000..5b360da4c --- /dev/null +++ b/tests/Titanium.Tls.Tests/TlsAlgorithmPolicyTests.cs @@ -0,0 +1,194 @@ +using System; +using System.IO; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class TlsAlgorithmPolicyTests +{ + [TestMethod] + public void FipsPolicyKeepsAesGcmNistGroupsAndPss() + { + Assert.IsTrue(TlsAlgorithmSet.AllowsCipher(TlsAlgorithmPolicy.FipsApprovedOnly, 0x1301)); + Assert.IsTrue(TlsAlgorithmSet.AllowsCipher(TlsAlgorithmPolicy.FipsApprovedOnly, 0x1302)); + Assert.IsFalse(TlsAlgorithmSet.AllowsCipher(TlsAlgorithmPolicy.FipsApprovedOnly, 0x1303)); + Assert.IsTrue(TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0017)); + Assert.IsTrue(TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0018)); + Assert.IsFalse(TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, 0x001D)); + Assert.IsFalse(TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.FipsApprovedOnly, 0x11EC)); + Assert.IsTrue(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0403)); + Assert.IsTrue(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0503)); + Assert.IsTrue(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0804)); + Assert.IsTrue(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0805)); + Assert.IsTrue(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0806)); + Assert.IsFalse(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0401)); + Assert.IsFalse(TlsAlgorithmSet.AllowsSignature(TlsAlgorithmPolicy.FipsApprovedOnly, 0x0807)); + Assert.IsFalse(TlsAlgorithmSet.AllowsRsa(TlsAlgorithmPolicy.FipsApprovedOnly, 2047)); + Assert.IsTrue(TlsAlgorithmSet.AllowsRsa(TlsAlgorithmPolicy.FipsApprovedOnly, 2048)); + Assert.IsTrue(TlsAlgorithmSet.AllowsCipher(TlsAlgorithmPolicy.Default, 0x1303)); + Assert.IsTrue(TlsAlgorithmSet.AllowsGroup(TlsAlgorithmPolicy.Default, 0x001D)); + } + + [TestMethod] + public void RegistryAndLinuxFileSelectFipsMode() + { + Assert.IsTrue(FipsEnvironment.Evaluate(new FakeProbe(windows: true, enabled: 1, linux: null, mac: false))); + Assert.IsFalse(FipsEnvironment.Evaluate(new FakeProbe(windows: true, enabled: 0, linux: null, mac: false))); + Assert.IsFalse(FipsEnvironment.Evaluate(new FakeProbe(windows: true, enabled: null, linux: null, mac: false))); + Assert.IsTrue(FipsEnvironment.Evaluate(new FakeProbe(windows: false, enabled: null, linux: "1\n", mac: false, linuxOs: true))); + Assert.IsFalse(FipsEnvironment.Evaluate(new FakeProbe(windows: false, enabled: null, linux: "0\n", mac: false, linuxOs: true))); + Assert.IsFalse(FipsEnvironment.Evaluate(new FakeProbe(windows: false, enabled: null, linux: null, mac: false, linuxOs: true))); + Assert.IsFalse(FipsEnvironment.Evaluate(new FakeProbe(windows: false, enabled: 1, linux: "1\n", mac: true, linuxOs: true))); + } + + [TestMethod] + public void FipsModeRefusesTheManagedStackUntilTheOverrideIsSet() + { + FipsEnvironment.Use(new FakeProbe(windows: true, enabled: 1, linux: null, mac: false)); + try + { + using var stream = new TlsStream(new MemoryStream()); + Assert.AreEqual(TlsFingerprintFidelity.ReducedFipsPolicy, stream.FingerprintFidelity); + NotSupportedException error = Assert.ThrowsException(() => + stream.AuthenticateAsClient(new System.Net.Security.SslClientAuthenticationOptions())); + StringAssert.Contains(error.Message, "TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1"); + + using var allowed = new TlsStream(new MemoryStream(), new TlsStreamOptions { AllowManagedStackUnderFips = true }); + Assert.AreEqual(TlsFingerprintFidelity.ReducedFipsPolicy, allowed.FingerprintFidelity); + try + { + allowed.AuthenticateAsClient(new System.Net.Security.SslClientAuthenticationOptions { TargetHost = "localhost" }); + Assert.Fail("An empty stream cannot finish a handshake."); + } + catch (NotSupportedException denied) + { + Assert.Fail(denied.Message); + } + catch (IOException) + { + } + } + finally + { + FipsEnvironment.Reset(); + } + } + + [TestMethod] + public void ManagedStackRefusalNamesTheOverride() + { + FipsEnvironment.Use(new FakeProbe(windows: true, enabled: 1, linux: null, mac: false)); + string? previous = Environment.GetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE"); + try + { + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE", null); + string? refused = FipsEnvironment.ManagedStackRefusal(managedRequested: true, configOverride: false); + StringAssert.Contains(refused, "TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1"); + StringAssert.Contains(refused, "managedStackFipsOverride"); + Assert.IsNull(FipsEnvironment.ManagedStackRefusal(managedRequested: false, configOverride: false)); + Assert.IsNull(FipsEnvironment.ManagedStackRefusal(managedRequested: true, configOverride: true)); + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE", "1"); + Assert.IsNull(FipsEnvironment.ManagedStackRefusal(managedRequested: true, configOverride: false)); + } + finally + { + Environment.SetEnvironmentVariable("TITANIUM_MANAGED_STACK_FIPS_OVERRIDE", previous); + FipsEnvironment.Reset(); + } + } + + [TestMethod] + public void FipsClientHelloOmitsX25519AndChaCha() + { + using var engine = new TlsEngine(TlsRole.Client) { AlgorithmPolicy = TlsAlgorithmPolicy.FipsApprovedOnly }; + var output = new TlsOutput(); + engine.Advance([], out _, output); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(output.Bytes, out ReadOnlySpan payload, out _, out _)); + Assert.IsTrue(HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out _)); + Assert.IsFalse(ContainsPair(hello.CipherSuites, 0x1303)); + Assert.IsTrue(ContainsPair(hello.CipherSuites, 0x1301)); + ReadOnlySpan groups = Extension(hello.Extensions, ExtensionType.SupportedGroups); + ReadOnlySpan signatures = Extension(hello.Extensions, ExtensionType.SignatureAlgorithms); + Assert.IsFalse(ContainsPair(groups, 0x001D)); + Assert.IsFalse(ContainsPair(groups, 0x11EC)); + Assert.IsTrue(ContainsPair(groups, 0x0017)); + Assert.IsTrue(ContainsPair(groups, 0x0018)); + Assert.IsTrue(ContainsPair(signatures, 0x0403)); + Assert.IsTrue(ContainsPair(signatures, 0x0804)); + Assert.IsFalse(ContainsPair(signatures, 0x0401)); + } + + [TestMethod] + public void DefaultClientHelloOffersEcdsaAndRsaPss() + { + using var engine = new TlsEngine(TlsRole.Client); + var output = new TlsOutput(); + engine.Advance([], out _, output); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(output.Bytes, out ReadOnlySpan payload, out _, out _)); + Assert.IsTrue(HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out _)); + ReadOnlySpan signatures = Extension(hello.Extensions, ExtensionType.SignatureAlgorithms); + Assert.IsTrue(ContainsPair(signatures, 0x0403)); + Assert.IsTrue(ContainsPair(signatures, 0x0503)); + Assert.IsTrue(ContainsPair(signatures, 0x0804)); + Assert.IsTrue(ContainsPair(signatures, 0x0805)); + Assert.IsFalse(ContainsPair(signatures, 0x0401)); + } + + [TestMethod] + public void FipsProfileDropsTheHybridShare() + { + var profile = new ChromeFingerprintProfile(new SystemEntropy(), TlsFingerprintFidelity.ReducedFipsPolicy); + Assert.AreEqual(TlsFingerprintFidelity.ReducedFipsPolicy, profile.Fidelity); + var writer = new System.Buffers.ArrayBufferWriter(); + profile.BuildClientHello(new ClientHelloContext { ServerName = "localhost" }, writer); + byte[] record = writer.WrittenSpan.ToArray(); + Assert.IsTrue(HandshakeFraming.TryUnwrapHandshakeRecord(record, out ReadOnlySpan payload, out _, out _)); + Assert.IsTrue(HandshakeMessages.TryReadClientHello(payload, out ClientHelloView hello, out _)); + Assert.IsFalse(ContainsPair(hello.CipherSuites, 0x1303)); + ReadOnlySpan groups = Extension(hello.Extensions, ExtensionType.SupportedGroups); + Assert.IsFalse(ContainsPair(groups, 0x11EC)); + Assert.IsFalse(ContainsPair(groups, 0x001D)); + Assert.IsTrue(ContainsPair(groups, 0x0017)); + } + + private static bool ContainsPair(ReadOnlySpan data, ushort value) + { + for (int i = 0; i + 1 < data.Length; i++) + { + if (((data[i] << 8) | data[i + 1]) == value) + { + return true; + } + } + + return false; + } + + private static byte[] Extension(ReadOnlySpan extensions, ushort type) + { + TlsReader reader = new(extensions); + while (reader.TryReadUInt16(out ushort found) && reader.TryReadVector16(out ReadOnlySpan body)) + { + if (found == type) + { + return body.ToArray(); + } + } + + return []; + } + + private sealed class FakeProbe(bool windows, int? enabled, string? linux, bool mac, bool linuxOs = false) : IFipsProbe + { + public bool IsWindows => windows; + + public bool IsLinux => linuxOs; + + public bool IsMacOs => mac; + + public int? WindowsEnabled => enabled; + + public string? LinuxFile => linux; + } +} diff --git a/tests/Titanium.Tls.Tests/TlsFuzzTarget.cs b/tests/Titanium.Tls.Tests/TlsFuzzTarget.cs new file mode 100644 index 000000000..926ed9232 --- /dev/null +++ b/tests/Titanium.Tls.Tests/TlsFuzzTarget.cs @@ -0,0 +1,35 @@ +using System; + +namespace Titanium.Tls.Tests; + +/// Entry point for a handshake fuzzer. A bad input closes or waits. It does not throw. +internal static class TlsFuzzTarget +{ + internal static void Handshake(byte[] data) + { + Drive(TlsRole.Client, data); + Drive(TlsRole.Server, data); + if (data.Length < 4) + { + return; + } + + ReadOnlySpan message = data; + _ = HandshakeMessages.TryReadClientHello(message, out _, out _); + _ = HandshakeMessages.TryReadServerHello(message, out _, out _); + _ = HandshakeMessages.TryReadEncryptedExtensions(message, out _, out _); + _ = HandshakeMessages.TryReadCertificate(message, out _, out _); + _ = HandshakeMessages.TryReadCertificateRequest(message, out _, out _, out _); + _ = HandshakeMessages.TryReadCertificateVerify(message, out _, out _, out _); + _ = HandshakeMessages.TryReadFinished(message, out _, out _); + _ = HandshakeMessages.TryReadNewSessionTicket(message, out _, out _, out _, out _, out _, out _); + _ = HandshakeMessages.TryReadKeyUpdate(message, out _, out _); + } + + private static void Drive(TlsRole role, byte[] data) + { + using var engine = new TlsEngine(role); + var output = new TlsOutput(); + engine.Advance(data, out _, output); + } +} diff --git a/tests/Titanium.Tls.Tests/TlsInteropTests.cs b/tests/Titanium.Tls.Tests/TlsInteropTests.cs new file mode 100644 index 000000000..60c610b57 --- /dev/null +++ b/tests/Titanium.Tls.Tests/TlsInteropTests.cs @@ -0,0 +1,860 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Hosting.Server; +using Microsoft.AspNetCore.Hosting.Server.Features; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +[DoNotParallelize] +public sealed class TlsInteropTests +{ + public static IEnumerable PairwiseRows + { + get + { + foreach (InteropCase row in InteropMatrix.Pairwise()) + { + yield return new object[] { row.ToString() }; + } + } + } + + [TestMethod] + [DynamicData(nameof(PairwiseRows))] + [Timeout(60000)] + public async Task PairwiseCellSpeaksTls13(string label) + { + await Exchange(InteropCase.Parse(label), 32); + } + + [TestMethod] + [Timeout(120000)] + public async Task OpenSslEchoesTenMebibytes() + { + var row = new InteropCase(InteropRole.ManagedClient, InteropCipher.Aes128, InteropGroup.X25519, InteropCert.EcdsaP256, InteropAlpn.None, false, false); + await Exchange(row, 10 * 1024 * 1024); + } + + [TestMethod] + [Timeout(60000)] + public async Task ResumesASecondConnection() + { + using X509Certificate2 certificate = Issue(InteropCert.EcdsaP256, client: false).Certificate; + using var tickets = new MemoryTicketProtector(); + var cache = new MemoryTlsSessionCache(); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + Task server = Task.Run(async () => + { + for (int i = 0; i < 2; i++) + { + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using var stream = new TlsStream(accepted.GetStream(), new TlsStreamOptions { Tickets = tickets }); + await stream.AuthenticateAsServerAsync(ServerOptions(certificate)); + if (i == 1) + { + Assert.IsTrue(stream.AcceptedResumption); + } + + byte[] buffer = new byte[4]; + Assert.AreEqual(4, await stream.ReadAsync(buffer)); + await stream.WriteAsync(buffer); + } + }); + + for (int i = 0; i < 2; i++) + { + using var tcp = new TcpClient(); + tcp.Connect((IPEndPoint)listener.LocalEndpoint); + await using var stream = new TlsStream(tcp.GetStream(), new TlsStreamOptions { SessionCache = cache }); + await stream.AuthenticateAsClientAsync(ClientOptions(null, null)); + await stream.WriteAsync(new byte[] { 1, 2, 3, 4 }); + byte[] echoed = new byte[4]; + Assert.AreEqual(4, await ReadExact(stream, echoed)); + } + + await server; + } + + [TestMethod] + [Timeout(60000)] + public async Task ClientReadsAKestrelResponse() + { + PlatformSsl.RequireTls13(); + using X509Certificate2 certificate = Issue(InteropCert.EcdsaP256, client: false).Certificate; + var builder = WebApplication.CreateBuilder(); + builder.WebHost.ConfigureKestrel(options => + { + options.Listen(IPAddress.Loopback, 0, listen => listen.UseHttps(certificate)); + }); + WebApplication app = builder.Build(); + app.MapGet("/", () => "ok"); + await app.StartAsync(); + try + { + string? address = null; + foreach (string candidate in app.Services.GetRequiredService().Features.Get()!.Addresses) + { + address = candidate; + } + + if (address is null) + { + throw new InvalidOperationException("Kestrel did not publish an address."); + } + + int port = new Uri(address).Port; + using var tcp = new TcpClient(); + tcp.Connect(IPAddress.Loopback, port); + await using var stream = new TlsStream(tcp.GetStream()); + SslClientAuthenticationOptions options = ClientOptions("http/1.1", null); + await stream.AuthenticateAsClientAsync(options); + await stream.WriteAsync("GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n"u8.ToArray()); + var response = new byte[1024]; + int count = 0; + while (count < response.Length) + { + int read = await stream.ReadAsync(response.AsMemory(count)); + if (read == 0) + { + break; + } + + count += read; + if (Encoding.ASCII.GetString(response, 0, count).Contains("ok", StringComparison.Ordinal)) + { + return; + } + } + + Assert.Fail(Encoding.ASCII.GetString(response, 0, count)); + } + finally + { + await app.StopAsync(); + await app.DisposeAsync(); + } + } + + [TestMethod] + [TestCategory("Slow")] + public async Task FullMatrixSpeaksTls13() + { + foreach (InteropCase row in InteropMatrix.Full()) + { + try + { + await Exchange(row, 32); + } + catch (Exception error) + { + throw new AssertFailedException(row + " " + error.Message, error); + } + } + } + + [TestMethod] + [TestCategory("Slow")] + [Timeout(14400000)] + public async Task SeededSampleAgreesWithOpenSsl() + { + int count = Positive(Environment.GetEnvironmentVariable("TITANIUM_FUZZ_HANDSHAKES"), 500); + int seed = Environment.GetEnvironmentVariable("TITANIUM_FUZZ_SEED") is string text && int.TryParse(text, out int parsed) + ? parsed + : 8446; + var random = new Random(seed); + for (int index = 0; index < count; index++) + { + InteropCase row = DrawSupported(random); + try + { + await Exchange(row, 32); + } + catch (Exception error) + { + throw new AssertFailedException("seed=" + seed + " index=" + index + " " + row, error); + } + } + } + + [TestMethod] + [Timeout(60000)] + public async Task FipsPolicySpeaksTls13WithOpenSsl() + { + var client = new InteropCase(InteropRole.ManagedClient, InteropCipher.Aes128, InteropGroup.P256, InteropCert.EcdsaP256, InteropAlpn.None, false, false); + var server = new InteropCase(InteropRole.ManagedServer, InteropCipher.Aes128, InteropGroup.P256, InteropCert.EcdsaP256, InteropAlpn.None, false, false); + await Exchange(client, 32, TlsAlgorithmPolicy.FipsApprovedOnly); + await Exchange(server, 32, TlsAlgorithmPolicy.FipsApprovedOnly); + } + + private static InteropCase DrawSupported(Random random) + { + if (random.Next(2) == 0) + { + var group = random.Next(2) == 0 ? InteropGroup.X25519 : InteropGroup.P256; + return new InteropCase( + InteropRole.ManagedClient, + InteropCipher.Aes128, + group, + InteropCert.EcdsaP256, + (InteropAlpn)random.Next(3), + random.Next(2) == 1, + group == InteropGroup.P256); + } + + return new InteropCase( + InteropRole.ManagedServer, + (InteropCipher)random.Next(3), + (InteropGroup)random.Next(4), + (InteropCert)random.Next(3), + (InteropAlpn)random.Next(3), + random.Next(2) == 1, + random.Next(2) == 1); + } + + private static int Positive(string? text, int fallback) => int.TryParse(text, out int value) && value > 0 ? value : fallback; + + private static async Task Exchange(InteropCase row, int payloadLength) => await Exchange(row, payloadLength, TlsAlgorithmPolicy.Default); + + private static async Task Exchange(InteropCase row, int payloadLength, TlsAlgorithmPolicy policy) + { + if (!OpenSslOracle.Require(new Version(3, 5))) + { + Assert.Inconclusive("OpenSSL 3.5 or newer was not found."); + } + + string openssl = OpenSslOracle.Find() ?? throw new InvalidOperationException("OpenSSL was not found."); + string directory = Path.Combine(Path.GetTempPath(), "twp-interop-" + Guid.NewGuid().ToString("n")); + Directory.CreateDirectory(directory); + Issued server = Issue(row.Certificate, client: false); + Issued? client = row.ClientAuthentication ? Issue(InteropCert.EcdsaP256, client: true) : null; + try + { + string serverCert = Path.Combine(directory, "server.pem"); + string serverKey = Path.Combine(directory, "server.key"); + WritePem(serverCert, "CERTIFICATE", server.Certificate.RawData); + WritePem(serverKey, "PRIVATE KEY", server.Key); + string? clientCert = null; + string? clientKey = null; + if (client is not null) + { + clientCert = Path.Combine(directory, "client.pem"); + clientKey = Path.Combine(directory, "client.key"); + WritePem(clientCert, "CERTIFICATE", client.Value.Certificate.RawData); + WritePem(clientKey, "PRIVATE KEY", client.Value.Key); + } + + byte[] payload = new byte[payloadLength]; + payload.AsSpan().Fill(0x5A); + if (row.Role == InteropRole.ManagedClient) + { + await ClientAgainstOpenSsl(openssl, row, server.Certificate, serverCert, serverKey, client?.Certificate, clientCert, payload, policy); + } + else + { + await ServerAgainstOpenSsl(openssl, row, server.Certificate, client?.Certificate, clientCert, clientKey, payload, policy); + } + } + finally + { + server.Certificate.Dispose(); + client?.Certificate.Dispose(); + try + { + Directory.Delete(directory, recursive: true); + } + catch (IOException) + { + } + } + } + + private static async Task ClientAgainstOpenSsl(string openssl, InteropCase row, X509Certificate2 serverCertificate, string serverCert, string serverKey, X509Certificate2? clientCertificate, string? clientCert, byte[] payload, TlsAlgorithmPolicy policy = TlsAlgorithmPolicy.Default) + { + _ = serverCertificate; + int port = FreePort(); + string groups = row.HelloRetry || row.Group == InteropGroup.P256 ? "P-256" : GroupName(row.Group); + var args = new StringBuilder(); + args.Append("s_server -tls1_3 -quiet -num_tickets 0 -accept 127.0.0.1:").Append(port); + args.Append(" -cert ").Append(Quote(serverCert)).Append(" -key ").Append(Quote(serverKey)); + args.Append(" -groups ").Append(groups); + args.Append(" -ciphersuites ").Append(CipherName(row.Cipher)); + AppendAlpn(args, row.Alpn); + if (clientCert is not null) + { + args.Append(" -Verify 1 -verify_return_error -CAfile ").Append(Quote(clientCert)); + } + + using Peer peer = Peer.Start(openssl, args.ToString(), drainOutput: false); + using var tcp = new TcpClient(); + await Connect(tcp, port, peer); + await using var stream = new TlsStream(tcp.GetStream(), new TlsStreamOptions { AlgorithmPolicy = policy }); + await stream.AuthenticateAsClientAsync(ClientOptions(AlpnName(row.Alpn), clientCertificate)); + if (AlpnName(row.Alpn) is string selected) + { + Assert.AreEqual(selected, stream.NegotiatedApplicationProtocol.ToString(), peer.ErrorText()); + } + + // s_server copies the TLS payload to stdout and copies stdin back onto the TLS connection. + byte[] received = new byte[payload.Length]; + Task fromPeer = ReadExact(peer.Output, received); + await stream.WriteAsync(payload); + Assert.AreEqual(payload.Length, await fromPeer, peer.ErrorText()); + CollectionAssert.AreEqual(payload, received, peer.ErrorText()); + byte[] returned = new byte[payload.Length]; + Task fromStream = ReadExact(stream, returned); + await peer.Input.WriteAsync(received); + await peer.Input.FlushAsync(); + Assert.AreEqual(payload.Length, await fromStream, peer.ErrorText()); + CollectionAssert.AreEqual(payload, returned, peer.ErrorText()); + } + + private static async Task ServerAgainstOpenSsl(string openssl, InteropCase row, X509Certificate2 serverCertificate, X509Certificate2? clientCertificate, string? clientCert, string? clientKey, byte[] payload, TlsAlgorithmPolicy policy = TlsAlgorithmPolicy.Default) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + var args = new StringBuilder(); + args.Append("s_client -tls1_3 -quiet -connect 127.0.0.1:").Append(port); + args.Append(" -groups ").Append(row.HelloRetry ? "X25519:P-256" : GroupName(row.Group)); + args.Append(" -ciphersuites ").Append(CipherName(row.Cipher)); + AppendAlpn(args, row.Alpn); + if (clientCert is not null && clientKey is not null) + { + args.Append(" -cert ").Append(Quote(clientCert)).Append(" -key ").Append(Quote(clientKey)); + } + + using Peer peer = Peer.Start(openssl, args.ToString(), drainOutput: false); + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + var streamOptions = new TlsStreamOptions + { + Groups = ServerGroups(row), + CipherSuites = [CipherId(row.Cipher)], + RequestClientCertificate = row.ClientAuthentication, + AlgorithmPolicy = policy, + }; + if (clientCertificate is not null) + { + streamOptions.ClientTrustAnchors = [clientCertificate]; + } + + await using var stream = new TlsStream(accepted.GetStream(), streamOptions); + await stream.AuthenticateAsServerAsync(ServerOptions(serverCertificate, AlpnName(row.Alpn))); + if (AlpnName(row.Alpn) is string selected) + { + Assert.AreEqual(selected, stream.NegotiatedApplicationProtocol.ToString(), peer.ErrorText()); + } + + await peer.Input.WriteAsync(payload); + await peer.Input.FlushAsync(); + byte[] got = new byte[payload.Length]; + Assert.AreEqual(payload.Length, await ReadExact(stream, got), peer.ErrorText()); + CollectionAssert.AreEqual(payload, got, peer.ErrorText()); + await stream.WriteAsync(got); + byte[] reply = new byte[payload.Length]; + Assert.AreEqual(payload.Length, await ReadExact(peer.Output, reply), peer.ErrorText()); + CollectionAssert.AreEqual(payload, reply, peer.ErrorText()); + } + + private static SslClientAuthenticationOptions ClientOptions(string? alpn, X509Certificate2? clientCertificate) + { + var options = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }; + if (alpn is not null) + { + options.ApplicationProtocols = [new SslApplicationProtocol(alpn)]; + } + + if (clientCertificate is not null) + { + options.ClientCertificates = [clientCertificate]; + } + + return options; + } + + private static SslServerAuthenticationOptions ServerOptions(X509Certificate2 certificate, string? alpn = null) + { + var options = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }; + if (alpn is not null) + { + options.ApplicationProtocols = [new SslApplicationProtocol(alpn)]; + } + + return options; + } + + private static NamedGroup[] ServerGroups(InteropCase row) + { + if (row.HelloRetry) + { + return [NamedGroup.Secp256r1]; + } + + return row.Group switch + { + InteropGroup.X25519 => [NamedGroup.X25519], + InteropGroup.P256 => [NamedGroup.Secp256r1], + InteropGroup.P384 => [NamedGroup.Secp384r1], + _ => [NamedGroup.X25519MlKem768], + }; + } + + private static async Task Connect(TcpClient tcp, int port, Peer peer) + { + for (int attempt = 0; attempt < 50; attempt++) + { + if (peer.HasExited) + { + throw new InvalidOperationException(peer.ErrorText()); + } + + try + { + await tcp.ConnectAsync(IPAddress.Loopback, port); + return; + } + catch (SocketException) + { + await Task.Delay(50); + } + } + + throw new TimeoutException(peer.ErrorText()); + } + + private static async Task ReadExact(Stream stream, byte[] buffer) + { + int offset = 0; + while (offset < buffer.Length) + { + int read = await stream.ReadAsync(buffer.AsMemory(offset)); + if (read == 0) + { + break; + } + + offset += read; + } + + return offset; + } + + private static int FreePort() + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + return ((IPEndPoint)listener.LocalEndpoint).Port; + } + + private static void AppendAlpn(StringBuilder args, InteropAlpn alpn) + { + if (AlpnName(alpn) is string name) + { + args.Append(" -alpn ").Append(name); + } + } + + private static string? AlpnName(InteropAlpn alpn) => alpn switch + { + InteropAlpn.H2 => "h2", + InteropAlpn.Http11 => "http/1.1", + _ => null, + }; + + private static string GroupName(InteropGroup group) => group switch + { + InteropGroup.X25519 => "X25519", + InteropGroup.P256 => "P-256", + InteropGroup.P384 => "P-384", + _ => "X25519MLKEM768", + }; + + private static string CipherName(InteropCipher cipher) => cipher switch + { + InteropCipher.Aes128 => "TLS_AES_128_GCM_SHA256", + InteropCipher.Aes256 => "TLS_AES_256_GCM_SHA384", + _ => "TLS_CHACHA20_POLY1305_SHA256", + }; + + private static ushort CipherId(InteropCipher cipher) => cipher switch + { + InteropCipher.Aes128 => 0x1301, + InteropCipher.Aes256 => 0x1302, + _ => 0x1303, + }; + + private static string Quote(string path) => "\"" + path + "\""; + + private static void WritePem(string path, string label, byte[] der) + { + File.WriteAllText(path, new string(PemEncoding.Write(label, der))); + } + + private static Issued Issue(InteropCert kind, bool client) + { + using AsymmetricAlgorithm key = kind switch + { + InteropCert.Rsa2048 => RSA.Create(2048), + InteropCert.EcdsaP384 => ECDsa.Create(ECCurve.NamedCurves.nistP384), + _ => ECDsa.Create(ECCurve.NamedCurves.nistP256), + }; + CertificateRequest request = key switch + { + ECDsa ecdsa => new CertificateRequest("CN=localhost", ecdsa, HashAlgorithmName.SHA256), + RSA rsa => new CertificateRequest("CN=localhost", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1), + _ => throw new InvalidOperationException("Unexpected key."), + }; + var usages = new OidCollection { new Oid(client ? "1.3.6.1.5.5.7.3.2" : "1.3.6.1.5.5.7.3.1") }; + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(usages, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(2)); + byte[] pkcs8 = key switch + { + ECDsa ecdsa => ecdsa.ExportPkcs8PrivateKey(), + RSA rsa => rsa.ExportPkcs8PrivateKey(), + _ => throw new InvalidOperationException("Unexpected key."), + }; + X509Certificate2 certificate = X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + return new Issued(certificate, pkcs8); + } + + private readonly struct Issued(X509Certificate2 certificate, byte[] key) + { + internal X509Certificate2 Certificate { get; } = certificate; + + internal byte[] Key { get; } = key; + } + + private sealed class Peer : IDisposable + { + private readonly Process _process; + private readonly StringBuilder _error = new(); + private readonly Task _errorTask; + private readonly Task? _discard; + + private Peer(Process process, bool drainOutput) + { + _process = process; + Input = process.StandardInput.BaseStream; + Output = process.StandardOutput.BaseStream; + _errorTask = Task.Run(ReadError); + if (drainOutput) + { + _discard = Task.Run(DiscardOutput); + } + } + + internal Stream Input { get; } + + internal Stream Output { get; } + + internal bool HasExited => _process.HasExited; + + internal static Peer Start(string openssl, string arguments, bool drainOutput) + { + var start = new ProcessStartInfo + { + FileName = openssl, + Arguments = arguments, + UseShellExecute = false, + RedirectStandardInput = true, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + }; + Process process = Process.Start(start) ?? throw new InvalidOperationException("OpenSSL did not start."); + return new Peer(process, drainOutput); + } + + internal string ErrorText() + { + return _error.ToString(); + } + + public void Dispose() + { + try + { + Input.Dispose(); + } + catch (IOException) + { + } + + if (!_process.HasExited && !_process.WaitForExit(500)) + { + _process.Kill(entireProcessTree: true); + _process.WaitForExit(2000); + } + + _errorTask.Wait(2000); + _discard?.Wait(2000); + _process.Dispose(); + } + + private void ReadError() + { + var buffer = new char[256]; + while (true) + { + int read = _process.StandardError.Read(buffer, 0, buffer.Length); + if (read <= 0) + { + return; + } + + _error.Append(buffer, 0, read); + } + } + + private void DiscardOutput() + { + var buffer = new byte[4096]; + while (Output.Read(buffer, 0, buffer.Length) > 0) + { + } + } + } +} + +internal enum InteropRole +{ + ManagedClient, + ManagedServer, +} + +internal enum InteropCipher +{ + Aes128, + Aes256, + ChaCha, +} + +internal enum InteropGroup +{ + X25519, + P256, + P384, + Hybrid, +} + +internal enum InteropCert +{ + EcdsaP256, + EcdsaP384, + Rsa2048, +} + +internal enum InteropAlpn +{ + H2, + Http11, + None, +} + +internal readonly record struct InteropCase(InteropRole Role, InteropCipher Cipher, InteropGroup Group, InteropCert Certificate, InteropAlpn Alpn, bool ClientAuthentication, bool HelloRetry) +{ + public override string ToString() + { + return Role + "," + Cipher + "," + Group + "," + Certificate + "," + Alpn + "," + ClientAuthentication + "," + HelloRetry; + } + + internal static InteropCase Parse(string text) + { + string[] parts = text.Split(','); + return new InteropCase( + Enum.Parse(parts[0]), + Enum.Parse(parts[1]), + Enum.Parse(parts[2]), + Enum.Parse(parts[3]), + Enum.Parse(parts[4]), + bool.Parse(parts[5]), + bool.Parse(parts[6])); + } +} + +internal static class InteropMatrix +{ + internal static IReadOnlyList Pairwise() + { + var rows = new List(); + foreach (int[] row in Cover([2, 3, 2], 17)) + { + var group = (InteropGroup)row[0]; + rows.Add(new InteropCase(InteropRole.ManagedClient, InteropCipher.Aes128, group, InteropCert.EcdsaP256, (InteropAlpn)row[1], row[2] == 1, group == InteropGroup.P256)); + } + + foreach (int[] row in Cover([3, 4, 3, 3, 2, 2], 17)) + { + rows.Add(new InteropCase( + InteropRole.ManagedServer, + (InteropCipher)row[0], + (InteropGroup)row[1], + (InteropCert)row[2], + (InteropAlpn)row[3], + row[4] == 1, + row[5] == 1)); + } + + return rows; + } + + internal static IReadOnlyList Full() + { + var rows = new List(); + foreach (InteropGroup group in Enum.GetValues()) + { + if (group is InteropGroup.P384 or InteropGroup.Hybrid) + { + continue; + } + + foreach (InteropAlpn alpn in Enum.GetValues()) + { + rows.Add(new InteropCase(InteropRole.ManagedClient, InteropCipher.Aes128, group, InteropCert.EcdsaP256, alpn, false, group == InteropGroup.P256)); + rows.Add(new InteropCase(InteropRole.ManagedClient, InteropCipher.Aes128, group, InteropCert.EcdsaP256, alpn, true, group == InteropGroup.P256)); + } + } + + foreach (InteropCipher cipher in Enum.GetValues()) + { + foreach (InteropGroup group in Enum.GetValues()) + { + foreach (InteropCert certificate in Enum.GetValues()) + { + foreach (InteropAlpn alpn in Enum.GetValues()) + { + foreach (bool auth in new[] { false, true }) + { + foreach (bool retry in new[] { false, true }) + { + rows.Add(new InteropCase(InteropRole.ManagedServer, cipher, group, certificate, alpn, auth, retry)); + } + } + } + } + } + } + + return rows; + } + + private static List Cover(int[] sizes, int seed) + { + var pairs = new List<(int Left, int LeftValue, int Right, int RightValue)>(); + for (int left = 0; left < sizes.Length; left++) + { + for (int right = left + 1; right < sizes.Length; right++) + { + for (int leftValue = 0; leftValue < sizes[left]; leftValue++) + { + for (int rightValue = 0; rightValue < sizes[right]; rightValue++) + { + pairs.Add((left, leftValue, right, rightValue)); + } + } + } + } + + var random = new Random(seed); + var open = new bool[pairs.Count]; + Array.Fill(open, true); + int remaining = pairs.Count; + var rows = new List(); + while (remaining > 0) + { + int[] best = new int[sizes.Length]; + int bestHits = 0; + for (int attempt = 0; attempt < 64; attempt++) + { + var candidate = new int[sizes.Length]; + for (int factor = 0; factor < sizes.Length; factor++) + { + candidate[factor] = random.Next(sizes[factor]); + } + + int hits = Hits(candidate, pairs, open); + if (hits > bestHits) + { + bestHits = hits; + candidate.CopyTo(best, 0); + } + } + + if (bestHits == 0) + { + for (int index = 0; index < pairs.Count; index++) + { + if (!open[index]) + { + continue; + } + + for (int factor = 0; factor < sizes.Length; factor++) + { + best[factor] = random.Next(sizes[factor]); + } + + best[pairs[index].Left] = pairs[index].LeftValue; + best[pairs[index].Right] = pairs[index].RightValue; + break; + } + } + + rows.Add((int[])best.Clone()); + for (int index = 0; index < pairs.Count; index++) + { + if (open[index] && Covers(best, pairs[index])) + { + open[index] = false; + remaining--; + } + } + } + + return rows; + } + + private static int Hits(int[] row, List<(int Left, int LeftValue, int Right, int RightValue)> pairs, bool[] open) + { + int hits = 0; + for (int index = 0; index < pairs.Count; index++) + { + if (open[index] && Covers(row, pairs[index])) + { + hits++; + } + } + + return hits; + } + + private static bool Covers(int[] row, (int Left, int LeftValue, int Right, int RightValue) pair) + { + return row[pair.Left] == pair.LeftValue && row[pair.Right] == pair.RightValue; + } +} diff --git a/tests/Titanium.Tls.Tests/TlsParityGuardTests.cs b/tests/Titanium.Tls.Tests/TlsParityGuardTests.cs new file mode 100644 index 000000000..c8d928c5a --- /dev/null +++ b/tests/Titanium.Tls.Tests/TlsParityGuardTests.cs @@ -0,0 +1,366 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +/// +/// Allocation and idle-memory gates for the managed TLS stack. The unit job skips TestCategory=Perf. +/// +[TestClass] +[DoNotParallelize] +public sealed class TlsParityGuardTests +{ + // Measured 181400 bytes on this PC with the handshake output, flight writers and receive buffer pooled, plus 10 percent. + private const long HandshakeBudgetBytes = 199540; + + [TestMethod] + [TestCategory("Perf")] + public async Task Handshake_StaysWithinBudgetAndOffTheLargeObjectHeap() + { + using X509Certificate2 certificate = Certificate(); + for (int i = 0; i < 50; i++) + { + await using Pair pair = await Pair.OpenManaged(certificate); + } + + int gen2 = GC.CollectionCount(2); + long before = GC.GetTotalAllocatedBytes(precise: true); + await using (Pair measured = await Pair.OpenManaged(certificate)) + { + _ = measured; + } + + long allocated = GC.GetTotalAllocatedBytes(precise: true) - before; + Assert.IsTrue(allocated <= HandshakeBudgetBytes, "allocated " + allocated + " bytes, budget " + HandshakeBudgetBytes); + Assert.AreEqual(gen2, GC.CollectionCount(2), "a handshake allocation reached the large object heap"); + } + + [TestMethod] + [TestCategory("Perf")] + public async Task SteadyStateRecord_AllocatesNothingBeyondThePlatformStack() + { + // The parity rule is "0 beyond platform", not an absolute zero: on Linux the BCL's own socket + // and stream plumbing allocates about 184 bytes per record on BOTH stacks (measured on + // linuxmini: 184.0 managed and 184.0 platform), so an absolute-zero assertion fails there + // while the managed stack is at parity. Measure the platform arm on the same machine. + // A hosted runner's two measurements disagree by a few bytes (ubuntu-26.04 reported 367 + // managed against 362 platform), so when the platform arm itself allocates, allow that noise. + // A Windows arm that allocates nothing still has to stay at zero. + long platform = await PerRecordAllocation(managed: false, Certificate()); + long managed = await PerRecordAllocation(managed: true, Certificate()); + long slack = platform == 0 ? 0 : 64; + Assert.IsTrue(managed <= platform + slack, + "managed " + managed + " bytes per record against platform " + platform); + } + + private static async Task PerRecordAllocation(bool managed, X509Certificate2 certificate) + { + byte[] payload = new byte[1024]; + byte[] clientReceived = new byte[1024]; + byte[] serverReceived = new byte[1024]; + await using Pair pair = await (managed ? Pair.OpenManaged(certificate) : Pair.OpenPlatform(certificate)); + Exception? serverError = null; + using var finished = new ManualResetEventSlim(false); + var server = new Thread(() => + { + try + { + for (int i = 0; i < 1002; i++) + { + ReadAndWrite(pair.Server, serverReceived, payload); + } + } + catch (Exception ex) + { + serverError = ex; + } + finally + { + finished.Set(); + } + }) + { + IsBackground = true, + }; + server.Start(); + for (int i = 0; i < 2; i++) + { + WriteAndRead(pair.Client, payload, clientReceived); + } + + long before = GC.GetTotalAllocatedBytes(precise: true); + for (int i = 0; i < 1000; i++) + { + WriteAndRead(pair.Client, payload, clientReceived); + } + + long allocated = GC.GetTotalAllocatedBytes(precise: true) - before; + finished.Wait(); + if (serverError is not null) + { + throw serverError; + } + + return allocated / 1000; + } + + [TestMethod] + [TestCategory("Perf")] + [Timeout(180000)] + public async Task IdleConnections_UseNoMoreMemoryThanThePlatformStack() + { + const int count = 200; + using X509Certificate2 certificate = Certificate(); + long platform = await BytesPerConnection(managed: false, certificate, count); + long managed = await BytesPerConnection(managed: true, certificate, count); + Assert.IsTrue(managed <= platform, "managed " + managed + " bytes per idle connection, platform " + platform); + } + + private static async Task BytesPerConnection(bool managed, X509Certificate2 certificate, int count) + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + long before = GC.GetTotalMemory(forceFullCollection: true); + List held = await OpenMany(managed, certificate, count); + try + { + GC.Collect(); + GC.WaitForPendingFinalizers(); + GC.Collect(); + long after = GC.GetTotalMemory(forceFullCollection: true); + return (after - before) / count; + } + finally + { + foreach (IDisposable item in held) + { + item.Dispose(); + } + } + } + + private static async Task> OpenMany(bool managed, X509Certificate2 certificate, int count) + { + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Assert.AreNotEqual(8000, port); + Assert.AreNotEqual(8866, port); + Assert.AreNotEqual(9080, port); + Assert.AreNotEqual(9464, port); + Task> servers = AcceptServers(listener, certificate, managed, count); + var clients = new List(count); + try + { + for (int i = 0; i < count; i++) + { + var tcp = new TcpClient(); + clients.Add(tcp); + await tcp.ConnectAsync(IPAddress.Loopback, port); + clients.Add(await AuthenticateClient(tcp.GetStream(), managed)); + } + + clients.AddRange(await servers); + return clients; + } + catch + { + listener.Stop(); + foreach (IDisposable item in clients) + { + item.Dispose(); + } + + try + { + foreach (IDisposable item in await servers) + { + item.Dispose(); + } + } + catch (SocketException) + { + } + + throw; + } + } + + private static async Task> AcceptServers(TcpListener listener, X509Certificate2 certificate, bool managed, int count) + { + var held = new List(count * 2); + for (int i = 0; i < count; i++) + { + TcpClient tcp = await listener.AcceptTcpClientAsync(); + held.Add(tcp); + held.Add(await AuthenticateServer(tcp.GetStream(), certificate, managed)); + } + + return held; + } + + private static async Task AuthenticateClient(System.IO.Stream inner, bool managed) + { + var options = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }; + if (!managed) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + await ssl.AuthenticateAsClientAsync(options); + return ssl; + } + + var stream = new TlsStream(inner); + await stream.AuthenticateAsClientAsync(options); + return stream; + } + + private static async Task AuthenticateServer(System.IO.Stream inner, X509Certificate2 certificate, bool managed) + { + var options = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }; + if (!managed) + { + var ssl = new SslStream(inner, leaveInnerStreamOpen: false); + await ssl.AuthenticateAsServerAsync(options); + return ssl; + } + + var stream = new TlsStream(inner); + await stream.AuthenticateAsServerAsync(options); + return stream; + } + + private static void WriteAndRead(System.IO.Stream stream, byte[] payload, byte[] received) + { + stream.Write(payload); + int offset = 0; + while (offset < received.Length) + { + int count = stream.Read(received, offset, received.Length - offset); + Assert.AreNotEqual(0, count); + offset += count; + } + } + + private static void ReadAndWrite(System.IO.Stream stream, byte[] received, byte[] payload) + { + int offset = 0; + while (offset < payload.Length) + { + int count = stream.Read(received, offset, payload.Length - offset); + Assert.AreNotEqual(0, count); + offset += count; + } + + stream.Write(payload); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + private sealed class Pair : IAsyncDisposable + { + private readonly TcpListener _listener; + private readonly TcpClient _clientTcp; + private readonly TcpClient _serverTcp; + + private Pair(TcpListener listener, TcpClient clientTcp, TcpClient serverTcp, System.IO.Stream client, System.IO.Stream server) + { + _listener = listener; + _clientTcp = clientTcp; + _serverTcp = serverTcp; + Client = client; + Server = server; + } + + internal System.IO.Stream Client { get; } + + internal System.IO.Stream Server { get; } + + internal static async Task OpenManaged(X509Certificate2 certificate) + { + var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task accepted = listener.AcceptTcpClientAsync(); + var clientTcp = new TcpClient(); + await clientTcp.ConnectAsync(IPAddress.Loopback, port); + TcpClient serverTcp = await accepted; + var client = new TlsStream(clientTcp.GetStream()); + var server = new TlsStream(serverTcp.GetStream()); + Task serverAuth = server.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }); + await client.AuthenticateAsClientAsync(new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }); + await serverAuth; + return new Pair(listener, clientTcp, serverTcp, client, server); + } + + /// The same topology on , so a guard can compare the two stacks on this machine. + internal static async Task OpenPlatform(X509Certificate2 certificate) + { + var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + Task accepted = listener.AcceptTcpClientAsync(); + var clientTcp = new TcpClient(); + await clientTcp.ConnectAsync(IPAddress.Loopback, port); + TcpClient serverTcp = await accepted; + var client = new SslStream(clientTcp.GetStream(), leaveInnerStreamOpen: false); + var server = new SslStream(serverTcp.GetStream(), leaveInnerStreamOpen: false); + Task serverAuth = server.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + }); + await client.AuthenticateAsClientAsync(new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }); + await serverAuth; + return new Pair(listener, clientTcp, serverTcp, client, server); + } + + public async ValueTask DisposeAsync() + { + await Client.DisposeAsync(); + await Server.DisposeAsync(); + _clientTcp.Dispose(); + _serverTcp.Dispose(); + _listener.Stop(); + } + } +} diff --git a/tests/Titanium.Tls.Tests/TlsStreamTests.cs b/tests/Titanium.Tls.Tests/TlsStreamTests.cs new file mode 100644 index 000000000..f1675539c --- /dev/null +++ b/tests/Titanium.Tls.Tests/TlsStreamTests.cs @@ -0,0 +1,460 @@ +using System; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class TlsStreamTests +{ + [TestMethod] + public void SynchronousAuthenticationMovesOneRecord() + { + using X509Certificate2 certificate = Certificate(); + using TcpListener listener = Listen(); + byte[] payload = [1, 2, 3, 4]; + Task server = Task.Run(() => + { + using TcpClient accepted = listener.AcceptTcpClient(); + using var stream = new TlsStream(accepted.GetStream()); + stream.AuthenticateAsServer(ServerOptions(certificate)); + byte[] buffer = new byte[4]; + Assert.AreEqual(4, stream.Read(buffer)); + stream.Write(buffer); + }); + + using TcpClient clientTcp = Connect(listener); + using var client = new TlsStream(clientTcp.GetStream()); + client.AuthenticateAsClient(ClientOptions()); + client.Write(payload); + byte[] echoed = new byte[4]; + Assert.AreEqual(4, client.Read(echoed)); + CollectionAssert.AreEqual(payload, echoed); + server.GetAwaiter().GetResult(); + } + + [TestMethod] + public async Task TransferMatchesOnBothSides() + { + byte[] outbound = Random(10 * 1024 * 1024); + byte[] inbound = Random(10 * 1024 * 1024); + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + Task writeOut = client.WriteAsync(outbound).AsTask(); + Task writeIn = server.WriteAsync(inbound).AsTask(); + Task readOut = ReadExact(server, outbound.Length); + Task readIn = ReadExact(client, inbound.Length); + await Task.WhenAll(writeOut, writeIn, readOut, readIn); + byte[] gotOut = await readOut; + byte[] gotIn = await readIn; + CollectionAssert.AreEqual(SHA256.HashData(outbound), SHA256.HashData(gotOut)); + CollectionAssert.AreEqual(SHA256.HashData(inbound), SHA256.HashData(gotIn)); + Assert.AreEqual(SslProtocols.Tls13, client.SslProtocol); + Assert.AreEqual(TlsCipherSuite.TLS_AES_128_GCM_SHA256, client.NegotiatedCipherSuite); + Assert.AreEqual("h2", client.NegotiatedApplicationProtocol.ToString()); + Assert.IsTrue(client.IsAuthenticated); + Assert.IsTrue(client.IsEncrypted); + Assert.IsTrue(server.IsServer); + byte[] left = new byte[32]; + byte[] right = new byte[32]; + client.ExportKeyingMaterial(left, "EXPERIMENTAL", "ctx"u8); + server.ExportKeyingMaterial(right, "EXPERIMENTAL", "ctx"u8); + CollectionAssert.AreEqual(left, right); + } + + [TestMethod] + public async Task ZeroLengthReadDoesNotConsumeTheRecord() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + await client.WriteAsync(new byte[] { 9, 8, 7, 6 }); + Assert.AreEqual(0, server.Read(Span.Empty)); + byte[] buffer = new byte[4]; + Assert.AreEqual(4, server.Read(buffer)); + CollectionAssert.AreEqual(new byte[] { 9, 8, 7, 6 }, buffer); + client.Write([]); + } + + [TestMethod] + public async Task TransportEndWithoutCloseNotifyThrows() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await pair.Server.DisposeAsync(); + Assert.ThrowsException(() => client.Read(new byte[4])); + } + + [TestMethod] + public async Task ReadAfterDisposeThrows() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await pair.Server.DisposeAsync(); + await pair.Client.DisposeAsync(); + Assert.ThrowsException(() => pair.Client.Read(new byte[1])); + } + + [TestMethod] + public async Task WriteAfterShutdownThrows() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + await client.ShutdownAsync(); + InvalidOperationException error = Assert.ThrowsException(() => client.Write(new byte[] { 1 })); + Assert.AreEqual("Write operations are not allowed after the channel was shutdown.", error.Message); + byte[] buffer = new byte[1]; + Assert.AreEqual(0, server.Read(buffer)); + } + + [TestMethod] + public async Task ConcurrentWriteAndReadMovesFourBytes() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + byte[] payload = [4, 5, 6, 7]; + byte[] got = new byte[4]; + Task reading = server.ReadAsync(got).AsTask(); + await client.WriteAsync(payload); + Assert.AreEqual(4, await reading); + CollectionAssert.AreEqual(payload, got); + } + + [TestMethod] + public async Task CancelledReadThrows() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + using var cancellation = new CancellationTokenSource(TimeSpan.FromMilliseconds(200)); + await Assert.ThrowsExceptionAsync(async () => + { + int read = await client.ReadAsync(new byte[4], cancellation.Token); + Assert.AreEqual(-1, read); + }); + await Assert.ThrowsExceptionAsync(async () => + { + int read = await client.ReadAsync(new byte[1]); + Assert.AreEqual(-1, read); + }); + } + + [TestMethod] + public async Task KeyUpdateSurvivesConcurrentTraffic() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + for (int i = 0; i < 8; i++) + { + client.UpdateKeys(); + byte[] payload = [(byte)i, 2, 3, 4]; + byte[] got = new byte[4]; + Task reading = server.ReadAsync(got).AsTask(); + await Task.Delay(1); + await client.WriteAsync(payload); + Assert.AreEqual(4, await reading); + CollectionAssert.AreEqual(payload, got); + server.UpdateKeys(); + byte[] reply = [(byte)(i + 10), 6, 7, 8]; + byte[] echoed = new byte[4]; + Task clientRead = client.ReadAsync(echoed).AsTask(); + await server.WriteAsync(reply); + Assert.AreEqual(4, await clientRead); + CollectionAssert.AreEqual(reply, echoed); + } + } + + [TestMethod] + public async Task MultiRecordWritesStayInOrderAcrossKeyUpdates() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + int[] sizes = [16385, 65536, 4 * 16384 + 1, 300_000]; + foreach (int size in sizes) + { + foreach (bool async in new[] { false, true }) + { + client.UpdateKeys(); + byte[] payload = Random(size); + Task reading = ReadExact(server, size); + if (async) + { + await client.WriteAsync(payload); + } + else + { + await Task.Run(() => client.Write(payload)); + } + + CollectionAssert.AreEqual(SHA256.HashData(payload), SHA256.HashData(await reading)); + } + } + } + + [TestMethod] + public async Task KeyUpdateKeepsTheFollowingRecordReadable() + { + using X509Certificate2 certificate = Certificate(); + (TlsStream Client, TlsStream Server) pair = await Pair(certificate, null); + await using TlsStream client = pair.Client; + await using TlsStream server = pair.Server; + await client.WriteAsync(new byte[] { 1 }); + Assert.AreEqual(1, server.Read(new byte[1])); + client.UpdateKeys(); + await client.WriteAsync(new byte[] { 2 }); + byte[] second = new byte[1]; + Assert.AreEqual(1, server.Read(second)); + Assert.AreEqual(2, second[0]); + server.UpdateKeys(); + await server.WriteAsync(new byte[] { 3 }); + byte[] reply = new byte[1]; + Assert.AreEqual(1, client.Read(reply)); + Assert.AreEqual(3, reply[0]); + } + + [TestMethod] + public async Task ClientSpeaksToAnSslStreamServer() + { + PlatformSsl.RequireTls13(); + using X509Certificate2 certificate = Certificate(); + using TcpListener listener = Listen(); + Task server = Task.Run(async () => + { + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using var stream = new SslStream(accepted.GetStream(), leaveInnerStreamOpen: false, static (_, _, _, _) => true); + await stream.AuthenticateAsServerAsync(ServerOptions(certificate)); + byte[] buffer = new byte[4]; + Assert.AreEqual(4, await stream.ReadAsync(buffer)); + await stream.WriteAsync(buffer); + }); + + using TcpClient clientTcp = Connect(listener); + await using var client = new TlsStream(clientTcp.GetStream()); + await client.AuthenticateAsClientAsync(ClientOptions()); + await client.WriteAsync(new byte[] { 1, 2, 3, 4 }); + byte[] echoed = new byte[4]; + Assert.AreEqual(4, await client.ReadAsync(echoed)); + server.GetAwaiter().GetResult(); + } + + [TestMethod] + public async Task ServerSpeaksToAnSslStreamClient() + { + PlatformSsl.RequireTls13(); + using X509Certificate2 certificate = Certificate(); + using TcpListener listener = Listen(); + Task server = Task.Run(async () => + { + using TcpClient accepted = await listener.AcceptTcpClientAsync(); + await using var stream = new TlsStream(accepted.GetStream()); + await stream.AuthenticateAsServerAsync(ServerOptions(certificate)); + byte[] buffer = new byte[4]; + Assert.AreEqual(4, await stream.ReadAsync(buffer)); + await stream.WriteAsync(buffer); + }); + + using TcpClient clientTcp = Connect(listener); + await using var client = new SslStream(clientTcp.GetStream()); + await client.AuthenticateAsClientAsync(ClientOptions()); + await client.WriteAsync(new byte[] { 5, 6, 7, 8 }); + byte[] echoed = new byte[4]; + Assert.AreEqual(4, await client.ReadAsync(echoed)); + server.GetAwaiter().GetResult(); + } + + [TestMethod] + public async Task TheSelectionCallbackSuppliesTheClientCertificate() + { + using X509Certificate2 serverCertificate = Certificate(); + using X509Certificate2 clientCertificate = ClientCertificate(); + string[]? seenIssuers = ["unset"]; + X509Certificate? seenRemote = null; + TcpListener listener = Listen(); + Task accepted = AcceptServer(listener, serverCertificate, options => + { + options.RemoteCertificateValidationCallback = static (_, _, _, _) => true; + }, new TlsStreamOptions { RequestClientCertificate = true }); + TcpClient clientTcp = Connect(listener); + await using var client = new TlsStream(clientTcp.GetStream()); + var clientOptions = ClientOptions(); + clientOptions.LocalCertificateSelectionCallback = (_, host, _, remote, issuers) => + { + Assert.AreEqual("localhost", host); + seenIssuers = issuers; + seenRemote = remote; + return clientCertificate; + }; + await client.AuthenticateAsClientAsync(clientOptions); + await using TlsStream server = await accepted; + listener.Stop(); + + Assert.AreEqual(0, seenIssuers!.Length); + Assert.IsNotNull(seenRemote); + Assert.AreEqual(serverCertificate.Subject, seenRemote!.Subject); + Assert.IsTrue(server.IsMutuallyAuthenticated); + Assert.AreEqual(clientCertificate.Subject, server.RemoteCertificate!.Subject); + Assert.AreEqual(clientCertificate.Subject, client.LocalCertificate!.Subject); + } + + [TestMethod] + public async Task ANullSelectionReplacesTheCertificateCollection() + { + using X509Certificate2 serverCertificate = Certificate(); + using X509Certificate2 clientCertificate = ClientCertificate(); + TcpListener listener = Listen(); + Task accepted = AcceptServer(listener, serverCertificate, options => + { + options.RemoteCertificateValidationCallback = static (_, _, _, _) => true; + }, new TlsStreamOptions { RequestClientCertificate = true }); + TcpClient clientTcp = Connect(listener); + await using var client = new TlsStream(clientTcp.GetStream()); + var clientOptions = ClientOptions(); + clientOptions.ClientCertificates = [clientCertificate]; + clientOptions.LocalCertificateSelectionCallback = static (_, _, _, _, _) => null!; + await client.AuthenticateAsClientAsync(clientOptions); + await using TlsStream server = await accepted; + listener.Stop(); + + Assert.IsFalse(server.IsMutuallyAuthenticated); + Assert.IsNull(client.LocalCertificate); + } + + [TestMethod] + public void CertificateAuthoritiesUseTheIssuerString() + { + using X509Certificate2 certificate = ClientCertificate(); + byte[] name = certificate.SubjectName.RawData; + var body = new byte[2 + 2 + name.Length]; + body[1] = (byte)(2 + name.Length); + body[3] = (byte)name.Length; + name.CopyTo(body, 4); + + string[]? issuers = TlsEngine.ReadCertificateAuthorities(Extension(body)); + Assert.IsNotNull(issuers); + Assert.AreEqual(1, issuers!.Length); + Assert.AreEqual(certificate.Issuer, issuers[0]); + Assert.IsNull(TlsEngine.ReadCertificateAuthorities(ReadOnlySpan.Empty)); + } + + private static byte[] Extension(byte[] body) + { + var encoded = new byte[4 + body.Length]; + encoded[0] = (byte)(ExtensionType.CertificateAuthorities >> 8); + encoded[1] = (byte)ExtensionType.CertificateAuthorities; + encoded[2] = (byte)(body.Length >> 8); + encoded[3] = (byte)body.Length; + body.CopyTo(encoded, 4); + return encoded; + } + + private static async Task<(TlsStream Client, TlsStream Server)> Pair(X509Certificate2 certificate, Action? configure) + { + TcpListener listener = Listen(); + Task accepted = AcceptServer(listener, certificate, configure, null); + TcpClient clientTcp = Connect(listener); + var client = new TlsStream(clientTcp.GetStream()); + await client.AuthenticateAsClientAsync(ClientOptions()); + TlsStream server = await accepted; + listener.Stop(); + return (client, server); + } + + private static async Task AcceptServer(TcpListener listener, X509Certificate2 certificate, Action? configure, TlsStreamOptions? streamOptions) + { + TcpClient accepted = await listener.AcceptTcpClientAsync(); + var stream = new TlsStream(accepted.GetStream(), streamOptions); + SslServerAuthenticationOptions options = ServerOptions(certificate); + configure?.Invoke(options); + await stream.AuthenticateAsServerAsync(options); + return stream; + } + + private static TcpListener Listen() + { + var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + return listener; + } + + private static TcpClient Connect(TcpListener listener) + { + var client = new TcpClient(); + client.Connect((IPEndPoint)listener.LocalEndpoint); + return client; + } + + private static SslClientAuthenticationOptions ClientOptions() => new() + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + ApplicationProtocols = [SslApplicationProtocol.Http2], + }; + + private static SslServerAuthenticationOptions ServerOptions(X509Certificate2 certificate) => new() + { + ServerCertificate = certificate, + EnabledSslProtocols = SslProtocols.Tls13, + ApplicationProtocols = [SslApplicationProtocol.Http2], + }; + + private static async Task ReadExact(Stream stream, int count) + { + var buffer = new byte[count]; + int offset = 0; + while (offset < count) + { + int read = await stream.ReadAsync(buffer.AsMemory(offset)); + Assert.AreNotEqual(0, read); + offset += read; + } + + return buffer; + } + + private static byte[] Random(int count) + { + var buffer = new byte[count]; + RandomNumberGenerator.Fill(buffer); + return buffer; + } + + private static X509Certificate2 ClientCertificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=client", key, HashAlgorithmName.SHA256); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } + + private static X509Certificate2 Certificate() + { + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, critical: false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), password: null, X509KeyStorageFlags.Exportable); + } +} diff --git a/tests/Titanium.Tls.Tests/WycheproofAeadTests.cs b/tests/Titanium.Tls.Tests/WycheproofAeadTests.cs new file mode 100644 index 000000000..f7a917b66 --- /dev/null +++ b/tests/Titanium.Tls.Tests/WycheproofAeadTests.cs @@ -0,0 +1,77 @@ +using System; +using System.IO; +using System.Security.Cryptography; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class WycheproofAeadTests +{ + [TestMethod] + public void AesGcmMatchesWycheproofFor96BitNonces() + { + AssertAead("aes_gcm_test.json", (key, nonce, ciphertext, tag, plaintext, aad) => + { + using var aes = new AesGcm(key, tag.Length); + aes.Decrypt(nonce, ciphertext, tag, plaintext, aad); + }); + } + + [TestMethod] + public void ChaCha20Poly1305MatchesWycheproofFor96BitNonces() + { + AssertAead("chacha20_poly1305_test.json", (key, nonce, ciphertext, tag, plaintext, aad) => + { + using var aead = new ChaCha20Poly1305(key); + aead.Decrypt(nonce, ciphertext, tag, plaintext, aad); + }); + } + + private static void AssertAead(string file, Decrypt decrypt) + { + using JsonDocument document = JsonDocument.Parse(File.ReadAllText(WycheproofX25519Tests.FindFixture(file))); + int checkedVectors = 0; + foreach (JsonElement group in document.RootElement.GetProperty("testGroups").EnumerateArray()) + { + if (group.GetProperty("ivSize").GetInt32() != 96) + { + continue; + } + + foreach (JsonElement test in group.GetProperty("tests").EnumerateArray()) + { + byte[] key = Convert.FromHexString(test.GetProperty("key").GetString()!); + byte[] nonce = Convert.FromHexString(test.GetProperty("iv").GetString()!); + byte[] aad = Convert.FromHexString(test.GetProperty("aad").GetString()!); + byte[] ciphertext = Convert.FromHexString(test.GetProperty("ct").GetString()!); + byte[] tag = Convert.FromHexString(test.GetProperty("tag").GetString()!); + byte[] message = Convert.FromHexString(test.GetProperty("msg").GetString()!); + byte[] plaintext = new byte[message.Length]; + string result = test.GetProperty("result").GetString()!; + try + { + decrypt(key, nonce, ciphertext, tag, plaintext, aad); + Assert.AreNotEqual("invalid", result, "tcId " + test.GetProperty("tcId").GetInt32()); + if (result == "valid") + { + Assert.IsTrue(plaintext.AsSpan().SequenceEqual(message), "tcId " + test.GetProperty("tcId").GetInt32()); + } + } + catch (AuthenticationTagMismatchException) when (result != "valid") + { + } + catch (ArgumentException) when (result != "valid") + { + } + + checkedVectors++; + } + } + + Assert.IsTrue(checkedVectors > 0); + } + + private delegate void Decrypt(byte[] key, byte[] nonce, byte[] ciphertext, byte[] tag, byte[] plaintext, byte[] aad); +} diff --git a/tests/Titanium.Tls.Tests/WycheproofEd25519Tests.cs b/tests/Titanium.Tls.Tests/WycheproofEd25519Tests.cs new file mode 100644 index 000000000..7df0472f7 --- /dev/null +++ b/tests/Titanium.Tls.Tests/WycheproofEd25519Tests.cs @@ -0,0 +1,46 @@ +using System; +using System.IO; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class WycheproofEd25519Tests +{ + [TestMethod] + public void VerifyMatchesWycheproofEd25519() + { + using JsonDocument document = JsonDocument.Parse(File.ReadAllText(WycheproofX25519Tests.FindFixture("ed25519_test.json"))); + int valid = 0; + foreach (JsonElement group in document.RootElement.GetProperty("testGroups").EnumerateArray()) + { + JsonElement key = group.GetProperty("publicKey"); + if (key.GetProperty("curve").GetString() != "edwards25519") + { + continue; + } + + byte[] publicKey = Convert.FromHexString(key.GetProperty("pk").GetString()!); + foreach (JsonElement test in group.GetProperty("tests").EnumerateArray()) + { + byte[] message = Convert.FromHexString(test.GetProperty("msg").GetString()!); + byte[] signature = Convert.FromHexString(test.GetProperty("sig").GetString()!); + bool verified = Ed25519Verifier.Verify(publicKey, message, signature); + string result = test.GetProperty("result").GetString()!; + int id = test.GetProperty("tcId").GetInt32(); + if (result == "valid") + { + Assert.IsTrue(verified, "tcId " + id); + valid++; + } + else if (result == "invalid") + { + Assert.IsFalse(verified, "tcId " + id); + } + } + } + + Assert.IsTrue(valid > 0); + } +} diff --git a/tests/Titanium.Tls.Tests/WycheproofSignatureTests.cs b/tests/Titanium.Tls.Tests/WycheproofSignatureTests.cs new file mode 100644 index 000000000..19354a76a --- /dev/null +++ b/tests/Titanium.Tls.Tests/WycheproofSignatureTests.cs @@ -0,0 +1,110 @@ +using System; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Org.BouncyCastle.Asn1.X509; +using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto.Generators; +using Org.BouncyCastle.Crypto.Operators; +using Org.BouncyCastle.Security; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class WycheproofSignatureTests +{ + [TestMethod] + public void EcdsaSha256MatchesWycheproof() + { + AssertVerified("ecdsa_secp256r1_sha256_test.json", 0x0403); + } + + [TestMethod] + public void EcdsaSha384MatchesWycheproof() + { + AssertVerified("ecdsa_secp384r1_sha384_test.json", 0x0503); + } + + [TestMethod] + public void RsaPssSha256MatchesWycheproof() + { + AssertVerified("rsa_pss_2048_sha256_mgf1_32_test.json", 0x0804); + } + + private static void AssertVerified(string file, ushort scheme) + { + using JsonDocument document = JsonDocument.Parse(System.IO.File.ReadAllText(WycheproofX25519Tests.FindFixture(file))); + AsymmetricKeyParameter signer = SigningKey(); + int valid = 0; + foreach (JsonElement group in document.RootElement.GetProperty("testGroups").EnumerateArray()) + { + byte[] spki = Convert.FromHexString(group.GetProperty("publicKeyDer").GetString()!); + using X509Certificate2 certificate = CertificateFor(spki, signer); + foreach (JsonElement test in group.GetProperty("tests").EnumerateArray()) + { + string result = test.GetProperty("result").GetString()!; + if (result == "acceptable" || PlatformAccepts(test)) + { + continue; + } + + byte[] message = Convert.FromHexString(test.GetProperty("msg").GetString()!); + byte[] signature = Convert.FromHexString(test.GetProperty("sig").GetString()!); + bool verified = TlsCertificateVerifier.Verify(certificate, scheme, message, signature); + int id = test.GetProperty("tcId").GetInt32(); + if (result == "valid") + { + Assert.IsTrue(verified, file + " tcId " + id); + valid++; + } + else + { + Assert.IsFalse(verified, file + " tcId " + id); + } + } + } + + Assert.IsTrue(valid > 0, file); + } + + private static bool PlatformAccepts(JsonElement test) + { + if (!test.TryGetProperty("flags", out JsonElement flags)) + { + return false; + } + + foreach (JsonElement flag in flags.EnumerateArray()) + { + string? name = flag.GetString(); + if (name is "MissingZero" or "BerEncodedSignature") + { + return true; + } + } + + return false; + } + + private static AsymmetricKeyParameter SigningKey() + { + var generator = new RsaKeyPairGenerator(); + generator.Init(new KeyGenerationParameters(new SecureRandom(), 2048)); + return generator.GenerateKeyPair().Private; + } + + private static X509Certificate2 CertificateFor(byte[] subjectPublicKeyInfo, AsymmetricKeyParameter signer) + { + var generator = new Org.BouncyCastle.X509.X509V3CertificateGenerator(); + var name = new X509Name("CN=wycheproof"); + generator.SetSerialNumber(Org.BouncyCastle.Math.BigInteger.One); + generator.SetIssuerDN(name); + generator.SetSubjectDN(name); + generator.SetNotBefore(DateTime.UtcNow.AddDays(-1)); + generator.SetNotAfter(DateTime.UtcNow.AddYears(1)); + generator.SetPublicKey(PublicKeyFactory.CreateKey(subjectPublicKeyInfo)); + Org.BouncyCastle.X509.X509Certificate certificate = generator.Generate(new Asn1SignatureFactory("SHA256WITHRSA", signer)); + return X509CertificateLoader.LoadCertificate(certificate.GetEncoded()); + } +} diff --git a/tests/Titanium.Tls.Tests/WycheproofX25519Tests.cs b/tests/Titanium.Tls.Tests/WycheproofX25519Tests.cs new file mode 100644 index 000000000..93cdf5182 --- /dev/null +++ b/tests/Titanium.Tls.Tests/WycheproofX25519Tests.cs @@ -0,0 +1,60 @@ +using System; +using System.IO; +using System.Text.Json; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class WycheproofX25519Tests +{ + [TestMethod] + public void ScalarMultMatchesWycheproofX25519() + { + using JsonDocument document = JsonDocument.Parse(File.ReadAllText(FindFixture("x25519_test.json"))); + int valid = 0; + Span shared = stackalloc byte[32]; + foreach (JsonElement group in document.RootElement.GetProperty("testGroups").EnumerateArray()) + { + foreach (JsonElement test in group.GetProperty("tests").EnumerateArray()) + { + byte[] scalar = Convert.FromHexString(test.GetProperty("private").GetString()!); + byte[] point = Convert.FromHexString(test.GetProperty("public").GetString()!); + byte[] expected = Convert.FromHexString(test.GetProperty("shared").GetString()!); + shared.Clear(); + bool agreed = scalar.Length == 32 && point.Length == 32 && X25519.TryAgree(scalar, point, shared); + string result = test.GetProperty("result").GetString()!; + if (result == "valid") + { + Assert.IsTrue(agreed, "tcId " + test.GetProperty("tcId").GetInt32()); + Assert.IsTrue(shared.SequenceEqual(expected), "tcId " + test.GetProperty("tcId").GetInt32()); + valid++; + } + else if (agreed) + { + Assert.IsTrue(shared.SequenceEqual(expected), "tcId " + test.GetProperty("tcId").GetInt32()); + } + } + } + + Assert.IsTrue(valid > 0); + } + + internal static string FindFixture(string name) + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "tests", "Titanium.Tls.Tests", "Fixtures", "wycheproof", name); + if (File.Exists(candidate)) + { + return candidate; + } + + dir = dir.Parent; + } + + Assert.Fail(name + " was not found."); + return string.Empty; + } +} diff --git a/tests/Titanium.Tls.Tests/X25519DifferentialTests.cs b/tests/Titanium.Tls.Tests/X25519DifferentialTests.cs new file mode 100644 index 000000000..0316559ed --- /dev/null +++ b/tests/Titanium.Tls.Tests/X25519DifferentialTests.cs @@ -0,0 +1,319 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class X25519DifferentialTests +{ + [TestMethod] + public void ScalarMultMatchesBouncyCastleOnThirtyTwoPairs() + { + AssertMatches(32); + } + + [TestMethod] + [TestCategory("Slow")] + public void ScalarMultMatchesBouncyCastleOnTenThousandPairs() + { + AssertMatches(10_000); + } + + [TestMethod] + public void ScalarMultMatchesBigIntegerOnExtremeAndRandomPairs() + { + AssertBigInteger(new byte[32], new byte[32]); + byte[] ones = new byte[32]; + Array.Fill(ones, (byte)0xFF); + AssertBigInteger(ones, ones); + byte[] scalar = new byte[32]; + byte[] point = new byte[32]; + var random = new Random(7748); + for (int i = 0; i < 64; i++) + { + random.NextBytes(scalar); + random.NextBytes(point); + AssertBigInteger(scalar, point); + } + } + + [TestMethod] + public void FixedBasePublicKeyMatchesTheLadderOnEdgeScalars() + { + var edges = new List + { + new byte[32], + Enumerable.Repeat((byte)0xFF, 32).ToArray(), + Enumerable.Repeat((byte)0x88, 32).ToArray(), + Enumerable.Repeat((byte)0x77, 32).ToArray(), + Enumerable.Repeat((byte)0x08, 32).ToArray(), + Enumerable.Repeat((byte)0xF8, 32).ToArray(), + Enumerable.Repeat((byte)0x80, 32).ToArray(), + Enumerable.Repeat((byte)0x0F, 32).ToArray(), + Enumerable.Repeat((byte)0xF0, 32).ToArray(), + }; + for (int i = 0; i < 32; i++) + { + var single = new byte[32]; + single[i] = 0x01; + edges.Add(single); + var high = new byte[32]; + high[i] = 0x80; + edges.Add(high); + var filled = new byte[32]; + Array.Fill(filled, (byte)0xFF, 0, i + 1); + edges.Add(filled); + } + + foreach (byte[] scalar in edges) + { + AssertFixedBase(scalar); + } + } + + [TestMethod] + public void FixedBasePublicKeyMatchesTheLadderOnRandomScalars() + { + byte[] scalar = new byte[32]; + var random = new Random(255_19); + for (int i = 0; i < 2000; i++) + { + random.NextBytes(scalar); + AssertFixedBase(scalar); + } + } + + [TestMethod] + public void FixedBasePublicKeyMatchesBigIntegerOnRandomScalars() + { + byte[] scalar = new byte[32]; + byte[] basePoint = new byte[32]; + basePoint[0] = 9; + var random = new Random(7748); + for (int i = 0; i < 16; i++) + { + random.NextBytes(scalar); + byte[] ours = new byte[32]; + X25519.PublicKey(scalar, ours); + Assert.IsTrue(ours.AsSpan().SequenceEqual(ReferenceLadder(scalar, basePoint)), $"scalar {i}"); + } + } + + [TestMethod] + public void FixedBasePublicKeyMatchesBouncyCastle() + { + byte[] scalar = new byte[32]; + byte[] ours = new byte[32]; + byte[] theirs = new byte[32]; + for (int i = 0; i < 256; i++) + { + RandomNumberGenerator.Fill(scalar); + X25519.PublicKey(scalar, ours); + Org.BouncyCastle.Math.EC.Rfc7748.X25519.GeneratePublicKey(scalar, 0, theirs, 0); + Assert.IsTrue(ours.AsSpan().SequenceEqual(theirs), $"scalar {i}"); + } + } + + [TestMethod] + public void MaxBoundLimbsMatchBigInteger() + { + const ulong max = (1UL << 54) - 1; + ulong r0 = max; + ulong r1 = max - 19; + ulong r2 = max / 3; + ulong r3 = 1; + ulong r4 = max; + Curve25519Field left = Curve25519Field.FromLimbs(max, max, max, max, max); + Curve25519Field right = Curve25519Field.FromLimbs(r0, r1, r2, r3, r4); + BigInteger leftValue = Limbs(max, max, max, max, max); + BigInteger rightValue = Limbs(r0, r1, r2, r3, r4); + Curve25519Field product = default; + Curve25519Field.Mul(ref product, in left, in right); + AssertField(product, leftValue * rightValue); + Curve25519Field square = default; + Curve25519Field.Square(ref square, in left); + AssertField(square, leftValue * leftValue); + } + + [TestMethod] + public void RandomLimbsAtEveryBoundMatchBigInteger() + { + var random = new Random(51_19); + int[] widths = [51, 52, 53, 54]; + foreach (int width in widths) + { + ulong mask = (1UL << width) - 1; + for (int i = 0; i < 4000; i++) + { + ulong[] a = new ulong[5]; + ulong[] b = new ulong[5]; + for (int limb = 0; limb < 5; limb++) + { + a[limb] = (ulong)random.NextInt64() & mask; + b[limb] = (ulong)random.NextInt64() & mask; + } + + Curve25519Field left = Curve25519Field.FromLimbs(a[0], a[1], a[2], a[3], a[4]); + Curve25519Field right = Curve25519Field.FromLimbs(b[0], b[1], b[2], b[3], b[4]); + BigInteger leftValue = Limbs(a[0], a[1], a[2], a[3], a[4]); + BigInteger rightValue = Limbs(b[0], b[1], b[2], b[3], b[4]); + Curve25519Field product = default; + Curve25519Field.Mul(ref product, in left, in right); + AssertField(product, leftValue * rightValue); + Curve25519Field square = default; + Curve25519Field.Square(ref square, in left); + AssertField(square, leftValue * leftValue); + + // The output feeds the next multiply, as it does in the ladder. + Curve25519Field chained = default; + Curve25519Field.Mul(ref chained, in product, in square); + AssertField(chained, leftValue * rightValue * (leftValue * leftValue)); + } + } + } + + [TestMethod] + [TestCategory("Slow")] + [Timeout(900000)] + public void ScalarMultMatchesBigIntegerOnOneHundredThousandPairs() + { + byte[] scalar = new byte[32]; + byte[] point = new byte[32]; + for (int i = 0; i < 100_000; i++) + { + RandomNumberGenerator.Fill(scalar); + RandomNumberGenerator.Fill(point); + AssertBigInteger(scalar, point); + } + } + + private static void AssertMatches(int pairs) + { + byte[] scalar = new byte[32]; + byte[] point = new byte[32]; + byte[] ours = new byte[32]; + byte[] theirs = new byte[32]; + for (int i = 0; i < pairs; i++) + { + RandomNumberGenerator.Fill(scalar); + RandomNumberGenerator.Fill(point); + point[31] &= 127; + X25519.ScalarMult(scalar, point, ours); + Org.BouncyCastle.Math.EC.Rfc7748.X25519.ScalarMult(scalar, 0, point, 0, theirs, 0); + Assert.IsTrue(ours.AsSpan().SequenceEqual(theirs), $"pair {i}"); + } + } + + private static void AssertFixedBase(byte[] scalar) + { + byte[] basePoint = new byte[32]; + basePoint[0] = 9; + byte[] ladder = new byte[32]; + X25519.ScalarMult(scalar, basePoint, ladder); + byte[] fixedBase = new byte[32]; + X25519.PublicKey(scalar, fixedBase); + Assert.IsTrue(ladder.AsSpan().SequenceEqual(fixedBase), Convert.ToHexString(scalar)); + } + + private static void AssertBigInteger(byte[] scalar, byte[] point) + { + byte[] ours = new byte[32]; + X25519.ScalarMult(scalar, point, ours); + byte[] theirs = ReferenceLadder(scalar, point); + Assert.IsTrue(ours.AsSpan().SequenceEqual(theirs)); + } + + private static void AssertField(Curve25519Field value, BigInteger expected) + { + Span bytes = stackalloc byte[32]; + value.ToBytes(bytes); + Assert.IsTrue(bytes.SequenceEqual(Encode(expected))); + } + + private static BigInteger Limbs(ulong z0, ulong z1, ulong z2, ulong z3, ulong z4) + { + return new BigInteger(z0) + + (new BigInteger(z1) << 51) + + (new BigInteger(z2) << 102) + + (new BigInteger(z3) << 153) + + (new BigInteger(z4) << 204); + } + + private static byte[] ReferenceLadder(ReadOnlySpan scalar, ReadOnlySpan uCoordinate) + { + Span clamped = stackalloc byte[32]; + scalar.CopyTo(clamped); + clamped[0] &= 248; + clamped[31] &= 127; + clamped[31] |= 64; + Span uBytes = stackalloc byte[32]; + uCoordinate.CopyTo(uBytes); + uBytes[31] &= 127; + BigInteger prime = (BigInteger.One << 255) - 19; + BigInteger x1 = Decode(uBytes); + BigInteger x2 = BigInteger.One; + BigInteger z2 = BigInteger.Zero; + BigInteger x3 = x1; + BigInteger z3 = BigInteger.One; + int swap = 0; + for (int bit = 254; bit >= 0; bit--) + { + int current = (clamped[bit >> 3] >> (bit & 7)) & 1; + swap ^= current; + if (swap != 0) + { + (x2, x3) = (x3, x2); + (z2, z3) = (z3, z2); + } + + swap = current; + BigInteger a = Mod(x2 + z2, prime); + BigInteger aa = Mod(a * a, prime); + BigInteger b = Mod(x2 - z2, prime); + BigInteger bb = Mod(b * b, prime); + BigInteger e = Mod(aa - bb, prime); + BigInteger c = Mod(x3 + z3, prime); + BigInteger d = Mod(x3 - z3, prime); + BigInteger da = Mod(d * a, prime); + BigInteger cb = Mod(c * b, prime); + BigInteger x3n = Mod((da + cb) * (da + cb), prime); + BigInteger z3n = Mod(x1 * Mod((da - cb) * (da - cb), prime), prime); + BigInteger x2n = Mod(aa * bb, prime); + BigInteger z2n = Mod(e * Mod(aa + (121665 * e), prime), prime); + x2 = x2n; + z2 = z2n; + x3 = x3n; + z3 = z3n; + } + + BigInteger result = Mod(x2 * BigInteger.ModPow(z2, prime - 2, prime), prime); + return Encode(result); + } + + private static BigInteger Decode(ReadOnlySpan bytes) + { + Span little = stackalloc byte[33]; + bytes.CopyTo(little); + return new BigInteger(little, isUnsigned: true, isBigEndian: false); + } + + private static byte[] Encode(BigInteger value) + { + BigInteger prime = (BigInteger.One << 255) - 19; + value = Mod(value, prime); + byte[] raw = value.ToByteArray(isUnsigned: true, isBigEndian: false); + var encoded = new byte[32]; + raw.AsSpan(0, Math.Min(32, raw.Length)).CopyTo(encoded); + return encoded; + } + + private static BigInteger Mod(BigInteger value, BigInteger prime) + { + value %= prime; + return value.Sign < 0 ? value + prime : value; + } +} diff --git a/tests/Titanium.Tls.Tests/X25519OpenSslTests.cs b/tests/Titanium.Tls.Tests/X25519OpenSslTests.cs new file mode 100644 index 000000000..39954e369 --- /dev/null +++ b/tests/Titanium.Tls.Tests/X25519OpenSslTests.cs @@ -0,0 +1,84 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class X25519OpenSslTests +{ + private static readonly byte[] PrivatePrefix = Convert.FromHexString("302e020100300506032b656e04220420"); + private static readonly byte[] PublicPrefix = Convert.FromHexString("302a300506032b656e032100"); + + [TestMethod] + public void ScalarMultMatchesOpenSslOnFiftySamples() + { + if (!OpenSslOracle.Require(new Version(3, 5))) + { + Assert.Inconclusive("OpenSSL 3.5 or later was not found."); + return; + } + + string openssl = OpenSslOracle.Find() ?? throw new InvalidOperationException("OpenSSL was not found."); + string dir = Path.Combine(Path.GetTempPath(), "twp-x25519-" + Guid.NewGuid().ToString("N")); + Directory.CreateDirectory(dir); + try + { + string privPath = Path.Combine(dir, "priv.der"); + string peerPath = Path.Combine(dir, "peer.der"); + string sharedPath = Path.Combine(dir, "shared.bin"); + byte[] scalar = new byte[32]; + byte[] peerScalar = new byte[32]; + Span peerPublic = stackalloc byte[32]; + Span shared = stackalloc byte[32]; + for (int i = 0; i < 50; i++) + { + RandomNumberGenerator.Fill(scalar); + RandomNumberGenerator.Fill(peerScalar); + X25519.PublicKey(peerScalar, peerPublic); + File.WriteAllBytes(privPath, Concat(PrivatePrefix, scalar)); + File.WriteAllBytes(peerPath, Concat(PublicPrefix, peerPublic)); + Derive(openssl, privPath, peerPath, sharedPath); + Assert.IsTrue(X25519.TryAgree(scalar, peerPublic, shared), $"sample {i} was rejected"); + Assert.IsTrue(shared.SequenceEqual(File.ReadAllBytes(sharedPath)), $"sample {i}"); + } + } + finally + { + Directory.Delete(dir, recursive: true); + } + } + + private static void Derive(string openssl, string privPath, string peerPath, string sharedPath) + { + if (File.Exists(sharedPath)) + { + File.Delete(sharedPath); + } + + ProcessStartInfo start = new() + { + FileName = openssl, + Arguments = $"pkeyutl -derive -inkey \"{privPath}\" -keyform DER -peerkey \"{peerPath}\" -peerform DER -out \"{sharedPath}\"", + RedirectStandardError = true, + UseShellExecute = false, + }; + using Process process = Process.Start(start) ?? throw new InvalidOperationException("OpenSSL did not start."); + string error = process.StandardError.ReadToEnd(); + if (!process.WaitForExit(10000) || process.ExitCode != 0) + { + throw new InvalidOperationException("OpenSSL X25519 derive failed. " + error); + } + } + + private static byte[] Concat(byte[] prefix, ReadOnlySpan body) + { + byte[] result = new byte[prefix.Length + body.Length]; + prefix.CopyTo(result, 0); + body.CopyTo(result.AsSpan(prefix.Length)); + return result; + } +} diff --git a/tests/Titanium.Tls.Tests/X25519Tests.cs b/tests/Titanium.Tls.Tests/X25519Tests.cs new file mode 100644 index 000000000..4be59b15e --- /dev/null +++ b/tests/Titanium.Tls.Tests/X25519Tests.cs @@ -0,0 +1,170 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Security.Cryptography; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Tls.Tests.Support; + +namespace Titanium.Tls.Tests; + +[TestClass] +public sealed class X25519Tests +{ + [TestMethod] + [RfcRequirement("RFC 7748", "5.2", "X25519Tests.ScalarMultMatchesRfc7748Section52")] + public void ScalarMultMatchesRfc7748Section52() + { + byte[] scalar = Hex("a546e36bf0527c9d3b16154b82465edd62144c0ac1fc5a18506a2244ba449ac4"); + byte[] u = Hex("e6db6867583030db3594c1a424b15f7c726624ec26b3353b10a903a6d0ab1c4c"); + Span result = stackalloc byte[32]; + X25519.ScalarMult(scalar, u, result); + Assert.IsTrue(result.SequenceEqual(Hex("c3da55379de9c6908e94ea4df28d084f32eccf03491c71f754b4075577a28552"))); + } + + [TestMethod] + public void AliceAndBobAgreeOnRfc7748Section61() + { + byte[] alicePrivate = Hex("77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a"); + byte[] bobPrivate = Hex("5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb"); + Span alicePublic = stackalloc byte[32]; + Span bobPublic = stackalloc byte[32]; + X25519.PublicKey(alicePrivate, alicePublic); + X25519.PublicKey(bobPrivate, bobPublic); + Assert.IsTrue(alicePublic.SequenceEqual(Hex("8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a"))); + Assert.IsTrue(bobPublic.SequenceEqual(Hex("de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f"))); + + Span aliceShared = stackalloc byte[32]; + Span bobShared = stackalloc byte[32]; + Assert.IsTrue(X25519.TryAgree(alicePrivate, bobPublic, aliceShared)); + Assert.IsTrue(X25519.TryAgree(bobPrivate, alicePublic, bobShared)); + Assert.IsTrue(aliceShared.SequenceEqual(Hex("4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742"))); + Assert.IsTrue(bobShared.SequenceEqual(aliceShared)); + } + + [TestMethod] + public void IteratedScalarMultMatchesRfc7748AfterOneThousand() + { + byte[] scalar = new byte[32]; + byte[] u = new byte[32]; + scalar[0] = 9; + u[0] = 9; + Span result = stackalloc byte[32]; + Span previousScalar = stackalloc byte[32]; + for (int i = 0; i < 1000; i++) + { + scalar.AsSpan().CopyTo(previousScalar); + X25519.ScalarMult(scalar, u, result); + result.CopyTo(scalar); + previousScalar.CopyTo(u); + if (i == 0) + { + Assert.IsTrue(scalar.AsSpan().SequenceEqual(Hex("422c8e7a6227d7bca1350b3e2bb7279f7897b87bb6854b783c60e80311ae3079"))); + } + } + + Assert.IsTrue(scalar.AsSpan().SequenceEqual(Hex("684cf59ba83309552800ef566f2f4d3c1c3887c49360e3875f2eb94d99532c51"))); + } + + [TestMethod] + [TestCategory("Slow")] + [Timeout(900_000)] + public void IteratedScalarMultMatchesRfc7748AfterOneMillion() + { + byte[] scalar = new byte[32]; + byte[] u = new byte[32]; + scalar[0] = 9; + u[0] = 9; + Span result = stackalloc byte[32]; + Span previousScalar = stackalloc byte[32]; + for (int i = 0; i < 1_000_000; i++) + { + scalar.AsSpan().CopyTo(previousScalar); + X25519.ScalarMult(scalar, u, result); + result.CopyTo(scalar); + previousScalar.CopyTo(u); + } + + Assert.IsTrue(scalar.AsSpan().SequenceEqual(Hex("7c3911e0ab2586fd864497297e575e6f3bc601c0883c30df5f4dd2d24f665424"))); + } + + [TestMethod] + public void AgreementIsCommutative() + { + Span alice = stackalloc byte[32]; + Span bob = stackalloc byte[32]; + RandomNumberGenerator.Fill(alice); + RandomNumberGenerator.Fill(bob); + Span alicePublic = stackalloc byte[32]; + Span bobPublic = stackalloc byte[32]; + X25519.PublicKey(alice, alicePublic); + X25519.PublicKey(bob, bobPublic); + Span aliceShared = stackalloc byte[32]; + Span bobShared = stackalloc byte[32]; + Assert.IsTrue(X25519.TryAgree(alice, bobPublic, aliceShared)); + Assert.IsTrue(X25519.TryAgree(bob, alicePublic, bobShared)); + Assert.IsTrue(aliceShared.SequenceEqual(bobShared)); + } + + [TestMethod] + public void LadderSourceDoesNotCallThePlatform() + { + DirectoryInfo? dir = new(AppContext.BaseDirectory); + string? path = null; + while (dir is not null) + { + string candidate = Path.Combine(dir.FullName, "src", "Titanium.Tls", "Internal", "X25519.cs"); + if (File.Exists(candidate)) + { + path = candidate; + break; + } + + dir = dir.Parent; + } + + Assert.IsNotNull(path); + string source = File.ReadAllText(path); + StringAssert.DoesNotMatch(source, new System.Text.RegularExpressions.Regex("DllImport|ECDiffieHellman|\\bunsafe\\b")); + } + + [TestMethod] + public void LowOrderPublicKeyIsRejected() + { + Span shared = stackalloc byte[32]; + shared.Fill(1); + Assert.IsFalse(X25519.TryAgree(new byte[32], new byte[32], shared)); + Assert.IsTrue(shared.SequenceEqual(new byte[32])); + } + + [TestMethod] + public void ScalarMultStaysUnderTheRegressionCeiling() + { + byte[] scalar = new byte[32]; + byte[] point = new byte[32]; + scalar[0] = 9; + point[0] = 9; + Span result = stackalloc byte[32]; + X25519.ScalarMult(scalar, point, result); + var watch = Stopwatch.StartNew(); + const int iterations = 200; + for (int i = 0; i < iterations; i++) + { + X25519.ScalarMult(scalar, point, result); + } + + watch.Stop(); + double microseconds = watch.Elapsed.TotalMicroseconds / iterations; + Assert.IsTrue(microseconds <= 900, $"X25519 scalar multiplication took {microseconds:F1} µs."); + } + + private static byte[] Hex(string text) + { + byte[] bytes = new byte[text.Length / 2]; + for (int i = 0; i < bytes.Length; i++) + { + bytes[i] = Convert.ToByte(text.Substring(i * 2, 2), 16); + } + + return bytes; + } +} diff --git a/tests/Titanium.Tls.Tests/X25519TimingTests.cs b/tests/Titanium.Tls.Tests/X25519TimingTests.cs new file mode 100644 index 000000000..6e1b67d0b --- /dev/null +++ b/tests/Titanium.Tls.Tests/X25519TimingTests.cs @@ -0,0 +1,116 @@ +using System; +using System.Diagnostics; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Titanium.Tls.Tests; + +[TestClass] +[DoNotParallelize] +public sealed class X25519TimingTests +{ + public TestContext TestContext { get; set; } = null!; + + [TestMethod] + [TestCategory("TimingSideChannel")] + [Timeout(900000)] + public void ScalarMultTimingDoesNotSeparateFixedFromRandom() + { + byte[] point = new byte[32]; + point[0] = 9; + Span warm = stackalloc byte[32]; + X25519.ScalarMult(point, point, warm); + AssertNoSeparation((scalar, result) => X25519.ScalarMult(scalar, point, result)); + } + + [TestMethod] + [TestCategory("TimingSideChannel")] + [Timeout(900000)] + public void FixedBasePublicKeyTimingDoesNotSeparateFixedFromRandom() + { + Span warm = stackalloc byte[32]; + X25519.PublicKey(new byte[32], warm); + AssertNoSeparation((scalar, result) => X25519.PublicKey(scalar, result)); + } + + private delegate void Operation(byte[] scalar, Span result); + + private void AssertNoSeparation(Operation operation) + { + const int samples = 100_000; + var fixedTicks = new long[samples]; + var randomTicks = new long[samples]; + byte[] fixedScalar = new byte[32]; + byte[] randomScalar = new byte[32]; + fixedScalar[0] = 9; + var random = new Random(8446); + Span result = stackalloc byte[32]; + for (int i = 0; i < samples; i++) + { + random.NextBytes(randomScalar); + if (random.Next(2) == 0) + { + fixedTicks[i] = Time(operation, fixedScalar, result); + randomTicks[i] = Time(operation, randomScalar, result); + } + else + { + randomTicks[i] = Time(operation, randomScalar, result); + fixedTicks[i] = Time(operation, fixedScalar, result); + } + } + + long[] fixedCropped = CropTopFivePercent(fixedTicks); + long[] randomCropped = CropTopFivePercent(randomTicks); + double statistic = Welch(fixedCropped, randomCropped); + double fixedUs = Mean(fixedCropped) * 1_000_000d / Stopwatch.Frequency; + double randomUs = Mean(randomCropped) * 1_000_000d / Stopwatch.Frequency; + TestContext.WriteLine("welch-t=" + statistic.ToString("F2") + " fixed-us=" + fixedUs.ToString("F1") + " random-us=" + randomUs.ToString("F1")); + Assert.IsTrue(Math.Abs(statistic) <= 10, "Welch t is " + statistic.ToString("F2") + " (fixed " + fixedUs.ToString("F1") + " us, random " + randomUs.ToString("F1") + " us)."); + } + + private static long Time(Operation operation, byte[] scalar, Span result) + { + long start = Stopwatch.GetTimestamp(); + operation(scalar, result); + return Stopwatch.GetTimestamp() - start; + } + private static long[] CropTopFivePercent(long[] samples) + { + Array.Sort(samples); + int keep = samples.Length - (samples.Length / 20); + var cropped = new long[keep]; + Array.Copy(samples, cropped, keep); + return cropped; + } + + private static double Welch(long[] left, long[] right) + { + double leftMean = Mean(left); + double rightMean = Mean(right); + double denominator = Math.Sqrt((Variance(left, leftMean) / left.Length) + (Variance(right, rightMean) / right.Length)); + return denominator == 0 ? 0 : (leftMean - rightMean) / denominator; + } + + private static double Mean(long[] values) + { + double sum = 0; + for (int i = 0; i < values.Length; i++) + { + sum += values[i]; + } + + return sum / values.Length; + } + + private static double Variance(long[] values, double mean) + { + double sum = 0; + for (int i = 0; i < values.Length; i++) + { + double delta = values[i] - mean; + sum += delta * delta; + } + + return sum / (values.Length - 1); + } +} diff --git a/tests/Titanium.Web.Proxy.Configuration.Tests/FingerprintValidationTests.cs b/tests/Titanium.Web.Proxy.Configuration.Tests/FingerprintValidationTests.cs new file mode 100644 index 000000000..78a3437a1 --- /dev/null +++ b/tests/Titanium.Web.Proxy.Configuration.Tests/FingerprintValidationTests.cs @@ -0,0 +1,48 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Web.Proxy.Abstractions; +using Titanium.Web.Proxy.Abstractions.Clusters; +using Titanium.Web.Proxy.Configuration; +using Titanium.Web.Proxy.Configuration.Models; + +namespace Titanium.Web.Proxy.Configuration.Tests; + +[TestClass] +public class FingerprintValidationTests +{ + [TestMethod] + public void FingerprintWithoutTheManagedStackIsAnError() + { + var errors = string.Join("; ", TwpConfigValidator.Validate(Config(managedStack: null))); + StringAssert.Contains(errors, "UseManagedTlsStack"); + StringAssert.Contains(errors, "TITANIUM_MANAGED_STACK"); + StringAssert.Contains(errors, ManagedStackRequiredException.Reason); + } + + [TestMethod] + public void AnUnknownFingerprintIsAnError() + { + var errors = string.Join("; ", TwpConfigValidator.Validate(Config(managedStack: true, profile: "other"))); + StringAssert.Contains(errors, "unknown"); + } + + [TestMethod] + public void ChromeWithTheManagedStackIsAccepted() + { + var errors = TwpConfigValidator.Validate(Config(managedStack: true)); + Assert.AreEqual(0, errors.Count, string.Join("; ", errors)); + } + + private static TwpConfig Config(bool? managedStack, string profile = "chrome") => new() + { + Server = new ServerConfig { ManagedStack = managedStack }, + Clusters = + [ + new ClusterConfig + { + Id = "c", + Destinations = [new DestinationConfig { Id = "d", Address = "127.0.0.1", Port = 443, UseHttps = true }], + HttpClient = new ClusterHttpClientConfig { Fingerprint = profile }, + }, + ], + }; +} diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/HandlerHttp3ProxyTests.cs b/tests/Titanium.Web.Proxy.IntegrationTests/HandlerHttp3ProxyTests.cs new file mode 100644 index 000000000..548c791cf --- /dev/null +++ b/tests/Titanium.Web.Proxy.IntegrationTests/HandlerHttp3ProxyTests.cs @@ -0,0 +1,127 @@ +#pragma warning disable CA1416 // The platform listener starts only off Windows, and only when TITANIUM_QUIC_PLATFORM_LISTENER is 1. +#pragma warning disable TWP001 + +using System; +using System.Net; +using System.Net.Http; +using System.Net.Quic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Net.Http; +using Titanium.Web.Proxy.IntegrationTests.Setup; +using Titanium.Web.Proxy.Models; + +namespace Titanium.Web.Proxy.IntegrationTests; + +[TestClass] +public sealed class HandlerHttp3ProxyTests +{ + [TestMethod] + [Timeout(60000)] + public async Task Http3GetReachesTheProxyListener() + { + if (!PlatformListenerAllowed()) + { + return; + } + + using TestServer origin = new(TestCertificateAuthority.ServerCertificate, requireMutualTls: false); + origin.HandleRequest(static context => context.Response.WriteAsync("proxy-h3-ok")); + int forwardPort = new Uri(origin.ListeningHttpUrl).Port; + using ProxyServer proxy = StartProxy(forwardPort, out int port); + using HttpResponseMessage response = await SendAsync(port, HttpMethod.Get, content: null); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("proxy-h3-ok", await response.Content.ReadAsStringAsync()); + Assert.AreEqual(3, response.Version.Major); + Assert.IsNotNull(proxy); + } + + [TestMethod] + [Timeout(60000)] + public async Task Http3PostReachesTheProxyListener() + { + if (!PlatformListenerAllowed()) + { + return; + } + + using TestServer origin = new(TestCertificateAuthority.ServerCertificate, requireMutualTls: false); + origin.HandleRequest(async context => + { + string body = await new System.IO.StreamReader(context.Request.Body).ReadToEndAsync(); + await context.Response.WriteAsync(body); + }); + int forwardPort = new Uri(origin.ListeningHttpUrl).Port; + using ProxyServer proxy = StartProxy(forwardPort, out int port); + using HttpResponseMessage response = await SendAsync(port, HttpMethod.Post, new StringContent("payload")); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual("payload", await response.Content.ReadAsStringAsync()); + Assert.AreEqual(3, response.Version.Major); + Assert.IsNotNull(proxy); + } + + private static bool PlatformListenerAllowed() + { + // QuicListener opens a wildcard UDP socket. This PC must not start it. + return !OperatingSystem.IsWindows() + && string.Equals(Environment.GetEnvironmentVariable("TITANIUM_QUIC_PLATFORM_LISTENER"), "1", StringComparison.Ordinal) + && QuicListener.IsSupported; + } + + private static ProxyServer StartProxy(int forwardPort, out int port) + { + var endPoint = new TransparentProxyEndPoint(IPAddress.Loopback, 0, decryptSsl: true) + { + EnableHttp3 = true, + ForwardHost = "127.0.0.1", + ForwardPort = forwardPort, + ForwardCleartext = true, + GenericCertificateName = "127.0.0.1", + MaxInboundBidirectionalStreams = 100, + }; + endPoint.BeforeQuicAuthenticate += (_, args) => + { + args.UpstreamHttpProtocol = UpstreamHttpProtocol.Http11; + return Task.CompletedTask; + }; + var proxy = new ProxyServer(false, false, false) + { + EnableHttp3 = true, + EnableHttpsSvcbDnsDiscovery = false, + }; + proxy.CertificateManager.RootCertificateName = TestCertificateAuthority.RootCertificateName; + proxy.CertificateManager.RootCertificate = TestCertificateAuthority.RootCertificate; + proxy.CertificateManager.SaveFakeCertificates = false; + proxy.ServerCertificateValidationCallback += (_, args) => + { + args.IsValid = TestCertificateAuthority.Validate(args.Certificate, args.SslPolicyErrors); + return Task.CompletedTask; + }; + proxy.AddEndPoint(endPoint); + proxy.Start(); + port = endPoint.Port; + Assert.AreNotEqual(0, port); + Assert.IsFalse(port is 8000 or 8866 or 9080 or 9464); + return proxy; + } + + private static async Task SendAsync(int port, HttpMethod method, HttpContent? content) + { + var handler = new TitaniumHttpHandler + { + AllowManagedStackUnderFips = true, + UseProxy = false, + ConnectTimeout = TimeSpan.FromSeconds(10), + }; + handler.SslOptions.RemoteCertificateValidationCallback = static (_, _, _, _) => true; + using var client = new HttpClient(handler) { Timeout = TimeSpan.FromSeconds(20) }; + using var request = new HttpRequestMessage(method, "https://127.0.0.1:" + port.ToString(System.Globalization.CultureInfo.InvariantCulture) + "/") + { + Version = HttpVersion.Version30, + VersionPolicy = HttpVersionPolicy.RequestVersionExact, + Content = content, + }; + return await client.SendAsync(request); + } +} diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Http3CodecUsings.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Http3CodecUsings.cs new file mode 100644 index 000000000..29654734d --- /dev/null +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Http3CodecUsings.cs @@ -0,0 +1,7 @@ +global using CapsuleReader = Titanium.Http3.CapsuleReader; +global using Http3Settings = Titanium.Http3.Http3Settings; +global using Http3SettingsId = Titanium.Http3.Http3SettingsId; +global using QpackDecoder = Titanium.Http3.QpackDecoder; +global using Http3ConnectionException = Titanium.Http3.Http3ConnectionException; +global using Http3StreamException = Titanium.Http3.Http3StreamException; +global using Http3ErrorCode = Titanium.Http3.Http3ErrorCode; diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/MasqueRelayTests.cs b/tests/Titanium.Web.Proxy.IntegrationTests/MasqueRelayTests.cs index 47ab91e15..8b0596ef2 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/MasqueRelayTests.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/MasqueRelayTests.cs @@ -315,11 +315,50 @@ public async Task IdleTimeout_ClosesTheTunnel() await WaitUntilAsync(() => proxy.Active == 0); } - private static MasqueSession StartMasque(Action configure) + [TestMethod] + [Timeout(30_000)] + public async Task ManagedQuic_AnswersALongHeaderWithoutForwarding() + { + using var echo = new UdpEcho(); + using var plain = new UdpEcho(); + using var proxy = StartMasque(options => + { + options.RequireAuth = false; + options.BlockPrivateTargets = false; + options.AllowedPorts = [echo.Port, plain.Port]; + }, server => + { + server.UseManagedQuicStack = true; + server.AllowManagedStackUnderFips = true; + }); + + using var client = await ConnectAsync(proxy.Port); + await OpenTunnelAsync(client, 1, echo.Port); + var packet = new byte[1200]; + packet[0] = 0xC0; + packet[4] = 2; + packet[5] = 4; + var answered = await ExchangeAsync(client, 1, packet); + Assert.IsTrue(answered.Length > 4); + Assert.AreEqual(0x80, answered[0]); + Assert.AreEqual(0, answered[1]); + Assert.AreEqual(0, answered[2]); + Assert.AreEqual(0, answered[3]); + Assert.AreEqual(0, answered[4]); + await Task.Delay(200); + Assert.AreEqual(0, echo.Received); + + await OpenTunnelAsync(client, 3, plain.Port); + var echoed = await ExchangeAsync(client, 3, [4, 5, 6]); + CollectionAssert.AreEqual(new byte[] { 4, 5, 6 }, echoed); + } + + private static MasqueSession StartMasque(Action configure, Action? beforeStart = null) { var proxy = new ProxyServer(false, false, false); proxy.CertificateManager.RootCertificateName = TestCertificateAuthority.RootCertificateName; proxy.CertificateManager.RootCertificate = TestCertificateAuthority.RootCertificate; + beforeStart?.Invoke(proxy); var endPoint = new MasqueProxyEndPoint(IPAddress.Loopback, 0) { GenericCertificate = TestCertificateAuthority.ServerCertificate, @@ -479,6 +518,8 @@ public UdpEcho() public int Port { get; } + public int Received { get; private set; } + public void Dispose() { cancellation.Cancel(); @@ -495,6 +536,7 @@ private async Task LoopAsync() { var received = await socket.ReceiveFromAsync(buffer, SocketFlags.None, new IPEndPoint(IPAddress.Any, 0), cancellation.Token); + Received++; await socket.SendToAsync(buffer.AsMemory(0, received.ReceivedBytes), SocketFlags.None, received.RemoteEndPoint, cancellation.Token); } diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestCertificateAuthority.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestCertificateAuthority.cs index 46bb9a9f6..17b032e7b 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestCertificateAuthority.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Setup/TestCertificateAuthority.cs @@ -103,9 +103,13 @@ private static X509Certificate2 CreateRootCertificate() // "Do you want to install this certificate?" for the Trusted Root store. The root is // an in-memory trust anchor and signer, not a Schannel server certificate. var bytes = proxy.CertificateManager.RootCertificate.Export(X509ContentType.Pkcs12); - return X509CertificateLoader.LoadPkcs12( - bytes, - null, - X509KeyStorageFlags.Exportable | X509KeyStorageFlags.EphemeralKeySet); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + // Exportable alone persists a CA private key, and Windows then asks to install it. + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(bytes, null, flags); } } diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Socks5UdpAssociateTests.cs b/tests/Titanium.Web.Proxy.IntegrationTests/Socks5UdpAssociateTests.cs index 1b50c46e0..0c9450246 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Socks5UdpAssociateTests.cs +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Socks5UdpAssociateTests.cs @@ -112,9 +112,79 @@ await Assert.ThrowsAsync(async () => } } - private static ProxyServer BuildProxy(bool blockLoopback = false) + [TestMethod] + [Timeout(30_000)] + public async Task UdpAssociate_ManagedQuic_AnswersALongHeaderWithoutForwarding() + { + using var echo = new UdpEcho(); + using var plain = new UdpEcho(); + var proxy = BuildProxy(managedQuic: true); + try + { + var socksPort = proxy.ProxyEndPoints[0].Port; + using var control = new TcpClient(IPAddress.Loopback.ToString(), socksPort); + var stream = control.GetStream(); + await stream.WriteAsync(new byte[] { 5, 1, 0 }); + await ReadExactAsync(stream, new byte[2]); + await stream.WriteAsync(new byte[] { 5, 3, 0, 1, 0, 0, 0, 0, 0, 0 }); + var associate = new byte[10]; + await ReadExactAsync(stream, associate); + var relayPort = (associate[8] << 8) + associate[9]; + + using var client = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + client.Bind(new IPEndPoint(IPAddress.Loopback, 0)); + var packet = new byte[1200]; + packet[0] = 0xC0; + packet[4] = 2; + packet[5] = 4; + var header = new byte[10 + packet.Length]; + header[3] = 1; + IPAddress.Loopback.GetAddressBytes().CopyTo(header, 4); + header[8] = (byte)(echo.Port >> 8); + header[9] = (byte)echo.Port; + packet.CopyTo(header, 10); + await client.SendToAsync(header, SocketFlags.None, new IPEndPoint(IPAddress.Loopback, relayPort)); + + var received = new byte[1500]; + using var wait = new System.Threading.CancellationTokenSource(TimeSpan.FromSeconds(5)); + var result = await client.ReceiveFromAsync(received, SocketFlags.None, new IPEndPoint(IPAddress.Loopback, 0), wait.Token); + Assert.IsTrue(result.ReceivedBytes > 14); + Assert.AreEqual(0x80, received[10]); + Assert.AreEqual(0, received[11]); + Assert.AreEqual(0, received[12]); + Assert.AreEqual(0, received[13]); + Assert.AreEqual(0, received[14]); + await Task.Delay(200); + Assert.AreEqual(0, echo.Received); + + var small = new byte[] { 4, 5, 6 }; + var follow = new byte[10 + small.Length]; + follow[3] = 1; + IPAddress.Loopback.GetAddressBytes().CopyTo(follow, 4); + follow[8] = (byte)(plain.Port >> 8); + follow[9] = (byte)plain.Port; + small.CopyTo(follow, 10); + await client.SendToAsync(follow, SocketFlags.None, new IPEndPoint(IPAddress.Loopback, relayPort)); + using var plainWait = new System.Threading.CancellationTokenSource(TimeSpan.FromSeconds(5)); + var echoed = await client.ReceiveFromAsync(received, SocketFlags.None, new IPEndPoint(IPAddress.Loopback, 0), plainWait.Token); + CollectionAssert.AreEqual(small, received.AsSpan(10, small.Length).ToArray()); + Assert.IsTrue(echoed.ReceivedBytes > 10); + } + finally + { + proxy.Stop(); + proxy.Dispose(); + } + } + + private static ProxyServer BuildProxy(bool blockLoopback = false, bool managedQuic = false) { - var proxy = new ProxyServer(false, false, false) { BlockLoopbackDestinations = blockLoopback }; + var proxy = new ProxyServer(false, false, false) + { + BlockLoopbackDestinations = blockLoopback, + UseManagedQuicStack = managedQuic, + AllowManagedStackUnderFips = managedQuic, + }; proxy.CertificateManager.RootCertificate = TestCertificateAuthority.RootCertificate; proxy.CertificateManager.SaveFakeCertificates = false; proxy.AddEndPoint(new SocksProxyEndPoint(IPAddress.Loopback, 0, decryptSsl: false)); @@ -151,6 +221,8 @@ public UdpEcho() public int Port { get; } + public int Received { get; private set; } + public void Dispose() { cancellation.Cancel(); @@ -167,6 +239,7 @@ private async Task LoopAsync() { var received = await socket.ReceiveFromAsync(buffer, SocketFlags.None, new IPEndPoint(IPAddress.Loopback, 0), cancellation.Token); + Received++; await socket.SendToAsync(buffer.AsMemory(0, received.ReceivedBytes), SocketFlags.None, received.RemoteEndPoint, cancellation.Token); } diff --git a/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj b/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj index 6a76f52eb..4ff933651 100644 --- a/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj +++ b/tests/Titanium.Web.Proxy.IntegrationTests/Titanium.Web.Proxy.IntegrationTests.csproj @@ -17,6 +17,8 @@ + + diff --git a/tests/Titanium.Web.Proxy.UnitTests/Http3CodecUsings.cs b/tests/Titanium.Web.Proxy.UnitTests/Http3CodecUsings.cs new file mode 100644 index 000000000..0265113f5 --- /dev/null +++ b/tests/Titanium.Web.Proxy.UnitTests/Http3CodecUsings.cs @@ -0,0 +1,13 @@ +global using Http3VarInt = Titanium.Http3.Http3VarInt; +global using CapsuleReader = Titanium.Http3.CapsuleReader; +global using Http3Settings = Titanium.Http3.Http3Settings; +global using Http3SettingsId = Titanium.Http3.Http3SettingsId; +global using QpackStaticTable = Titanium.Http3.QpackStaticTable; +global using QpackDynamicTable = Titanium.Http3.QpackDynamicTable; +global using QpackContext = Titanium.Http3.QpackContext; +global using QpackDecoder = Titanium.Http3.QpackDecoder; +global using QpackEncoderStreamReader = Titanium.Http3.QpackEncoderStreamReader; +global using QpackDecoderStreamWriter = Titanium.Http3.QpackDecoderStreamWriter; +global using Http3ConnectionException = Titanium.Http3.Http3ConnectionException; +global using Http3StreamException = Titanium.Http3.Http3StreamException; +global using Http3ErrorCode = Titanium.Http3.Http3ErrorCode; diff --git a/tests/Titanium.Web.Proxy.UnitTests/ManagedStackFlagTests.cs b/tests/Titanium.Web.Proxy.UnitTests/ManagedStackFlagTests.cs new file mode 100644 index 000000000..379dd080b --- /dev/null +++ b/tests/Titanium.Web.Proxy.UnitTests/ManagedStackFlagTests.cs @@ -0,0 +1,133 @@ +using System; +using System.Net; +using Titanium.Web.Proxy.Abstractions; +using Titanium.Web.Proxy.Abstractions.Clusters; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Web.Proxy.Models; +using Titanium.Web.Proxy.Network.Quic; + +namespace Titanium.Web.Proxy.UnitTests; + +[TestClass] +public sealed class ManagedStackFlagTests +{ + [TestMethod] + public void TheFlagsDefaultOffAndCanChangeBeforeStart() + { + using var proxy = new ProxyServer(false, false, false); + Assert.IsFalse(proxy.UseManagedTlsStack); + Assert.IsFalse(proxy.UseManagedQuicStack); + + proxy.UseManagedTlsStack = true; + proxy.UseManagedQuicStack = true; + Assert.IsTrue(proxy.UseManagedTlsStack); + Assert.IsTrue(proxy.UseManagedQuicStack); + + proxy.UseManagedTlsStack = false; + proxy.UseManagedQuicStack = false; + Assert.IsFalse(proxy.UseManagedTlsStack); + Assert.IsFalse(proxy.UseManagedQuicStack); + } + + [TestMethod] + public void TheSuiteSwitchTurnsBothFlagsOn() + { + string? previous = Environment.GetEnvironmentVariable("TWP_MANAGED_TLS"); + try + { + Environment.SetEnvironmentVariable("TWP_MANAGED_TLS", "1"); + using var proxy = new ProxyServer(false, false, false); + Assert.IsTrue(proxy.UseManagedTlsStack); + Assert.IsTrue(proxy.UseManagedQuicStack); + } + finally + { + Environment.SetEnvironmentVariable("TWP_MANAGED_TLS", previous); + } + } + + [TestMethod] + public void UpstreamFingerprintFailsClosed() + { + using var off = new ProxyServer(false, false, false); + var profile = new ClusterHttpClientConfig { Fingerprint = "chrome" }; + ManagedStackRequiredException denied = Assert.ThrowsExactly( + () => off.RejectUpstreamFingerprint(profile)); + StringAssert.Contains(denied.Message, "UseManagedTlsStack"); + StringAssert.Contains(denied.Message, ManagedStackRequiredException.Reason); + + using var on = new ProxyServer(false, false, false); + on.UseManagedTlsStack = true; + NotSupportedException builtIn = Assert.ThrowsExactly( + () => on.RejectUpstreamFingerprint(profile)); + StringAssert.Contains(builtIn.Message, "built-in hello"); + on.RejectUpstreamFingerprint(null); + } + + [TestMethod] + public async Task ADifferentValueAfterStartThrowsAndTheSameValueDoesNot() + { + using var proxy = new ProxyServer(false, false, false); + proxy.AddEndPoint(new ExplicitProxyEndPoint(IPAddress.Loopback, 0, false)); + proxy.Start(changeSystemProxySettings: false); + try + { + Assert.IsFalse(proxy.UseManagedTlsStack); + Assert.IsFalse(proxy.UseManagedQuicStack); + proxy.UseManagedTlsStack = false; + proxy.UseManagedQuicStack = false; + + InvalidOperationException tls = Assert.ThrowsExactly(() => proxy.UseManagedTlsStack = true); + StringAssert.Contains(tls.Message, nameof(ProxyServer.UseManagedTlsStack)); + InvalidOperationException quic = Assert.ThrowsExactly(() => proxy.UseManagedQuicStack = true); + StringAssert.Contains(quic.Message, nameof(ProxyServer.UseManagedQuicStack)); + Assert.IsFalse(proxy.UseManagedTlsStack); + Assert.IsFalse(proxy.UseManagedQuicStack); + } + finally + { + await proxy.StopAsync(); + } + + proxy.UseManagedTlsStack = true; + proxy.UseManagedQuicStack = true; + Assert.IsTrue(proxy.UseManagedTlsStack); + Assert.IsTrue(proxy.UseManagedQuicStack); + } + + [TestMethod] + public async Task TheFipsOverrideFreezesAfterStart() + { + using var proxy = new ProxyServer(false, false, false); + proxy.AllowManagedStackUnderFips = true; + proxy.UseManagedTlsStack = true; + proxy.AddEndPoint(new ExplicitProxyEndPoint(IPAddress.Loopback, 0, false)); + proxy.Start(changeSystemProxySettings: false); + try + { + Assert.IsTrue(proxy.AllowManagedStackUnderFips); + proxy.AllowManagedStackUnderFips = true; + Assert.ThrowsExactly(() => proxy.AllowManagedStackUnderFips = false); + } + finally + { + await proxy.StopAsync(); + } + } + + [TestMethod] + public async Task TheManagedDialResolvesAnAddressLiteral() + { + IPEndPoint resolved = await QuicConnectionFactory.ResolveRemoteAsync( + new DnsEndPoint("127.0.0.1", 443), CancellationToken.None); + + Assert.AreEqual(IPAddress.Loopback, resolved.Address); + Assert.AreEqual(443, resolved.Port); + + IPEndPoint kept = await QuicConnectionFactory.ResolveRemoteAsync( + new IPEndPoint(IPAddress.IPv6Loopback, 443), CancellationToken.None); + Assert.AreEqual(IPAddress.IPv6Loopback, kept.Address); + } +} diff --git a/tests/Titanium.Web.Proxy.UnitTests/Routing/ForwardHostEligibilityGuardTests.cs b/tests/Titanium.Web.Proxy.UnitTests/Routing/ForwardHostEligibilityGuardTests.cs index a460ac77c..5824cc578 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/Routing/ForwardHostEligibilityGuardTests.cs +++ b/tests/Titanium.Web.Proxy.UnitTests/Routing/ForwardHostEligibilityGuardTests.cs @@ -122,6 +122,7 @@ public async Task RouteClusterAndDestination_EveryPropertyIsClassified() ["ClientCertificatePasswordEnv"] = ("CERT_PASSWORD", Expect.Inert), ["CaBundlePath"] = ("missing.crt", Expect.Ineligible), ["ServerName"] = ("origin.example", Expect.Ineligible), + ["Fingerprint"] = ("chrome", Expect.Ineligible), ["VerifyHostname"] = (false, Expect.Ineligible), ["ConnectionKey"] = (null, Expect.Inert), }; diff --git a/tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj b/tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj index 7193b79de..f3d16ca7d 100644 --- a/tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj +++ b/tests/Titanium.Web.Proxy.UnitTests/Titanium.Web.Proxy.UnitTests.csproj @@ -29,6 +29,7 @@ + diff --git a/tests/Titanium.Web.Proxy.UnitTests/TransparentQuicInjectTests.cs b/tests/Titanium.Web.Proxy.UnitTests/TransparentQuicInjectTests.cs new file mode 100644 index 000000000..4492e82c2 --- /dev/null +++ b/tests/Titanium.Web.Proxy.UnitTests/TransparentQuicInjectTests.cs @@ -0,0 +1,54 @@ +using System; +using System.Net; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Titanium.Web.Proxy.Abstractions; + +namespace Titanium.Web.Proxy.UnitTests; + +[TestClass] +public sealed class TransparentQuicInjectTests +{ + [TestMethod] + public async Task TheFlagOffPathRefusesTransparentQuic() + { + using var proxy = new ProxyServer(false, false, false); + ManagedStackRequiredException ex = await Assert.ThrowsExactlyAsync(() => + proxy.HandleTransparentQuicDatagramAsync( + new byte[1200], + new IPEndPoint(IPAddress.Loopback, 9), + new IPEndPoint(IPAddress.Loopback, 443), + (_, _, _) => ValueTask.CompletedTask).AsTask()); + StringAssert.Contains(ex.Message, "Transparent UDP interception"); + StringAssert.Contains(ex.Message, "UseManagedQuicStack"); + } + + [TestMethod] + public async Task ALongHeaderIsAnsweredForTheOriginalDestination() + { + using var proxy = new ProxyServer(false, false, false) + { + UseManagedQuicStack = true, + AllowManagedStackUnderFips = true, + }; + var client = new IPEndPoint(IPAddress.Loopback, 9); + var origin = new IPEndPoint(IPAddress.Loopback, 443); + var packet = new byte[1200]; + packet[0] = 0xC0; + packet[4] = 2; + packet[5] = 4; + int sent = 0; + IPEndPoint? to = null; + await proxy.HandleTransparentQuicDatagramAsync(packet, client, origin, (datagram, destination, _) => + { + sent = datagram.Length; + to = destination; + Assert.AreEqual(0x80, datagram.Span[0]); + Assert.AreEqual(0, datagram.Span[1]); + Assert.AreEqual(0, datagram.Span[4]); + return ValueTask.CompletedTask; + }); + Assert.IsTrue(sent > 0); + Assert.AreEqual(client, to); + } +} diff --git a/tests/conformance/README.md b/tests/conformance/README.md index 4d1a9e999..90857ff1a 100644 --- a/tests/conformance/README.md +++ b/tests/conformance/README.md @@ -1,7 +1,7 @@ # Conformance and resilience program What is checked, where it runs, and where the known gaps are written down. The workflows are -`.github/workflows/conformance.yml` (parser, chaos, h2spec, Autobahn, real peer) and `.github/workflows/soak.yml`. +`.github/workflows/conformance.yml` (parser, chaos, h2spec, Autobahn, real peer, tlsfuzzer, TLS-Anvil, h3spec, QUIC interop, BoGo) and `.github/workflows/soak.yml`. | Area | What | Where | When | |---|---|---|---| @@ -13,6 +13,12 @@ What is checked, where it runs, and where the known gaps are written down. The w | WebSocket conformance | Autobahn|Testsuite client cases through a reverse listener | `conformance.yml` job `autobahn`, allow-list `autobahn-known.txt` | nightly + dispatch | | Real peer | reverse listener in front of a stock nginx container; compares the proxy with the peer | `conformance.yml` job `real-peer` | nightly + dispatch | | Soak | 60 minutes of constant reverse-proxy load with error, memory and fd gates | `soak.yml` (RpsLoadProbe) | nightly + dispatch | +| Managed handshake soak | 30 minutes of TLS handshakes and 30 minutes of QUIC connections. The job does not set `TITANIUM_SOAK_SECONDS`. | `soak.yml` job `managed-handshake-soak` | nightly + dispatch; not started | +| tlsfuzzer | `test-tls13-conversation.py` against the loopback TLS probe | `conformance.yml` job `tlsfuzzer`; known failure in `src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md` | nightly + dispatch | +| TLS-Anvil | Feature scan, then `sendEmptyRecordFinished` (scored succeeded; the tool still does not parse a fatal alert). The 27-template run is not this job. | `conformance.yml` job `tls-anvil`; result in `src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md` | nightly + dispatch | +| h3spec | v0.1.15 against the loopback HTTP/3 probe (86 examples, 77 failures, 5 pending) | `conformance.yml` job `h3spec`; result in `src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md` | nightly + dispatch | +| QUIC interop | Handshake case: quic-go client downloads two files from the loopback HTTP/0.9 server | `conformance.yml` job `quic-interop`; result in `src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md` | nightly + dispatch | +| BoGo | TLS 1.3 server slice against BoringSSL `a003590712db` (49 passed, 248 failed, 7821 unimplemented) | `conformance.yml` job `bogo`; result in `src/Titanium.Tls/design/CONFORMANCE-EXPECTED-FAILURES.md` | nightly + dispatch | ## Existing coverage that these jobs rely on @@ -68,4 +74,4 @@ h2spec -h 127.0.0.1 -p 9101 -j report.xml Documented at the top of `soak.yml`: zero-ish errors and the probe's own SLO verdict, bounded RSS growth between the first and last third of the window, bounded file-descriptor growth, and a live proxy at the end. Throughput is recorded -and not gated. +and not gated. The `managed-handshake-soak` job is separate: it runs the existing 30 minute TLS and QUIC tests and does not change the reverse-proxy window. diff --git a/tests/coverage-floors.json b/tests/coverage-floors.json index a17ac20e2..f281a144c 100644 --- a/tests/coverage-floors.json +++ b/tests/coverage-floors.json @@ -12,6 +12,9 @@ "Titanium.Xds": 85, "Titanium.Inspector": 85, "Titanium.Web.Proxy.Scripting": 85, - "Titanium.Cli.GeoIp": 85 + "Titanium.Cli.GeoIp": 85, + "Titanium.Tls": 80, + "Titanium.Quic": 80, + "Titanium.Net.Compatibility": 80 } } diff --git a/tests/fuzz/README.md b/tests/fuzz/README.md index ea6444d40..cfd1cb840 100644 --- a/tests/fuzz/README.md +++ b/tests/fuzz/README.md @@ -116,6 +116,18 @@ dotnet test tests/Titanium.Manager.Tests/Titanium.Manager.Tests.csproj -c Releas dotnet test tests/Titanium.Plus.Tests/Titanium.Plus.Tests.csproj -c Release --filter "FullyQualifiedName~AgentConfigCorpusTests" ``` +## TLS handshake corpus (`corpus/tls-handshake`) + +`.hex` seeds for the managed handshake engine. One seed carries each handshake type: ClientHello (1), ServerHello (2), NewSessionTicket (4), EndOfEarlyData (5), EncryptedExtensions (8), Certificate (11), CertificateRequest (13), CertificateVerify (15), Finished (20), and KeyUpdate (24). `CorpusRunnerTests` loads every seed, checks that set, truncates every prefix, and applies a fixed-seed mutation. `TlsFuzzTarget.Handshake` drives a client and a server engine and the handshake readers. A bad input closes or waits. It must not throw. + +SharpFuzz is optional and not a dependency. A console project that references the test assembly can call `Fuzzer.OutOfProcess.Run(TlsFuzzTarget.Handshake)` under `afl-fuzz`, with this folder as the corpus after the `.hex` seeds are expanded to raw bytes. + +`SeededSampleAgreesWithOpenSsl` is the differential handshake sample. `TITANIUM_FUZZ_HANDSHAKES` defaults to 500 and `TITANIUM_FUZZ_SEED` defaults to 8446. A failure message includes the seed and the draw index. `ChunkingChaosTests` fragments the same handshake and record path down to one-byte reads. + +```powershell +dotnet test tests/Titanium.Tls.Tests -c Release --filter FullyQualifiedName~CorpusRunnerTests +``` + ## Adding a seed 1. Write the `.case` file with the right prefix and a `reason:`. diff --git a/tests/fuzz/corpus/tls-handshake/certificate-request.hex b/tests/fuzz/corpus/tls-handshake/certificate-request.hex new file mode 100644 index 000000000..d6e8026a1 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/certificate-request.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: CertificateRequest +16 03 03 00 04 0d 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/certificate-verify.hex b/tests/fuzz/corpus/tls-handshake/certificate-verify.hex new file mode 100644 index 000000000..d2a32ac47 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/certificate-verify.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: CertificateVerify +16 03 03 00 04 0f 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/certificate.hex b/tests/fuzz/corpus/tls-handshake/certificate.hex new file mode 100644 index 000000000..a053eff5a --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/certificate.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: Certificate +16 03 03 00 04 0b 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/client-hello.hex b/tests/fuzz/corpus/tls-handshake/client-hello.hex new file mode 100644 index 000000000..f83f6c163 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/client-hello.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: ClientHello +16 03 03 00 04 01 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/encrypted-extensions.hex b/tests/fuzz/corpus/tls-handshake/encrypted-extensions.hex new file mode 100644 index 000000000..8b3665ba4 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/encrypted-extensions.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: EncryptedExtensions +16 03 03 00 04 08 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/end-of-early-data.hex b/tests/fuzz/corpus/tls-handshake/end-of-early-data.hex new file mode 100644 index 000000000..8235d90cb --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/end-of-early-data.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: EndOfEarlyData +16 03 03 00 04 05 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/finished.hex b/tests/fuzz/corpus/tls-handshake/finished.hex new file mode 100644 index 000000000..edcbeafc2 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/finished.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: Finished +16 03 03 00 04 14 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/key-update.hex b/tests/fuzz/corpus/tls-handshake/key-update.hex new file mode 100644 index 000000000..6e908bb95 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/key-update.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: KeyUpdate +16 03 03 00 04 18 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/new-session-ticket.hex b/tests/fuzz/corpus/tls-handshake/new-session-ticket.hex new file mode 100644 index 000000000..af3d14e73 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/new-session-ticket.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: NewSessionTicket +16 03 03 00 04 04 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/server-hello.hex b/tests/fuzz/corpus/tls-handshake/server-hello.hex new file mode 100644 index 000000000..59389aa79 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/server-hello.hex @@ -0,0 +1,3 @@ +# expect: reject +# message: ServerHello +16 03 03 00 04 02 00 00 00 diff --git a/tests/fuzz/corpus/tls-handshake/short-handshake.hex b/tests/fuzz/corpus/tls-handshake/short-handshake.hex new file mode 100644 index 000000000..d282ee427 --- /dev/null +++ b/tests/fuzz/corpus/tls-handshake/short-handshake.hex @@ -0,0 +1,2 @@ +# expect: reject +1603010000 diff --git a/tests/smoke-matrix.yml b/tests/smoke-matrix.yml index f9b7dbaa2..49bbd6233 100644 --- a/tests/smoke-matrix.yml +++ b/tests/smoke-matrix.yml @@ -13,6 +13,7 @@ jobs: build: ".NET build job (Windows)" release-smoke: ".github/workflows/release.yml smoke-http3 and smoke-scripting" install-smoke: ".github/workflows/inspector-install-smoke.yml (packaged Inspector and CLI on Windows, Linux, and macOS)" + product-smoke: ".github/workflows/product-smoke.yml managed-stack job (advisory while the leg is new)" entries: - id: cli-help-matrix @@ -231,6 +232,12 @@ entries: test: tools/packaging/smoke/kind-chart-lifecycle.sh job: release-smoke + - id: cli-managed-stack + capability: titanium run --managed-stack on a loopback reverse proxy + status: covered + test: tools/packaging/smoke/cli-managed-stack.ps1 + job: product-smoke + - id: release-asset-gate capability: Expected release assets and release-manifest verification status: covered diff --git a/tools/RpsLoadProbe/Cli.cs b/tools/RpsLoadProbe/Cli.cs index fa9852d94..08e7aa593 100644 --- a/tools/RpsLoadProbe/Cli.cs +++ b/tools/RpsLoadProbe/Cli.cs @@ -45,6 +45,7 @@ public static int Run(string[] args) var clientReadChunkBytes = 0; var clientReadSleepMs = 0; var stopOnSloFail = true; + var managedStack = false; int? armTimeoutMin = null; (int Index, int Count)? armShard = null; string? armNameContains = null; @@ -227,6 +228,9 @@ public static int Run(string[] args) case "--no-stop-on-slo-fail": stopOnSloFail = false; break; + case "--managed-stack": + managedStack = true; + break; case "--print-arms": printArms = true; if (command == null) @@ -244,6 +248,13 @@ public static int Run(string[] args) } } + // The managed-stack arm reaches the proxy children through the environment: both the library + // host and the CLI host read the same variable, and ChildProcessStack forwards it. + if (managedStack) + { + Environment.SetEnvironmentVariable(TitaniumCliHost.ManagedStackEnvironmentVariable, "1"); + } + var workload = new WorkloadOptions { Method = method, @@ -1035,6 +1046,11 @@ A soak must set it above its measure window. --early-response-after N Origin starts response after N request bytes (0 = drain-then-write) --websocket Origin /ws echo; client uses ClientWebSocket --grpc Origin MapGrpcService Echo; client uses Grpc.Net.Client unary + --stop-on-slo-fail / --no-stop-on-slo-fail Default: stop an arm after the first SLO fail + --managed-stack Turn on both UseManagedTlsStack and UseManagedQuicStack on the proxy under + test. Library arms set the two properties before Start; CLI arms add the + product's own --managed-stack flag to `titanium run`. Off by default, so + the same probe build reports the platform stack. --print-arms Resolve arm list (+ optional --arm-shard) and exit (no ramp) --print-groups Print "\t" per wiki row for the mode and exit """); diff --git a/tools/RpsLoadProbe/Http3CodecUsings.cs b/tools/RpsLoadProbe/Http3CodecUsings.cs new file mode 100644 index 000000000..422079dba --- /dev/null +++ b/tools/RpsLoadProbe/Http3CodecUsings.cs @@ -0,0 +1,6 @@ +global using Http3Settings = Titanium.Http3.Http3Settings; +global using Http3SettingsId = Titanium.Http3.Http3SettingsId; +global using QpackDecoder = Titanium.Http3.QpackDecoder; +global using Http3ConnectionException = Titanium.Http3.Http3ConnectionException; +global using Http3StreamException = Titanium.Http3.Http3StreamException; +global using Http3ErrorCode = Titanium.Http3.Http3ErrorCode; diff --git a/tools/RpsLoadProbe/RpsLoadProbe.csproj b/tools/RpsLoadProbe/RpsLoadProbe.csproj index 722a71147..febdc90ab 100644 --- a/tools/RpsLoadProbe/RpsLoadProbe.csproj +++ b/tools/RpsLoadProbe/RpsLoadProbe.csproj @@ -24,6 +24,7 @@ + diff --git a/tools/RpsLoadProbe/TitaniumCliHost.cs b/tools/RpsLoadProbe/TitaniumCliHost.cs index f14342d18..a9786c65d 100644 --- a/tools/RpsLoadProbe/TitaniumCliHost.cs +++ b/tools/RpsLoadProbe/TitaniumCliHost.cs @@ -16,6 +16,17 @@ internal sealed class TitaniumCliHost : IDisposable public const string ControlPlaneSharedSecret = "changeme"; public const string JwtAuthorityHost = "http://127.0.0.1"; + /// + /// Set to 1 by the probe's --managed-stack argument. Both hosts read it: this one adds the + /// product's own --managed-stack flag to titanium run, and sets + /// UseManagedTlsStack and UseManagedQuicStack on the library proxy before it starts. + /// + public const string ManagedStackEnvironmentVariable = "TWP_RPS_MANAGED_STACK"; + + /// True when the probe was started with --managed-stack. + public static bool ManagedStackRequested => + string.Equals(Environment.GetEnvironmentVariable(ManagedStackEnvironmentVariable), "1", StringComparison.Ordinal); + private readonly Process process; private readonly string workDir; private readonly StringBuilder stdout = new(); @@ -323,6 +334,9 @@ await File.WriteAllTextAsync(configPath, psi.ArgumentList.Add("run"); psi.ArgumentList.Add("-c"); psi.ArgumentList.Add(configPath); + // --managed-stack is the shipped product flag: it wins over the file's server.* settings. + if (ManagedStackRequested) + psi.ArgumentList.Add("--managed-stack"); if (NeedsPlusDll(kind)) psi.Environment["TITANIUM_PLUS_ALLOW_DEV_SECRET"] = "1"; diff --git a/tools/RpsLoadProbe/TwpProxyHost.cs b/tools/RpsLoadProbe/TwpProxyHost.cs index efe0cc890..f6bea44b4 100644 --- a/tools/RpsLoadProbe/TwpProxyHost.cs +++ b/tools/RpsLoadProbe/TwpProxyHost.cs @@ -852,6 +852,15 @@ private static ProxyServer CreateBaseProxy(bool enableHttp2, bool enableHttp3, // New-connection TLS: skip ConcurrentDictionary session-CTS tracking (Stop still disposes). proxy.TrackSessionCancellations = false; + // --managed-stack (TWP_RPS_MANAGED_STACK=1) is the A/B switch for the managed TLS and QUIC + // stacks. Both flags are set before Start; the platform arm leaves them off (the default). + if (TitaniumCliHost.ManagedStackRequested) + { + proxy.UseManagedTlsStack = true; + proxy.UseManagedQuicStack = true; + Console.Error.WriteLine("rps: UseManagedTlsStack=1 UseManagedQuicStack=1"); + } + return proxy; } diff --git a/tools/RpsLoadProbe/rps-ab-run.py b/tools/RpsLoadProbe/rps-ab-run.py index ce3cfce09..78171d357 100755 --- a/tools/RpsLoadProbe/rps-ab-run.py +++ b/tools/RpsLoadProbe/rps-ab-run.py @@ -48,6 +48,10 @@ def main(argv: list[str]) -> int: ap.add_argument("--order", choices=["alternate", "counterbalance"], default="alternate", help="alternate = A,B,A,B...; counterbalance = A,B,B,A,A,B... (cancels linear drift)") ap.add_argument("--probe-arg", action="append", default=[], help="extra argument forwarded to the probe (repeatable)") + ap.add_argument("--baseline-probe-arg", action="append", default=[], + help="extra argument forwarded to the baseline probe only (repeatable, after --probe-arg)") + ap.add_argument("--candidate-probe-arg", action="append", default=[], + help="extra argument forwarded to the candidate probe only (repeatable, after --probe-arg)") ap.add_argument("--out", required=True) args = ap.parse_args(argv) @@ -68,6 +72,8 @@ def main(argv: list[str]) -> int: "mode": args.mode, "arm_contains": args.arm_contains, "arm_shard": args.arm_shard, "concurrency": args.concurrency, "warmup_sec": args.warmup_sec, "duration_sec": args.duration_sec, "pairs": args.pairs, "order": args.order, "cooldown_sec": args.cooldown_sec, + "probe_args": args.probe_arg, "baseline_probe_args": args.baseline_probe_arg, + "candidate_probe_args": args.candidate_probe_arg, "cpus": os.cpu_count(), "runs": [], } failures = 0 @@ -85,6 +91,7 @@ def main(argv: list[str]) -> int: if args.arm_contains: cmd += ["--arm-contains", args.arm_contains] cmd += args.probe_arg + cmd += args.baseline_probe_arg if side == "baseline" else args.candidate_probe_arg print(f"[pair {pair}/{args.pairs}] {side}: {' '.join(cmd)}", flush=True) with open(run_dir / "run.log", "w", encoding="utf-8") as log: rc = subprocess.run(cmd, stdout=log, stderr=subprocess.STDOUT).returncode diff --git a/tools/managed-stack/BogoShim/BogoShim.csproj b/tools/managed-stack/BogoShim/BogoShim.csproj new file mode 100644 index 000000000..8773ceff2 --- /dev/null +++ b/tools/managed-stack/BogoShim/BogoShim.csproj @@ -0,0 +1,18 @@ + + + Exe + net10.0 + enable + enable + BogoShim + true + + + + BogoShim.flags.txt + + + + + + diff --git a/tools/managed-stack/BogoShim/Program.cs b/tools/managed-stack/BogoShim/Program.cs new file mode 100644 index 000000000..e23e7339f --- /dev/null +++ b/tools/managed-stack/BogoShim/Program.cs @@ -0,0 +1,389 @@ +using System.Buffers.Binary; +using System.Diagnostics; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Reflection; +using System.Security.Authentication; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using Titanium.Tls; + +// Speaks the BoGo shim protocol: connect to the runner, write the shim id, then TLS. +// Exit 89 when a case needs behavior this shim does not implement. +const int Unimplemented = 89; +const int Tls13 = 0x0304; + +if (args.Length == 1 && args[0] == "self-test") +{ + return await SelfTestAsync().ConfigureAwait(false); +} + +try +{ + return await RunAsync(args).ConfigureAwait(false); +} +catch (Exception ex) +{ + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + return 1; +} + +static async Task RunAsync(string[] args) +{ + foreach (string arg in args) + { + if (arg == "-is-handshaker-supported") + { + Console.WriteLine("No"); + return 0; + } + } + + Dictionary table = LoadFlags(); + var initial = new Dictionary(StringComparer.Ordinal); + for (int i = 0; i < args.Length; i++) + { + string name = args[i]; + bool skip = false; + bool resumeOnly = false; + if (Strip(ref name, "-on-shim")) + { + } + else if (Strip(ref name, "-on-handshaker")) + { + skip = true; + } + + if (Strip(ref name, "-on-initial")) + { + } + else if (Strip(ref name, "-on-resume") || Strip(ref name, "-on-retry")) + { + resumeOnly = true; + } + + if (!table.TryGetValue(name, out bool hasParam)) + { + return Skip("unknown " + name); + } + + string? param = null; + if (hasParam) + { + if (i + 1 >= args.Length) + { + return Skip("missing parameter " + name); + } + + param = args[++i]; + } + + if (skip || resumeOnly) + { + continue; + } + + initial[name] = param; + } + + if (initial.ContainsKey("-dtls") || initial.ContainsKey("-quic") || initial.ContainsKey("-no-tls13") || !initial.ContainsKey("-server")) + { + return Skip("outside the TLS 1.3 server slice"); + } + + if (initial.TryGetValue("-resume-count", out string? resume) && resume != "0") + { + return Skip("resume"); + } + + if (initial.TryGetValue("-min-version", out string? minText) && (!int.TryParse(minText, out int minVersion) || minVersion > Tls13)) + { + return Skip("min-version"); + } + + if (initial.TryGetValue("-max-version", out string? maxText) && (!int.TryParse(maxText, out int maxVersion) || maxVersion < Tls13)) + { + return Skip("max-version"); + } + + if (!initial.TryGetValue("-cert-file", out string? certFile) || certFile is null + || !initial.TryGetValue("-key-file", out string? keyFile) || keyFile is null) + { + return Skip("no certificate"); + } + + if (!initial.TryGetValue("-port", out string? portText) || !int.TryParse(portText, out int port) || port is < 1 or > 65535) + { + return Skip("port"); + } + + if (!initial.TryGetValue("-shim-id", out string? idText) || !ulong.TryParse(idText, out ulong shimId)) + { + return Skip("shim-id"); + } + + foreach (string name in initial.Keys) + { + if (!Allowed(name)) + { + return Skip(name); + } + } + + IPAddress address = initial.ContainsKey("-ipv6") ? IPAddress.IPv6Loopback : IPAddress.Loopback; + using var tcp = new TcpClient(address.AddressFamily); + await tcp.ConnectAsync(address, port).ConfigureAwait(false); + NetworkStream raw = tcp.GetStream(); + var id = new byte[8]; + BinaryPrimitives.WriteUInt64LittleEndian(id, shimId); + await raw.WriteAsync(id).ConfigureAwait(false); + + SslStreamCertificateContext context = LoadContext(certFile, keyFile); + await using var stream = new TlsStream(raw, new TlsStreamOptions { AllowManagedStackUnderFips = true }); + await stream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificateContext = context, + EnabledSslProtocols = SslProtocols.Tls13, + }).ConfigureAwait(false); + + var buffer = new byte[512]; + while (true) + { + int count; + try + { + count = await stream.ReadAsync(buffer).ConfigureAwait(false); + } + catch (IOException ex) when (ex.Message == "The remote party closed the connection without a close_notify alert.") + { + // The runner treats a TCP close without close_notify as the end of the exchange. + break; + } + + if (count == 0) + { + break; + } + + for (int i = 0; i < count; i++) + { + buffer[i] ^= 0xff; + } + + await stream.WriteAsync(buffer.AsMemory(0, count)).ConfigureAwait(false); + } + + return 0; +} + +static bool Allowed(string name) +{ + return name is "-port" or "-shim-id" or "-server" or "-ipv6" or "-cert-file" or "-key-file" + or "-resume-count" or "-min-version" or "-max-version" or "-no-tls12" or "-no-tls11" or "-no-tls1" + || name.StartsWith("-expect-", StringComparison.Ordinal); +} + +static SslStreamCertificateContext LoadContext(string certFile, string keyFile) +{ + var all = new X509Certificate2Collection(); + all.ImportFromPem(File.ReadAllText(certFile)); + if (all.Count == 0) + { + throw new InvalidOperationException("The certificate file is empty."); + } + + using X509Certificate2 withKey = X509Certificate2.CreateFromPem(all[0].ExportCertificatePem(), File.ReadAllText(keyFile)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + X509Certificate2 leaf = X509CertificateLoader.LoadPkcs12(withKey.Export(X509ContentType.Pfx), null, flags); + var intermediates = new X509Certificate2Collection(); + for (int i = 1; i < all.Count; i++) + { + intermediates.Add(all[i]); + } + + return SslStreamCertificateContext.Create(leaf, intermediates, offline: true); +} + +static bool Strip(ref string name, string prefix) +{ + if (!name.StartsWith(prefix + "-", StringComparison.Ordinal)) + { + return false; + } + + name = name[prefix.Length..]; + return true; +} + +static int Skip(string reason) +{ + string? path = Environment.GetEnvironmentVariable("BOGO_SHIM_TRACE"); + if (!string.IsNullOrEmpty(path)) + { + File.AppendAllText(path, reason + "\n"); + } + + return Unimplemented; +} + +static Dictionary LoadFlags() +{ + using Stream resource = Assembly.GetExecutingAssembly().GetManifestResourceStream("BogoShim.flags.txt") + ?? throw new InvalidOperationException("The flag table is missing."); + using var reader = new StreamReader(resource, Encoding.UTF8); + var table = new Dictionary(StringComparer.Ordinal); + while (reader.ReadLine() is string line) + { + if (line.Length == 0) + { + continue; + } + + int split = line.LastIndexOf(' '); + table[line[..split]] = line[(split + 1)..] == "1"; + } + + return table; +} + +static async Task SelfTestAsync() +{ + (int code, string stdout, string stderr) = await SpawnAsync("-is-handshaker-supported").ConfigureAwait(false); + if (code != 0 || stdout != "No" || stderr.Length != 0) + { + Console.Error.WriteLine("handshaker probe code=" + code + " stdout=" + stdout + " stderr=" + stderr); + return 1; + } + + (code, stdout, stderr) = await SpawnAsync("-dtls", "-port", "1", "-shim-id", "1", "-server").ConfigureAwait(false); + if (code != Unimplemented || stdout.Length != 0) + { + Console.Error.WriteLine("dtls probe code=" + code + " stdout=" + stdout); + return 1; + } + + string directory = Path.Combine(Path.GetTempPath(), "bogo-shim-" + Guid.NewGuid().ToString("n")); + Directory.CreateDirectory(directory); + try + { + string certPath = Path.Combine(directory, "cert.pem"); + string keyPath = Path.Combine(directory, "key.pem"); + WriteCertificate(certPath, keyPath); + using var listener = new TcpListener(IPAddress.Loopback, 0); + listener.Start(); + int port = ((IPEndPoint)listener.LocalEndpoint).Port; + if (port is 8000 or 8866 or 9080 or 9464) + { + Console.Error.WriteLine("refusing reserved port " + port); + return 1; + } + + Task<(int Code, string Stdout, string Stderr)> child = SpawnAsync( + "-port", port.ToString(), + "-shim-id", "42", + "-server", + "-cert-file", certPath, + "-key-file", keyPath); + try + { + using TcpClient tcp = await listener.AcceptTcpClientAsync().WaitAsync(TimeSpan.FromSeconds(10)).ConfigureAwait(false); + NetworkStream raw = tcp.GetStream(); + var id = new byte[8]; + await ReadExactAsync(raw, id).ConfigureAwait(false); + if (BinaryPrimitives.ReadUInt64LittleEndian(id) != 42) + { + Console.Error.WriteLine("shim id mismatch"); + return 1; + } + + await using (var stream = new TlsStream(raw, new TlsStreamOptions { AllowManagedStackUnderFips = true })) + { + await stream.AuthenticateAsClientAsync(new SslClientAuthenticationOptions + { + TargetHost = "localhost", + EnabledSslProtocols = SslProtocols.Tls13, + RemoteCertificateValidationCallback = static (_, _, _, _) => true, + }).ConfigureAwait(false); + byte[] payload = [0x41, 0x00]; + await stream.WriteAsync(payload).ConfigureAwait(false); + var reply = new byte[payload.Length]; + await ReadExactAsync(stream, reply).ConfigureAwait(false); + if (reply[0] != (byte)(payload[0] ^ 0xff) || reply[1] != (byte)(payload[1] ^ 0xff)) + { + Console.Error.WriteLine("xor mismatch " + Convert.ToHexString(reply)); + return 1; + } + } + + (int childCode, string childOut, string childErr) = await child.WaitAsync(TimeSpan.FromSeconds(20)).ConfigureAwait(false); + if (childCode != 0 || childOut.Length != 0 || childErr.Length != 0) + { + Console.Error.WriteLine("shim code=" + childCode + " stdout=" + childOut + " stderr=" + childErr); + return 1; + } + } + finally + { + listener.Stop(); + } + } + finally + { + Directory.Delete(directory, recursive: true); + } + + Console.WriteLine("bogo-shim self-test ok"); + return 0; +} + +static void WriteCertificate(string certPath, string keyPath) +{ + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + File.WriteAllText(certPath, created.ExportCertificatePem()); + File.WriteAllText(keyPath, key.ExportPkcs8PrivateKeyPem()); +} + +static async Task<(int Code, string Stdout, string Stderr)> SpawnAsync(params string[] arguments) +{ + var start = new ProcessStartInfo(Environment.ProcessPath!) + { + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + }; + foreach (string argument in arguments) + { + start.ArgumentList.Add(argument); + } + + using var process = Process.Start(start) ?? throw new InvalidOperationException("The shim process did not start."); + string stdout = await process.StandardOutput.ReadToEndAsync().ConfigureAwait(false); + string stderr = await process.StandardError.ReadToEndAsync().ConfigureAwait(false); + await process.WaitForExitAsync().WaitAsync(TimeSpan.FromSeconds(20)).ConfigureAwait(false); + return (process.ExitCode, stdout.Trim(), stderr.Trim()); +} + +static async Task ReadExactAsync(Stream stream, Memory buffer) +{ + int got = 0; + while (got < buffer.Length) + { + int count = await stream.ReadAsync(buffer[got..]).ConfigureAwait(false); + if (count == 0) + { + throw new EndOfStreamException("The peer closed the connection."); + } + + got += count; + } +} diff --git a/tools/managed-stack/BogoShim/flags.txt b/tools/managed-stack/BogoShim/flags.txt new file mode 100644 index 000000000..f0b7dfa52 --- /dev/null +++ b/tools/managed-stack/BogoShim/flags.txt @@ -0,0 +1,229 @@ +-accepted-peer-cert-types 1 +-advertise-alpn 1 +-advertise-empty-npn 0 +-advertise-npn 1 +-allow-false-start-without-alpn 0 +-allow-hint-mismatch 0 +-allow-unknown-alpn-protos 0 +-alps-use-new-codepoint 1 +-application-settings 1 +-async 0 +-available-client-cert-types 1 +-available-trust-anchors 1 +-cbc-record-splitting 0 +-cert-file 1 +-cert-properties 1 +-check-close-notify 0 +-cipher 1 +-cnsa-202407 0 +-cnsa1-202603 0 +-cnsa2-202603 0 +-curves 1 +-curves-flags 1 +-decline-alpn 0 +-decline-ocsp-callback 0 +-defer-alps 0 +-delegated-credential 1 +-dtls 0 +-early-write-after-message 1 +-ech-config-list 1 +-ech-is-retry-config 1 +-ech-server-config 1 +-ech-server-key 1 +-enable-channel-id 0 +-enable-early-data 0 +-enable-ech-grease 0 +-enable-grease 0 +-enable-ocsp-stapling 0 +-enable-signed-cert-timestamps 0 +-expect-accept-early-data 0 +-expect-advertised-alpn 1 +-expect-alpn 1 +-expect-certificate-types 1 +-expect-channel-id 1 +-expect-cipher 1 +-expect-cipher-aes 1 +-expect-cipher-no-aes 1 +-expect-client-ca-list 1 +-expect-curve-id 1 +-expect-early-data-reason 1 +-expect-ech-accept 0 +-expect-ech-name-override 1 +-expect-ech-retry-configs 1 +-expect-extended-master-secret 0 +-expect-hrr 0 +-expect-msg-callback 1 +-expect-next-proto 1 +-expect-no-ech-name-override 0 +-expect-no-ech-retry-configs 0 +-expect-no-hrr 0 +-expect-no-next-proto 0 +-expect-no-offer-early-data 0 +-expect-no-peer-cert 0 +-expect-no-peer-match-trust-anchor 0 +-expect-no-secure-renegotiation 0 +-expect-no-server-name 0 +-expect-no-session 0 +-expect-no-session-id 0 +-expect-not-resumable-across-names 0 +-expect-ocsp-response 1 +-expect-peer-application-settings 1 +-expect-peer-available-trust-anchors 1 +-expect-peer-cert-file 1 +-expect-peer-certificate-type 1 +-expect-peer-match-trust-anchor 0 +-expect-peer-rpk-sha256 1 +-expect-peer-signature-algorithm 1 +-expect-peer-verify-pref 1 +-expect-quic-transport-params 1 +-expect-reject-early-data 0 +-expect-resumable-across-names 0 +-expect-secure-renegotiation 0 +-expect-selected-credential 1 +-expect-server-name 1 +-expect-server-sent-requested-padding 0 +-expect-session-id 0 +-expect-session-miss 0 +-expect-sha256-client-cert 0 +-expect-signed-cert-timestamps 1 +-expect-ticket-age-skew 1 +-expect-ticket-renewal 0 +-expect-ticket-supports-early-data 0 +-expect-total-renegotiations 1 +-expect-verify-result 0 +-expect-version 1 +-export-context 1 +-export-keying-material 1 +-export-label 1 +-export-traffic-secrets 0 +-fail-cert-callback 0 +-fail-cert-callback-alert 1 +-fail-ddos-callback 0 +-fail-early-callback 0 +-fail-early-callback-ech-rewind 0 +-fail-ocsp-callback 0 +-fallback-scsv 0 +-false-start 0 +-fips-202205 0 +-fips-202609 0 +-forbid-renegotiation-after-handshake 0 +-fuzzer-mode 0 +-handshake-hints 0 +-handshake-never-done 0 +-handshake-twice 0 +-handshaker-path 1 +-handshaker-resume 0 +-host-name 1 +-implicit-handshake 0 +-initial-timeout-duration-ms 1 +-install-cert-compression-algs 0 +-install-ddos-callback 0 +-install-one-cert-compression-alg 1 +-ipv6 0 +-is-handshaker-supported 0 +-jdk11-workaround 0 +-key-file 1 +-key-shares 1 +-key-update 0 +-key-update-before-read 0 +-max-cert-list 1 +-max-send-fragment 1 +-max-version 1 +-min-version 1 +-mtu 1 +-must-match-issuer 0 +-new-delegated-credential 0 +-new-psk-credential 0 +-new-rpk-credential 0 +-new-spake2plusv1-credential 0 +-new-x509-credential 0 +-no-key-shares 0 +-no-legacy-server-connect 0 +-no-op-extra-handshake 0 +-no-server-name-ack 0 +-no-ticket 0 +-no-tls1 0 +-no-tls11 0 +-no-tls12 0 +-no-tls13 0 +-ocsp-response 1 +-pake-client-id 1 +-pake-context 1 +-pake-password 1 +-pake-server-id 1 +-partial-write 0 +-peek-then-read 0 +-permute-extensions 0 +-port 1 +-private-key-delay-ms 1 +-psk 1 +-psk-identity 1 +-psk-importer-context 1 +-psk-importer-identity 1 +-psk-importer-key 1 +-psk-importer-sha256 0 +-psk-importer-sha384 0 +-quic 0 +-quic-early-data-context 1 +-quic-transport-params 1 +-quic-use-legacy-codepoint 1 +-read-size 1 +-read-with-unfinished-write 0 +-reject-alpn 0 +-reject-unusable-ech-config 0 +-renegotiate-explicit 0 +-renegotiate-freely 0 +-renegotiate-ignore 0 +-renegotiate-once 0 +-renew-ticket 0 +-repeat-shim-initial-write 1 +-request-server-padding 1 +-requested-trust-anchors 1 +-require-any-client-certificate 0 +-resume-count 1 +-resumption-across-names-enabled 0 +-resumption-delay 1 +-retain-only-sha256-client-cert 0 +-reverify-on-resume 0 +-select-alpn 1 +-select-empty-alpn 0 +-select-empty-next-proto 0 +-select-next-proto 1 +-send-alert 0 +-send-channel-id 1 +-server 0 +-server-supported-groups-hint 1 +-server-supports-padding 0 +-session-id-context 1 +-set-ocsp-in-callback 0 +-shim-id 1 +-shim-initial-write 1 +-shim-shuts-down 0 +-shim-writes-first 0 +-signed-cert-timestamps 1 +-signing-prefs 1 +-skip-ticket 0 +-srtp-profiles 1 +-ticket-key 1 +-tls-unique 0 +-tls13-ciphers 1 +-tls13-ciphers-flags 1 +-trust-cert 1 +-use-client-ca-list 1 +-use-custom-verify-callback 0 +-use-early-callback 0 +-use-export-context 0 +-use-exporter-between-reads 0 +-use-ocsp-callback 0 +-use-old-client-cert-callback 0 +-use-ticket-aead-callback 0 +-use-ticket-callback 0 +-verify-fail 0 +-verify-peer 0 +-verify-prefs 1 +-wait-for-debugger 0 +-wpa-202304 0 +-write-different-record-sizes 0 +-write-hint-trace 1 +-write-settings 1 +-wrong-pake-role 0 diff --git a/tools/managed-stack/Capture-ClientHello.ps1 b/tools/managed-stack/Capture-ClientHello.ps1 new file mode 100644 index 000000000..528835abd --- /dev/null +++ b/tools/managed-stack/Capture-ClientHello.ps1 @@ -0,0 +1,145 @@ +# Captures the first TLS ClientHello (TCP) or the first QUIC datagrams from a browser. +# Only the chrome launch command is filled in. Another browser is a new entry in $launchers. +param( + [ValidateSet('chrome')] + [string] $Browser = 'chrome', + [ValidateSet('tcp', 'udp')] + [string] $Transport = 'tcp', + [int] $Count = 50, + [string] $OutDir = '' +) + +$ErrorActionPreference = 'Stop' +$chrome = @( + "$env:ProgramFiles\Google\Chrome\Application\chrome.exe", + "$env:LocalAppData\Google\Chrome\Application\chrome.exe" +) | Where-Object { Test-Path $_ } | Select-Object -First 1 +if (-not $chrome) { throw 'Chrome is not installed.' } + +$versionLine = (& $chrome --version | Out-String).Trim() +if ($versionLine -notmatch '(\d+\.\d+\.\d+\.\d+)') { throw "Could not read a Chrome version from: $versionLine" } +$version = $Matches[1] + +if (-not $OutDir) { + $OutDir = Join-Path $PSScriptRoot "..\..\tests\Titanium.Tls.Tests\Fixtures\captures\$Browser\$version" +} +$OutDir = [System.IO.Path]::GetFullPath($OutDir) +$bucket = Join-Path $OutDir $Transport +New-Item -ItemType Directory -Force -Path $bucket | Out-Null + +function Read-Exact([System.IO.Stream] $stream, [byte[]] $buffer) { + $got = 0 + while ($got -lt $buffer.Length) { + $n = $stream.Read($buffer, $got, $buffer.Length - $got) + if ($n -le 0) { throw 'The browser closed before the record was complete.' } + $got += $n + } +} + +function Save-TcpHello([int] $index) { + $saved = $false + for ($attempt = 1; $attempt -le 3 -and -not $saved; $attempt++) { + $listener = [System.Net.Sockets.TcpListener]::new([System.Net.IPAddress]::Loopback, 0) + $listener.Start() + $port = ([System.Net.IPEndPoint]$listener.LocalEndpoint).Port + $profile = Join-Path $env:TEMP ("twp-chrome-" + [guid]::NewGuid().ToString('n')) + $proc = $null + try { + $accept = $listener.AcceptTcpClientAsync() + $args = @( + "--user-data-dir=$profile", + '--no-first-run', + '--no-default-browser-check', + '--disable-sync', + '--disable-background-networking', + '--ignore-certificate-errors', + "https://localhost:$port/" + ) + $proc = Start-Process -FilePath $chrome -ArgumentList $args -PassThru -WindowStyle Minimized + $deadline = [DateTime]::UtcNow.AddSeconds(15) + while ([DateTime]::UtcNow -lt $deadline -and -not $saved) { + $left = [int]($deadline - [DateTime]::UtcNow).TotalMilliseconds + if ($left -le 0 -or -not $accept.Wait($left)) { break } + $tcp = $accept.Result + try { + $stream = $tcp.GetStream() + $stream.ReadTimeout = 3000 + $header = New-Object byte[] 5 + Read-Exact $stream $header + $length = ([int]$header[3] -shl 8) -bor [int]$header[4] + if ($header[0] -eq 22 -and $length -gt 0 -and $length -le 16384) { + $body = New-Object byte[] $length + Read-Exact $stream $body + $record = New-Object byte[] (5 + $length) + [Array]::Copy($header, $record, 5) + [Array]::Copy($body, 0, $record, 5, $length) + $path = Join-Path $bucket ("hello-{0:d3}.bin" -f $index) + [System.IO.File]::WriteAllBytes($path, $record) + $saved = $true + } + } + catch { } + finally { $tcp.Dispose() } + if (-not $saved) { $accept = $listener.AcceptTcpClientAsync() } + } + } + finally { + $listener.Stop() + if ($proc -and -not $proc.HasExited) { Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue } + Get-Process chrome -ErrorAction SilentlyContinue | Where-Object { $_.StartTime -gt (Get-Date).AddMinutes(-2) } | Out-Null + if (Test-Path $profile) { Remove-Item -Recurse -Force $profile -ErrorAction SilentlyContinue } + } + } + + if (-not $saved) { throw "Chrome did not send a ClientHello for capture $index." } +} + +function Save-UdpDatagrams([int] $index) { + $udp = [System.Net.Sockets.UdpClient]::new([System.Net.IPAddress]::Loopback, 0) + $port = ([System.Net.IPEndPoint]$udp.Client.LocalEndPoint).Port + $profile = Join-Path $env:TEMP ("twp-chrome-quic-" + [guid]::NewGuid().ToString('n')) + $proc = $null + try { + $udp.Client.ReceiveTimeout = 12000 + $args = @( + "--user-data-dir=$profile", + '--no-first-run', + '--no-default-browser-check', + '--disable-sync', + '--enable-quic', + '--host-resolver-rules=MAP localhost 127.0.0.1', + "--origin-to-force-quic-on=localhost:$port", + '--ignore-certificate-errors', + "https://localhost:$port/" + ) + $proc = Start-Process -FilePath $chrome -ArgumentList $args -PassThru -WindowStyle Minimized + $remote = New-Object System.Net.IPEndPoint([System.Net.IPAddress]::Any, 0) + $packets = New-Object System.Collections.Generic.List[byte[]] + $deadline = [DateTime]::UtcNow.AddSeconds(8) + while ([DateTime]::UtcNow -lt $deadline -and $packets.Count -lt 4) { + try { $packets.Add($udp.Receive([ref] $remote)) } catch { break } + } + if ($packets.Count -eq 0) { throw "Chrome sent no QUIC datagram for capture $index." } + $path = Join-Path $bucket ("initial-{0:d3}.bin" -f $index) + $ms = New-Object System.IO.MemoryStream + $writer = New-Object System.IO.BinaryWriter($ms) + foreach ($packet in $packets) { + $writer.Write([int]$packet.Length) + $writer.Write($packet) + } + $writer.Flush() + [System.IO.File]::WriteAllBytes($path, $ms.ToArray()) + } + finally { + $udp.Dispose() + if ($proc -and -not $proc.HasExited) { Stop-Process -Id $proc.Id -Force -ErrorAction SilentlyContinue } + if (Test-Path $profile) { Remove-Item -Recurse -Force $profile -ErrorAction SilentlyContinue } + } +} + +for ($i = 1; $i -le $Count; $i++) { + Write-Host "$Transport $i/$Count" + if ($Transport -eq 'tcp') { Save-TcpHello $i } else { Save-UdpDatagrams $i } +} + +Write-Host "Wrote $Count $Transport captures for $versionLine to $bucket" diff --git a/tools/managed-stack/H3Probe/H3Probe.csproj b/tools/managed-stack/H3Probe/H3Probe.csproj new file mode 100644 index 000000000..3dbb2a643 --- /dev/null +++ b/tools/managed-stack/H3Probe/H3Probe.csproj @@ -0,0 +1,13 @@ + + + Exe + net10.0 + enable + enable + H3Probe + + + + + + diff --git a/tools/managed-stack/H3Probe/Probe.cs b/tools/managed-stack/H3Probe/Probe.cs new file mode 100644 index 000000000..1929f6fdf --- /dev/null +++ b/tools/managed-stack/H3Probe/Probe.cs @@ -0,0 +1,171 @@ +#pragma warning disable CA1416 // The probe names the BCL stream type. It does not open a platform listener. +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Titanium.Http3; +using Titanium.Quic; + +namespace H3Probe; + +static class Probe +{ + // QPACK header block for :status 200 (static index 25): Required Insert Count 0, Delta Base 0, indexed static field. + internal static ReadOnlyMemory HeadersFrame { get; } = new byte[] { 0x01, 0x03, 0x00, 0x00, 0xD9 }; + + private static ReadOnlyMemory DataFrame { get; } = new byte[] { 0x00, 0x02, (byte)'o', (byte)'k' }; + + private static ReadOnlyMemory SettingsFrame { get; } = new byte[] { 0x04, 0x00 }; + + internal static async Task RunAsync(IPEndPoint endpoint, Action ready, CancellationToken cancellationToken) + { + using X509Certificate2 certificate = Certificate(); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = endpoint, + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = [new SslApplicationProtocol("h3")], + }, + }), + }, cancellationToken).ConfigureAwait(false); + ready(listener.LocalEndPoint); + while (!cancellationToken.IsCancellationRequested) + { + ManagedQuicConnection connection; + try + { + connection = await listener.AcceptConnectionAsync(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + break; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + break; + } + + await ServeAsync(connection, cancellationToken).ConfigureAwait(false); + } + } + + internal static async Task WriteControlAsync(ManagedQuicConnection connection, CancellationToken cancellationToken) + { + await OpenUniAsync(connection, Http3StreamType.Control, SettingsFrame, cancellationToken).ConfigureAwait(false); + await OpenUniAsync(connection, Http3StreamType.QpackEncoder, ReadOnlyMemory.Empty, cancellationToken).ConfigureAwait(false); + await OpenUniAsync(connection, Http3StreamType.QpackDecoder, ReadOnlyMemory.Empty, cancellationToken).ConfigureAwait(false); + } + + private static async Task ServeAsync(ManagedQuicConnection connection, CancellationToken cancellationToken) + { + await using ManagedQuicConnection server = connection; + try + { + await WriteControlAsync(server, cancellationToken).ConfigureAwait(false); + Task? bidirectional = null; + Task? unidirectional = null; + while (!cancellationToken.IsCancellationRequested) + { + bidirectional ??= server.AcceptInboundStreamAsync(cancellationToken).AsTask(); + unidirectional ??= server.AcceptInboundUnidirectionalStreamAsync(cancellationToken).AsTask(); + Task finished = await Task.WhenAny(bidirectional, unidirectional).ConfigureAwait(false); + if (finished == bidirectional) + { + ManagedQuicStream stream = await bidirectional.ConfigureAwait(false); + bidirectional = null; + await ReplyAsync(stream, cancellationToken).ConfigureAwait(false); + } + else + { + ManagedQuicStream stream = await unidirectional.ConfigureAwait(false); + unidirectional = null; + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + Console.Error.WriteLine("uni=" + (type?.ToString() ?? "eof")); + } + } + } + catch (Exception ex) when (ex is not OperationCanceledException) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + } + } + + private static async Task ReplyAsync(ManagedQuicStream stream, CancellationToken cancellationToken) + { + bool headers = false; + while (!headers) + { + ulong? type = await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + ulong? length = type is null ? null : await Http3VarInt.ReadAsync(stream, cancellationToken).ConfigureAwait(false); + if (type is null || length is null) + { + return; + } + + if (length > 65536) + { + Console.Error.WriteLine("frame=" + type + " length=" + length); + return; + } + + await DiscardAsync(stream, (int)length.Value, cancellationToken).ConfigureAwait(false); + headers = type == Http3FrameType.Headers; + } + + await stream.WriteAsync(HeadersFrame, cancellationToken).ConfigureAwait(false); + await stream.WriteAsync(DataFrame, cancellationToken).ConfigureAwait(false); + await stream.CompleteWritesAsync(cancellationToken).ConfigureAwait(false); + Console.Error.WriteLine("replied"); + } + + private static async Task DiscardAsync(Stream stream, int length, CancellationToken cancellationToken) + { + var buffer = new byte[Math.Min(length, 8192)]; + int left = length; + while (left > 0) + { + int count = await stream.ReadAsync(buffer.AsMemory(0, Math.Min(buffer.Length, left)), cancellationToken).ConfigureAwait(false); + if (count == 0) + { + return; + } + + left -= count; + } + } + + private static async Task OpenUniAsync(ManagedQuicConnection connection, ulong type, ReadOnlyMemory payload, CancellationToken cancellationToken) + { + ManagedQuicStream stream = await connection.OpenOutboundStreamAsync(QuicStreamType.Unidirectional, cancellationToken).ConfigureAwait(false); + var typeBytes = new byte[8]; + int written = Http3VarInt.Write(typeBytes, type); + await stream.WriteAsync(typeBytes.AsMemory(0, written), cancellationToken).ConfigureAwait(false); + if (!payload.IsEmpty) + { + await stream.WriteAsync(payload, cancellationToken).ConfigureAwait(false); + } + } + + private static X509Certificate2 Certificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), null, flags); + } +} diff --git a/tools/managed-stack/H3Probe/Program.cs b/tools/managed-stack/H3Probe/Program.cs new file mode 100644 index 000000000..bcf53134d --- /dev/null +++ b/tools/managed-stack/H3Probe/Program.cs @@ -0,0 +1,91 @@ +#pragma warning disable CA1416 // The probe names the BCL stream type. It does not open a platform listener. +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using H3Probe; +using Titanium.Quic; + +if (args.Length == 1 && args[0] == "self-test") +{ + return await SelfTestAsync().ConfigureAwait(false); +} + +if (args.Length != 2 || args[0] != "127.0.0.1" || !int.TryParse(args[1], out int port) || port < 0 || IsReserved(port)) +{ + Console.Error.WriteLine("usage: H3Probe 127.0.0.1 "); + return 2; +} + +using var stop = new CancellationTokenSource(); +Console.CancelKeyPress += (_, eventArgs) => +{ + eventArgs.Cancel = true; + stop.Cancel(); +}; + +try +{ + await Probe.RunAsync(new IPEndPoint(IPAddress.Loopback, port), endpoint => + { + Console.WriteLine("port=" + endpoint.Port); + Console.Out.Flush(); + }, stop.Token).ConfigureAwait(false); +} +catch (OperationCanceledException) +{ +} + +return 0; + +static bool IsReserved(int port) => port is 8000 or 8866 or 9080 or 9464; + +static async Task SelfTestAsync() +{ + using var stop = new CancellationTokenSource(TimeSpan.FromSeconds(15)); + var ready = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = Probe.RunAsync(new IPEndPoint(IPAddress.Loopback, 0), endpoint => ready.TrySetResult(endpoint), stop.Token); + IPEndPoint bound = await ready.Task.WaitAsync(stop.Token).ConfigureAwait(false); + await using ManagedQuicConnection client = await ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = bound, + AllowManagedStackUnderFips = true, + ClientAuthenticationOptions = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + ApplicationProtocols = [new SslApplicationProtocol("h3")], + }, + }, stop.Token).ConfigureAwait(false); + await Probe.WriteControlAsync(client, stop.Token).ConfigureAwait(false); + ManagedQuicStream request = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, stop.Token).ConfigureAwait(false); + await request.WriteAsync(Probe.HeadersFrame, stop.Token).ConfigureAwait(false); + await request.CompleteWritesAsync(stop.Token).ConfigureAwait(false); + var buffer = new byte[64]; + int got = 0; + while (got < buffer.Length) + { + int count = await request.ReadAsync(buffer.AsMemory(got), stop.Token).ConfigureAwait(false); + if (count == 0) + { + break; + } + + got += count; + if (buffer.AsSpan(0, got).IndexOf("ok"u8) >= 0) + { + Console.WriteLine("h3-probe self-test ok"); + stop.Cancel(); + try + { + await server.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + } + + return 0; + } + } + + Console.Error.WriteLine("self-test read " + got + " bytes"); + return 1; +} diff --git a/tools/managed-stack/Invoke-RemoteTests.ps1 b/tools/managed-stack/Invoke-RemoteTests.ps1 new file mode 100644 index 000000000..287e8ea3b --- /dev/null +++ b/tools/managed-stack/Invoke-RemoteTests.ps1 @@ -0,0 +1,24 @@ +# Copies this branch to a remote clone with a git bundle and runs one test project. +# Nothing is pushed. The remote checkout is ~/work/twp and the SDK is ~/.dotnet/dotnet. +param( + [Parameter(Mandatory = $true)] + [ValidateSet('macmini', 'linuxmini')] + [string] $Machine, + [string] $Project = 'tests/Titanium.Tls.Tests/Titanium.Tls.Tests.csproj', + [string] $Filter = '' +) + +$ErrorActionPreference = 'Stop' +$bundle = Join-Path $env:TEMP 'twp-managed.bundle' +git bundle create $bundle 'origin/develop..HEAD' +scp $bundle "${Machine}:~/twp-managed.bundle" +$filterArg = '' +if ($Filter) { $filterArg = "--filter '$Filter'" } +$remote = @" +set -e +git -C "`$HOME/work/twp" fetch "`$HOME/twp-managed.bundle" HEAD +git -C "`$HOME/work/twp" checkout -B feat/managed-tls-quic-stack FETCH_HEAD +"`$HOME/.dotnet/dotnet" test "`$HOME/work/twp/$Project" -c Release --nologo $filterArg +"@ +$remote = $remote.Replace("`r`n", "`n") +$remote | ssh $Machine 'bash -s' diff --git a/tools/managed-stack/QuicInterop/InteropServer.cs b/tools/managed-stack/QuicInterop/InteropServer.cs new file mode 100644 index 000000000..3216259a3 --- /dev/null +++ b/tools/managed-stack/QuicInterop/InteropServer.cs @@ -0,0 +1,161 @@ +#pragma warning disable CA1416 // The tool names the BCL stream type. It does not open a platform listener. +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Titanium.Quic; + +namespace QuicInterop; + +static class InteropServer +{ + internal static async Task RunAsync(IPEndPoint endpoint, string www, Action ready, CancellationToken cancellationToken) + { + using X509Certificate2 certificate = Certificate(); + string root = Path.GetFullPath(www); + await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions + { + ListenEndPoint = endpoint, + AllowManagedStackUnderFips = true, + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + AllowManagedStackUnderFips = true, + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = [new SslApplicationProtocol("hq-interop")], + }, + }), + }, cancellationToken).ConfigureAwait(false); + ready(listener.LocalEndPoint); + while (!cancellationToken.IsCancellationRequested) + { + ManagedQuicConnection connection; + try + { + connection = await listener.AcceptConnectionAsync(cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + break; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + break; + } + + await ServeAsync(connection, root, cancellationToken).ConfigureAwait(false); + } + } + + private static async Task ServeAsync(ManagedQuicConnection connection, string root, CancellationToken cancellationToken) + { + await using ManagedQuicConnection server = connection; + try + { + while (!cancellationToken.IsCancellationRequested) + { + ManagedQuicStream stream = await server.AcceptInboundStreamAsync(cancellationToken).ConfigureAwait(false); + if (!await ReplyAsync(stream, root, cancellationToken).ConfigureAwait(false)) + { + break; + } + } + } + catch (Exception ex) when (ex is not OperationCanceledException) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + } + } + + private static async Task ReplyAsync(ManagedQuicStream stream, string root, CancellationToken cancellationToken) + { + var request = new byte[2048]; + int used = 0; + int line = -1; + while (line < 0 && used < request.Length) + { + int count = await stream.ReadAsync(request.AsMemory(used), cancellationToken).ConfigureAwait(false); + if (count == 0) + { + break; + } + + used += count; + line = request.AsSpan(0, used).IndexOf((byte)'\n'); + } + + if (used == 0) + { + return false; + } + + if (line < 0 || !TryMap(root, request.AsSpan(0, line), out string file)) + { + await stream.CompleteWritesAsync(cancellationToken).ConfigureAwait(false); + Console.Error.WriteLine("rejected"); + return true; + } + + await using FileStream body = File.OpenRead(file); + var buffer = new byte[16384]; + while (true) + { + int count = await body.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + if (count == 0) + { + break; + } + + await stream.WriteAsync(buffer.AsMemory(0, count), cancellationToken).ConfigureAwait(false); + } + + await stream.CompleteWritesAsync(cancellationToken).ConfigureAwait(false); + Console.Error.WriteLine("served " + Path.GetFileName(file)); + return true; + } + + private static bool TryMap(string root, ReadOnlySpan line, out string file) + { + file = string.Empty; + string text = System.Text.Encoding.ASCII.GetString(line).TrimEnd('\r'); + if (!text.StartsWith("GET ", StringComparison.Ordinal)) + { + return false; + } + + string path = text[4..].Split(' ')[0]; + if (path.Length == 0 || path[0] != '/' || path.Contains('\\') || path.Contains("..", StringComparison.Ordinal)) + { + return false; + } + + string relative = path[1..].Replace('/', Path.DirectorySeparatorChar); + string full = Path.GetFullPath(Path.Combine(root, relative)); + string prefix = root.EndsWith(Path.DirectorySeparatorChar) ? root : root + Path.DirectorySeparatorChar; + if (!full.StartsWith(prefix, StringComparison.OrdinalIgnoreCase) || !File.Exists(full)) + { + return false; + } + + file = full; + return true; + } + + private static X509Certificate2 Certificate() + { + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), null, flags); + } +} diff --git a/tools/managed-stack/QuicInterop/Program.cs b/tools/managed-stack/QuicInterop/Program.cs new file mode 100644 index 000000000..4aae05648 --- /dev/null +++ b/tools/managed-stack/QuicInterop/Program.cs @@ -0,0 +1,136 @@ +#pragma warning disable CA1416 // The tool names the BCL stream type. It does not open a platform listener. +using System.Net; +using System.Net.Quic; +using System.Net.Security; +using System.Security.Cryptography; +using QuicInterop; +using Titanium.Quic; + +if (args.Length == 1 && args[0] == "self-test") +{ + return await SelfTestAsync().ConfigureAwait(false); +} + +if (args.Length != 3 || args[0] != "127.0.0.1" || !int.TryParse(args[1], out int port) || port < 0 || IsReserved(port)) +{ + Console.Error.WriteLine("usage: QuicInterop 127.0.0.1 "); + return 2; +} + +if (!Directory.Exists(args[2])) +{ + Console.Error.WriteLine("www directory does not exist"); + return 2; +} + +using var stop = new CancellationTokenSource(); +Console.CancelKeyPress += (_, eventArgs) => +{ + eventArgs.Cancel = true; + stop.Cancel(); +}; + +try +{ + await InteropServer.RunAsync(new IPEndPoint(IPAddress.Loopback, port), args[2], endpoint => + { + Console.WriteLine("port=" + endpoint.Port); + Console.Out.Flush(); + }, stop.Token).ConfigureAwait(false); +} +catch (OperationCanceledException) +{ +} + +return 0; + +static bool IsReserved(int port) => port is 8000 or 8866 or 9080 or 9464; + +static async Task SelfTestAsync() +{ + string www = Directory.CreateTempSubdirectory("quic-interop-").FullName; + try + { + byte[] first = RandomNumberGenerator.GetBytes(32); + byte[] second = new byte[1000]; + second.AsSpan().Fill(7); + await File.WriteAllBytesAsync(Path.Combine(www, "a.bin"), first).ConfigureAwait(false); + await File.WriteAllBytesAsync(Path.Combine(www, "b.bin"), second).ConfigureAwait(false); + using var stop = new CancellationTokenSource(TimeSpan.FromSeconds(20)); + var ready = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + Task server = InteropServer.RunAsync(new IPEndPoint(IPAddress.Loopback, 0), www, endpoint => ready.TrySetResult(endpoint), stop.Token); + IPEndPoint bound = await ready.Task.WaitAsync(stop.Token).ConfigureAwait(false); + await using (ManagedQuicConnection client = await ConnectAsync(bound, stop.Token).ConfigureAwait(false)) + { + byte[] gotA = await GetAsync(client, "/a.bin", stop.Token).ConfigureAwait(false); + byte[] gotB = await GetAsync(client, "/b.bin", stop.Token).ConfigureAwait(false); + byte[] escaped = await GetAsync(client, "/../a.bin", stop.Token).ConfigureAwait(false); + if (!gotA.AsSpan().SequenceEqual(first) || !gotB.AsSpan().SequenceEqual(second) || escaped.Length != 0) + { + Console.Error.WriteLine("self-test body mismatch"); + return 1; + } + + await client.CloseAsync(0, stop.Token).ConfigureAwait(false); + } + + await using (ManagedQuicConnection again = await ConnectAsync(bound, stop.Token).ConfigureAwait(false)) + { + byte[] got = await GetAsync(again, "/a.bin", stop.Token).ConfigureAwait(false); + if (!got.AsSpan().SequenceEqual(first)) + { + Console.Error.WriteLine("self-test second connection mismatch"); + return 1; + } + } + + Console.WriteLine("quic-interop self-test ok"); + stop.Cancel(); + try + { + await server.ConfigureAwait(false); + } + catch (OperationCanceledException) + { + } + + return 0; + } + finally + { + Directory.Delete(www, recursive: true); + } +} + +static Task ConnectAsync(IPEndPoint endpoint, CancellationToken cancellationToken) => + ManagedQuicConnection.ConnectAsync(new ManagedQuicClientConnectionOptions + { + RemoteEndPoint = endpoint, + AllowManagedStackUnderFips = true, + ClientAuthenticationOptions = new SslClientAuthenticationOptions + { + TargetHost = "localhost", + ApplicationProtocols = [new SslApplicationProtocol("hq-interop")], + }, + }, cancellationToken).AsTask(); + +static async Task GetAsync(ManagedQuicConnection client, string path, CancellationToken cancellationToken) +{ + ManagedQuicStream stream = await client.OpenOutboundStreamAsync(QuicStreamType.Bidirectional, cancellationToken).ConfigureAwait(false); + await stream.WriteAsync(System.Text.Encoding.ASCII.GetBytes("GET " + path + "\r\n"), cancellationToken).ConfigureAwait(false); + await stream.CompleteWritesAsync(cancellationToken).ConfigureAwait(false); + using var body = new MemoryStream(); + var buffer = new byte[4096]; + while (true) + { + int count = await stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + if (count == 0) + { + break; + } + + body.Write(buffer, 0, count); + } + + return body.ToArray(); +} diff --git a/tools/managed-stack/QuicInterop/QuicInterop.csproj b/tools/managed-stack/QuicInterop/QuicInterop.csproj new file mode 100644 index 000000000..9b0244895 --- /dev/null +++ b/tools/managed-stack/QuicInterop/QuicInterop.csproj @@ -0,0 +1,12 @@ + + + Exe + net10.0 + enable + enable + QuicInterop + + + + + diff --git a/tools/managed-stack/QuicInteropHost/Dockerfile b/tools/managed-stack/QuicInteropHost/Dockerfile new file mode 100644 index 000000000..dda61d5be --- /dev/null +++ b/tools/managed-stack/QuicInteropHost/Dockerfile @@ -0,0 +1,5 @@ +FROM martenseemann/quic-network-simulator-endpoint:latest +COPY publish/ /endpoint/ +COPY run_endpoint.sh /run_endpoint.sh +RUN sed -i 's/\r$//' /run_endpoint.sh && chmod +x /run_endpoint.sh /endpoint/QuicInteropHost +ENTRYPOINT ["/run_endpoint.sh"] diff --git a/tools/managed-stack/QuicInteropHost/Program.cs b/tools/managed-stack/QuicInteropHost/Program.cs new file mode 100644 index 000000000..e629c74ac --- /dev/null +++ b/tools/managed-stack/QuicInteropHost/Program.cs @@ -0,0 +1,209 @@ +using System; +using System.Globalization; +using System.IO; +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Titanium.Quic; + +int port = 4433; +string? www = null; +string? certs = null; +for (int i = 0; i < args.Length; i++) +{ + if (args[i] == "--port" && i + 1 < args.Length && int.TryParse(args[i + 1], NumberStyles.None, CultureInfo.InvariantCulture, out int parsed)) + { + port = parsed; + i++; + } + else if (args[i] == "--www" && i + 1 < args.Length) + { + www = args[++i]; + } + else if (args[i] == "--certs" && i + 1 < args.Length) + { + certs = args[++i]; + } + else if (int.TryParse(args[i], NumberStyles.None, CultureInfo.InvariantCulture, out int bare)) + { + port = bare; + } +} + +string? testCase = Environment.GetEnvironmentVariable("TESTCASE"); +if (testCase is not null && testCase is not ("handshake" or "multiconnect")) +{ + Console.Error.WriteLine("unsupported test case: " + testCase); + return 127; +} +if (port is 8000 or 8866 or 9080 or 9464 || port is < 1 or > 65535) +{ + Console.Error.WriteLine("Refusing port " + port.ToString(CultureInfo.InvariantCulture) + "."); + return 1; +} + +using var probe = new TcpListener(IPAddress.Any, port); +probe.Start(); +using X509Certificate2 certificate = certs is null ? Certificate() : X509Certificate2.CreateFromPemFile(Path.Combine(certs, "cert.pem"), Path.Combine(certs, "priv.key")); +await using ManagedQuicListener listener = await ManagedQuicListener.ListenAsync(new ManagedQuicListenerOptions +{ + ListenEndPoint = new IPEndPoint(IPAddress.Any, port), + HandshakeTimeout = TimeSpan.FromSeconds(30), + ConnectionOptionsCallback = (_, _, _) => ValueTask.FromResult(new ManagedQuicServerConnectionOptions + { + ServerAuthenticationOptions = new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + ApplicationProtocols = [new SslApplicationProtocol("h3"), new SslApplicationProtocol("h3-29"), new SslApplicationProtocol("hq-interop"), new SslApplicationProtocol("hq-29")], + }, + }), +}).ConfigureAwait(false); + +Console.WriteLine("listening " + listener.LocalEndPoint); +using var stop = new CancellationTokenSource(); +Console.CancelKeyPress += (_, eventArgs) => +{ + eventArgs.Cancel = true; + stop.Cancel(); +}; + +while (!stop.IsCancellationRequested) +{ + ManagedQuicConnection connection; + try + { + connection = await listener.AcceptConnectionAsync(stop.Token).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + break; + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + continue; + } + + Console.WriteLine("accepted " + connection.RemoteEndPoint); + _ = www is null ? HoldAsync(connection) : ServeAsync(connection, www); +} + +return 0; + +static async Task ServeAsync(ManagedQuicConnection connection, string root) +{ + try + { + await using (connection) + { + ManagedQuicStream stream = await connection.AcceptInboundStreamAsync().ConfigureAwait(false); + byte[] buffer = new byte[1024]; + var request = new StringBuilder(); + using var done = new CancellationTokenSource(TimeSpan.FromSeconds(30)); + while (request.Length < 4096 && request.ToString().IndexOf("\r\n", StringComparison.Ordinal) < 0) + { + int count = await ReadWithPingsAsync(connection, stream, buffer, done.Token).ConfigureAwait(false); + if (count == 0) + { + break; + } + + request.Append(Encoding.ASCII.GetString(buffer, 0, count)); + } + + string? file = FileFor(root, request.ToString()); + if (file is not null) + { + byte[] body = await File.ReadAllBytesAsync(file).ConfigureAwait(false); + if (body.Length > 0) + { + await stream.WriteAsync(body).ConfigureAwait(false); + } + } + + await stream.CompleteWritesAsync().ConfigureAwait(false); + // A dropped file is sent again only while this connection stays open. + byte[] tail = new byte[8]; + while (await ReadWithPingsAsync(connection, stream, tail, done.Token).ConfigureAwait(false) > 0) + { + } + } + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + } +} + +static async Task ReadWithPingsAsync(ManagedQuicConnection connection, ManagedQuicStream stream, Memory buffer, CancellationToken token) +{ + ValueTask read = stream.ReadAsync(buffer, token); + Task pending = read.AsTask(); + while (!pending.IsCompleted) + { + Task delay = Task.Delay(200, token); + if (await Task.WhenAny(pending, delay).ConfigureAwait(false) == pending) + { + break; + } + + await connection.PingAsync(token).ConfigureAwait(false); + } + + return await pending.ConfigureAwait(false); +} + +static string? FileFor(string root, string request) +{ + int end = request.IndexOf("\r\n", StringComparison.Ordinal); + if (end < 5 || !request.StartsWith("GET /", StringComparison.Ordinal)) + { + return null; + } + + string raw = request[4..end].Trim(); + if (raw.Contains("..", StringComparison.Ordinal) || raw.Contains('\\')) + { + return null; + } + + string relative = raw.TrimStart('/'); + string baseDir = Path.GetFullPath(root); + string full = Path.GetFullPath(Path.Combine(baseDir, relative)); + string prefix = baseDir.EndsWith(Path.DirectorySeparatorChar) ? baseDir : baseDir + Path.DirectorySeparatorChar; + if (!full.StartsWith(prefix, StringComparison.Ordinal) || !File.Exists(full)) + { + return null; + } + + return full; +} + +static async Task HoldAsync(ManagedQuicConnection connection) +{ + try + { + await Task.Delay(TimeSpan.FromSeconds(15)).ConfigureAwait(false); + await connection.CloseAsync(0).ConfigureAwait(false); + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + } + finally + { + await connection.DisposeAsync().ConfigureAwait(false); + } +} + +static X509Certificate2 Certificate() +{ + using var key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + return request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(2)); +} diff --git a/tools/managed-stack/QuicInteropHost/QuicInteropHost.csproj b/tools/managed-stack/QuicInteropHost/QuicInteropHost.csproj new file mode 100644 index 000000000..d0f7cf93b --- /dev/null +++ b/tools/managed-stack/QuicInteropHost/QuicInteropHost.csproj @@ -0,0 +1,13 @@ + + + Exe + net10.0 + enable + disable + true + latest-recommended + + + + + diff --git a/tools/managed-stack/QuicInteropHost/run_endpoint.sh b/tools/managed-stack/QuicInteropHost/run_endpoint.sh new file mode 100644 index 000000000..2cbbc2646 --- /dev/null +++ b/tools/managed-stack/QuicInteropHost/run_endpoint.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euo pipefail +if [ -x /setup.sh ]; then + /setup.sh +fi +if [ "${ROLE:-server}" = "client" ]; then + echo "This endpoint is a server." >&2 + exit 127 +fi +case "${TESTCASE:-handshake}" in + handshake|multiconnect) ;; + *) + echo "unsupported test case: ${TESTCASE}" >&2 + echo "exit status 127" >&2 + exit 127 + ;; +esac +export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 +exec /endpoint/QuicInteropHost --www /www --certs /certs --port 443 diff --git a/tools/managed-stack/Summarize-ClientHello.ps1 b/tools/managed-stack/Summarize-ClientHello.ps1 new file mode 100644 index 000000000..f3f3a8202 --- /dev/null +++ b/tools/managed-stack/Summarize-ClientHello.ps1 @@ -0,0 +1,124 @@ +# Summarizes captured ClientHello records: cipher suites, extension order, and which slots stay fixed. +param( + [Parameter(Mandatory = $true)] + [string] $Dir +) + +$ErrorActionPreference = 'Stop' +$names = @{ + 0 = 'server_name'; 5 = 'status_request'; 10 = 'supported_groups'; 11 = 'ec_point_formats' + 13 = 'signature_algorithms'; 16 = 'application_layer_protocol_negotiation'; 18 = 'signed_certificate_timestamp' + 21 = 'padding'; 23 = 'extended_master_secret'; 27 = 'compress_certificate'; 34 = 'delegated_credential' + 35 = 'session_ticket'; 41 = 'pre_shared_key'; 42 = 'early_data'; 43 = 'supported_versions' + 44 = 'cookie'; 45 = 'psk_key_exchange_modes'; 47 = 'certificate_authorities'; 49 = 'post_handshake_auth' + 50 = 'signature_algorithms_cert'; 51 = 'key_share'; 57 = 'quic_transport_parameters' + 17513 = 'application_settings'; 17613 = 'application_settings_new'; 65281 = 'renegotiation_info' + 65037 = 'encrypted_client_hello' +} + +function Read-U16([byte[]] $b, [int] $o) { return ([int]$b[$o] -shl 8) -bor [int]$b[$o + 1] } +function Read-U24([byte[]] $b, [int] $o) { return ([int]$b[$o] -shl 16) -bor ([int]$b[$o + 1] -shl 8) -bor [int]$b[$o + 2] } + +function Parse-Hello([byte[]] $record) { + if ($record[0] -ne 22 -or $record[5] -ne 1) { throw 'Not a ClientHello record.' } + $o = 9 + $legacy = Read-U16 $record $o; $o += 2 + $o += 32 + $sidLen = $record[$o]; $o += 1 + $sidLen + $cipherLen = Read-U16 $record $o; $o += 2 + $ciphers = @() + for ($i = 0; $i -lt $cipherLen; $i += 2) { $ciphers += Read-U16 $record ($o + $i) } + $o += $cipherLen + $compLen = $record[$o]; $o += 1 + $compLen + $extLen = Read-U16 $record $o; $o += 2 + $end = $o + $extLen + $exts = @() + while ($o + 4 -le $end) { + $type = Read-U16 $record $o + $len = Read-U16 $record ($o + 2) + $body = New-Object byte[] $len + [Array]::Copy($record, $o + 4, $body, 0, $len) + $exts += [pscustomobject]@{ Type = $type; Body = $body } + $o += 4 + $len + } + [pscustomobject]@{ Legacy = $legacy; SessionIdLength = $sidLen; Ciphers = $ciphers; Extensions = $exts } +} + +function Name-Of([int] $type) { + if ($names.ContainsKey($type)) { return $names[$type] } + if (($type -band 0x0f0f) -eq 0x0a0a) { return 'grease' } + return ('0x{0:x4}' -f $type) +} + +$files = Get-ChildItem -Path $Dir -Filter 'hello-*.bin' | Sort-Object Name +if ($files.Count -eq 0) { throw "No hello-*.bin files in $Dir" } +$parsed = foreach ($file in $files) { Parse-Hello ([System.IO.File]::ReadAllBytes($file.FullName)) } +$first = $parsed[0] +$extCount = $first.Extensions.Count +$lines = New-Object System.Collections.Generic.List[string] +$lines.Add("files=$($files.Count) legacy=0x$('{0:x4}' -f $first.Legacy) sessionId=$($first.SessionIdLength) extensions=$extCount") +$lines.Add('ciphers=' + (($first.Ciphers | ForEach-Object { '0x{0:x4}' -f $_ }) -join ',')) +for ($slot = 0; $slot -lt $extCount; $slot++) { + $at = @{} + foreach ($hello in $parsed) { + $name = Name-Of $hello.Extensions[$slot].Type + if (-not $at.ContainsKey($name)) { $at[$name] = 0 } + $at[$name]++ + } + $dist = ($at.GetEnumerator() | Sort-Object Name | ForEach-Object { "$($_.Key)=$($_.Value)" }) -join ' ' + $fixed = if ($at.Count -eq 1) { 'fixed' } else { 'moves' } + $lines.Add(("slot {0:d2} {1} {2}" -f $slot, $fixed, $dist)) +} + +$groups = $first.Extensions | Where-Object { $_.Type -eq 10 } | Select-Object -First 1 +if ($groups) { + $g = @() + $n = Read-U16 $groups.Body 0 + for ($i = 2; $i -lt 2 + $n; $i += 2) { $g += '0x{0:x4}' -f (Read-U16 $groups.Body $i) } + $lines.Add('groups=' + ($g -join ',')) +} +$shares = $first.Extensions | Where-Object { $_.Type -eq 51 } | Select-Object -First 1 +if ($shares) { + $s = @() + $n = Read-U16 $shares.Body 0 + $i = 2 + while ($i + 4 -le $n + 2) { + $group = Read-U16 $shares.Body $i + $klen = Read-U16 $shares.Body ($i + 2) + $s += ('0x{0:x4}:{1}' -f $group, $klen) + $i += 4 + $klen + } + $lines.Add('key_shares=' + ($s -join ',')) +} +$lines.Add('alpn-present=' + [bool]($first.Extensions | Where-Object { $_.Type -eq 16 })) +$lines.Add('ech-present=' + [bool]($first.Extensions | Where-Object { $_.Type -eq 65037 })) +$lines.Add('cert-compression-present=' + [bool]($first.Extensions | Where-Object { $_.Type -eq 27 })) +$lines.Add('alps-17513=' + [bool]($first.Extensions | Where-Object { $_.Type -eq 17513 })) +$lines.Add('alps-17613=' + [bool]($first.Extensions | Where-Object { $_.Type -eq 17613 })) +$sameGrease = 0 +$hybridMatchesX = 0 +foreach ($hello in $parsed) { + $grease = @($hello.Extensions | Where-Object { (($_.Type -band 0x0f0f) -eq 0x0a0a) } | ForEach-Object { $_.Type }) + if ($grease.Count -ge 2 -and $grease[0] -ne $grease[1]) { $sameGrease++ } + $share = $hello.Extensions | Where-Object { $_.Type -eq 51 } | Select-Object -First 1 + if (-not $share) { continue } + $n = Read-U16 $share.Body 0 + $i = 2 + $xInHybrid = $null + $xAlone = $null + while ($i + 4 -le $n + 2) { + $group = Read-U16 $share.Body $i + $klen = Read-U16 $share.Body ($i + 2) + if ($group -eq 0x11ec -and $klen -ge 32) { + $xInHybrid = [Convert]::ToHexString($share.Body, $i + 4 + $klen - 32, 32) + } + if ($group -eq 0x001d -and $klen -eq 32) { + $xAlone = [Convert]::ToHexString($share.Body, $i + 4, 32) + } + $i += 4 + $klen + } + if ($xInHybrid -and $xAlone -and $xInHybrid -eq $xAlone) { $hybridMatchesX++ } +} +$lines.Add("first-and-last-grease-differ=$sameGrease/$($parsed.Count)") +$lines.Add("hybrid-x25519-equals-separate-share=$hybridMatchesX/$($parsed.Count)") +$lines -join "`n" diff --git a/tools/managed-stack/TlsProbe/Program.cs b/tools/managed-stack/TlsProbe/Program.cs new file mode 100644 index 000000000..5952f8817 --- /dev/null +++ b/tools/managed-stack/TlsProbe/Program.cs @@ -0,0 +1,152 @@ +using System.Net; +using System.Net.Security; +using System.Net.Sockets; +using System.Security.Cryptography; +using System.Security.Cryptography.X509Certificates; +using Titanium.Tls; + +if (args.Length != 2 || args[0] != "127.0.0.1" || !int.TryParse(args[1], out int port) || port < 0) +{ + Console.Error.WriteLine("usage: TlsProbe 127.0.0.1 "); + return 2; +} + +using X509Certificate2 certificate = Certificate(); +using var listener = new TcpListener(IPAddress.Loopback, port); +listener.Start(); +Console.WriteLine("port=" + ((IPEndPoint)listener.LocalEndpoint).Port); +Console.Out.Flush(); +using var stop = new CancellationTokenSource(); +Console.CancelKeyPress += (_, eventArgs) => +{ + eventArgs.Cancel = true; + stop.Cancel(); +}; + +while (!stop.IsCancellationRequested) +{ + TcpClient tcp; + try + { + tcp = await listener.AcceptTcpClientAsync(stop.Token).ConfigureAwait(false); + } + catch (OperationCanceledException) + { + break; + } + + await ServeAsync(tcp, certificate).ConfigureAwait(false); +} + +return 0; + +static async Task ServeAsync(TcpClient tcp, X509Certificate2 certificate) +{ + using var _ = tcp; + try + { + NetworkStream raw = tcp.GetStream(); + var header = new byte[5]; + int got = await raw.ReadAsync(header).ConfigureAwait(false); + Console.Error.WriteLine("first=" + Convert.ToHexString(header.AsSpan(0, got))); + await using var stream = new TlsStream(new PrefixStream(raw, header.AsSpan(0, got).ToArray()), new TlsStreamOptions { AllowManagedStackUnderFips = true }); + await stream.AuthenticateAsServerAsync(new SslServerAuthenticationOptions + { + ServerCertificate = certificate, + EnabledSslProtocols = System.Security.Authentication.SslProtocols.Tls13, + }).ConfigureAwait(false); + var buffer = new byte[4096]; + while (true) + { + int count = await stream.ReadAsync(buffer).ConfigureAwait(false); + if (count == 0) + { + break; + } + + await stream.WriteAsync(buffer.AsMemory(0, count)).ConfigureAwait(false); + } + } + catch (Exception ex) + { + Console.Error.WriteLine(ex.GetType().Name + ": " + ex.Message); + } +} + +static X509Certificate2 Certificate() +{ + using ECDsa key = ECDsa.Create(ECCurve.NamedCurves.nistP256); + var request = new CertificateRequest("CN=localhost", key, HashAlgorithmName.SHA256); + request.CertificateExtensions.Add(new X509EnhancedKeyUsageExtension(new OidCollection { new Oid("1.3.6.1.5.5.7.3.1") }, false)); + using X509Certificate2 created = request.CreateSelfSigned(DateTimeOffset.UtcNow.AddDays(-1), DateTimeOffset.UtcNow.AddDays(1)); + X509KeyStorageFlags flags = X509KeyStorageFlags.Exportable; + if (OperatingSystem.IsWindows()) + { + flags |= X509KeyStorageFlags.EphemeralKeySet; + } + + return X509CertificateLoader.LoadPkcs12(created.Export(X509ContentType.Pfx), null, flags); +} + +sealed class PrefixStream : Stream +{ + private readonly Stream _inner; + private readonly byte[] _prefix; + private int _used; + + public PrefixStream(Stream inner, byte[] prefix) + { + _inner = inner; + _prefix = prefix; + } + + public override bool CanRead => true; + + public override bool CanSeek => false; + + public override bool CanWrite => true; + + public override long Length => throw new NotSupportedException(); + + public override long Position + { + get => throw new NotSupportedException(); + set => throw new NotSupportedException(); + } + + public override void Flush() => _inner.Flush(); + + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + public override void SetLength(long value) => throw new NotSupportedException(); + + public override void Write(byte[] buffer, int offset, int count) => _inner.Write(buffer, offset, count); + + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) => _inner.WriteAsync(buffer, cancellationToken); + + public override int Read(byte[] buffer, int offset, int count) + { + if (_used < _prefix.Length) + { + int countFromPrefix = Math.Min(count, _prefix.Length - _used); + Buffer.BlockCopy(_prefix, _used, buffer, offset, countFromPrefix); + _used += countFromPrefix; + return countFromPrefix; + } + + return _inner.Read(buffer, offset, count); + } + + public override async ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + if (_used < _prefix.Length) + { + int countFromPrefix = Math.Min(buffer.Length, _prefix.Length - _used); + _prefix.AsSpan(_used, countFromPrefix).CopyTo(buffer.Span); + _used += countFromPrefix; + return countFromPrefix; + } + + return await _inner.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + } +} diff --git a/tools/managed-stack/TlsProbe/TlsProbe.csproj b/tools/managed-stack/TlsProbe/TlsProbe.csproj new file mode 100644 index 000000000..f5ab2d727 --- /dev/null +++ b/tools/managed-stack/TlsProbe/TlsProbe.csproj @@ -0,0 +1,12 @@ + + + Exe + net10.0 + enable + enable + TlsProbe + + + + + diff --git a/tools/managed-stack/compare-perf-regression.ps1 b/tools/managed-stack/compare-perf-regression.ps1 new file mode 100644 index 000000000..cb2e92e27 --- /dev/null +++ b/tools/managed-stack/compare-perf-regression.ps1 @@ -0,0 +1,146 @@ +# Compares fresh BenchmarkDotNet full JSON exports against the committed baselines. +# +# The baselines live per machine under src/Titanium.Tls/design/perf-baselines// and +# src/Titanium.Quic/design/perf-baselines// as runN-.json, three runs per cell. This +# script takes the median of those three run medians as the reference for each benchmark and prints +# the fresh/reference ratio. +# +# Advisory only: a ratio above -ThresholdPercent prints a warning and never fails the job, because the +# runner is not the machine the baseline was recorded on. Use -FailOnRegression to make it a gate. +# +# pwsh tools/managed-stack/compare-perf-regression.ps1 ` +# -BaselineDir src/Titanium.Tls/design/perf-baselines/linuxmini -FreshDir artifacts/perf-tls +param( + [Parameter(Mandatory = $true)] [string] $BaselineDir, + [Parameter(Mandatory = $true)] [string] $FreshDir, + [double] $ThresholdPercent = 10, + [string] $Label = 'perf', + [switch] $FailOnRegression +) + +$ErrorActionPreference = 'Stop' + +function Get-Medians([string] $dir) { + # BenchmarkDotNet spells the parameter list differently across exporter versions + # ("Stack:" vs "stack:"), so keys are matched case-insensitively. + $map = [System.Collections.Generic.Dictionary[string, System.Collections.Generic.List[double]]]::new( + [System.StringComparer]::OrdinalIgnoreCase) + foreach ($file in Get-ChildItem -LiteralPath $dir -Recurse -Filter '*.json' -File) { + $json = $null + try { + $json = Get-Content -Raw -LiteralPath $file.FullName | ConvertFrom-Json + } + catch { + continue + } + + if ($null -eq $json -or $null -eq $json.Benchmarks) { continue } + foreach ($benchmark in $json.Benchmarks) { + $name = $benchmark.FullName + $median = $benchmark.Statistics.Median + if ([string]::IsNullOrWhiteSpace($name) -or $null -eq $median) { continue } + if (-not $map.ContainsKey($name)) { $map[$name] = [System.Collections.Generic.List[double]]::new() } + $map[$name].Add([double] $median) + } + } + + $out = [System.Collections.Generic.Dictionary[string, double]]::new([System.StringComparer]::OrdinalIgnoreCase) + foreach ($name in $map.Keys) { + $values = @($map[$name] | Sort-Object) + $mid = [int] [math]::Floor($values.Count / 2) + $out[$name] = if ($values.Count % 2 -eq 0) { ($values[$mid - 1] + $values[$mid]) / 2 } else { $values[$mid] } + } + + return $out +} + +if (-not (Test-Path -LiteralPath $BaselineDir)) { + Write-Host "[$Label] no baseline directory at $BaselineDir; nothing to compare." + exit 0 +} + +$baseline = Get-Medians $BaselineDir +if ($baseline.Count -eq 0) { + Write-Host "[$Label] no baseline benchmarks under $BaselineDir; nothing to compare." + exit 0 +} + +if (-not (Test-Path -LiteralPath $FreshDir)) { + Write-Host "[$Label] no fresh export directory at $FreshDir; nothing to compare." + exit 0 +} + +$fresh = Get-Medians $FreshDir +if ($fresh.Count -eq 0) { + Write-Host "[$Label] no fresh BenchmarkDotNet export under $FreshDir; nothing to compare." + exit 0 +} + +$limit = 1.0 + ($ThresholdPercent / 100.0) +$rows = [System.Collections.Generic.List[string]]::new() +$regressions = [System.Collections.Generic.List[string]]::new() +$missing = [System.Collections.Generic.List[string]]::new() + +$rows.Add('| Benchmark | Baseline median (ns) | Fresh median (ns) | Ratio | Verdict |') +$rows.Add('| --- | ---: | ---: | ---: | --- |') +foreach ($name in ($baseline.Keys | Sort-Object)) { + if (-not $fresh.ContainsKey($name)) { + $missing.Add($name) + continue + } + + $before = $baseline[$name] + $after = $fresh[$name] + $ratio = if ($before -eq 0) { 0 } else { $after / $before } + # Above 1.00 is slower than the committed baseline (every median here is a time). + $verdict = if ($ratio -gt $limit) { 'WARN slower' } else { 'ok' } + if ($ratio -gt $limit) { + $regressions.Add(('{0:N3}x {1}' -f $ratio, $name)) + } + + $rows.Add(('| {0} | {1:N1} | {2:N1} | {3:N3} | {4} |' -f $name, $before, $after, $ratio, $verdict)) +} + +$title = "$Label advisory benchmark check against $BaselineDir (warn above $ThresholdPercent% slower)" +Write-Host $title +Write-Host '' +$rows | ForEach-Object { Write-Host $_ } +if ($missing.Count -gt 0) { + Write-Host '' + Write-Host "Not measured this run (baseline only): $($missing.Count)" +} + +if ($env:GITHUB_STEP_SUMMARY) { + $summary = [System.Collections.Generic.List[string]]::new() + $summary.Add("### $title") + $summary.Add('') + $summary.Add('Advisory: the runner is not the machine the baseline was recorded on, so a ratio here is a coarse') + $summary.Add('regression tripwire rather than a parity number. Nothing in this job fails the pull request.') + $summary.Add('') + $summary | ForEach-Object { $_ } | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 + $rows | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 +} + +if ($regressions.Count -eq 0) { + Write-Host '' + Write-Host "[$Label] no benchmark is more than $ThresholdPercent% slower than its baseline." + exit 0 +} + +Write-Host '' +foreach ($regression in $regressions) { + Write-Warning "[$Label] slower than the committed baseline: $regression" +} + +if ($env:GITHUB_STEP_SUMMARY) { + "`n**$($regressions.Count) benchmark(s) more than $ThresholdPercent% slower:**`n" | + Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 + $regressions | ForEach-Object { "- $_" } | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append -Encoding utf8 +} + +if ($FailOnRegression) { + throw "[$Label] $($regressions.Count) benchmark(s) regressed more than $ThresholdPercent%." +} + +Write-Host "[$Label] advisory only; not failing the job." +exit 0 diff --git a/tools/managed-stack/pack-and-build-samples.ps1 b/tools/managed-stack/pack-and-build-samples.ps1 new file mode 100644 index 000000000..2a00dc0bd --- /dev/null +++ b/tools/managed-stack/pack-and-build-samples.ps1 @@ -0,0 +1,107 @@ +# Packs the managed libraries into a local feed and builds the three samples from those packages. +$ErrorActionPreference = "Stop" +$root = Resolve-Path (Join-Path $PSScriptRoot "..\..") +$feed = Join-Path $root "artifacts\managed-feed" +New-Item -ItemType Directory -Force -Path $feed | Out-Null +$projects = @( + "src\Titanium.Tls\Titanium.Tls.csproj", + "src\Titanium.Quic.UdpOffload\Titanium.Quic.UdpOffload.csproj", + "src\Titanium.Quic\Titanium.Quic.csproj", + "src\Titanium.Http3\Titanium.Http3.csproj", + "src\Titanium.Net.Http\Titanium.Net.Http.csproj", + "src\Titanium.Net.Compatibility\Titanium.Net.Compatibility.csproj" +) +foreach ($project in $projects) { + dotnet pack (Join-Path $root $project) -c Release -o $feed --nologo + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } +} + +Add-Type -AssemblyName System.IO.Compression.FileSystem +function Assert-ManagedPackage { + param($Name, [string[]]$ExpectedDeps) + $nupkg = Get-ChildItem -Path $feed -Filter "$Name.*.nupkg" | Select-Object -First 1 + $snupkg = Get-ChildItem -Path $feed -Filter "$Name.*.snupkg" | Select-Object -First 1 + if (-not $nupkg) { throw "missing nupkg for $Name" } + if (-not $snupkg) { throw "missing symbols package for $Name" } + $zip = [System.IO.Compression.ZipFile]::OpenRead($nupkg.FullName) + try { + $names = @($zip.Entries | ForEach-Object { $_.FullName }) + foreach ($required in @("README.md", "LICENSE", "icon.png")) { + if ($names -notcontains $required) { throw "$Name package is missing $required" } + } + $nuspecEntry = $zip.Entries | Where-Object { $_.FullName -like "*.nuspec" } | Select-Object -First 1 + $reader = New-Object System.IO.StreamReader($nuspecEntry.Open()) + $xml = [xml]$reader.ReadToEnd() + $reader.Dispose() + $ns = New-Object System.Xml.XmlNamespaceManager($xml.NameTable) + $ns.AddNamespace("n", $xml.DocumentElement.NamespaceURI) + $license = $xml.SelectSingleNode("//n:license", $ns) + if ($license.InnerText -ne "MIT" -or $license.GetAttribute("type") -ne "expression") { + throw "$Name license is not the MIT expression" + } + $deps = @() + $nodes = $xml.SelectNodes("//n:dependency", $ns) + if ($nodes) { $deps = @($nodes | ForEach-Object { $_.id }) } + foreach ($dep in $deps) { + if ($dep -like "*Web.Proxy*") { throw "$Name depends on $dep" } + } + $actual = @($deps | Sort-Object) -join "," + $want = @($ExpectedDeps | Sort-Object) -join "," + if ($actual -ne $want) { throw "$Name dependencies are '$actual', expected '$want'" } + $dll = $zip.Entries | Where-Object { $_.FullName -eq "lib/net10.0/$Name.dll" } | Select-Object -First 1 + if (-not $dll) { throw "$Name package is missing its assembly" } + $temp = Join-Path ([System.IO.Path]::GetTempPath()) ("managed-pack-" + [guid]::NewGuid().ToString("n") + ".dll") + $stream = [System.IO.File]::Create($temp) + $dll.Open().CopyTo($stream) + $stream.Dispose() + $token = [System.Reflection.AssemblyName]::GetAssemblyName($temp).GetPublicKeyToken() + Remove-Item $temp + if ($token.Length -eq 0) { throw "$Name is not strong-named" } + } + finally { + $zip.Dispose() + } + $sym = [System.IO.Compression.ZipFile]::OpenRead($snupkg.FullName) + try { + $pdb = @($sym.Entries | Where-Object { $_.FullName -like "*.pdb" }) + if ($pdb.Count -lt 1) { throw "$Name symbols package has no pdb" } + } + finally { + $sym.Dispose() + } + $link = Join-Path $root "src\$Name\obj\Release\net10.0\$Name.sourcelink.json" + if (-not (Test-Path $link)) { throw "$Name has no Source Link file" } + $map = Get-Content -LiteralPath $link -Raw + if ($map -notlike "*justcoding121/titanium-web-proxy*") { + throw "$Name Source Link does not name this repository" + } +} + +Assert-ManagedPackage "Titanium.Tls" @() +Assert-ManagedPackage "Titanium.Quic.UdpOffload" @() +Assert-ManagedPackage "Titanium.Quic" @("Titanium.Tls", "Titanium.Quic.UdpOffload") +Assert-ManagedPackage "Titanium.Http3" @() +Assert-ManagedPackage "Titanium.Net.Http" @("Titanium.Tls", "Titanium.Quic", "Titanium.Http3") +Assert-ManagedPackage "Titanium.Net.Compatibility" @("Titanium.Tls", "Titanium.Quic") +foreach ($dir in @("Titanium.Tls", "Titanium.Quic", "Titanium.Http3", "Titanium.Net.Http", "Titanium.Net.Compatibility")) { + foreach ($file in @("PublicAPI.Shipped.txt", "PublicAPI.Unshipped.txt")) { + $path = Join-Path $root "src\$dir\$file" + if (-not (Test-Path $path)) { throw "missing $path" } + } +} +Write-Output "packages ok" + +$samples = @( + "samples\HttpClientManagedStack\HttpClientManagedStack.csproj", + "samples\TlsStreamEcho\TlsStreamEcho.csproj", + "samples\QuicEcho\QuicEcho.csproj" +) +foreach ($sample in $samples) { + dotnet build (Join-Path $root $sample) -c Release --nologo -p:UseManagedPackages=true "-p:RestoreAdditionalProjectSources=$feed" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } +} + +dotnet run --project (Join-Path $root "samples\TlsStreamEcho\TlsStreamEcho.csproj") -c Release --no-build --nologo +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } +dotnet run --project (Join-Path $root "samples\QuicEcho\QuicEcho.csproj") -c Release --no-build --nologo +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } diff --git a/tools/managed-stack/tlsfuzzer-conversation.sh b/tools/managed-stack/tlsfuzzer-conversation.sh new file mode 100644 index 000000000..56513eb82 --- /dev/null +++ b/tools/managed-stack/tlsfuzzer-conversation.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -eu +export DEBIAN_FRONTEND=noninteractive +apt-get update -qq +apt-get install -y -qq git +git clone --depth 1 https://github.com/tlsfuzzer/tlsfuzzer /tmp/tlsfuzzer +pip install --disable-pip-version-check -q -r /tmp/tlsfuzzer/requirements.txt +python /tmp/tlsfuzzer/scripts/test-tls13-conversation.py -h 127.0.0.1 -p 18443 \ No newline at end of file diff --git a/tools/packaging/smoke/cli-managed-stack.ps1 b/tools/packaging/smoke/cli-managed-stack.ps1 new file mode 100644 index 000000000..84d061491 --- /dev/null +++ b/tools/packaging/smoke/cli-managed-stack.ps1 @@ -0,0 +1,122 @@ +# Starts the CLI with --managed-stack and a loopback reverse proxy, then reads one HTTP response. +# Inspector stays on the platform stack. This script does not change that default. +$ErrorActionPreference = "Stop" +$root = Resolve-Path (Join-Path $PSScriptRoot "..\..\..") +dotnet build (Join-Path $root "src\Titanium.Cli\Titanium.Cli.csproj") -c Release --nologo +if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + +function Get-LoopbackPort { + $forbidden = @(8000, 8866, 9080, 9464) + for ($attempt = 0; $attempt -lt 20; $attempt++) { + $listener = [System.Net.Sockets.TcpListener]::new([System.Net.IPAddress]::Loopback, 0) + $listener.Start() + $port = ([System.Net.IPEndPoint]$listener.LocalEndpoint).Port + $listener.Stop() + if ($forbidden -notcontains $port) { return $port } + } + throw "Could not reserve a loopback port." +} + +$originPort = Get-LoopbackPort +$proxyPort = Get-LoopbackPort +while ($proxyPort -eq $originPort) { $proxyPort = Get-LoopbackPort } + +$job = Start-Job -ArgumentList $originPort -ScriptBlock { + param($port) + $listener = [System.Net.Sockets.TcpListener]::new([System.Net.IPAddress]::Loopback, $port) + $listener.Start() + try { + $client = $listener.AcceptTcpClient() + try { + $stream = $client.GetStream() + $stream.ReadTimeout = 5000 + $buffer = New-Object byte[] 2048 + $received = New-Object System.IO.MemoryStream + while ($true) { + $count = $stream.Read($buffer, 0, $buffer.Length) + if ($count -le 0) { break } + $received.Write($buffer, 0, $count) + $text = [System.Text.Encoding]::ASCII.GetString($received.ToArray()) + if ($text.Contains("`r`n`r`n")) { break } + } + $payload = [System.Text.Encoding]::ASCII.GetBytes("HTTP/1.1 200 OK`r`nContent-Length: 2`r`nConnection: close`r`n`r`nok") + $stream.Write($payload, 0, $payload.Length) + } + finally { $client.Dispose() } + } + finally { $listener.Stop() } +} + +$config = @" +schemaVersion: "7.1" +listeners: + - host: "127.0.0.1" + port: $proxyPort + decryptSsl: false + forwardHost: "127.0.0.1" + forwardPort: $originPort +"@ +$configPath = Join-Path ([System.IO.Path]::GetTempPath()) ("twp-managed-smoke-" + $PID + ".yaml") +$stdout = Join-Path ([System.IO.Path]::GetTempPath()) ("twp-managed-smoke-" + $PID + ".out") +$stderr = Join-Path ([System.IO.Path]::GetTempPath()) ("twp-managed-smoke-" + $PID + ".err") +Set-Content -LiteralPath $configPath -Value $config -Encoding ascii +$exe = Join-Path $root "src\Titanium.Cli\bin\Release\net10.0\titanium.exe" +if (-not (Test-Path -LiteralPath $exe)) { + $exe = Join-Path $root "src\Titanium.Cli\bin\Release\net10.0\titanium" +} +$proc = $null +try { + $proc = Start-Process -FilePath $exe -ArgumentList @("run", "-c", $configPath, "--managed-stack") -PassThru -RedirectStandardOutput $stdout -RedirectStandardError $stderr + $ready = $false + $deadline = [DateTime]::UtcNow.AddSeconds(30) + while ([DateTime]::UtcNow -lt $deadline) { + if ($proc.HasExited) { break } + try { + $probe = [System.Net.Sockets.TcpClient]::new() + $probe.Connect("127.0.0.1", $proxyPort) + $probe.Dispose() + $ready = $true + break + } + catch { + Start-Sleep -Milliseconds 200 + } + } + if (-not $ready) { + $log = "" + if (Test-Path $stderr) { $log = Get-Content -LiteralPath $stderr -Raw } + throw "The CLI did not listen on 127.0.0.1:${proxyPort}. $log" + } + + $client = [System.Net.Sockets.TcpClient]::new() + $client.Connect("127.0.0.1", $proxyPort) + $stream = $client.GetStream() + $request = [System.Text.Encoding]::ASCII.GetBytes("GET / HTTP/1.1`r`nHost: 127.0.0.1:${proxyPort}`r`nConnection: close`r`n`r`n") + $stream.Write($request, 0, $request.Length) + $stream.ReadTimeout = 10000 + $response = New-Object System.IO.MemoryStream + $buffer = New-Object byte[] 2048 + while ($true) { + try { $count = $stream.Read($buffer, 0, $buffer.Length) } + catch { break } + if ($count -le 0) { break } + $response.Write($buffer, 0, $count) + } + $client.Dispose() + $body = [System.Text.Encoding]::ASCII.GetString($response.ToArray()) + if ($body -notlike "HTTP/1.1 200 *" -or $body -notlike "*`r`n`r`nok") { + throw "Unexpected proxy response: $body" + } + Write-Output "managed-stack smoke ok" +} +finally { + if ($proc -and -not $proc.HasExited) { + Stop-Process -Id $proc.Id -Force + $proc.WaitForExit() + } + if ($job) { + Stop-Job $job -ErrorAction SilentlyContinue + Remove-Job $job -Force -ErrorAction SilentlyContinue + } + Remove-Item -LiteralPath $configPath, $stdout, $stderr -ErrorAction SilentlyContinue +} diff --git a/tools/run-tests.ps1 b/tools/run-tests.ps1 index 585d05c60..15ebc0e51 100644 --- a/tools/run-tests.ps1 +++ b/tools/run-tests.ps1 @@ -22,6 +22,10 @@ $projects = [ordered]@{ manager = 'tests\Titanium.Manager.Tests\Titanium.Manager.Tests.csproj' gateway = 'tests\Titanium.Gateway.Tests\Titanium.Gateway.Tests.csproj' xds = 'tests\Titanium.Xds.Tests\Titanium.Xds.Tests.csproj' + tls = 'tests\Titanium.Tls.Tests\Titanium.Tls.Tests.csproj' + quic = 'tests\Titanium.Quic.Tests\Titanium.Quic.Tests.csproj' + compat = 'tests\Titanium.Net.Compatibility.Tests\Titanium.Net.Compatibility.Tests.csproj' + nethttp = 'tests\Titanium.Net.Http.Tests\Titanium.Net.Http.Tests.csproj' geoip = 'tests\Titanium.Cli.GeoIp.Tests\Titanium.Cli.GeoIp.Tests.csproj' unit = 'tests\Titanium.Web.Proxy.UnitTests\Titanium.Web.Proxy.UnitTests.csproj' cli = 'tests\Titanium.Cli.Tests\Titanium.Cli.Tests.csproj' diff --git a/tools/tls/compare-perf-baseline.ps1 b/tools/tls/compare-perf-baseline.ps1 new file mode 100644 index 000000000..2a0487160 --- /dev/null +++ b/tools/tls/compare-perf-baseline.ps1 @@ -0,0 +1,42 @@ +# Compares a fresh BenchmarkDotNet full JSON export to a committed baseline. +# Prints the median ratio (fresh / baseline) for each benchmark present in both files. +param( + [Parameter(Mandatory = $true)] + [string] $Baseline, + [Parameter(Mandatory = $true)] + [string] $Fresh +) + +$ErrorActionPreference = "Stop" + +function Read-Medians([string] $path) { + $json = Get-Content -Raw -Path $path | ConvertFrom-Json + $rows = @{} + foreach ($benchmark in $json.Benchmarks) { + $name = $benchmark.FullName + if ([string]::IsNullOrWhiteSpace($name)) { + $name = $benchmark.DisplayInfo + } + + $median = $benchmark.Statistics.Median + if ($null -ne $name -and $null -ne $median) { + $rows[$name] = [double]$median + } + } + + return $rows +} + +$baseline = Read-Medians $Baseline +$fresh = Read-Medians $Fresh +foreach ($name in ($baseline.Keys | Sort-Object)) { + if (-not $fresh.ContainsKey($name)) { + Write-Output ("missing`t{0}" -f $name) + continue + } + + $before = $baseline[$name] + $after = $fresh[$name] + $ratio = if ($before -eq 0) { 0 } else { $after / $before } + Write-Output ("{0:N3}x`t{1:N0} -> {2:N0}`t{3}" -f $ratio, $before, $after, $name) +} diff --git a/tools/tls/install-oracle.ps1 b/tools/tls/install-oracle.ps1 new file mode 100644 index 000000000..d30102f34 --- /dev/null +++ b/tools/tls/install-oracle.ps1 @@ -0,0 +1,92 @@ +# Installs an OpenSSL 3.5+ "oracle" for the TLS tests and points TITANIUM_OPENSSL at it. +# +# The tests in tests/Titanium.Tls.Tests that compare against a real TLS peer ask OpenSslOracle for a +# binary and are Inconclusive without one. With TITANIUM_REQUIRE_ORACLE=1 they fail instead, so the +# managed-stack workflow installs the oracle first and never silently skips those comparisons. +# +# Usage: +# pwsh tools/tls/install-oracle.ps1 # install if needed, export TITANIUM_OPENSSL +# pwsh tools/tls/install-oracle.ps1 -MinimumVersion 3.5 +# +# On GitHub runners the script also writes TITANIUM_OPENSSL into $GITHUB_ENV so later steps see it. +param( + [string] $MinimumVersion = '3.5' +) + +$ErrorActionPreference = 'Stop' +$minimum = [Version] $MinimumVersion + +function Get-OpenSslVersion([string] $Path) { + if (-not (Test-Path -LiteralPath $Path -PathType Leaf)) { return $null } + $text = & $Path version 2>&1 + if ($LASTEXITCODE -ne 0) { return $null } + # "OpenSSL 3.5.9 29 Sep 2026" (or "LibreSSL 3.3.6" on macOS, which is not the oracle) + $parts = ($text -join ' ').Split(' ', [System.StringSplitOptions]::RemoveEmptyEntries) + if ($parts.Length -lt 2 -or $parts[0] -ne 'OpenSSL') { return $null } + $parsed = $null + if (-not [Version]::TryParse($parts[1], [ref] $parsed)) { return $null } + return $parsed +} + +function Resolve-Candidate([string[]] $Paths, [string] $Source) { + foreach ($path in $Paths) { + $version = Get-OpenSslVersion $path + if ($null -ne $version -and $version -ge $minimum) { + # ${Source} not "$Source:" — PowerShell reads `$Source:` as a scope-qualified variable. + Write-Host "${Source}: $path is OpenSSL $version" + return $path + } + if ($null -ne $version) { + Write-Host "${Source}: $path is OpenSSL $version (below $minimum)" + } + } + + return $null +} + +$resolved = Resolve-Candidate @($env:TITANIUM_OPENSSL) 'TITANIUM_OPENSSL' + +if (-not $resolved) { + if ($IsWindows) { + # Git for Windows bundles a recent OpenSSL and the Git install is on every runner. + $resolved = Resolve-Candidate @( + (Join-Path $env:ProgramFiles 'Git\usr\bin\openssl.exe'), + (Join-Path ${env:ProgramFiles(x86)} 'Git\usr\bin\openssl.exe') + ) 'git-for-windows' + if (-not $resolved -and (Get-Command choco -ErrorAction SilentlyContinue)) { + Write-Host 'git-for-windows has no OpenSSL >= minimum; trying chocolatey openssl.light' + & choco install openssl.light -y --no-progress 2>&1 | Out-Host + $resolved = Resolve-Candidate @('C:\Program Files\OpenSSL\bin\openssl.exe') 'chocolatey' + } + } + elseif ($IsMacOS) { + $env:HOMEBREW_NO_AUTO_UPDATE = '1' + $env:HOMEBREW_NO_INSTALL_UPGRADE = '1' + if (-not (brew list --versions openssl@3)) { brew install openssl@3 } + $prefix = (& brew --prefix openssl@3).Trim() + $resolved = Resolve-Candidate @( + (Join-Path $prefix 'bin/openssl'), + '/opt/homebrew/opt/openssl@3/bin/openssl', + '/usr/local/opt/openssl@3/bin/openssl' + ) 'homebrew' + } + else { + # Ubuntu's openssl package is 3.5.x on the 26.04 image; an older distro is a loud failure. + $sudo = if ($env:CI) { 'sudo' } else { '' } + if ($sudo) { + & sudo apt-get update + & sudo apt-get install -y openssl + } + $resolved = Resolve-Candidate @('/usr/bin/openssl', '/usr/local/bin/openssl') 'distro' + } +} + +if (-not $resolved) { + throw "No OpenSSL $minimum or later was found. Install one, or set TITANIUM_OPENSSL to its path." +} + +$finalVersion = Get-OpenSslVersion $resolved +if ($env:GITHUB_ENV) { + "TITANIUM_OPENSSL=$resolved" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 +} +Write-Host "TITANIUM_OPENSSL=$resolved (OpenSSL $finalVersion, minimum $minimum)" diff --git a/website/docs/cli.md b/website/docs/cli.md index 5ea625794..8c35cadc3 100644 --- a/website/docs/cli.md +++ b/website/docs/cli.md @@ -28,7 +28,7 @@ Path-based routing and load balancing: [Configuration](/docs/configuration). ## Commands ```text -titanium run -c [-v|--verbose] [--watch] [--service] +titanium run -c [-v|--verbose] [--watch] [--service] [--managed-stack [true|false]] titanium reload -c titanium restart -c # Linux hot restart, needs server.hotRestart titanium test -c @@ -57,7 +57,7 @@ Nested help: `titanium --help` (and `titanium service install --help`, ### `run` ```text -titanium run -c [-v|--verbose] [--watch] [--service] [--name ] +titanium run -c [-v|--verbose] [--watch] [--service] [--name ] [--managed-stack [true|false]] ``` | Flag | Meaning | @@ -67,6 +67,7 @@ titanium run -c [-v|--verbose] [--watch] [--service] [--name For an application that wants this TLS and QUIC stack and does not run Titanium Web Proxy. + +The libraries are prepared in this repository as `0.1.0-preview.1`. They are not published. `tools/managed-stack/pack-and-build-samples.ps1` packs them into `artifacts/managed-feed` and builds the samples from that feed. + +## Packages + +- `Titanium.Net.Http` is the package an application references for `HttpClient`. `TitaniumHttpHandler` always uses the managed stacks. It has no flag. +- `Titanium.Tls` and `Titanium.Quic` are the TLS 1.3 and QUIC v1 libraries. +- `Titanium.Http3` is framing and QPACK. It does not open a socket. +- `Titanium.Net.Compatibility` copies platform QUIC options onto the managed types. `Titanium.Net.Http` does not reference it. +- `Titanium.Quic` also depends on `Titanium.Quic.UdpOffload`. + +## Samples + +`samples/HttpClientManagedStack` sends one HTTPS request as HTTP/1.1, one as HTTP/2, and one as HTTP/3. HTTP/2 from this handler sends `:scheme http`. A server that rejects that scheme is retried once over HTTP/1.1 when the request allows a lower version. + +`samples/TlsStreamEcho` authenticates a loopback client and server and echoes two bytes. `samples/QuicEcho` does the same on one QUIC stream. Both listen on `127.0.0.1` with an ephemeral port. + +## FIPS + +These libraries are not a FIPS-validated module. While FIPS mode is on, `TlsStream` and `TitaniumHttpHandler` throw unless `AllowManagedStackUnderFips` is set or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`. diff --git a/wiki/Managed-TLS-and-QUIC.md b/wiki/Managed-TLS-and-QUIC.md new file mode 100644 index 000000000..68614e018 --- /dev/null +++ b/wiki/Managed-TLS-and-QUIC.md @@ -0,0 +1,55 @@ +> For operators and library users. This page describes the managed TLS and QUIC stacks in this tree, and when the proxy uses them. + +Titanium.Tls is a TLS 1.3 implementation whose state machine is C#. Record protection, signatures, and the NIST curves use `System.Security.Cryptography`. X25519 is a managed ladder because it is not available through that API on every platform. Titanium.Quic is the QUIC library. The proxy calls either stack only when its flag is on. With both flags left at the default, authentication stays on `SslStream` and QUIC stays on the platform listener and connection types. + +## Defaults + +- A `ProxyServer` in the library leaves `UseManagedTlsStack` and `UseManagedQuicStack` false. +- `titanium run` leaves them false unless `--managed-stack` or `TITANIUM_MANAGED_STACK` says otherwise. +- The proxy and Gateway charts set `server.managedStack: false`. +- Inspector has a TLS stack switch in Advanced. It defaults to the platform stacks. Choosing the managed stacks sets both flags before the proxy starts. FIPS mode, and `TITANIUM_MANAGED_STACK=0`, keep the platform stacks and show the reason. The managed option becomes the default only after the throughput comparison against the platform stack passes. + +Assigning either flag after `Start` throws. Reading the flags after `Start` is allowed. + +## Turning it on + +Precedence, highest first: `--managed-stack`, then `TITANIUM_MANAGED_STACK`, then the config file, then the product default. The environment variable accepts `1`, `true`, `0`, and `false`. + +In config, `server.managedStack` sets both flags. `server.managedTls` and `server.managedQuic` override that umbrella. Omit all three and the library default stays in force. + +In code, set the properties before `Start`: + +```csharp +proxy.UseManagedTlsStack = true; +proxy.UseManagedQuicStack = true; +``` + +`new HttpClient(new TitaniumHttpHandler())` always uses the managed stacks. That handler has no flag. It is a separate package, `Titanium.Net.Http`. `samples/HttpClientManagedStack` sends one request as HTTP/1.1, one as HTTP/2, and one as HTTP/3. An application that does not run the proxy follows [Using the managed stack](Using-the-managed-stack). + +## What needs the flag + +Fingerprint evasion and terminating QUIC that arrives as raw datagrams need a stack this process owns. The platform TLS and QUIC APIs do not let a program choose the exact ClientHello, extension order, or QUIC Initial layout, and they do not expose raw UDP datagrams to a QUIC connection. + +With the QUIC flag on: + +- A QUIC datagram on a SOCKS5 UDP association is answered by the managed listener. The reply goes back to the client. A plain datagram to another destination stays on the relay. +- A QUIC datagram inside a CONNECT-UDP tunnel is answered the same way. A plain datagram stays on the socket. +- A transparently redirected datagram is answered for the origin the client addressed. The reply goes back to the caller. The listener does not open its own socket. + +With the QUIC flag off, SOCKS5 UDP ASSOCIATE and CONNECT-UDP keep relaying. Transparent interception throws `ManagedStackRequiredException`. The message names `UseManagedQuicStack` and `TITANIUM_MANAGED_STACK`. + +`clusters[].httpClient.fingerprint: chrome` asks for a browser ClientHello. The proxy reports an error when the managed TLS flag is off. While the bytes on the wire are still the engine's built-in hello, the handshake is refused instead of sending that hello. + +An accepted HTTP/3 connection on the managed listener is closed. HTTP/3 framing on that path still reads the platform stream. `TitaniumHttpHandler` speaks HTTP/3 on its own managed connection. + +## FIPS + +`FipsEnvironment.IsEnabled` is true when Windows `FipsAlgorithmPolicy` is 1 or Linux `/proc/sys/crypto/fips_enabled` reads `1`. It is false on macOS. While that is true, the proxy refuses to start with the managed flags on unless `server.managedStackFipsOverride` is true or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE` is `1`. `TlsStream` and `TitaniumHttpHandler` throw `NotSupportedException` unless `AllowManagedStackUnderFips` is set or that same variable is `1`. The override forces `TlsAlgorithmPolicy.FipsApprovedOnly`. This library is not a FIPS-validated module. Fingerprint fidelity is reduced under that policy. + +## Fingerprint + +`TlsFingerprintProfiles.Chrome` is a measured ClientHello profile. `TlsStream` stores that profile and reports `TlsStream.FingerprintFidelity`. The bytes on the wire are still the engine's short hello, not the profile. Fidelity is `Full`, `ReducedNoPostQuantum` when ML-KEM is unavailable, or `ReducedFipsPolicy` when the FIPS algorithm set is in force. `ReducedFipsPolicy` drops ChaCha20-Poly1305, X25519, and the hybrid share from the profile's offer. + +## Limits + +The managed client offers `TLS_AES_128_GCM_SHA256`, X25519 and P-256, and the signature schemes `ecdsa_secp256r1_sha256`, `ecdsa_secp384r1_sha384`, `rsa_pss_rsae_sha256`, and `rsa_pss_rsae_sha384`. Under `FipsApprovedOnly` the client share is P-256 and the group offer is P-256 and P-384. The server can also select AES-256-GCM, ChaCha20-Poly1305, P-384, and X25519MLKEM768 when the peer offers them. An RSA-2048 origin completes on that hello. TLS 1.2 is rejected. Stapled OCSP and SCT bytes are copied and not checked. Online revocation stays `NoCheck` on the caller thread. Tickets resume only inside this stack. Local timing is on [Performance Local Lab](Performance-Local-Lab). diff --git a/wiki/Performance-Local-Lab.md b/wiki/Performance-Local-Lab.md index 3cb44b657..011777c1a 100644 --- a/wiki/Performance-Local-Lab.md +++ b/wiki/Performance-Local-Lab.md @@ -9,6 +9,11 @@ Playbook (harness, dumps, stage timing, Memory techniques) stays on [Performance - [Local Windows lab (developer laptop)](#user-content-local-windows-lab-developer-laptop) - [Local saturation control (laptop)](#user-content-local-saturation-control-laptop) - [Editions (CLI / Plus stress)](#user-content-editions-cli--plus-stress) +- [Managed TLS on this PC](#user-content-managed-tls-on-this-pc) +- [Managed TLS on linuxmini](#user-content-managed-tls-on-linuxmini) +- [Managed TLS on macmini](#user-content-managed-tls-on-macmini) +- [Managed QUIC on linuxmini](#user-content-managed-quic-on-linuxmini) +- [Managed QUIC on this PC and on macmini](#user-content-managed-quic-on-this-pc-and-on-macmini) ## Local Windows lab (developer laptop) @@ -252,3 +257,159 @@ Local Win smoke 2026-08-29 (`rps-ramp-20260829-104306.csv`): c=64, warmup 2s / m | `twp-cli-logging-http1` | **33,218** | 120 MiB | **0.96×** | ≥0.90 | | `twp-cli-lb-leasttime-http1` | **31,995** | 131 MiB | ÷route **0.89×** | ≥0.85 | | `twp-cli-dialect-twp-http1` | **36,532** | 116 MiB | **1.06×** | ≥0.90 | + +## Managed TLS on this PC + +These rows are `TlsStream` against `SslStream` on this machine, not the laptop table above. Do not paste them onto [Performance](Performance). + +| | | +| --- | --- | +| OS | Windows 11 (10.0.26300) | +| CPU | AMD Ryzen 5 7640HS, 6 cores / 12 threads | +| RAM | 13.8 GiB | +| SDK / runtime | .NET SDK 10.0.404, runtime 10.0.15 | +| Harness | BenchmarkDotNet 0.14.0, one warmup, 10 iterations. Three Release runs; the medians below are the median of the three run medians. The runner switched the power plan to High performance for the timed job and restored Balanced afterwards. | +| Handshake | ECDSA P-256, X25519, AES-128-GCM. Both peers are in one process. The certificate callback accepts the self-signed leaf. | + +A ratio is managed throughput divided by platform throughput, from medians. Above 1.00 the managed stack is faster. The re-measurement on 2026-11-29 is after D2. Per-run JSON exports are in `src/Titanium.Tls/design/perf-baselines/local-windows/`. + +| Cell | Platform median | Managed median | Ratio | Gate | +| --- | ---: | ---: | ---: | --- | +| Full handshake, loopback | 3.248 ms | 2.878 ms | 1.13 | 0.90, met | +| Full handshake, in-memory | 2.389 ms | 2.033 ms | 1.17 | 0.90, met | +| Resumed handshake, loopback | 3.227 ms | 1.544 ms | 2.09 | not a resumption gate: the platform cell was not faster than its full handshake | +| Resumed handshake, in-memory | 2.386 ms | 1.481 ms | 1.61 | same limit | +| 256 MiB, loopback, 16 KiB writes | 268.9 ms | 270.9 ms | 0.99 | 0.95 on the median; the 99.9% intervals overlap | +| 256 MiB, loopback, 64 KiB writes | 271.4 ms | 269.3 ms | 1.01 | 0.95, met | +| 256 MiB, in-memory, 16 KiB writes | 79.81 ms | 61.15 ms | 1.31 | 0.95 on the median | +| 256 MiB, in-memory, 64 KiB writes | 79.30 ms | 57.85 ms | 1.37 | 0.95 on the median | +| 100-byte exchange, loopback | 31.77 µs | 28.16 µs | 1.13 | within 3 percent, met | +| 1 KiB exchange, loopback | 32.37 µs | 29.87 µs | 1.08 | within 3 percent, met | +| 100-byte exchange, in-memory | 14.58 µs | 11.60 µs | 1.26 | within 3 percent, met | +| 1 KiB exchange, in-memory | 14.57 µs | 12.41 µs | 1.17 | within 3 percent, met | + +The 2026-11-27 run of the same cells on the earlier tree had the two full handshakes at 0.75 and 0.69, so both gates that the first run missed now pass here. Those old exports are still in `src/Titanium.Tls/design/perf-baselines/` and are a record of that run, not of this one. Read the Windows handshake rows next to the linuxmini rows below before drawing a conclusion: the platform handshake on this PC is 2.7 times slower than the platform handshake on linuxmini, while the managed handshake is only 1.9 times slower, so most of the Windows win is the platform reference rather than the managed stack. + +The platform resumed cell is not faster than its full handshake, so that row is a managed resume against a full platform handshake. The managed resume still offers `psk_dhe_ke`, so it still runs the key exchange. The second 16 KiB exchange allocates 0 bytes on the calling thread for both stacks. That probe is the synchronous API. A 256 MiB transfer still shows about 18 KB in the process-wide BenchmarkDotNet column. Loopback bulk sits on the socket; the in-memory rows are where the stacks separate. AES-256, an RSA leaf, and the hybrid group are not in this table: the managed client does not offer them. + +One X25519 scalar multiplication on the High performance plan, 200 calls after one warmup, was 767 µs on the first run and 401 µs in the 2026-11-29 probe on the same plan. A managed-to-managed handshake calls the ladder for each side's public key and each side's agreement. Those calls were not timed inside the handshake, so the handshake ratios are not attributed to a ladder count. The portable ladder stays. + +Idle connections use the in-memory pair, whose two 32 KiB pipes are in both GC figures. At 8,000 connections the managed GC heap was 961 KB each and the platform heap was 84 KB each. That was measured before D2. After D2 one handshake allocates 181400 bytes and does not reach the large object heap, and idle on this PC is 9834 managed bytes against about 20900 platform bytes. At 50,000 the earlier platform run finished and the earlier managed run ran out of memory; the 50,000 managed run was not repeated. + +A burst of 200 handshakes, not 10,000, ran 32 quiet exchanges. The slowest sample was 47 ms on the platform and 93 ms on the managed stack. That sample is the maximum of 32, not a p99, and the 10,000-client storm was not run. + +## Managed TLS on linuxmini + +The same cells on linuxmini. Both peers are in one process, and the CPU governor was pinned to `performance` for the timed job and restored to `powersave` afterwards. + +| | | +| --- | --- | +| OS | Ubuntu 26.04.1 LTS | +| CPU | AMD Ryzen 5 7640HS, 6 cores / 12 threads | +| RAM | 30.8 GB | +| SDK / runtime | .NET SDK 10.0.404, runtime 10.0.15 | +| Harness | BenchmarkDotNet 0.14.0, one warmup, 10 iterations. Three Release runs; the medians below are the median of the three run medians. | + +Per-run JSON exports are in `src/Titanium.Tls/design/perf-baselines/linuxmini/`. + +| Cell | Platform median | Managed median | Ratio | Gate | +| --- | ---: | ---: | ---: | --- | +| Full handshake, loopback | 1.214 ms | 1.145 ms | 1.06 | 0.90, met | +| Full handshake, in-memory | 981.7 µs | 913.9 µs | 1.07 | 0.90, met | +| Resumed handshake, loopback | 1.195 ms | 737.9 µs | 1.62 | platform did not resume | +| Resumed handshake, in-memory | 981.4 µs | 518.9 µs | 1.89 | platform did not resume | +| 256 MiB, loopback, 16 KiB writes | 176.5 ms | 163.2 ms | 1.08 | 0.95, met | +| 256 MiB, loopback, 64 KiB writes | 109.6 ms | 95.84 ms | 1.14 | unstable platform cell, see below | +| 256 MiB, in-memory, 16 KiB writes | 71.10 ms | 62.28 ms | 1.14 | 0.95, met | +| 256 MiB, in-memory, 64 KiB writes | 125.9 ms | 58.80 ms | 2.14 | unstable platform cell, see below | +| 100-byte exchange, loopback | 21.09 µs | 19.04 µs | 1.11 | within 3 percent, met | +| 1 KiB exchange, loopback | 21.45 µs | 20.14 µs | 1.07 | within 3 percent, met | +| 100-byte exchange, in-memory | 12.96 µs | 13.00 µs | 0.997 | within 3 percent, met | +| 1 KiB exchange, in-memory | 13.58 µs | 13.14 µs | 1.03 | within 3 percent, met | + +These rows were re-measured on 2026-11-29 at `6f958907b`, after the managed field arithmetic, socket write batching, and QUIC changes recorded in `src/Titanium.Tls/design/PERF-PLAYBOOK.md` (three Release runs of the full suite). They replace the first run on the same machine, which read the full handshakes at 0.74 and 0.69, the resumed handshakes at 0.81 and 0.62, the loopback 64 KiB bulk at 0.68, and the in-memory 100-byte exchange at 0.97. The platform column moved by up to 15% between that run and this one on the same machine, so compare the ratios and not the absolute platform medians. and the managed cell does not, so the loopback 16 KiB row (1.06 in the first run) and the loopback 64 KiB row (0.68 in the first run) are one unstable platform reference rather than two facts. In the first run, across three main runs and three extra bulk-only runs, the platform 16 KiB medians were 115.4, 166.6, 166.1, 164.7, 166.0, and 165.5 ms while the managed medians stayed between 154.9 and 156.8 ms; the managed 64 KiB cell has since dropped from 155 ms to 96 ms because a socket stream now seals several records into one write. In-memory 16 KiB is the one bulk size where the platform is consistently ahead. + +The platform resumed handshake is not faster than its own full handshake on this machine, so those two rows do not demonstrate a resumption win. The managed half does resume: the benchmark throws if `AcceptedResumption` is false. + +## Managed TLS on macmini + +The platform cells could not be measured on macmini. Every `SslStream` cell failed in setup with `PlatformNotSupportedException: The requested security protocol is not supported` from `System.Net.SslProtocolsValidation.ValidateContiguous`, because the harness asks for TLS 1.3 and the platform TLS provider on macOS 26.6.2 does not offer it. A standalone probe on that machine negotiated TLS 1.2 when neither side forced 1.3 and failed against an OpenSSL 3.5.9 `s_server -tls1_3`. The managed stack speaks only TLS 1.3, so a TLS 1.2 platform cell would not be a peer. Only managed medians are recorded here. + +| | | +| --- | --- | +| OS | macOS 26.6.2 (25G83), Darwin 25.6.0 | +| CPU | Apple M1, 8 cores | +| RAM | 16 GB | +| SDK / runtime | .NET SDK 10.0.404, runtime 10.0.15, Arm64 | +| Harness | BenchmarkDotNet 0.14.0, one warmup, 10 iterations. Three Release runs; the medians below are the median of the three run medians. | + +Per-run JSON exports are in `src/Titanium.Tls/design/perf-baselines/macmini/`. + +| Cell | Managed median | Platform | +| --- | ---: | --- | +| Full handshake, loopback | 8.00 ms | not measured | +| Full handshake, in-memory | 7.70 ms | not measured | +| Resumed handshake, loopback | 0.833 ms | not measured | +| Resumed handshake, in-memory | 1.013 ms | not measured | +| 256 MiB, loopback, 16 KiB writes | 179.0 ms | not measured | +| 256 MiB, loopback, 64 KiB writes | 180.4 ms | not measured | +| 256 MiB, in-memory, 16 KiB writes | 150.8 ms | not measured | +| 256 MiB, in-memory, 64 KiB writes | 151.0 ms | not measured | +| 100-byte exchange, loopback | 88.46 µs | not measured | +| 1 KiB exchange, loopback | 89.21 µs | not measured | +| 100-byte exchange, in-memory | 23.09 µs | not measured | +| 1 KiB exchange, in-memory | 24.68 µs | not measured | + + +## Managed QUIC on linuxmini + +These rows are the managed QUIC stack against System.Net.Quic on linuxmini. Both peers are in one process. This PC does not start a platform listener, so these numbers are not mixed with a Windows run. Do not paste them onto [Performance](Performance). + +| | | +| --- | --- | +| OS | Ubuntu 26.04.1 LTS | +| CPU | AMD Ryzen 5 7640HS, 6 cores / 12 threads | +| RAM | 30.8 GB | +| SDK / runtime | .NET SDK 10.0.404, runtime 10.0.15 | +| Harness | BenchmarkDotNet 0.14.0, one warmup, 10 iterations, one invocation, one launch. Three Release runs; the medians below are the median of the three run medians. The runner switched the CPU governor to performance for the timed job and restored powersave afterwards. | +| Handshake | ECDSA P-256, X25519, AES-128-GCM, ALPN `test`. The certificate callback accepts the self-signed leaf. One bidirectional stream. A second stream is rejected. | + +A ratio is managed throughput divided by platform throughput, from medians. Above 1.00 the managed stack is faster. BenchmarkDotNet's Error column is half the width of the 99.9% confidence interval of the mean. Per-run JSON exports are in `src/Titanium.Quic/design/perf-baselines/linuxmini/`. + +The platform half is a `libmsquic` 2.6.4 build extracted under `~/opt/msquic/extract`, reached with `LD_LIBRARY_PATH` and `TITANIUM_QUIC_PLATFORM_LISTENER=1`. It is not a system package, and `QuicConnection.IsSupported` is false without it. + +| Cell | Platform median | Managed median | Ratio | Gate | +| --- | ---: | ---: | ---: | --- | +| Handshake, loopback | 1.847 ms | 1.260 ms | 1.47 | 0.90, met | +| 100-byte exchange, 50 on one stream | 42.27 µs | 35.46 µs | 1.19 | 0.90, met; 0.98 parity floor, met | +| 64 KiB, loopback, 8 KiB writes | 141.3 µs | 315.8 µs | 0.45 | recorded; no portable numeric gate; below the 0.98 parity floor | + +These rows were re-measured on 2026-11-30 at `92611a08d` (three Release runs, the median of the run medians), after the QUIC datagram path redesign recorded under "QUIC datagram path redesign" in `src/Titanium.Tls/design/PERF-PLAYBOOK.md`: the listener takes the queued datagrams of one wake as a batch (one `recvmmsg` that keeps each datagram's source address), sends and wakes readers once per connection per batch, acknowledges a batch once, and sends a flight whose last datagram is shorter as one segmented send. The 64 KiB bulk managed median moved from 744.5 µs (the same tree before the redesign, measured in the same session) to 315.8 µs, and the ratio from 0.20 to 0.45; a second set of three runs on the same code read 324.7 µs against 127.8 µs (0.39). It still fails the 0.98 floor. The platform bulk median moved between 112.4 and 166.1 µs across the three runs. Per 64 KiB transfer the listener now wakes 2.5 times (it woke 66 times) and takes 25 datagrams per wake. The remaining cost is about 5.6 µs per datagram against 2.5 µs for the platform stack, and the managed arm allocates about 229 KB per transfer against 69 KB. The handshake and the 100-byte exchange did not regress (steady-state probe: 100-byte +0.9%, inside the noise of the machine). + +The re-measurement before that one, on 2026-11-29 at `1715273f4` (three Release runs), came after the fully optimized datagram path (PQ9) and the 64 KiB application flight cap (PQ11) recorded in `src/Titanium.Tls/design/PERF-PLAYBOOK.md`. The small exchange moved from 0.95 to 1.20 because the benchmark cell runs for about 30 ms after setup and so measured tier-0 code; the bulk cell is still at 0.20 and is bound by the receive loop's per-datagram cost. The paragraph that follows describes the run at `6f958907b`, which is the one before those two entries. + +The earlier re-measurement on 2026-11-29 at `6f958907b`, after the sent-number ranges, the delayed acknowledgement, and the AES-NI header-protection mask recorded in `src/Titanium.Tls/design/PERF-PLAYBOOK.md`. The handshake passes at 1.46, the small exchange is at 0.95 (intervals overlap, below the 0.98 parity floor), and the 64 KiB bulk is at 0.19. The platform bulk cell moved between 124.8, 166.1, and 174.6 µs across the three runs. A profile of the small exchange shows no product frame above 0.5% of samples; the bulk cell costs about 16 µs per datagram against about 3 µs on the platform stack, a per-datagram receive and thread-hop cost that needs a different receive loop. The paragraphs below describe the earlier run at `4ddf70612`, which is after D3 and D4. The first run of these cells recorded handshake 0.355, small 0.306, and bulk 0.012; D3 then re-measured handshake 0.661, small 0.434, and bulk 0.068. The handshake and bulk rows have moved by roughly the same amount twice, and the small row moved from 0.434 to 0.35 between the D3 run and this one, so the small cell is the one whose direction is not settled. + +The platform bulk cell moved between 112.2, 201.1, and 129.6 µs across the three runs, so its median carries little weight against a managed cell that held 1.717 to 2.016 ms. Allocation per operation is 66 to 68 KB platform and 354 to 357 KB managed for bulk, 110 to 111 KB against 166 to 169 KB for the handshake, and 66 KB against 71 KB for the small exchange. + +## Managed QUIC on this PC and on macmini + +macmini has no platform QUIC listener, so its cells are managed-only with no ratio. This PC ran the platform listener for the 2026-11-30 re-measurement (`TITANIUM_QUIC_PLATFORM_LISTENER=1`, the platform arm on the same `System.Net.Quic`), so it carries a ratio. They are here so a reader can see the managed stack's own numbers on three machines. + +| | This PC | macmini | +| --- | --- | --- | +| OS | Windows 11 (10.0.26300) | macOS 26.6.2 (25G83) | +| CPU | AMD Ryzen 5 7640HS | Apple M1, 8 cores | +| Handshake, loopback | 2.288 ms managed, 4.376 ms platform (ratio 1.91) | 9.63 ms | +| 100-byte exchange, 50 on one stream | 67.8 µs managed, 87.9 µs platform (ratio 1.30) | 118.9 µs | +| 64 KiB, loopback, 8 KiB writes | 863.4 µs managed, 349.5 µs platform (ratio 0.41) | 1.408 ms | + +These cells were re-measured on 2026-11-30 at `92611a08d`, three Release runs, median of the run medians, after the datagram path redesign in `src/Titanium.Tls/design/PERF-PLAYBOOK.md`. Before it, this PC's managed cells were 3.878 ms, 160.8 µs, and 2.692 ms, and macmini's were 12.53 ms, 184.9 µs, and 2.815 ms, so the portable path (the plain socket receive, with no batch call) did not regress on either machine; the 64 KiB cell is 3.1 times faster on this PC and 2.0 times faster on macmini. The Windows ratio at 64 KiB (0.41) fails the 0.98 floor like linuxmini's. The macmini rows are the portable path only: the batch read and the segmented send are Linux calls inside `Titanium.Quic.UdpOffload`, and the listener there takes a datagram that is already queued without a second wait. + +Earlier managed-only exports are in `src/Titanium.Quic/design/perf-baselines/local-windows/` and `src/Titanium.Quic/design/perf-baselines/macmini/`. The macmini handshake cell is wide (10.03 to 13.58 ms across runs) and the machine carries background window-server work, so treat that row as coarse. + +The handshake cell is connect, accept, and close, five times per invoke, and the median is one handshake. It does not open a stream. The small cell is fifty 100-byte echoes on the one bidirectional stream, and the median is one echo. The bulk cell is one 64 KiB transfer on a connection opened before the timed loop. The managed stream window is 1 MiB and is not raised, so the repeated cell stays at 64 KiB: one jitting call, one warmup, and ten iterations fit in that window. + +The older rows that this section used to carry — handshake 0.355, small 0.306, bulk 0.012, and a batch-send row at 0.010 measured after the loopback probe accepted `sendmmsg` — were 2026-11-27 numbers on a tree before D3 and D4, and the earlier exports are still in the parent folder for that record. They are not the current state and the gates they missed were not lowered. The managed bulk row that used to allocate about 136 MiB to move 64 KiB now allocates about 355 KB, and the batch-send row's 139 MiB is gone with it: the send path batches and frames in place rather than building an array per datagram. + +The managed Error columns are 15 to 23 µs for the handshake, 2.9 to 4.8 µs for the small cell, and 89 to 168 µs for the bulk cell, against 22 to 38 µs, 0.4 to 2.3 µs, and 7 to 18 µs on the platform side. The small-cell iterations are still shorter than BenchmarkDotNet's 100 ms guidance and the gates stay where they are. diff --git a/wiki/Security-Considerations.md b/wiki/Security-Considerations.md index d13dde9cf..865699e2e 100644 --- a/wiki/Security-Considerations.md +++ b/wiki/Security-Considerations.md @@ -147,6 +147,11 @@ claim full OWASP Core Rule Set coverage. Options, rule categories, and the per-route `waf` policy are in [Plus](https://titaniumproxy.com/docs/plus#web-application-firewall-waf). + +## The managed TLS and QUIC stacks are opt-in + +`UseManagedTlsStack` and `UseManagedQuicStack` default to false, so the proxy keeps `SslStream` and the platform QUIC types. Startup refuses the managed stacks while FIPS mode is on unless `server.managedStackFipsOverride` or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1` is set. That override leaves the stack unvalidated. Terminating QUIC that arrives as a raw datagram needs the QUIC flag, because the platform API does not hand those datagrams to a connection. The flag, the features that need it, and the FIPS override are on [Managed TLS and QUIC](Managed-TLS-and-QUIC). + ## See also - [Migration from 4.x](Migration-from-4.x) — cumulative behavior changes from 4.x through current 7.x. diff --git a/wiki/Using-the-managed-stack.md b/wiki/Using-the-managed-stack.md new file mode 100644 index 000000000..648f58625 --- /dev/null +++ b/wiki/Using-the-managed-stack.md @@ -0,0 +1,25 @@ +> For an application that references the packages and does not run the proxy. + +The packages are prepared in this tree and are not published. `tools/managed-stack/pack-and-build-samples.ps1` packs them into `artifacts/managed-feed` and builds the samples from that feed. + +## HTTP + +`Titanium.Net.Http` is the package an application references when it wants `HttpClient` on this stack. The handler always uses the managed TLS and QUIC stacks. It has no flag. + +```csharp +using var handler = new TitaniumHttpHandler(); +using var client = new HttpClient(handler); +using var response = await client.GetAsync("https://example.com/"); +``` + +`samples/HttpClientManagedStack` sends one HTTPS request as HTTP/1.1, one as HTTP/2, and one as HTTP/3. HTTP/2 from this handler sends `:scheme http`. A server that rejects that scheme is retried once over HTTP/1.1 when the request allows a lower version. + +## TLS and QUIC + +`samples/TlsStreamEcho` authenticates a loopback `TlsStream` pair and echoes two bytes. `samples/QuicEcho` does the same on one `ManagedQuicConnection` stream. Both listen on `127.0.0.1` with an ephemeral port. + +`Titanium.Http3` is the framing and QPACK library. It does not open a socket. `Titanium.Net.Compatibility` copies platform QUIC options onto the managed types. `Titanium.Net.Http` does not reference that compatibility package. + +## FIPS + +These libraries are not a FIPS-validated module. While FIPS mode is on, `TlsStream` and `TitaniumHttpHandler` throw unless `AllowManagedStackUnderFips` is set or `TITANIUM_MANAGED_STACK_FIPS_OVERRIDE=1`.